This circuit aims to replace a traditional toggle switch for switching large amounts of current. Instead of the bulky and expensive traditional toggle switch, this circuit allows for a cheap pushbutton, and a few transistors and resistors to be used and have the same effect.
For my application, I wanted a way to have the circuit draw very little curren
t when in the off state, be able to be powered on with a pushbutton, and then turned off through software on the Arduino.
Here is the circuit diagram:
Here’s a video of the circuit in operation:
The code running on the Arduino is very simple:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
int button = 3; int led = 2; void setup() { pinMode(button, INPUT); pinMode(led, OUTPUT); digitalWrite(led, LOW); } void loop() { if (digitalRead(button)) { digitalWrite(led, HIGH); } } |