Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 2 | ||||
| × | 2 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
Hey Guys..
I'm back with another project.
In this I made 2 projects.
1. Police Siren and Lights using Arduino without Bluetooth module and app.2. Police Siren and Lights using Arduino with Bluetooth module and Android application.
You can make this project and fix it in your RC car or Bluetooth controlled Arduino car.
To make 1st Project do the steps:
1. First Take Red and Blue LEDs.
2. Join GND ( cathode ) of all LEDs and connect to Arduino GND.
3. Connect Anode of red LEDs to A4 of Arduino and Anode of Blue LEDs to A5 of Arduino.
4. Take speaker connect + pin to Arduino 2 and - pin to Arduino GND.
5. Upload the first code and check it.
To make 2nd Project do the steps:
1. Don't remove the previous connections.
2. Take Bluetooth Module and do the connections from circuit diagram.
3. Download the Android application from below link.
4. Install it in your android device and open the Bluetooth of mobile connect to HC-05. Put the password as 0000 or 1234.
5. Open app and connect to HC-05 and now test the Police siren and lights.
Link to download Android Mobile Application:
https://drive.google.com/file/d/1cpBDtKORGHcIYkhQHJTkLerJ6Ea5FHsZ/view?usp=sharing
If you like this project respect it.
Give me suggestions so I can improve it or any feedback you want to give to my YouTube channel.
link is : https://studio.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g
// https://www.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g //
// Police siren with lights //
// By MOHD SOHAIL //
int blue = A4;
int red = A5;
int speaker =2;
int t=60;
int i=0;
void setup() {
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(A5, OUTPUT);
pinMode(A4, OUTPUT);
}
void loop() {
digitalWrite(A4,HIGH); // for police siren lights
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
for(i=700;i<800;i++){ // for police siren
tone(2,i);
delay(15);
}
for(i=800;i>700;i--){
tone(2,i);
delay(15);
}
}
// https://www.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g //
// police siren via bluetooth module //
// By MOHD SOHAIL //
int blue = A4;
int red = A5;
int speaker =2;
int t=60;
int i=0;
char command;
void setup()
{
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(A5, OUTPUT);
pinMode(A4, OUTPUT);
}
void loop()
{
while(Serial.available() > 0){
command = Serial.read();
switch(command){
case 'c': // Siren on
sirenon();
break;
case 'd': // Siren off
sirenoff();
break;
case 'a': // Siren leds on
sirenledon();
break;
case 'b': // Siren leds off
sirenledoff();
break;
}
}
}
void sirenledon ()
{
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
digitalWrite(A4,HIGH);
delay(t);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(t);
digitalWrite(A5,LOW);
delay(t);
}
void sirenledoff ()
{
digitalWrite( A4, LOW);
digitalWrite( A5 , LOW);
}
void sirenon ()
{
for(i=700;i<800;i++){
tone(2,i);
delay(15);
}
for(i=800;i>700;i--){
tone(2,i);
delay(15);
}
}
void sirenoff ()
{
digitalWrite(2 , LOW);
noTone(2);
}
Comments