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

IMG-7137.jpg
IMG-7136.jpg

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

Screen Shot 2022-03-29 at 11.05.14 AM.png
Screen Shot 2022-03-29 at 11.05.54 AM.png
Screen Shot 2022-03-29 at 11.05.32 AM.png

The supplies that I used are:

Assembling the Car

IMG-7134.jpg

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

Screen Shot 2022-03-29 at 11.18.42 AM.png
Screen Shot 2022-03-29 at 11.21.35 AM.png
  • 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

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

IMG-7135.jpg
  • 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!

Completed Demo!