# Noob Help: Circuit on when off?

Discussion in 'General Electronics Chat' started by m.houstrup, Jul 19, 2011.

1. ### m.houstrup Thread Starter New Member

Jul 19, 2011
5
1
Hello dear community,

I'm a total newb at circuits, and I need help to a (kinda) simple one!
SO basically, I have a battery, some wires and a LED (I'll need more, I guess)

What I need to do, is to turn the LED on when two wires get disconnected.
I want to use this as an alarm, so when a door opens and a wire breaks contact, the alarm should go off (the LED).

How the #&!¤ do I do that an what component do I need?

Last edited: Jul 19, 2011

Feb 16, 2010
112
5
Perhaps you could put the switch in parallel with the LED so that when it is shut, it shorts the LED out and when the door is open the LED is not shorted. You would need to use a current limiting resistor to dissipate power in the circuit when the door is shut and to limit LED current when open.

I think there is a more power efficient way but that is the simplest I can think of.

3. ### Sparky49 Well-Known Member

Jul 16, 2011
835
417
Hi, and welcome to the forums!

This isn't a very complicated circuit, it just needs to be thought about.

The switch is a push to make switch. That means when you push it, it completes the circuit. The moment you stop pushing it, it breaks the circuit.

When the door is closed, the switch is also closed. As current will always follow the path of least resistance, it will keep on flowing through the switch and R1. It will not flow through R2 and the LED.

Think of it like a valve for water. The water will always flow in the easiest direction, with the least resistance.

However, when the door opens, there's nothing pushing that switch, so it opens. This gives effectively an infinite amount of resistance. The electrons, like water, will look for a new path. Anything with less than infinite resistance will do.

The current finds the path with the LED and R2 and will now flow through them, thus lighting the LED.

However, when that door is closed, the switch closes with it. The electrons find that they are doing too much work against R2, and will now take the path of least resistance - meaning they will flow through the switch - bypassing the LED.

Now, there is a component called a Thyristor which can be used to make the circuit latch. When the door is opened, the LED will come on and will stay on even when the door is closed. The LED will stay on until the thyristor is reset.

But that's another circuit and another story!

File size:
12.7 KB
Views:
17
4. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
The trouble with both of the ideas presented thus far is very high current through the switch when the LED is off, which will rapidly drain the battery.

It would help quite a bit if you would tell us what your battery is, and also what the forward voltage and current rating of your LED is.

However, I'll just assume you're using a red LED and a 9v battery.
Here's how you could use a couple of very common NPN transistors, a few resistors and a switch for your alarm. The standby current will be very low, about 40uA (micro-amperes), and the LED will get about 15mA current when S1 opens. It's more complicated than the other suggestions, but your battery will last a lot longer.

File size:
15.3 KB
Views:
62
5. ### Sparky49 Well-Known Member

Jul 16, 2011
835
417
Seeing how he says he is a 'total newb', I thought I'd keep it as simple as possible.

I wouldn't think battery conservation would be important, as I very much doubt he would actually use this as an alarm. For a demostration circuit - in this context - I'd imagine it would only be used for a few seconds. Perhaps minutes at most.

On a side note, may I ask how you got the values of resistors? Thanks.

6. ### iONic AAC Fanatic!

Nov 16, 2007
1,422
68
Nice one Sgt. I was going to suggest something similar with a magnetic switch.

7. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Simple is good. However, our OP might have wondered why they were going through so many batteries; they're not cheap nowadays.

Well, that's possible - but they have not given us that information. At least they have options to choose from.

Sure thing.
I started out with R3. Assumed that a red LED would have ~1.7v Vf with 15mA current through it.
R3 ~= (Vsupply-Vf_LED)/Desired_Current = (9v-1.7v)/15mA = 7.3/0.015 = 487 Ohms. 470 Ohms was close enough. 7.3v/470 Ohms ~= 15.5mA.

So then came R2. In order to saturate Q2, you need about 1/10 of the collector current going through the base. I'm using Q1 as an emitter follower, so there will be a Vce across Q1 of around 0.1v, and a Vbe on Q2 of about 0.7v; total drop will be somewhere around 0.8v.
(9v-0.8v)/1.55mA = 8.2/.00155 = 5.29k Ohms. To just keep it simple, I used 4.7k instead.

Q1 is being used as an emitter follower. Gain is pretty high when used like that; ONsemi gives a minimum beta of 70 when Ic=1mA, 100 when Ic=100mA.
There are essentially two forward-biased PN junctions from the base of Q1 to ground; the base-emitter junctions of both transistors. So, 9v-1.4v = 7.6v
We need ~1.55mA current from the emitter, so 1/70th of that to the base.
R1 ~= 7.6v/(1.55mA/70) ~= 343k Ohms, so I'm about 120k Ohms low.
However, I couldn't be certain that the OP would actually use the exact transistor specified; they might use one which has a lower gain. So, increasing the current by 1/3 allows for that. The standby current is thus higher than it could be, but 40uA is pretty low. A typical 500mAh 9v battery would last over a year at that rate.

Jul 16, 2011
835
417
Thankyou.

9. ### m.houstrup Thread Starter New Member

Jul 19, 2011
5
1
Thanks for you replies!

I actually understood the MOST of it.
The easiest way seems to be Sparky49's way. But wouldn't the resistors change the effect/strength of the LED?

Srg's way seems more advanced, but do-able!
I am actually planning to do this with an electromagnetic buzzer....
The alarm should buzz until shut down (main switch) manually or until the door is closed again.

What would be cool though, is that the alarm would buzz until shutdown, not just when the door closes. I saw a video on YouTube where a dude used a magnet and he had to arm the alarm, etc.

Any ideas?

Sparky49 likes this.
10. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Now, I could have made the circuit more simple by eliminating R1 and Q1, and connecting R2 and S1 to Q2's base. However, that would be an idle current of 9v/4700 ~= 1.9mA, nearly 48 times as much current consumption as the schematic I posted. It would've worked, but a typical 500mAh PP3 9v transistor battery would be dead in under 11 days.

11. ### Sparky49 Well-Known Member

Jul 16, 2011
835
417
Try using that component called a Thyristor.

Look at the attachment.

I think you should have a go at constructing somthing out of the circuits you've seen - try merging bits, post the result here, and we'll tell you how you got on.

File size:
20.4 KB
Views:
11
12. ### m.houstrup Thread Starter New Member

Jul 19, 2011
5
1
Hey Sgt,

I used a simulator to test out ur stuff - it freaking worked!!
The standby is - as you predicted - only 40,91 uA!
So, I will do some some more research and find some buzzers.
How can I make a buzzer "flash" btw? I suppose I need a relay or something?

I attached a screenshot of my simulation, thanks for your great effort!
Now, to the flashing buzzy part!

IMAGE FAIL:

The battery is only 9V and 17,69 mA!

File size:
10 KB
Views:
8
13. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Well, if you want it to flash too, you'll need some kind of astable multivibrator circuit.
555 timers are cheap and readily available. There's a CMOS version that Radio Shack stocks, the TLC555 by Texas Instruments. As long as your buzzer and LED together don't need more than 100mA current, it would work.

Do you know what voltage and current your buzzer requires?

14. ### m.houstrup Thread Starter New Member

Jul 19, 2011
5
1
Okay, I will jump over the flashing part.
I found this buzzer:

7-17 Vdc / 12 Vdc
15mA
75 dB / 300-500Hz

Will it be loud enough?
I thoght that 15 mA would be the easiest thing, as you used a 15 mA LED

So I will need:

• 15 mA Buzzer
• 220K, 4.7K and 470 Resistors
• 2 x NPN 2n3904 Transistors
• Some wires
• A circuit board
• Soldering tools etc.
Am I right?

15. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Here's the alarm with a buzzer and LED that flash nearly 2x/second:

File size:
31.2 KB
Views:
22
16. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
If the buzzer is 15mA, then change R2 to 2.7k Ohms. I was planning on it drawing a bit more current.

Jul 7, 2009
1,585
141
Here's another thought:

You want the LED to come on when the door opens. The best component for this is a switch with form C contacts. When the door opens, the LED will be powered through a resistor in series with the power source and the normally open contact.

Note: you might want to use the other contact for another LED to show that in fact the system is working (i.e., there's power available).

File size:
32.6 KB
Views:
10
18. ### m.houstrup Thread Starter New Member

Jul 19, 2011
5
1
Sgt, I will exclude the 555-Timer.
I will probably f+++ it all up, if I'll try that.
A simple buzzing sound is fine

Someonedad, I dindn't quite get you there xD
I have no idea what a form c contact is. I tried to understand, but couldn't
Could you explain - maybe a (more) detailed example diagram?

19. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
1 form C means one NO (Normally Open) contact, one NC (Normally Closed) contact, and a Common terminal. The Common is normally connected to NC unless the switch is actuated.