GitHub repository with all resources: https://github.com/Microttus/LightCare
The LightCar Race is a competition focused on designing the best-performing car and creating the most effective code for a specific challenge. Your car must follow a LeadCar, which is pre-programmed to drive a set path with varying speeds and turns. The path will be repeated as many times as your car can manage without interference, with a short stop between each run.
You will use two photoresistors to follow the LeadCar, which has a built-in light source at its rear (as shown below). Combining input from both sensors will provide optimal tracking. The ultimate goal is to follow the LeadCar as closely and accurately as possible throughout the course and to stop as close as possible to 10 cm behind the LeadCar after the first loop.
The cars' performance will be judged from 4 categories, with a grade from 1 til 10.
The first category is the Best Looking Code, and the criteria are:
Neatest look
Using functions
Good variable names
Only uses one type of variable method
Describing names
Easily adjustable
Complexity in a simple way
The second category is the one who follows best, and the criteria are:
Able to follow the longest in one single loop
Able to follow several loops
Has the smoothest driving
The third category is Stopping The Closest, and the criteria are:
Able to follow through a complete loop
Stopping the closest to 10 cm behind the Leader-Car after the first loop
Maintain still for as long as the Leader-Car stands still
The fourth and last category is The Most Creative Design, and the criteria are:
Has a creative and original design
Holds all the necessary components
Has to be drivable
Using two photoresistors, your vehicle is designed to follow a LeadCar as accurately as possible. The drive computer is an Arduino Uno, which reads sensor data and controls the motors and, optionally, a servo. The Arduino board is primarily programmed in C, but MATLAB Simulink may also be used as an alternative.
As displayed, this is how the measuring should be done after the first loop.
You can also see how the alignment should be between the LeadCar and your vehicle when the start signal goes.
The car assembly for the LeadCar, code can be found at the GitHub Repository
The light source is a 9V battery light called Blocklight.
Available at: Biltema, Amazon
For the car challenge project, there are some basic rules regarding the components you can use.
The requirements for the components are listed in the section below. Some components, such as the Arduino, are mandatory, while others are optional and can be chosen if you think they will make your car faster.
You must design the car’s frame yourself, and it should be made either by 3D printing in PLA plastic, cutting from acrylic plates using the laser cutter, or machining with the CNC machine. The wheels can also be made using these methods if you wish. Soldering wires and using screws or glue for assembly are, of course, allowed.
Arduino Uno x1
Motor controller L298 x1
9 volt battery x1
Power line from battery to L298 x1
TT motor x2
Photocell x2
Resistors x2
Necessary wires
Wheels (can be made, or use pre-made)
Various sensors (for example, proximity)
9g Servo (If you would rather have this for steering)
Weight
Circuit design for necessary components
This project can be completed with simple programming and empirical testing. However, if you want to take your car to the next level, there is a lot of control theory you can explore to optimize your code. A brief introduction to some mechanical aspects to consider, along with important mathematical calculations, is presented in this presentation.
Below, you’ll also find a beginner’s guide to the Arduino IDE. This is a great starting point for learning Arduino basics, which will be helpful when programming for this project.