Update: I received many complaints about the aesthetic quality of the pull chain nightlight's installation and several suggestions that I should place the circuit in the diffuser bowl. Well I'm pleased to announce that I've reworked this project to keep the circuitry out-of-sight and make the pull chain wiring look better. Steps 1 through 5 describe the rework as if I started from scratch, and steps 7 through 10 are the original instructable.
The primary source of illumination for my bedroom is a ceiling fan lamp. Most of the time I use the wall switch to turn the light on and off, but sometimes I'm closer to the pull chain switch so I'll use it instead. The trouble is the pull chain can be impossible to find in the dark; sometimes I'll find it right away but other times I'll flail my whole arm around feeling like an idiot trying to locate it. So I decided to hack apart a solar powered garden light and use its LED to make the pull chain's handle glow. When the garden light circuit detects the ceiling fan lamp is off it powers the LED with a battery. The circuit also recharges the battery when the lamp is on via a solar cell.
For this instructable I used this garden light. First I separated the end that held the globe and electronics from the metal tube and removed the battery. Then I removed several sets of screws to separate the electronics from its housing. Next, I gently pried the hot glued photoresistor from it's mounting hole, and then removed the excess hot glue. I used diagonal cutters to snip the battery leads where they met the battery contacts. Then I cut the LED's wires so I could insert it into the pull chain's handle in step 4. Finally I desoldered the solar cell so it could be taken out of its plastic holder.
To enclose the circuit I used 2x AA enclosed battery holder. Since only one AA battery is needed for the circuit the other space can be used to hold the board. First I removed the negative battery lead and contact, then desoldered the positive lead. I replaced the circuit board's negative battery wire, which was too short, with the longer one I took from the battery holder. Then I replaced the board's LED wires with wires that were long enough to exit the enclosure. After that, I reconnected the solar cell to the board. Next I soldered the board's battery leads to the enclosures battery contacts. I had to use a scrap piece of copper to make a connection to the negative contact. Don't have the battery in the holder when soldering to the battery contacts. Finally, I widened the hole the leads passed through and removed a portion of the material surrounding it. Doing this makes it easier to pass the solar cell, photoresitor, and LED leads out of the box.
First I placed the board in the empty battery slot and arranged all the wires so that the solar cell and photoresistor rested flat on the back of the battery holder (i.e. the side with out the screw). Then I hot glued the photoresitor to the case. I made little standoffs for the solar cell out of double sided tape before hot gluing it at it's corners. I also put hot glue on the solder joints to insulate them. Next I soldered a 2x1 female header to the board's LED wires before. Finally I added a bit of hot glue for insulation and to hold the wires in place.
For the LED to fit in the hole in the metal part of the pull chain handle a bit of material must be drilled out. Doing this prevents the ball chain connector from holding the handle on the pull chain so it is necessary to use a small amount of JB Weld to epoxy the connector to the handle. I affixed the connector to the handle such that the LED's wires can pass through the connector's hole. The epoxy needs to set before continuing. Next I soldered a two lengths of wire wrap wire to the LED's legs so that it could be inserted into the pull chain's handle and reattached to the circuit a greater distance away. I marked one of the wires with a black sharpie to make clear it was attached to the cathode. I used hot glue to insulate the solder joints. After that I threaded the wire through the handle and three pieces of heat shrink, which were on the pull chain. Clear heat shrink would be better, but I only had green. Sewing thread can also be used to attach the wire to the chain, but it caused the chain to kink more than I liked. Attaching the wire to the chain is easiest if the chain is pulled tight. Once I had the pull chain modified, I connected to the lamp and threaded the wires into the diffuser bowl. Doing this allowed me to see how much excess wire I had. Next I took down the pull chain, trimmed the excess wire, discarded the excess, and soldered on two individual, male header pins to the remainder. Then I removed a bit of material from the top of the translucent plastic handle so that it would mate well with the LED. Finally, I inserted the translucent plastic handle.
The installation process is was a big pain and is very specific to the type of diffuser bowl and mounting my ceiling fan has. My ceiling fan has two pulls. One controls the fan and the other controls the lights. The pull chain which controls the fan passes through a hole in the diffuser bowl's mounting hardware. This hole is only wide enough to pass one male header at a time. I removed the fan's pull chain from the hole and rerouted it so that it now hangs over the side of the diffuser bowl. Then I attached the modified pull chain to light's pull chain connector. Next I threaded both male connectors through the hole and connected them to the female headers on the battery holder. I had to do this while working in the tight confines of the bowl. It would have been easier if I'd left more wire connected to the LED so that I could have made the connection outside of the bowl, then simply wrapped the excess around the battery holder before placing it in the bowl.
Step 6: Interstitial
The next step is the beginning of the original instructable.
For this instructable I used this garden light. First I separated the end that held the globe and electronics from the metal tube and removed the battery. Set aside the battery, but don't discarded it because you'll need it later. Then I removed several sets of screws to separate the electronics from its housing. Next, I gently pried the hot glued photoresistor from it's mounting hole, and then removed the excess hot glue. I used pliers and diagonal cutters to remove and reshape the battery contacts. Finally I desoldered the solar cell so it could be taken out of its plastic holder.
To enclose the circuit I used an old, clear battery storage case. First I glued the battery contacts to the case. I did this with the battery in the circuit and the LED on so I could be certain I had the contacts positioned correctly. Then I snipped the LED's leads so I could insert it into the pull chain's handle in the next step. After that I moved the LED's board connection wires to the other side of the board and attached a barrel jack to them on the back side of the battery case. Doing this allows the LED to be easily connected/disconnected to/from the circuit. Next I carefully separated the solar cell from the hot glue that bonded it to it's holder. Then I resoldered the solar cell to the board. Once I had everything in place I inserted the battery, closed the case, and hot glued the barrel jack and a couple hooks taken from a junk plate hanger onto the enclosure.
To modify the pull chain I first soldered a length of twisted pair to the LED's legs so that it could be inserted into the pull chain's handle and reattached to the circuit a greater distance away. I used hot glue to insulate the solder joints. To insert the LED's lead wires into the pull chain's handle I had to drill out a bit of material from the hole that the chain passes through. Widening the hole resulted in the stopper no longer holding the handle on the end of the chain. No matter because the stopper was easily attached to the top of the handle by a bit of JB Weld, but before doing so I passed the wire leads through the hole and pulled the LED into the metal portion of the handle. Next, I removed a bit of material from the top of the translucent plastic handle so that it would mate well with the LED. Then I wound the wire around the metal chain and secured it with hot glue. Wrapping the wire around the chain is easiest if the chain is pulled tight. After removing some excess wire I added a barrel plug to the twisted pair. Finally, I inserted the translucent plastic handle.
The installation process is quite simple. I attached the pull chain to the ceiling fan, mated the barrel plug to its jack, and hung the circuit from the lamp's diffuser bowl. This allows the rechargeable battery to be replenished by the solar cell which creates electricity when the ceiling fan's lamp is on. When the lamp is off the photoresistor detects the darkness and signals the control circuit to turn the LED on.
You may have noticed this build doesn't exactly have the nice finished look of a consumer off-the-shelf product. This project was originally a hack, one-off proof of concept. However, I have since reworked it to make the pull chain modification look better and hide the circuit board (see steps 1-5). I still think hanging the board outside of the diffuser bowl is the best approach. It could be made to look much better by designing a custom, hanging enclosure that looked decorative. Perhaps something that looked like a stained glass flower where the LED's wires follow the stem down to a pull chain which integrate the wires seamlessly.
The rechargeable battery is replenished by the solar cell which creates electricity when the ceiling fan's lamp is on. When the lamp is off the photoresistor detects the darkness and signals the control circuit to turn the LED on.
I was afraid that putting the circuit board in the diffuser bowl so close to the hot lamps would create a fire hazard, but after replacing the lamps with CFLs and measuring the temperature in the bowl I concluded that it was probably safe. I was also worried about some part of the circuit accidentally contacting mains and electrifying the pull chain or starting a fire. However, there seems to be enough room in the bowl and the pull switch is constructed such that accidentally contacting mains appears unlikely. However, these risks are real possibilities and you follow this instructable at your own peril. You are responsible for your own safety. The reason I've left the original instructable intact is because I feel it is much safer and its installation step is both easier and depends less on having a specific type of lighting fixture.
If I were to redesign this as a product to be sold, I would look into making a new pull chain switch that has an integrated AC to DC converter and a new pull cord that can deliver power to the LED in the pull handle while standing up to the wear of being pulled on many times a day for years. The idea of a lighted pull chain handle has been patented since at least 2001. Maybe the engineering challenges of designing it to be safe while still being economical aren't realizable.
Oddly, after a period of time the LED cuts off even if the battery still holds a good charge. Since the intent of the original garden light was for decorative purposes and not providing illumination, I'm guessing that there is a timer that controls how long the LED stays on so that it doesn't shine late at night when no one is around to appreciate it, but this is only a guess. Additionally, given that the LED puts out more light than needed and changes colors constantly it may disrupt sleep. A solar garden light meant to provide illumination throughout the night paired with a high efficiency red LED, which will help preserve night vision, may be a better solution.
Bonus Hack: In the planning stages of this project I considered using the pull chain as part of the return leg of the LED's circuit. So I connected the pull chain to a multimeter and selected the continuity test; it showed an open circuit. However, when I pulled the chain tight the resistance drop to only a few ohms. Therefore, if you need a simple on/off stretch sensor, then using a pull chain might not be a bad option.