Police Strobe Light Using Arduino

In this article you will see how to display Police Strobe Light using Arduino.

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 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 bread board, then commonly connect the  postive 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 bread board, and then connect the postive pins (+) together and negative pins (-) together.

Step 9: Take an Anode pin to digital pin 12 and Cathode to gnd.
 
Programming
  1. const int analogInPin = A0; // Analog input pin in potentiometer to be attached.     
  2. int sensorvalue = 0;    
  3. int timer = 0;    
  4. void setup()    
  5. {    
  6.     pinMode(12, OUTPUT);    
  7.     pinMode(11, OUTPUT);    
  8. }    
  9. void loop()    
  10. {    
  11.     sensorValue = analog Read(analogInPin);    
  12.     timer = map(sensorValue, 0, 1023, 10, 500); //time delay.    
  13.     digitalWrite(12, HIGH);    
  14.     delay(timer);    
  15.     digitalWrite(12, LOW);    
  16.     delay(timer);    
  17.     digitalWrite(12, HIGH);    
  18.     delay(timer);    
  19.     digitalWrite(12, LOW);    
  20.     delay(timer);    
  21.     digitalWrite(11, HIGH);    
  22.     delay(timer);    
  23.     digitalWrite(11, LOW);    
  24.     delay(timer);    
  25.     digitalWrite(11, HIGH);    
  26.     delay(timer);    
  27.     digitalWrite(11, LOW);    
  28.     delay(timer);    
  29. }    
 
            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 Arduino board.
  • The strobe lights are used in Ambulance, Fire engine in Emergency situation.