AME 3623: Project 4: Analog Sensor Processing
- All components of the project are due by Thursday, March 24th
at 8:55 am
- Groups are the same as for project 1.
- Discussion within groups is fine.
- Discussion across groups may not be about the specifics of the
solution (general programming/circuit issues are fine to
discuss).
At the end of this project, you should be able to:
- connect an analog sensor to your microcontroller,
- read analog voltage data, and
- display information through a USB serial interface.
Component 1: Microcontroller Circuit
- Connect one Sharp infrared distance sensor to your circuit
board. The
coloring of the wires varies from connector to connector . In
general:
- Black/brown is ground
- Redish is +5V power (middle pin)
- Green/yellow is signal
Wiring:
- Connect power and ground from your breadboard.
- Run a signal line from your circuit board to one of the Arduino
board's analog ports.
- Install a terminal program on your computer (see the Downloads page). The USB cable
from your computer connects to serial port zero on the Arduino.
This serial connection runs at a rate of 38400 bits per second (bps).
- Mount your sensor to the hovercraft.
Component 2: Analog Interface Software
Write a program that:
- Declares a file pointer at the top of your code (you are
declaring a global variable):
#include "oulib_serial_buffered.h"
// File pointer for USB connection
FILE* fp = NULL;
- Initializes the file pointer at the top of your main() function:
fp = serial_init_buffered(0, 38400, 40, 40);
sei();
- Initializes the analog port that you have connected your sensor
to (see lecture notes)
- In a while() loop, samples from the analog sensor every 500ms,
and prints out the raw value.
Printing to USB port example:
fprintf(fp, "Foo\n\r");
Note: oulib_serial_buffered.h and buffer.h are available in your oulib/include folder.
Component 3: Data Collection
- Set up your sensor so that it is pointed in a direction that
does not have any obstacles.
- Place a flat obstacle at a known distance and record 5 samples
from of the raw analog value. The obstacle should be
orthogonal to the IR beam emitted from the sensor. Record
samples at least from the following distances: 5, 6, 8, 10,
14, 20, 30, 40, 60, 80 cm.
- Using a tool such as Excel or Matlab, graph the raw value as a
function of distance. Also graph the raw value as a
function of inverse distance.
What to Hand In
All components of the project are due by Thursday, March 24th at
8:55 am.
- Code: Check your documented code into your
group subversion tree for project 4.
- Figures: a copy of the two graphs that you have generated (JPG, PNG, PDF
or EPS format). Place these in your project4 folder of your subversion tree.
- Demonstration/Code Review: All group
members must be present. This must be completed by Friday, March 25th.
- Personal report: there is no personal report for this project.
Grading
Personal programming credit:
- Personal programming credit: this project offers one programming credit.
- Group grade distribution:
- 35%: Project implementation
- 25%: Demonstration of working project (to either
of the TA or the instructor)
- 40%: Documentation
Group Grading Rubric
Grades for individuals will be based on the group grade, but weighted
by the assessed contributions of the group members to the non-personal programming items.
References
andrewhfagg -- gmail.com
Last modified: Wed Mar 2 23:42:05 2016