8050 Triode Switch Circuit Diagram（1）
1.Using NPN triode to do the circuit diagram of the switch circuit control led:
2.The general control of the LED, taking into account the increase in voltage input when the power is sufficient, so that the LED light, save power when the input voltage is low. The 10K sampling potentiometer can arbitrarily adjust the voltage to be controlled, and all the resistors are changed according to the high and low voltage of the power supply to make the circuit work normally.
3. There is an output terminal for reverse control (when input is high, output is low).
8050 Triode Switch Circuit Diagram（2）
8050 three-stage tube switch circuit diagram (3)
When the MCU detects that a button has been pressed, it immediately executes a 10-ms delay program, and then detects if the pin is still closed. If it is still closed, confirm that the key is pressed and immediately execute the corresponding processing procedure. Otherwise, it may be interference and discard this test result.
Next, we install a four-digit DIP switch, which is the red switch in the figure. It is equivalent to four toggle switches that are mounted together. When the switch is turned to the "ON" side, the corresponding path will be Turned on, otherwise turned off. It is generally used in microcontrollers to set initial parameters and does not change often. Here, because the pin resources of the MCU are not enough, we only use the 2nd, 3rd, and 4th bits of the DIP switch, and the 1st bit is idle. The three switches can be logically combined in 8 states, so we can easily and flexibly preset up to 7 countdown times.