Introduction: UCL - Embedded Controlled Car
We had big ambitions for this project. Self driving car! Following a black line or driving around free avoiding obsticals. Bluetooth connections, and a 2nd arduino for controller with wireless communication the car. Maybe a 2nd car that could follow the first one.
In the end we had alot of problems just to get the car driving manual forwars or backwards.
Step 1: Parts List
Base car with servo motor for steering
Bridge Motor Controller
Black colour detector sensor
Wires, screws, strips and elastics
Step 2: Pre Considerations
First we followed an assembly guide for a 4wd robot car with manual control with infared and bluetooth, linetracking mode and obstical avoidance mode. When it didnt work after we assembled it, it was impossible for us to find the error as we did not have overwiev of the code. So we decided to start over and instead of 4wd drive, we decided to use a base of an old defect remote controlled car. from this base there was a servo motor connected to the two front wheels for steering, and then we added two motors and two wheels to drive the car forward or backwards so the car has 4 wheels in total.
Step 3: Assembling and Wiring
The motor that controls the direction of the front wheels is connected to a L298N motor driver module.
The two DC motors that drive the back wheels is connected to the same L298N motor driver, on the other output.
The L298N is connected from its power input to the power supply. We placed an on/off switch between the two. The GND is connected with the arduino GND and there is also a 5v output from the L298N that is connected to the VIN pin on the arduino.
There is 6 signal wires connected between the arduino and the L298N. 3 for each motor control. The first two are used to choose if the motor is on and what direction. the third is to decide the speed of the motors.
Now there is power to the engine and the car is driveable and we are going to add infared sensor to be able to have manual control with a remote controller. And we will add 3 black colour detector sensors to try to make the car follow a black line.
the infared sensor is connected to the arduinos 5v output and gnd for power and the signal was initially connected to digita pin 13, but the wire broke in there and the pin 13 is now unusable in our arduino, so we switched it to didital pin 3
The sensors used for line tracking we made 1 wire that connects all the 5v to the L298N 5v output and the GNDs are also comined in 1 wire that is connected on arduino GND pin. The signal pins are connected to arduino digital pin 8,7 and 2
Step 4: 3D Print With Fusion 360
Made drawings for a mast in Fusion 360, that was intended to be holding the infared-sensor and bluetooth module.
Added the file to CURA for the 3D printer Ultimaker 2+ to read it.
Step 5: Code
Our program consists of different elements. The first thing we did was making a program to read infared signal from remote control, and write down which commands was attached to wich buttons.
Then we created a program to control the 3 motors with the motor driver and manual steering with remote control.
Then we created a program that reads from the 3 line tracking sensors, running different code depending what combination of sensors is active.
in the end we tried to combine the programs, so that you have control from the remote control to go to manual mode and steer the car or swap to line tracking mode, where the car follows a black line beneith it.