Arduino Controlled Toy Car

by Brosiman in Circuits > Arduino

3047 Views, 12 Favorites, 0 Comments

Arduino Controlled Toy Car

20190929_132933.jpg
20190929_133030.jpg
20190929_133006.jpg

This is the second part in my Arduino controlled toy cars.Once again it is an obstacle avoidance one.

In this car I'm using an Arduino Nano instead of an Uno.The motor driver is a L298N module.

Supplies

What you need also :

-two dc motors,the best ones are gear motors for reasons that become clear later on

-a HC-SR04 sensor

-Dupont cables female-female

-battery holders and clip leads,in this case a 2 x 18650 battery holder and 9V clip leads

Tools

-soldering iron

-rotary tool like a Dremel

-hot glue gun

-screw driver

Prepare Your Car and Install the Motors

20190929_133051.jpg
15698592336836925618617397064043.jpg
15698627195397458181631767904558.jpg

First take off the top part to see what space you have to work with.In this case the two rear wheels are mounted separately which is a big plus.I wanted to put the motors there but couldn't take the wheels off easily.So in the front they had to go .My two DC motors just fitted in there ,I had to enlarge the wheel base a little bit to accommodate the wheels.

That went well,however when I tested the car later I found out those motors didn't had enough torque to move the car.This is why it is better to use gear motors here.So instead of these motors,I choose the well known yellow ones from China.Due to lack of space these were hot glued standing up with a wooden support between them.

Adding Power

20191013_162459.jpg
20191013_162310.jpg
20191013_162347.jpg

The motors are powered with 2 lithium-ion batteries,and no you don't get 9900 mAh from these ones(I think they showed about 500 mAh in a test).The Arduino is powered with a 9V battery.This car has plenty of space to place the batteries.

The End Product,a Video........and the Code

20191013_162336.jpg
20191013_162441.jpg
Arduino controlled obstacle avoidance toy car

In the video you can see the car wiggles a little bit,this is because I had to modify the shafts of the motors a little bit to fit the wheels.I think having the sensor close to the ground is a good thing to have .The car seems to spot the obstacles in time without getting stuck in corners.

The code is the same as I used in my other toy car project ...a simple copy and paste job for you.