This little vehicle is on an impossible, never ending mission to catch the light. You can make it follow you by pointing a flashlight at it. (The one on your mobile phone eg.) It will always turn towards the light.
Materials
- 1 Arduino Uno board
- 1 Basic Education shield
- 2 continuous servo motor
- 1 100 µF capacitor
- 2 LDR sensor
- 2 1k ohm resistor
- 6 colored jumper wires
- 2 black jumper wires
- 8 AA batteries
- 1 AA battery holder
- 1 power connector
- 1 Light Chaser kit
- 1 ping pong ball
Instructions
Code
You can find the code at: File -> Examples -> BasicEducationShield -> Robots -> LightChaser
How it works
The program checks the left LDR sensor to see if the light is higher than the threshold. If so, turn the left wheel backward and right wheel forward so the vehicle turns left. It does the same for the right LDR sensor, but turns the wheels in the opposite direction to turn right. If neither of the LDRs passes the threshold, the Vehicle simply moves forward turning both wheels at the same rate.
Troubleshooting
- Vehicle is not turning towards light? See LDR reference about how to debug LDRs.
- Motors are not working/Vehicle is not going straight? See the reference about how to debug servo motors.
Experiment further
- Can you turn it into a “Vampire Vehicle” so that it runs away from light?
- Modify the example so the Vehicle only moves when there is a light pointed at it.