Intro: Dark Sensing LED Throwies - DCP Style
LED Throwies are fun and simple projects to create, but the basic ones have some limitations - no on/off switch, so once you wire them up, they start to run down the battery. There's other instructables for fixing those issues (On/Off LED Throwies, and Auto On/Off LED Throwies). Those are good improvements, but the LED will still run during day-light hours, when it's not likely to be seen. Googling that, I found a solution at EvilMadScientiest.com for adding in a Photo-transistor (in this case, to sense Infra-red). It's pretty simple, although doing multiple solders on small wires in tight areas was a challenge for me, especially trying to do it neatly / cleanly, to have a compact throwie.
I wanted to do this throwie as part of a project in an 'Introduction to Engineering' class I help out in - soldering was OK, but I knew that ~20 students, most with no soldering experience, having to do 5 solders each wouldn't be fast... Crimp connectors could solve that, but would give a pretty bulky body. Thankfully, next to the soldering and crimp connectors in my local electronics store were some Molex connectors - they turned out to work GREAT!
And, a quick shout-out to the Downtown College Prep (DCP) Alum Rock High School Engineering Design students and staff - Keep Calm and Ganas On!
Step 1: Materials
- 1x CR2032 coin cell battery
- 1x 1K Ohm resistor
- 1x 2N3904 Transistor
- 1x LTR-4206E Phototransistor
- 1x Molex KK .1" 4 terminal Connector & 4x Molex terminals
- 2x short wires, about 2” / 5cm long (22 gauge is good - I used Red and Black to stick with red = + (positive) and black = - (negative) standard
- 1x one small, round Neodymium (i.e. rare earth) magnet (1/2” by 1/16” is good)
- Electrical tape
- (Optional) Hot Glue gun
- (Optional) Card stock and double-sided tape for final assembly
For the Molex Connector & Terminals -
- I got Waldom WMLX-102 at local store - should be $4-$6 for a pack with 3 housing and 13 terminals. If you can't find 102, but can find other Molex KK .100" series with more connections, those work as well - just use 4 terminals in them.If you want more than a few (like I did for the class),
- If you want more than a handful of them, it's cheaper to buy housings and terminals separately / in bulk from an online store like DigiKey. The part numbers for the Molex housing is Part #’s 22012041 and for the Molex terminals is 08500114. I got 50 housings and 250 terminals from DigiKey for $30 plus shipping.
Step 2: Prepage the Molex Connector
The Molex connector has 1 end with larger holes, in which wires with Molex terminals (see photos) can slide in (I'll call these "terminal holes"). The opposite end has holes in which small pins (like on PCB boards) can go in (I'll call these "pin holes"), or an electrical connection can be made via the metal tabs on the terminals and the slots in the molex housing. To grip the pins in the pin holes, the terminal has a spiral end, which acts like a spring - when you insert the terminal into the Molex terminal hole, with the flat / parallel side of the spring facing the slots (rounded / spiral side facing away from the slot), this spiral section gets compressed, increasing its tension against the housing. When you insert a pin into the pin hole, that tension holds it pretty firmly in place. We'll use that tension to make our circuit connections.
- Strip insulation from ~3/16” (2mm) on one end of each wire, and ~3/8” (4mm) from the other end of each
- Crimp (or solder) one end of the colored (red in picture) wire into the “u” shaped channel in 1 terminal. Repeat on one end of 2nd wire (black in picture).
- In the 3rd picture, I stripped the too much insulation off the wire. On the terminal end, the insulation should go into the first set of crimps, and the metal into the 2nd set. See 1st picture for a great example.
- Insert colored wire & terminal into terminal hole #1, then 2 terminals (without wires) into terminal holes #2 & #3, and finally the 2nd wire into terminal hole #4
- The spiral head faces the end with slots, with the flat side of the spiral towards the slots
- The wire or “u” channel end faces out the bigger hole
- If you can see the "top" of the "u" channel / crimps as you slide the wire and/or terminal in and the slots on the Molex connector, you're inserting it correctly.
- Lightly push until almost all the way in – you should see silver showing in part of the slot. Use a pen or another fine tip item to seat firmly.
- Easiest to do it in order from #1 to #4 or vice versa - inserting the 2 middle terminals when #1 and #4 are already done is a bit trickier, but you can do it.
Step 3: Assembling the Circuit - the 2N3904 Transistor
Labelling the slots on the Molex connector may help you - a fine tip Sharpie works well here.
Note - the schematic has 4 connections, labelled 1..4, which will match what's inserted into the Molex connector terminal #1..4 holes. The schematic also has the flat side of the 2 transistors drawn in.
Insert the 2N3904 transistor (one with 3 legs) into Molex connector holes for Terminal 1..3 - with FLAT side of transistor facing you
- the right leg (the collector) goes into pin hole #1
- the middle leg (the base) goes into pin hole #2
- and the left leg (the emitter) goes into pin hole #3
- Get the tips of all 3 legs into the Molex pin holes and then push the transistor body - you wan the legs to go in 1/4 - 3/8” (6-8mm) to seat the transistor firmly
Step 4: Assembling the Circuit - the 1K Ohm Resistor
To add the 1K Ohm resistor into our circuit, we want 1 leg (either one) to go into the terminal 1 hole, and the 2nd leg to go into the terminal 2 hole.
- To make this easier, trim 1 leg of the resistor to be about 1/2" (10-12mm) long.
- Bend the other leg of the resistor 180 degrees and back in parallel with the leg you just trimmed, and trim it to end at same depth as the first leg.
- Now insert the resistor into the Molex, with the body of the resistor above pin hole #1
- Place the 2nd leg into pin hole #2
Push in legs 1/4 - 3/8” (6-8mm) to seat the resistor firmly
Step 5: Assembling the Circuit - the LTR-4206E Phototransistor
Great – now we’ll place the phototransistor between pin holes #2 (collector) and #4 (emitter)
- Note: You may want to trim the legs on the phototransistor – gently slide the phototransistor into any 2 pin holes about 1/4" (or 6mm) and see how it looks - I trimmed off 1/4" (6mm) of the phototransistor legs to get it to sit deeper
- The photo transistor body is also a cylinder with a flattened side. On the LTR-2406E, the flat side points to the (C)olletor leg – that should go into pin hole #2
- It may be a little difficult to get the phototransistor collector leg into pin hole #2– using a pair of needle nose pliers, tweezers, or forceps, with the body of the tool in parallel to the direction of force, to help push it in will help
Push in legs 1/4 - 3/8” (6-8mm) to seat the Phototransistor firmly
Step 6: Assembling the Circuit - the LED
Wow – almost done! It’s time to place the LED.
- Note: You may want to trim the legs on the LED – I thought the LED sitting 1" (25mm) above the connector was too much, so I trimmed off about 3/8” (8mm), so it would sit just above the phototransistor.
- If you trim it, one leg may not be longer anymore – use a battery to find the +ve / -ve legs
- The longer / +ve leg goes into pin hole #3
- The shorter / -ve leg goes into pin hole #4
- Push in legs 1/4 - 3/8” (6-8mm) to seat the LED firmly
Step 7: Quick Test to Make Sure It Works
Excellent – let's do a quick test with the overall circuit
Touch the wire (red in the picture) coming out of back of terminal #1 hole to the positive side of the CR2032 battery, and the other wire (black in picture) coming out of the back of terminal #4 hole to the -ve side of the battery. If you’re in-doors / under fluorescent lights, the LED will turn on. That’s *expected* - the phototransistor senses IR (infra-red) light, which most lights don't emit. Hold the wires to the battery, walk outside (assuming it’s daytime) to check that the LED goes out.
Assuming everything works, go on to the next step.
If there is a problem, things to check:
- Light doesn't come on inside
- Try reversing the battery - might be using the wrong polarity.
- Re-check the LED vs. the battery - try both directions. The leg of the LED that touches the + side of the battery needs to go into pin hole #3, and the leg of the LED from the - side of the battery should be in the pin hole #4.
- Are any legs of the resistor / transistor / photo-transistor / LED touching other legs? This would cause a short and cause different types of issues depending where the short is.
- To prevent and/or reduce shorting, you can gently bend the bodies of the resistor, transistor, phototransistor, and LED away from the pin hole #1..4
- The optional step using a Hot Glue gun will also help keep this from happening in the future, but only do that step once you have the circuit working!
Step 8: (Optional) Add Hot Glue to Hold Everything in Place, and Prevent Shorts
Assuming it works, let’s use some hot-glue to help hold everything in place, provided electrical insulation between the component legs, and maybe even weather-proof the connections
- Run a small bead (1/8 - 3/16", or 1-2mm) of hot glue along one side of the “top” (pin holes #1..4), and then back across the other side. You're trying to inject it in between the legs to help hold them all in place, and keep them separate.
- Repeat on the terminal holes, covering both sides and all 4 holes (2 with wires, 2 without).
- DON’T TOUCH the HOT GLUE! - Let it sit for 1 minute for the glue to set (harden).
Step 9: Time to Wrap It Up
Once the hot glue has set, we can tape the “a” (red in picture) and “b” (black in picture) wires to the positive and negative sides of the battery / magnet combo.
Your choice on “always on” (just tape it up), using a simple Paper On Off Switch, or using accordion fold paper “spring” to make an Auto On Off LED Throwie (where the magnet clamping on metal closes the switch).
If the “a” and “b” wires are thin enough, you can bend the battery back around and tape-id\t to the connector housing to make a very compact LED Throwie - just be sure to leave the magnet facing out, so it’ll attach to an iron or steel surface!