Transistor as switch unexpectedly blinks LED

Irving

Joined Jan 30, 2016
5,132
The advantage of the TS' arrangement is it arguably provides better protection against potential large -ve spikes that may be present if the pump is an inductive load. If you go for the later arrangement I'd use a dual fast diode from 3.3v to GPIO to ground. BAV99 or similar.
 

Attachments

ErnieM

Joined Apr 24, 2011
8,415
The disadvantage is the lack of any control over what voltage appears at the GPIO pin.

Strange how better ideas appear after a nights sleep. A transistor will be well used as a buffer fairly imune to a very large range of "12V" inputs.

DIV2.jpg
 

Irving

Joined Jan 30, 2016
5,132
The disadvantage is the lack of any control over what voltage appears at the GPIO pin.
Hmmm, I disagree, why do you think that? As long as the input voltage is >~4v, to put the transistor into saturation, there's nothing to choose between them other than the original is positive logic and yours is negative logic. If the requirement was to "detect any +ve voltage > 1v" then I'd agree but the requirement is to detect the presence of +12v and for that it works fine.

1643567579573.png
 

ErnieM

Joined Apr 24, 2011
8,415
Hmmm, I disagree, why do you think that?
I think that because in the above circuit Q1 is connected as a traditional emitter follower, you know, the one where the emitter voltage follows the input (minus the Vbe drop)?

So yeah you could tickle it on with a huge series resistance (like a mega ohm) but I would hardly call that operating in "saturation" irregardless of what a simulator computes.

Carbon over silicon one again (until SkyNet goes online).
 

sghioto

Joined Dec 31, 2017
8,634
So yeah you could tickle it on with a huge series resistance (like a mega ohm) but I would hardly call that operating in "saturation" irregardless of what a simulator computes.
The simulator is correct. Testing the above emitter follower circuit the voltage at the emitter measured 3.26 volts using a 2N2222 and a 12 volt input. At 6 volts input the emitter was at 3.21 volts and 3 volts at a 5 volt input.
Silicon over carbon this time.
 
Last edited:
Top