noob transistor circuit question

Thread Starter

randini

Joined Jun 5, 2010
8
Hello All,

I'm effectively trying to reproduce the function of an SPDT relay but in a project that will run on AA batteries 24/7 so a relay will draw too much power.

In a nutshell, there will be (or not be) +3VDC coming out of a timer. When there is, I want a green LED to light. When there's not, I want a red LED to light.

I could do this using a solid state relay but I'm trying to do this on the cheap (my wife has dared/commanded me to build this thing using only parts on hand) and we're only talking about 20mA.

Found some good tutorials for using a transistor as a simple SPST switch. But the waters get a little muddy when you start talking SPDT.

Found one reference to using a NOT gate and essentially hooking it up with two SPST's in tandem. Also makes sense. Now we're pretty much talking about 3 NPN's, 2 1K resistors and the LED's.

But am I correct that a PNP transistor is effectively the opposite of an NPN? Instead of Could I do this simpler with one NPN and one PNP? Basically two separate switches, one that "puts out" a high positive to the positive end of a green led when there's voltage at it's base, and one that "takes" a high negative from the negative end of a red led when there's not voltage at it's base?

Hope to hear from you. In the mean time I'll probably start experimenting on a breadboard, and hopefully not let the smoke out of too many of my on-hand parts (if I have to buy more I can't tell my wife).

Randini
Seattle
 

ErnieM

Joined Apr 24, 2011
8,377
It would help lots of you can post a schematic of what you are thinking of doing. The "not" gate sounds like the right thing but without any details...

But even before all that, how long do you expect a puny AA battery to light a LED?
 

GopherT

Joined Nov 23, 2012
8,009
Use a 555 timer. The Red LED connected to the output and the ground (resistor in there too). The Green LED connected to the output and Vcc (positive voltage source).

LEDs should toggle green/red ad the 555 timer flashes. No other chips needed.

Pick a CMOS version of the 555 to allow low voltage operation. LMC555, or check the Datasheets on the parts in your inventory (Remember, "happy wife, happy life").

If you have a good LED that will be reqsonably bright at 5ma, you will get 400 to 500 hours of operation off of a pair of AA batteries (~3 to 4 weeks).
 
Last edited:

Thread Starter

randini

Joined Jun 5, 2010
8
I should clarify. The project is a wake up timer for my twin girls. The gist is it hangs on their wall with a red light on it and at some time like 6:30 the light turns green and they know they can start partying.

They sell these for ~$40 but wife wants one cheaper and it'd be fun to make something cooler. For example she sent me a link to one that a guy built out an arduino. Really cool but would cost a hundred bucks to build.

I had the idea to find a thrift store programmable thermostat and use it to drive a red and green led set or even an rgb led. In fact, if the thermo had concurrent heating and cooling switching it'd be a no brainer. But alas, the $8 unit I found has a mechanical switch for heating or cooling, one or the other. So I need an spdt relay. But ideally I'd like to run this thing from its internal battery holder(2 AA) or at least a bigger AA holder (got a five cell holder on hand).

Been googling and trying things and I've managed to build a working NO and a working NC "relay." In fact, ideally I could just use the output of the thermo to drive one led and also to drive a simple NOT gate. But the NOT gate I've got working doesn't take a high input to work, it closes to ground, and the conventional one flakes as soon as I add an led to the same output that turns off the other (did that make any sense).

If this beast is only going to run for maybe a month on a set of batteries I'm inclined to run it from a wall wart anyway and might as well use a relay. But I've always wanted to get my head around a transistor circuit. I'm a geek by trade, systems and coding, and was a physics major about a hundred years ago and did study how a transistor works. Heck, I can also hang drywall and rebuild a veedub. But it'd be cool to do this solid state.

I welcome any feedback.
 

SPQR

Joined Nov 4, 2011
379
I should clarify. The project is a wake up timer for my twin girls. The gist is it hangs on their wall with a red light on it and at some time like 6:30 the light turns green and they know they can start partying.
So either the red or green light is on all the time?
Green = party (wakeup?)
Red = get to school, sleep
The green comes on at 6:30 pm or am?
 

Thread Starter

randini

Joined Jun 5, 2010
8
Yes, one or the other is always on, red from (say) 8pm until 6:30am, green otherwise, so they know when it's ok to leave their room in the morning.

Guess why I'm up at six when I have the day off?
 

Thread Starter

randini

Joined Jun 5, 2010
8
There are a dozen ways to do this, could be as simple as a lamp timer. I like the idea of it having a real time display for when they learn to tell time, and of it not using line voltage or making any noise.
 

SPQR

Joined Nov 4, 2011
379
Well, I'm in a "transistor phase" where I'm trying to learn more about them, so I thought I'd take this on.

To me, the problem isn't with the circuit, but rather powering the circuit.

In the diagram below, on the left you'll see the simplest "off-on" LED circuit you can have.
Two LEDs in series with appropriately calculated resistors, one end connected to positive, the other to neg.

If point A is positive, one of the LEDs goes on, if point A is 0V, ground (not unconnected, or "floating") the other goes on.
If point A is "floating", both come on.

So the diagram on the right shows a transistor "controlling" the LED pair - if there is an appropriate base current
then one LED is on, if there is no base current, the other is on.


A few minutes ago I built it and it works.

But what you would need is one wall-wart connected all the time to the LED/transistor CE rails,
and a second wall-wart that supplies the base current controlled by your timer.

I've been thinking about this most of the night (yes, I'm insomnic) and it is an interesting exercise in basic transistors.

Let's see what the experts say.
Nice question.
 

Attachments

Last edited:

SPQR

Joined Nov 4, 2011
379
But how would you control the base current with a timer?
If you used a SPDT relay, you'd still need two power supplies.

The basic issue is:
1 - you need one source of power to keep one light on all the time.
2 - you need a controlled source of power (off-on) to run a relay or control the base of a transistor.

The only other way would be to build a circuit with a built-in timer - but that might get expensive.
 
Last edited:

Thread Starter

randini

Joined Jun 5, 2010
8
the programmable thermo I picked up runs on 2 AA's or from the furnace's 24VDC if there's a wire for it: I'm guessing it can run on any DC voltage between those two. I'm hoping to use one wall wart to power the thermostat/timer, provide the base/signal voltage (using the timer as an SPST switch), and any power the transistor/LEDs need. Is there a reason those three things couldn't come from one source?
 

SPQR

Joined Nov 4, 2011
379
Ok, so that might be your "timing circuit", and so you might get away with one wall-wart.
Also you might be able to kludge together a circuit from the wall-wart to power the device so you don't need batteries.

Can you give us any information about the device?
Name, number, etc?
 

Thread Starter

randini

Joined Jun 5, 2010
8
Correction, the thermo takes two internal AA's or 24VAC. Can the added circuits all run on 3V? This would remove the need to step down voltage for the LED's?
 

SPQR

Joined Nov 4, 2011
379
I'm not sure 3V will do what you need - I tried 3.3V this AM on the two LEDs and they barely lit.

So you could get a 24V wall wart, power the thermostat so its timer can drive the transistor base with 3V, then regulate the 24V down to 5 volts to run the rest.

Any info on the thermostat?
 
Top