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(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
- 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...
- 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...
-
-
Helium IoT Network Sensor Development board | H2S-Dev V1.2
90 0 0 -
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
176 1 1