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 sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(2)
-
Sergio Oliveira
Jun 18,2025
-
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
-
Web 4CH Switch
ESP12F based board with 4 relays, DHST and/or LM35 temperature sensor(s) for Local or remote tempera...
-
IR Remote Control
TinyRemote is a compact and ultra-low-power infrared (IR) remote control built around the CH32V003, ...
-
Flasher Diet Fake
Flasher Diet FakeFake Car Alarm LED Flasher CircuitThe Flasher Diet Fake is a simple electronic circ...
-
Smart Medi Box
This project contains a medi box design, having humidity and temperature sensor inside. User interat...
-
Pool Heater Controller
Smart controller for gas pool heaters.Simple panel control is a built in option however the intent i...
-
remote controller
WiFi Infrared Remote Control Universal Smart Remote Control for Air Conditioner Fan TV Voice Control...
-
WiFi Smart Wall Switches
All switches can be controlled remotely using your phone, and devices connected with switches can wo...
-
Smart Home 4CH Pro
Overall, the Smart Home 4-Line 10A Panel simplifies home automation and enhances convenience through...
-
Shutter control 10A
Overall, the remote curtain opener and closeer control panel simplifies home automation and enhances...
-
Air conditioning control board
Overall, the AC on/off control panel simplifies home automation and enhances comfort through central...
-
Smart Home 3CH_10A
Overall, the Smart Home 3-Line 10A Panel simplifies home automation and enhances convenience through...
-
Smart Home 2CH_10A
Overall, the Smart Home 2-Line 10A Panel simplifies home automation and enhances convenience through...
-
Smart Home 4CH_10A
Overall, the Smart Home 4-Line 10A Panel simplifies home automation and enhances convenience through...
-
Stepper Motor Control
The port was implemented to connect the ESP and the driver so that the shield is integrated and a de...
-
Smart Home_8CH_10A
Overall, the Smart Home 8-Line Board simplifies home automation and enhances convenience by centrali...
-
Smart Home_4ch-smart_1.4
Overall, the Smart Home 4-Line Board simplifies home automation and enhances convenience by centrali...
-
Smart Home_4CH_2A
Overall, the Smart Home 4-Line Board simplifies home automation and enhances convenience by centrali...
-
PET Machine
The temperature and speed control board of the stepper motor is used to control the water bottle rec...
-
-
AEL-2011 Power Supply Module
444 0 2 -
AEL-2011 50W Power Amplifier
411 0 2 -
-
-
Custom Mechanical Keyboard
644 0 0 -
Tester for Touch Screen Digitizer without using microcontroller
289 2 2 -
Audio reactive glow LED wristband/bracelet with NFC / RFID-Tags
275 0 1 -
-
-







