Maker Pro
Maker Pro

transistor switch for LED's

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
Hi all,

I'm building a prop for a childrens event. It's a sort of fake decoding machine. When a card (with an irrelevant code on) is slid into a slot I want it to open a switch and turn on 3 LEDs inside a box, while simultaneously turning off an LED outside the box. I want to run it from a battery (9v?).

Here is a summary of the functions:
http://www.flickr.com/photos/61496548@N03/8675815551/

I have googled around and have come up with the following solution:
http://www.flickr.com/photos/61496548@N03/8675813959/in/photostream/


Is this a good solution?

Can anyone help me calculate the resistors/ tansistors needed?

I need to produce this quickly and cheaply and I'm going to solder it all up with my own inexpert hands (not literally - I don't have soldering-iron-fingers or anything)

All help much appreciated
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
oh just realised that in the circuit finctions picture I have accidentally reversed the master switch functions... oops.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Looking at the circuit diagram you have, the LED marked "Set 1" will never illuminate, and the LEDs marked "Set 2" are going to always be illuminated as long as the master power switch is on.

I presume you want the card switch to toggle "Set1" and "Set 2"?

And that the master switch turns everything on and off?

I'll try to draw you a circuit to do that... (It's not pretty)

R1 can be something like 10k
R2 and R4 are chosen appropriately for the LEDs
R3 should be as high as possible so that the LED on the left doesn't appear to be lit. I would start with 10k.

When the switch CS is open the single LED will be off (actually it will have a VERY dim glow) and the three LEDs will be ON.

When the CS switch is closed, the single LED will be ON and the three LEDs will turn off.

If the LEDs don't turn fully on or fully off, some twiddling of component values (chiefly R1 and R3) may be required. The two LED sets can be swapped over if you need to.

If this is not what you need, let me know :)
 

Attachments

  • toggle.png
    toggle.png
    7.2 KB · Views: 237

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Easiest way is to use a SPDT switch. Common contact to the power, NC contact to the string of LEDs that should be normally on, NO contact to the string of LEDS that should be normally off, with resistor in each string to ground.

Bob
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
Thanks

Thanks Steve
That looks like you have hit the nail on the head.

I based my circuit on one that used a LDR in place of the card switch and no 'set1' LED - its on this page if you are interested (about 4/5 of the way down):

http://electronicsclub.info/transistorcircuits.htm

I guess the LDR and simple switch are not interchangeable. I'm struggling to get my head arround it all to be honest havin no real electronics knowledge...


Couple more questions.
1. do transistors come in a a range of types - how do I work out which to use (I guess its NPN but do they vary?)

2. if I am powering 3 LED's in series will a 9v cell be too little? (i think they normally drop about 3v?). Should I connect them in parallel to one another?

3. Do you think a single 9v cell will run this set up all day or should I put a couple in parrallel?


Hi bob
Thanks for your suggestion - that would be much simpler.
Unfortunately because my prop will be controlled by a card sliding between two contacts I can't use a togglilng switch - only open or closed...
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
Oh balls. Ok thanks for the heads up Bob - it does say there is a moderator when you hit submit reply... I wonder where those two messages went then.

well I'll do it all again then (must remember to copy messages before posting...) :

Steve: thanks of your post I think you have hit the nail on the head.

I based my circuit on light sensing circuit which had an LDR in place of my card switch and which switched the LED on when the LDR was dark.

It's here if you are interested (about 4/5 of the way down):
http://electronicsclub.info/transistorcircuits.htm

I guess the LDR is not replaceable with a simple switch. I am struggling to get my head around all this as I dont have any real electronics knowledge...:eek:

I still have a couple of questions:

1. I figure the transistors are NPN, but are there different types of NPN transistor, how do I choose.

2. Will the 9v cell power all three LEDs in series well? I read that LEDs normally drop about 3v each. Should I be wiring them in parrallel to eachother?

3. Do you think a 9v cell will run this set up all day or should I put a couple in parrallel to extend their life?

Thanks again.

Bob: Thanks for your suggestion - it definitely seems simpler. Unfortunately the prop I am making relies on a card sliding into a slot and breaking a contact so the switch can only be open or closed...
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
Oh. Ok thanks for the heads up Bob - it does say there is a moderator when you hit submit reply... I wonder where those two messages went then.

well I'll do it all again then (must remember to copy messages before posting...) :

Steve: thanks of your post I think you have hit the nail on the head.

I based my circuit on light sensing circuit which had an LDR in place of my card switch and which switched the LED on when the LDR was dark.

I guess the LDR is not replaceable with a simple switch. I am struggling to get my head around all this as I dont have any real electronics knowledge...:eek:
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
Bob: Thanks for your suggestion - it definitely seems simpler. Unfortunately the prop I am making relies on a card sliding into a slot and breaking a contact so the switch can only be open or closed...
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
I still have a couple of questions:

1. I figure the transistors are NPN, but are there different types of NPN transistor, how do I choose.

2. Will the 9v cell power all three LEDs in series well? I read that LEDs normally drop about 3v each. Should I be wiring them in parrallel to eachother?

3. Do you think a 9v cell will run this set up all day or should I put a couple in parrallel to extend their life?

Thnaks again.
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
(by the way if anyone has managed to stick through this cloud of wierd accidental self-trolling I've ended up doing then you are trojans, thanks a load)
 

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
The circuit I copied is here in case anyone is interested - I think the forum didn't like the link to it.
 

Attachments

  • tranldr1.gif
    tranldr1.gif
    3.2 KB · Views: 125

davenn

Moderator
Sep 5, 2009
14,265
Joined
Sep 5, 2009
Messages
14,265
Hi OldHat

because you are a new member and a lot of you posts contained links to www sites
your posts were ( by the forum software) automatically placed into moderation as possible spam. That means a moderator like steve or myself had to review them to see if they were spam or not. I have allowed your posts and deleted any double ups and done a general tidy up of the thread. :)

Regards
Dave
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
1. I figure the transistors are NPN, but are there different types of NPN transistor, how do I choose.

That circuit will suit any small NPN transistor. BC548, 2N2222, or almost whatever else you have on hand or can buy cheaply.

There are also PNP transistors (which won't work in the circuit as drawn) and mosfets (which are another type of transistor). An N channel mosfet could be used, but there are issues with the sensitivity of the gate to stray voltages which mean I probably wouldn't advise them for a first circuit.

2. Will the 9v cell power all three LEDs in series well? I read that LEDs normally drop about 3v each. Should I be wiring them in parrallel to eachother?

Well spotted, and yes, top marks for that solution. The only thing is that you should have a resistor for each LED if you place them in parallel. (See the tutorial on driving LEDs in the tutorial section above for more information).

3. Do you think a 9v cell will run this set up all day or should I put a couple in parrallel to extend their life?

The live depends on the current drawn. In daylight you may need the full 20mA to make the light from the LED visible. Let's assume that. If you have three LEDs in parallel, then that's 60mA. Let's go with 60mA as the load. A typical (good) small 9V battery will last about an hour under that load, with the LEDs getting quite a bit dimmer toward the end.

Paralleling batteries would be better, but using larger batteries (say AA C, or even D in series) would be even better. 6 AA batteries would last a lot longer (maybe take a spare set) and probably be cheaper (I can get a pack of 12 or so good AA batteries for the same price as a pair of 9 volt batteries.

You need to test to make sure the LEDs are visible with the ambient light expected, and I'd probably also see how long the batteries lasted (since the LEDs will get dimmer as the batteries go flat). That will give you a good idea about how many batteries you'll need and how often to change them.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Last edited:

OldHat

Apr 24, 2013
11
Joined
Apr 24, 2013
Messages
11
Thanks All

Want to say thanks for all the help fellas

I used Steves circuit and soldered it up yesterday and it works great (tinkered about with the resistors a bit to get the red LED to be propperly dim when "off")

It was fun to do.

Bob that lever switch looks like a good solution. If I hadn't already bought all the bits I reckon that would have been a simpler way to go. Ah, in the perfect world of next time eh...

Any way thanks again.

I'll post a picture of the completed "decoding machine" when its done (It should ready by friday - the event is on Monday)

O
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Glad to hear you got it working, and even more glad to hear it was fun :)
 
Top