Self Driving Car With LEDs and Sounds
by khouck18 in Circuits > Arduino
328 Views, 4 Favorites, 0 Comments
Self Driving Car With LEDs and Sounds
I built a self driving car that plays sounds and uses LEDs when it has reached key points on the track or accomplished a task (i.e. autoparking or reaching the end of the track). The overall build is fairly straightforward and the project gives basic experience coding in python and C. Additionally, you will gain experience working with servo motors, distance sensors, and more art related topics like playing sound and using LEDs.
Supplies
The supplies that I used are:
- 1 - Elegoo Car Kit
- 1 - Circuit Playground Bluefruit
- 1 - 30 Pixel LED light strip
- 1 - Roll of black electrical tape
Assembling the Car
Once you receive your Elegoo Car Kit follow the assembly tutorial booklet that comes in the kit. Make sure to take time building the car correctly as a weak frame could cause your car to fall apart or become damaged while driving.
Writing the Car Code
- First Download the Arduino IDE
- Add in the code below
- To compile the code first click the check mark in the top left (pictured below)
- Next connect the car to your laptop by plugging the blue cable in the car kit into the Arduino uno and your laptop
- Before you run your code be sure to go to click on the Arduino software and go to the tools tab. Ensure that the following matches your computers output or your code will not run:
- Board: "Arduino Uno"
- Port: "/dev/cu/usbmodem00001"
- Next click on the arrow next to the check mark in the top left to run your code and upload it to the Arduino board
Downloads
Writing the Circuit Playground Bluefruit Code
- First download the MU IDE
- Copy the below code and note that most of this code relies on timing, so you will need to adjust bits and pieces depending on the size of your track, sound files, and the differing durations for which you would want to play your LEDs
- Also you will need to download sounds onto your Circuit Bluefruit device. The two formats that I accept in the project are .wav and .mp3
Downloads
Building the Track
- The car's sensors work best when there is black electrical tape for it to follow. A sample track is included but feel free to create your own designs!
- Once the track is built, simply place the car on the line created and switch it on!