I am trying to setup a self powering Attiny (for battery powered remote purposes) with a 2N2222 NPN.
Thus, I created a sketch that sets 2N2222 base to high when the button us pressed so the transistor can keep the Attiny13 alive while completing the tasks.
After my tests, I get the correct logical state at the emitter pin during 3 seconds. But when plugged to the board, it's like there is nothing else than the switch is plugged.
In the picture I can see:
Reset pin (#1) is connected to GND. This would hold ATtiny13 in reset all the time.
GND pin (#4) is not connected to anything.
uxomm:
Normally you need 2 transistors (or MOSFETs).
This may work for low current needs (less than 100 mA):
Awesome circuit! A couple of suggestions:
The BC557 has an ABSOLUTE MAX IC of 100ma and the datasheet specs the ß at -2ma, and the Static Characteristic curve diagram stops at 50ma, this really doesn't seem a suitable transistor for this application [unless current demand doesn't go above, say -35ma]. The PN2907 [or even 2N2907] seems a better choice, at least for higher currents up to 100ma.
Since this is for a battery powered device, I suggest increasing the value of R1 a bit. One can argue that to turn a bipolar transistor "fully" on [i.e. saturated], one should set the base current in terms of ß=10. But, there's some wiggle room if one balances power loss, in the transistor, with current drain in the Emitter-Base leg. And, this is especially "wiggle happy" with cases of low power demand -- as is likely the case here. The reason for increasing the value of R1 is to reduce the current it drains away while this circuit is powered. But, if this is considered trivial, then no need to change it. Another way around this, is to use a P-Channel MOSFET, instead. The Source pin goes where the Emitter pin is, the Gate where the Base is and the Drain where the Collector is -- then add a 100k resistor from the Source to the Gate. Then there will be no wasteful current path. Plus, a MOSFET can be chosen to have FAR less voltage drop, and so it will not heat up at all. The SFT1342-W looks like a good choice. Relatively inexpensive, logic level [gate threshold of -1.2V to -2.6V], RDS(on) of 96mΩ at VGS = -4V [and even at VGS = -2.5V the VDS is -0.1V at a Drain current ofhalf an amp! And at VGS = -5V, the VDS is more like 20mV at half an amp] and, its a 60V transistor, so plenty of headroom True, it's a transistor designed for much higher currents [up to -12A], but it has a very low channel resistance, thus it will drop very little voltage at the small currents likely involved here. I looked at smaller, (TO92, for instance) MOSFETS but I kept seeing RDS(on) in the the 10Ω range. At 100ma, that's a voltage drop of 1V! And, I couldn't find anything that wasn't SMD in the 1Ωish range, that were truly Logic Level (with gate threshold below -4V). Since this one is less than a dollar, then why not? It probably has a higher gate capacitance, but switching speed is not a requirement -- thus no need to worry about high gate drive current -- and that 1k resistor in the Gate leg will fix the max current to 5ma.
Ok guys hmmmmm don't hit me ok ?
I got bad eyes and mixed up the BC337 and BC227.
My radio remote is working
Just a small comment, I removed the resistor between Arduino VCC and Arduino Output because the appliance kept drawing current after pin shutdown. Now it works and shuts down correctly.
Thanks for your help. I still need to figure out why it's working (magic)
ReverseEMF:
Here's another way to do it (possibly a little tricker for the nubie):
That circuit can't work for a power MOSFET which has a body diode, since that would simply conduct all the time. A signal MOSFET (no body diode) won't have a low enough Rds(on) for most cases I fear.
As stated previously normally you need 2 active devices to perform this task.