Introduction: Self-Driving and PS2Joystick-Controlled Arduino Car
Hi, my name is Joaquín and I'm an Arduino hobbyist. Last year I became obsessed with Arduino and I just started doing all sorts of things and this automatic and joystick-controlled car is one of them.
In case you want to do something similar these are the components you'll need:
- An Arduino Mega with its USB cable
- 1 ps2 wireless joystick with its wireless receiver
- A motor L293D Motor Driver Shield
- 4 DC hobbyist motors with their wheels
- 2 normal hobbyist servos
- 3 HC-SR04
- 1 car chassis
- one little battery bank
- 6 AA rechargeable batteries and a bettery holder for them
- Some Male to Female cables.
- Some Male to Male cables.
Step 1: Setup
Well, the very first thing I did was take the chassis out of the box and follow the instructions until the car was ready and the motors where in place. Just in case, if your motors do not come pre-soldered with cables, you may want to solder 2 cables to each motor before putting all the parts together. After that, all I had to do was connect the motors to the L293D shield with a screwdriver.
Step 2: Adding the Different Pieces
Now, I hat to glue the servos to the car chassis and the HC-SR04 to the servos with a glue gun, but if your car chassis comes with holes in it you may not have to.
In the video you will see how I glued everything and how the car looks
Step 3: Programming
Well, you have to open the arduino file or copy and paste the text from the .txt file in the next step into the arduino editor and then upload it to the board. You will have to download the libraries I use (you may already have them, they are very popular).
If you dont have a joystick you should modify the code so that it is always in automatic mode.
In case you do have one, before the code starts you will find some intructions on how to control the car and where to connect everything.
Step 4: Code
Step 5: Almost There...
All that's left to do now is to connect the shield with the arduino and power them. The arduino is powered, in my case, with the USB that came with it that is connected to a small power bank. The motor shield gets its power from 6 AA batteries (they need to be rechargeable, 10 minutes of driving are enough to drain them all. Also, we have to save the planet).
Step 6: Your Car Is Now Ready!!!!!!
Congrats on your new self-driving car!!
Participated in the
Arduino Contest 2020
2 years ago
Thank you for sharing :)