How-To-Not-Hack-A-Night-Light

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Home Sign Up!

Browse Community Submit


All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

How To (Not) Hack A Night Light


by Duff 333 on February 11, 2009

Table of Contents

How To (Not) Hack A Night Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: How To (Not) Hack A Night Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Gather Parts and Accessories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Sizing the AC Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: Step It Up a Notch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Control Circuit: Attempt Number 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: Control Circuit: Attempt Number 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 6: Control Circuit: Final Attempt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 7: All Together Now! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Step 8: Why This Is a Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Intro: How To (Not) Hack A Night Light
The road to hacker prowess is paved in stillborn experiments and bloody pieces of failed projects. From these failures we learn patience, determination, how to cuss, and
of course, what not to do. The following hour of programming details once such disaster;

How To Hack Together An Adjustable, Dark Activated, AC Outlet Powered, Cold Cathode Tube, Night Light

Step 1: Gather Parts and Accessories


See that Modware - Windowed Side Panel and Mod Kit over in the corner? We bought that a few years ago in the heyday of the PC case modding fad and never used it.
Time to wipe the dust off. Take out the 12" Neon Cold Cathode Light Kit and the Case Cutting Tool, throw the rest away. The cathode kit includes the light tube itself and
a voltage converter (black box thingy). We won't be using the cutting tool in this project but you never know when you'll need some crappy tin snips.

Rummage through your junk box/drawer/closet/basement and find a suitable AC adapter. We'll go into how to pick the right adapter a little later.

Also in said junk, find a transistor, a potentiometer, resistors, and a photoresistor. Don't get too caught up in the values, I have a feeling we'll be replacing these with
Radio Shack parts soon anyway.

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Step 2: Sizing the AC Adapter
When sizing a power source it would do you good to ask the load a few questions. What's your current draw? What's your favorite potential? Are you always this needy or
do you spike at all?

Take a look at how our cathode kit is supposed to connect to the computer. It's a standard 4-pin peripheral plug but it only has two wires. Is it +12v or +5v? See where the
two wires line up when you connect it to an open, and running, computer. Then, measure with a multimeter. Or just look up the color code on the internet. It's +12v.

Current is a little trickier. You have to place your multimeter in series. Use a 12 volt power supply and stuff the ground wire into the cathode kit's connector. Connect one
lead of the meter to the power supply's positive and the other lead to the kit's connector. Approximately 333mA.

Ignore this new information and just grab the smallest AC adapter in your junk pile.

Image Notes Image Notes


1. Red and yellow kill a fellow. Yellow and black make 12 volts. 1. Something's wrong...
2. Already had it broken open for parts insertion.

Step 3: Step It Up a Notch


Just to test things out a bit, strip the AC adapter's wires and stuff them into the cold cathode connector. Make all the proper safety checks and plug it in.

Things are looking dim. And smelling hot.

Well, that adapter isn't going to work. It wasn't gonna have enough room inside for our control circuit anyway. Grab one that says it can handle the awesomeness of a
blue cathode tube. We're not even gonna test it this time. That's confidence.

Image Notes
1. "Can handle awesome blue cathode tubes"

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Step 4: Control Circuit: Attempt Number 1
The main goal here is to electronically switch on/off the light according to ambient luminescence. Maybe the simplest switching circuit is a transistor and resistors for
biasing. Make one of those resistors sensitive to light, and viola, diagram 1. Vcc is the DC voltage from your wall adapter and Load is the cold cathode. R1 and R2
could/should be a potentiometer in series with a regular resistor. Its up to you if you want to use an NPN or PNP transistor.

Load this up on a prototyping board and let the electrons fly. Then, understand the meaning of 'In Between'.

There is a certain ambient brightness that will cause this circuit to be not quite on and not quite off. The cathode tube will probably be dim and blinky and may even make
a buzzing noise. What we need is a circuit that will give us a hard "on".

Step 5: Control Circuit: Attempt Number 2


Head on down to your local Radio Shack and pick up the MPF102 JFET. Go ahead and just substitute the old transistor with the JFET. Remember, Base = Gate,
Collector = Drain, Emitter = Source.... kind of.... not really.... just line them up the same in the circuit. Turn on the power.

Wow, the light never turns off.

Some of our more learned viewers will have already figured out this attempt was doomed from the start. They know that the MPF102 is an N-Channel RF Amplifier and
that the gate bias voltage should be negative for a fully off switch. That just won't do for our needs.

Some things you forget from college turn out to be important later.

Optional: Before finding out about the negative bias thing.


In frustration, try to set up a Darlington pair by combining the JFET and the transistor from Attempt Number 1. Reference diagram 2.

Mmmm, smokey.

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Step 6: Control Circuit: Final Attempt
Time again for a Radio Shack run. Your shopping list is now:

CdS Photoresistors (5-Pack) - $2.99


100-Piece 1/4-Watt Fixed Carbon-Film Resistor Assortment - $6.49
10K-Ohm 15-Turn Cermet Potentiometer/Trimmer - $2.69
TL082/TL082CP Wide Dual JFET Input Op Amp (8-Pin DIP) - $1.99
Grid-Style PC Board with 371 Holes - $1.99

From Mouser:

MOSFET - Enhancement Mode N-Channel 30V 1.2Ohm X 5 - $0.76 each, $5.00 s&h

Five MOSFETs because shipping would be the same for a single and extras might come in handy.

The circuit in diagram 3 is what we're shooting for. The main plot point here is the voltage comparator created with the op-amp. The varying voltage from the
photoresistor/trimmer divider gets compared to the constant voltage from the resistor divider. The output of the op-amp is a definitive "on/off". And, of coarse, the
MOSFET is there to handle the switching of the light.

Throw this on a prototyping board first. You want to check functionality because of the wildly varied values of photoresistors. It would be tragic to get it all soldered
together yet not have enough adjustment to get the light turning on in the dark.

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Step 7: All Together Now!
Measure the empty space inside your AC adapter (hopefully there is some). Cut out a chunk of PCB a little bit larger than the width and depth of the empty space. It
needs to fit snug and it's a good idea to shave it down slowly instead of starting over with a new board. Arrange the control circuit in such a way that the photoresistor and
trimmer are close to the edges. Solder your heart out.

We need a holy AC adapter. One hole for the photoresistor and one for the trimmer. There should already be a hole from the old wire where we can place the cold
cathode tube wiring. It would be nice to have the photoresistor sticking out the front but some AC adapters have PC boards in the way. Instead, have it hang over the
edge of the board so it will stick far enough through a side hole to catch some photons.

Line everything up and shove it all together now. If the circuit board is snug and the photoresistor is in a good position it shouldn't rattle around too much. If the adapter
won't hold together use some rubber bands. Hopefully, you can get to the trimmer with a small screwdriver.

Don't panic! Be cautiously optimistic that everything is in order. Hook up the cold cathode tube kit and plug in the AC adapter to an appropriate AC wall outlet.

If there are sparks, you've failed. If the lights go out in the house, you've failed. If you've swept the trimmer up/down and the light doesn't turn on/off, you've failed. If it is
off with the lights on and you see nice neon glow with the lights off, congratulations!

You now know how (not) to hack a night light!

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Image Notes
1. Trimmer adjustment port

Image Notes Image Notes


1. Light goes here 1. Finished product

Step 8: Why This Is a Failure


Adding up all the parts and stupidity, this project cost me $46.95. I could have bought an awesome GE Limelite Night Light for $4.19. It uses space age materials!

Even though the light draws less than half the rated power of the AC adapter, it still gets warm. I tried to remedy this with a lot of little venting holes to no avail. I'm still
nervous to leave it plugged in over night.

Photoresistors are temperature sensitive. The on/off point of the device tends to drift with the aforementioned heat build-up. A possible fix I'm thinking about is to add a
similar photoresistor to the trimmer side of the divider with black tape over it. That should negate the temperature variation of the first photoresistor.

There is an unused op-amp in the control circuit.

Hysteresis would be nice. There may or may not be room to build or place a Schmitt trigger . This would probably help out with the photoresistor drift, also.

In conclusion, and because I suck at conclusions, enjoy the glamour shots!

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
Image Notes
1. Obi-wan Affleck

Related Instructables

Trade in your
Free Cold Cold Cathodes Install enhanced LEGO T-
Cathode Computer Cold lighting for your Intersection
Simple RGB for LED's! by
Lighting! Cathode Lights vehicle by LED Traffic
(Photos) by Cold Cathode Yerboogieman Into Car by Light by
sabianq
Xellers Light by drips theduke2011 Maloffstrano

Comments
7 comments Add Comment

angelaice12 says: Jul 13, 2010. 12:29 PM REPLY


if ur trying not to hack a night light then just let it be ><

Duff 333 says: Feb 20, 2009. 7:52 AM REPLY


I appreciate the encouraging words. I was worried my jovial self-deprecation would be mistaken for genuine disgust. In any event, I had a ton of fun on this
project and learned quite a bit.

PKM says: Feb 20, 2009. 6:21 AM REPLY


I haven't laughed out loud at an Instructable in a while.. this was classic. Step 4 especially :)
yes I'm juvenile, sue me

This reminds me of building my own ball mill- it went through four radically different designs, smoked two wall transformers and a piddly electric motor. The
process of failing teaches you what works, however, which is always an invaluable lesson.

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/
gmjhowe says: Feb 20, 2009. 5:41 AM REPLY
Well, at least you gained experience, and no doubt you enjoyed making it!

Rob K says: Feb 20, 2009. 1:49 AM REPLY


Cheaper to go with the night light.

Also yellow and red make 7.

You can use the 5v as a ground from 12v. http://www.cpemma.co.uk/7volt.html

nixiebunny says: Feb 19, 2009. 9:17 PM REPLY


That's a fine project, I wouldn't call it a failure. I'd recommend a few small changes to deal with the instability. It's better to use a real voltage comparator, the
LM393, when you need to compare voltages. Op-amps aren't designed to run open-loop like that. Add a >1 megohm resistor from the + input to the output
for positive feedback to achieve hysteresis. Put a bypass capacitor across its supply leads to keep it stable while switching. Also, having to spend money on
this project just means that you haven't stocked your workshop with enough thousands of dollars of inventory. My shop holds everything needed to build this,
but I've been collecting junk for 35 years.

cyrozap says: Feb 19, 2009. 2:42 PM REPLY


Wow. $46.95. I'm honored to learn from your mistake. I'm just glad it wasn't me. That's pretty cool, though.

http://www.instructables.com/id/How-To-Not-Hack-A-Night-Light/

You might also like