Police lighting
The circuit that switches between red and blue lights to simulate police lights using the ESP8266 controller and the PNP transistor 2N2222 can be described as follows:
ESP8266: Acts as the main controller in the circuit. It can be used to control the light state (red or blue) and send control signals to the transistor.
PNP Transistor 2N2222: Used to control the current flow to the LEDs. The transistor acts as a switch to control the on/off state of the current by controlling the base current (small current) using a signal from the ESP8266.
Red and Blue LEDs: Used to simulate police lights. The red and blue LEDs can be connected in the same circuit, and the current is switched between them using the transistor.
Resistors: Resistors are used to control the base current of the transistor and ensure its proper operation.
Power Source: A suitable power source should be provided to power the circuit, supply the LEDs and ESP8266.
#define LEDb D1
#define LEDb2 D2
#define LEDr D5
#define LEDr2 D6
#define d 75
void setup() {
pinMode(LEDb, OUTPUT);
pinMode(LEDb2, OUTPUT);
pinMode(LEDr, OUTPUT);
pinMode(LEDr2, OUTPUT);
}
void loop() {
digitalWrite(LEDb, HIGH);
digitalWrite(LEDb2, HIGH);
delay(d);
digitalWrite(LEDb, LOW);
digitalWrite(LEDb2, LOW);
delay(d);
digitalWrite(LEDb, HIGH);
digitalWrite(LEDb2, HIGH);
delay(d);
digitalWrite(LEDb, LOW);
digitalWrite(LEDb2, LOW);
delay(d);
digitalWrite(LEDr2, HIGH);
digitalWrite(LEDr, HIGH);
delay(d);
digitalWrite(LEDr2, LOW);
digitalWrite(LEDr, LOW);
delay(d);
digitalWrite(LEDr2, HIGH);
digitalWrite(LEDr, HIGH);
delay(d);
digitalWrite(LEDr2, LOW);
digitalWrite(LEDr, LOW);
delay(d);
}
Police lighting
*PCBWay community is a shared platform and we are not responsible for any design issues.
- Comments(0)
- Likes(1)
- CD Smart Feb 05,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by CD Smart
- Staircase lighting control The circuit works to sense movement using the SIR motion sensor, and when anyone approaches the sens...
- 4CH Relay Module Robust design using an NPN transistor to drive each relay with a PC817 optocoupler.Relay on LED indi...
- Police lighting The circuit that switches between red and blue lights to simulate police lights using the ESP8266 co...
- Smart Home Overall, the Smart Home 4-Line Board simplifies home automation and enhances convenience by centrali...
-
Open Source Very Large Stick - Freejoy & MMjoy2 breakout board
488 0 0 -
RF Control training board for students based on ESP32 C3
652 0 2 -
Aquarius+ Computer, Standard PCB
862 0 4 -
KINETIC COASTERS with a TWIST! Laser or 3D Print some DIY Magic
595 0 1 -
RPI - 8 IO PLC With ATTiny85 Watch Dog
517 0 1 -
Nintendo Famicom HVC-001 Controller Shells
618 0 1 -
COMMODORE 128 DIAGNOSTIC REV.785260 KEYBOARD DONGLE
574 0 4 -
COMMODORE 128 15KHz DISPLAY ADAPTER (C128 80 COLUMN ADAPTER)
780 1 5 -