Hi, well its been a long while since i have done programming or electronics but loving playing with my uno!
I wanted to create a simple circuit that keeps power on to the Arduino until a digital pin goes low. so this what i was trying.
press switch supplies power to the UNO. the UNO boots up and raise D6 out pin HIGH, this is connected to the base of the 2n2222 via a 1K resistor.
the 2N2222 maintains the power when the switch is released until in code the Pin connected to the base is lowered.
Arduino is powered via 9V battery on VIN.
I can use the 2N2222 to switch an LED on and off, but it is controlling the uno its on all the time. the 2N2222 i believe is rated at 30V 800mA so should not be breaking down.
So not sure what i'm doing wrong!
Sorry for the lack of a circuit diagram I have not found what you all use to do them yet!
I_Need_Help2:
Sorry for the lack of a circuit diagram I have not found what you all use to do them yet!
Pen, paper, digital camera. If possible, set the camera to 1024x768 or lower resolution. When taking the picture, back up a bit then use zoom to frame the paper.
To post the image, click Reply, click Attachments and other options, click Browse, select the image, click OK/Open, click Post.
The simplest way to implement this is with the polulu switch module. polulu push on/push off switch It will allow you to power on the device with a button press, push it again, it powers off... and.. it has a pin which will allow you to turn it off from an arduino pin. All for less than $7.00.
That circuit isn't going to work, but you can do it with 2 transistors. Use a PNP transistor to switch the +ve side of the battery (emitter to battery +ve, collector to Arduino Vin or barrel jack). Then use an NPN transistor driven by an Arduino output pin to drive base of the PNP transistor, not forgetting the current limiting resistors.
The fundamental issue is that switches made from transistors invert, so that you need
another inverter somewhere that isn't powered down. For instance you could
high-side switch with a PNP or p-FET driven from a 74HC14 inverter, so long as the inverter
remains powered up to pull the base high when the load is powered down.
With an NPN or n-FET on the low side the powered down load is necessarily at 5V, so you
need to invert that to get 0V for the base/gate of the switch.
One flexible way to do a power switch is use a CMOS set/reset flip-flop driving
a p-channel FET high-side switch. This gives a two inputs, one to power up and
one to power down.
Hi Mark thank you for taking the time to explain it to me I do appreciate it.
"One flexible way to do a power switch is use a CMOS set/reset flip-flop driving
a p-channel FET high-side switch. This gives a two inputs, one to power up and
one to power down."
Sounds very interesting would you be able to point me at an example circuit?