Introduction: Police Car Using Arduino
This project consists of students making a robot that doesn't function properly. In this case, I decided to make use of several different components to make one large crappy robot. This robot consists of an ultrasonic distance sensor, a piezo buzzer, and LED lights that all fit onto a breadboard connected to an Arduino. This instructable will demonstrate the construction of the final project as well as the final diagram and code needed to be replicated by you in order to be successful when making this project.
Step 1: Gather All Materials
For this project, you will need to be able to have the following:
- Arduino with cable
- Breadboard
- Piezo Buzzer
- Ultrasonic Distance Sensor
- 2 LED lights
- Jumper wires
- Computer (Obviously)
Step 2: Set Up the LED Lights
These LED lights should be red and blue to represent the colours that a police car makes use of in real life. Connect these to any pin number (in my case, I used 13 and 11) and write the code that allows it to work in the correct timing. I made sure that the lights would not alternate too fast nor too slow. The code for the whole project will be demonstrated at the end sp that you can easily copy it onto the Arduino coding application.
Step 3: Set Up the USDS
The USDS will be one of the major components in this project. It will also require a lot of thinking when creating the code for this to function properly (luckily for you, I have already created the code for you to copy). This will measure how far someone is from the car and whoever is close, the car alarm will sound by the piezo buzzer.
Step 4: Set Up the Piezo Buzzer
This will be the component that actually produces the annoying sound when someone gets close to the police car. The information from the USDS will activate the buzzer and the lights when the person is within 10 cm of distance. This will be the most annoying part of the project as well as the crappiest factor of it, ironically making it a successful project!
Step 5: Customise It Yourself!
Although I didn't have enough time to make a car and fit this into the car, you can! Just get some cardboard and use your imagination! The code and the diagram for the construction of the breadboard will be attached to this project. Hope you liked it lads!