Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Police Strobe Light Using Arduino
WhatsApp
Sr Karthiga
4y
19.5k
0
1
100
Article
police.rar
Introduction
In my last article, I explained about Remote Control using the Arduino Uno. In this article, I will explain about Police Strobe Light using Arduino.
List of Parts
2 Red Led
2 Blue Led
Arduino Uno
Potentiometer
Bread Board
Jumper Wires.
Connection
Step 1:
Connect the Arduino Uno board to the pc using a USB cable.
Step 2:
Fix LEDs and potentiometer in the bread board
Step 3:
POTENTIOMETER CONNECTION
Figure 1: Potentiometer
Step 4:
Connect the potentiometer to the Arduino Board as in the preceding figure 1.
Step 5:
Potentiometer
Centre
leads to
Analog 0 pin
in Arduino Board.
Step 6:
Fix the 2 red LEDs in the bread board, then commonly connect the positive pins (+) together and negative pins (-) together.
Step 7:
Take an
Anode pin to digital pin 11 and Cathode to gnd.
Step 8:
Fix the 2 blue LEDs in the bread board, and then connect the positive pins (+) together and negative pins (-) together.
Step 9:
Take an
Anode pin to digital pin 12 and Cathode to gnd.
Programming
const
int
analogInPin = A0;
// Analog input pin in potentiometer to be attached.
int
sensorvalue = 0;
int
timer = 0;
void
setup()
{
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
}
void
loop()
{
sensorValue = analog Read(analogInPin);
timer = map(sensorValue, 0, 1023, 10, 500);
//time delay.
digitalWrite(12, HIGH);
delay(timer);
digitalWrite(12, LOW);
delay(timer);
digitalWrite(12, HIGH);
delay(timer);
digitalWrite(12, LOW);
delay(timer);
digitalWrite(11, HIGH);
delay(timer);
digitalWrite(11, LOW);
delay(timer);
digitalWrite(11, HIGH);
delay(timer);
digitalWrite(11, LOW);
delay(timer);
}
Figure 2:
Police Strobe Light
Explanation
LEDs can blink lightly one by one automatically, we can adjust the potentiometer and see the changes in LEDs blink.
const int analogInPin
= The input from the
potentiometer
to
the Arduino board
.
The strobe lights are used in
Ambulance, Fire engine in Emergency situation.
Arduino
Internet of things
IoT
Police Strobe Light
Up Next
Ebook Download
View all
Raspberry Pi -Sensorial Symphony of Connectivity
Read by 704 people
Download Now!
Learn
View all
Membership not found