3
\$\begingroup\$

enter image description here

The above image is of a small little box I'm working on; I want an LED to turn on while the box is open.

I've made this small circuit and in theory it should work perfectly, given that electricity will take the easiest path, using this set up, when the box is closed, the contacts of the top half and the bottom half touch and conduct current and short the circuit, and thus, if not no current, minimal current will flow through the LED and it will appear off.

But what I'm curious about is, will this drain the battery? Will current constantly travel through the contacts until the battery dies?

Edit: In the diagram I have miscoloured the wires and gotten my polarities mixed up, sorry about this mistake but it shouldn't affect the overall question.

\$\endgroup\$
4
  • 3
    \$\begingroup\$ You don't need to include "a question about..." in the title. \$\endgroup\$
    – JYelton
    Commented Jun 4 at 14:42
  • 2
    \$\begingroup\$ Electricity will take all possible paths, but more current will flow in the "easier" (lower resistance) paths than in higher resistance paths. \$\endgroup\$ Commented Jun 4 at 15:18
  • 22
    \$\begingroup\$ Depends on the battery chemistry, a good, high powered Li Ion battery will be on fire, before it's drained. \$\endgroup\$
    – Christian
    Commented Jun 4 at 19:27
  • 2
    \$\begingroup\$ that's actually my very first circuit: I was 4 or so...I was puzzled on how the lamp will turn off when I pressed the button! \$\endgroup\$ Commented Jun 5 at 6:23

5 Answers 5

22
\$\begingroup\$

With the lid closed, the battery will be dead within minutes.

Consider using a microswitch such as this one, found on ebay

enter image description here

Position the lever to be depressed when the lid is closed. When the lid opens, the lever will release, causing two of those terminals to be connected together (the ones marked "normally closed", or "NC"), which you can use to close the loop of battery and LED.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you very much, this would be perfect \$\endgroup\$
    – Gijahara
    Commented Jun 4 at 11:03
  • 29
    \$\begingroup\$ If you're lucky, the battery will be dead within minutes. If you're not lucky, it will be on fire. \$\endgroup\$
    – Mark
    Commented Jun 4 at 23:39
  • 2
    \$\begingroup\$ Don't use a switch like that pictured, this is way overengineered for your application and relatively expensive. But switches much smaller than this are available and fit the intent of the answer well. \$\endgroup\$
    – Steve
    Commented Jun 5 at 4:20
  • 1
    \$\begingroup\$ A 3-volt coin cell? Those aren't powerful enough to start a fire. They'll still be dead, though. \$\endgroup\$ Commented Jun 7 at 1:32
24
\$\begingroup\$

enter image description here

Figure 1. Image source: RS Reed switches guide.

A reed switch is the most compact non-electronic solution to your design problem. They are available in NO (normally open) and NC (normally closed) contact arrangements as well as changeover style which can perform either function. The NO is the most common.

Two options:

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Using an NC switch.

  1. Use an NC switch hidden in the box side to connect the battery to the LED. Sink a magnet in the lid. When the lid is closed the switch will open and LED will turn off.

schematic

simulate this circuit

Figure 2. Using an NO switch with opposing magnet.

  1. Use an NO switch hidden as before but with a second magnet below it. Arrange the polarity of the lid magnet so that it cancels out the field of the magnet under the switch so that the switch remains open when the lid is closed. Once the lid is open the magnetic field of the switch magnet will close the contact and light the LED.

This will be very discreet.

\$\endgroup\$
2
14
\$\begingroup\$

Yes, the circuit you've shown will pretty much immediately drain the battery; some batteries have enough energy in them they'll get very hot or worse when you short them out.

I can see you'll need to redesign your contacts, but the circuit you need is this:

schematic

simulate this circuit – Schematic created using CircuitLab

The resistor keeps the current through the LED suitable; the value depends on the battery voltage and the LED.


About the resistor

EDIT: You will see that in some circumstances you might be able to omit the resistor (depending on the exact battery and LED), but it's best to learn this circuit with the resistor.

You'll find lots of explanations about how to choose the resistor, but it might help to know some "just testing" values, which you can use just depending on the supply voltage:

  • 3 V use 50Ω
  • 5 V use 150Ω
  • 12 V use 600Ω

These are calculated for the voltage for the LED, which varies according to the colour (and manufacturer a little) but are about 2 (red) to 3V (blue); and the current it will take, calculated here to be a very low 20 mA. You normally look up the LED's "Vforward" and current in the specifications for that device.

You can always use a higher value resistors, it just makes the LED dimmer. In fact I always just use 1 kΩ as they are on the bench, and change it if it needs to be brighter.

The calculation is R = (Vsupply - VLED) / I, which is just an application of Ohm's law.

\$\endgroup\$
15
  • 3
    \$\begingroup\$ I suggest the best way is redesign the contacts so they close when the box is opened; it's better than any more circuitry. \$\endgroup\$
    – jonathanjo
    Commented Jun 4 at 11:00
  • 1
    \$\begingroup\$ @AndyK I'd say the reason for not needing a resistor is more that a small coin cell battery generally can't supply enough current to damage a typical LED. A 3V supply capable of more current can still burn out an LED (might depend on its color/forward voltage). \$\endgroup\$
    – kwc
    Commented Jun 4 at 20:55
  • 3
    \$\begingroup\$ @AndyK for some LEDs and some 3V batteries, the internal resistance of the battery is enough to limit the current - often the case with coin cells, but not the case if you use a couple of AA cells. In the general case, it's not the voltage that matters but the current, so the resistor should be shown, and included unless you can be sure that there's enough resistance elsewhere \$\endgroup\$
    – Chris H
    Commented Jun 4 at 20:59
  • 2
    \$\begingroup\$ I specifically added the resistor because it was missing from the question, and it's clear from the question that OP is new to electronics. In general, you must have the resistor, and it's better to learn it's necessary (in the first instance) than the special case of when you might be able to omit it for a particular battery and LED. Anyways, that was my thinking. \$\endgroup\$
    – jonathanjo
    Commented Jun 5 at 8:01
  • 1
    \$\begingroup\$ @AndyK do you mean the circle drawn on the wood. It might well represent a coin cell, but I wouldn't assume so. Anyway, even a coin cell's internal resistance is too low for anything but white or blue LEDs, and we don't know the colour or power. (10R according to Energizer, and Vf for red LEDs can be around 1.5V. Dropping the remaining 1.5V over 10R would give 150mA and even most bright red LEDs in bike lights use much less). You have to make a lot of assumptions to do without the resistor \$\endgroup\$
    – Chris H
    Commented Jun 6 at 6:00
5
\$\begingroup\$

Short circuiting a battery to use it as a switch is a bad idea. 1, the battery will get drained almost instantly, so unless you want to buy millions of batteries, you shouldn't do that. 2, it will produce a lot of heat, so your wooden box will get burnt badly, and in some cases, catch on fire. You can just use a tactile button as a switch like so:

schematic

simulate this circuit – Schematic created using CircuitLab

with SW1 being the tactile button. You don't really need a resistor because the 3v battery you have there is just enough to power the LED.

\$\endgroup\$
3
  • \$\begingroup\$ A tactile switch (which is normally closed), when placed in a way that the lid presses the switch, is a fantastic idea. \$\endgroup\$
    – Steve
    Commented Jun 5 at 4:18
  • \$\begingroup\$ Using a constant voltage source for powering LEDs is certainly not recommended. The drop voltage of a LED depends on their type. For example usual red, yellow and green LEDs have drop voltage around 2 V and you will probably quickly fry them using a 3V battery. On the other hand, batteries have internal resistance which could be significant and in certain cases it could allow powering a LED directly without an additional resistor. See: LED forward current vs forward voltage and LED circuit \$\endgroup\$ Commented Jun 5 at 7:24
  • \$\begingroup\$ battery is supposed to be 3v my mistake \$\endgroup\$
    – Andy K
    Commented Jun 6 at 0:06
4
\$\begingroup\$

You don't need a microswitch or any other additional devices. Just a bit of metal.

Just have a bit of metal on the lid, a bit of leaf-springy-material on the base, and a little bit of paper separating the two, when the box is closed. When the box is opened, the bit of paper would slide out of the space between these two pieces of metal, and make contact to light the LED. I'll leave the problem of "closing the box turns off the LED" to you ... But this is essentially the problem. Make contact when open, break contact when closed. No extra devices. Perhaps get fancy with the geometry to avoid the paper.

Actually, I've created a bad drawing to describe what I'm talking about. The blue line is a bit of metal reed. So is the red one. When the box is open, there is contact between the red and blue wires. When the box closes, the green bit (which is attached to the lid) is rotated down, and causes the red bit to bend a bit into the box slightly, disconnecting the circuit. This could be built into the box edge pretty small and protected.

I think you might get the idea.

Poor diagram of circuit and box

No Additional Devices, Little Added Cost

\$\endgroup\$
2
  • \$\begingroup\$ This is very similar to this bit of plastic you need to pull out of a remote when you first buy a TV. This keeps the remote from slowly draining the battery. But, it's "re-insertable". \$\endgroup\$
    – Steve
    Commented Jun 5 at 4:15
  • \$\begingroup\$ Just turn this on its side, and it will work fine: a plastic button backed by a spring, that pokes up from the side when the lid is open, and is depressed when the lid closes, thus opening the contacts. \$\endgroup\$
    – MikeB
    Commented Jun 6 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.