User:Skwon9642/ENES100 (Fall 14)/Project 1 (Line Following Robot)

This project is the "Line Following Robot", our goal is to build and design (kit) a robot that will follow a black electrical tape on a white floor. An Arduino paired with an Infrared sensor will be used to follow the lines.

Week1 Narrative
Task: Design ways to mount Infrared sensor onto car as low as possible without interfering with mobility.

Design Ideas

 * Metal bracket
 * Most durable (metal)
 * Cheap and easy to obtain (home improvement store)


 * Sensor on center bottom of robot
 * Prevents rear "wipeout" when taking sharp corners at faster speeds
 * most stable drive (prediction)


 * 1 sensor each on front and rear
 * Prevents rear "wipeout" when taking sharp corners at faster speeds
 * rear sensor may interfere with direction judgement of robot (prediction)


 * 2 collapsible antenna pillars
 * gives more flexibility when testing for optimal height for sensor operation
 * less prone to damage when being carried around

Next task is to build the kit and try out different designs on them

Week2 Narrative
Task: I was assigned the task of creating a specific criteria for defining what the "best way" to position the sensor is.


 * position the sensor so that the robot's rear will not spin out.
 * position the sensor so that the sensor will recognize the black tape (needs to be low to the ground).
 * position the sensor so that the sensor is in the same direction as the car's forward direction.
 * cannot interfere with other parts of the robot.

After group discussion, metal bracket (design 1 from week 1) was agreed upon but with slight modification to the shape.

3d sketch prototype


 * shape is changed in order to make sensor lower to the ground.
 * dimensions are in mm

Next Steps: look for the bracket in the lab or if not available, 3d print

Week3 Narrative
my task this week is to make a prototype of the bracket with materials found in the lab.


 * found some used scrap metal sheets on "ferrous scrap" bin
 * Cut them to the appropriate dimensions

next steps:


 * find Arduino code and test it out while team mates work on wiring up all the parts.

Week4 Narrative
Task: Find arduino code that corresponds to Arduino+motor shield+sensor QTR-8A reflectance sensor

=code 1=
 * Found a [|Youtube Video] containing an arduino code.
 * code did not return any errors but is not the correct code because the author uses different arduino board, shield and sensor.
 * the video was still helpful because the author explains what the code means.

=code 2=
 * [|Instrucables website]
 * library downloads
 * This code is by far the closest I have gotten to where I want to be.
 * This uses all the same materials that the robot is using (arduino uno, adafruit motorshield and QTR 8-A)
 * before using the code, I have to have the correct "library" installed on the computer. If it is not installed, the code will not work
 * code is giving errors:

In file included from QTRRC_Line_Follow.pde:1:

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/Button.h:23:22: error: WProgram.h: No such file or directory

In file included from QTRRC_Line_Follow.pde:1:

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/Button.h:34: error: expected `)' before 'buttonPin'

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/Button.h:42: error: 'uint8_t' does not name a type

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/Button.h:43: error: 'uint8_t' does not name a type

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/Button.h:44: error: 'uint8_t' does not name a type

In file included from QTRRC_Line_Follow.pde:3:

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h: In function 'void engineSetup':

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h:23: error: 'OUTPUT' was not declared in this scope

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h:23: error: 'pinMode' was not declared in this scope

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h: In function 'void motor(int, int)':

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h:33: error: 'HIGH' was not declared in this scope

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h:41: error: 'LOW' was not declared in this scope

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h:45: error: 'analogWrite' was not declared in this scope

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/engine.h:46: error: 'digitalWrite' was not declared in this scope

In file included from QTRRC_Line_Follow.pde:4:

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/navigation.h: In function 'void calibrate(PololuQTRSensorsRC*)':

C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors/navigation.h:21: error: 'delay' was not declared in this scope


 * My prediction is that the library is not installed properly because the error mentions "C:\Users\Student\Documents\Arduino\libraries\PololuQTRSensors". It must be in the wrong folder or maybe the files are named incorrectly.


 * next steps: continue attemping to run the code without errors. Possibly join the arduino forums and ask there...