How-to: Turn On A Light Bulb


All too often, the commentors here on Hackaday display some parsimony in their engineering prowess. If someone uses a Raspberry Pi to blink a few LEDs, someone will invariably chime in that an ARM microcontroller would do just as well. Switching a relay on and off belies the capabilities of a 32-bit Cortex microcontroller when a simpler 8-bit build would certainly suffice. Of course this can always be reduced to a 555 circuit and further still to conditioned pigeons tapping a key in response to either food or opiates. I’d like to take this opportunity to present a tutorial. Not just any tutorial, but the actual foundation of everything we love here at Hackaday: blinky, glowey things.

You can check out the rest of this tutorial after the break.

The battery

Put bluntly, every project dealing with electricity needs a power source. Whether through mains power, a solar cell, some sort of strange inductive contraption, or through a chemical reaction, every electronic project needs a power source. I have considered a few different power sources for this project including mains power (far too dangerous to use with a light bulb), a bicycle generator (I’m focusing on strength training this week. Cardio is next week), hamsters and wheels (burning the hamsters as a fuel source and using a heat exchanger to turn a turbine), and magnets (how do they work?). In the end, I settled on using a battery to power the light bulb for this project.


The battery used for this build. It consists of four ‘D’ cells connected together in series via a COMF UM-1×4 battery holder. It provides 6 Volts across its terminals.

The power source for this project is called a battery, as it is made up of a collection of cells. [Benjamin Franklin] came up with this terminology, alluding to artillery formations. Just as more than one cannon is needed to form an artillery battery, more than one cell is needed to form one electronic battery. Yes, this means the AA, AAA, C, and D cells are not batteries per se, but individual cells. They only become batteries when used together. One exception of this is a 9 Volt battery, itself made of eight AAAA (that’s quadruple-A) cells. Seriously. go take a pair of pliers to a 9 Volt battery and see for yourself.

For this project I’ve used ‘D’ cells, as they have a larger capacity than AAA, AA, and C cells. The longer life of D cells is vitally important for this project; I very much expect to have this project sit in the back of my closet or tucked away in some drawer for quite a while until I stumble across it one day and remember the beautiful April morning where I wrote this tutorial fueled by at least two pots of coffee.

Of course just simply putting a battery next to a light bulb won’t do any good. Unfortunately transmission line theory is far too broad a subject to cover in this short tutorial so I’ll just have to cover the basics right now. This battery has two leads coming out of it; a positive and a negative. If we connect the positive wire to the negative wire, electricity will flow through the gap. At higher voltages, a small spark may form. With the voltages we’re working with here, it’s fairly safe, although it is possible to electrocute yourself with even these small voltages. While this may only be possible by stabbing your heart with electrodes and applying power, safety is of utmost concern when playing with electricity.

The light bulb

As connecting the positive and negative terminals of a battery together is amazingly stupid, we might as well throw in a light bulb. For this build, I’m using a 6 Volt light bulb that pairs perfectly with our four D cell battery. Just like our battery holder, the socket for the light bulb is attached to a piece of plywood, much more convenient and ergonomic than any flashlight or electric lantern.

You may notice the light bulb is off in the picture below. This is because the light bulb is not screwed down completely into the socket. Yes, unlike LEDs where electrical contacts are soldered on, light bulbs are usually wired into a circuit with a screw-type base. Just as with the lid on a jar of peanut butter, you screw the light bulb into the socket by turning it clockwise. To remove the light bulb from the peanut butter, unscrew it by turning it counter-clockwise.


Before we get into the actual process of turning on a light bulb by screwing it into its base, let’s first consider how a light bulb works. The light bulb was invented by [Thomas Edison] after many, many failed attempts at creating a practical electric light. The light bulb I’m using passes electrical current through a tungsten filament, heating it up and producing light as blackbody radiation. Before discovering tungsten as a perfect filament for an electric light, [Edison] tried hundreds of different materials from carbonized bamboo to the hopes and dreams of a young [Nikola Tesla]. Of course the use of tungsten wasn’t without its downsides – at the time there was no commercial use for tungsten and its extremely high melting point, the highest of any element, made it impractical for use in industry.

[Edison]’s use of tungsten in his successful light bulb guaranteed the continued employment of thousands of tungsten miners in backwoods West Virginia tungsten towns. Life there wasn’t easy, sellin’ your soul to the company store and watchin’ your son grow up to take your job after you’re lost to a tragic cave-in. Of course working conditions improved after the tungsten miner riots of 1824 and the intervention of governor Batman.


In closing, The Professor on Gilligan’s Island was an incompetent fool. As he was clearly not a materials scientist or structural engineer vis-à-vis his inability to fix a hole in a boat, we can only assume he was some sort of physicist or electrical engineer. This is not congruent with The Professor’s actions, though; even a second year EE undergraduate would be able to construct a simple spark gap transmitter using components found in their radio and wiring found aboard the ship.

“Oh, wait.” you say, “broadband transmissions and thus spark gap transmitters are illegal.” Yes, well that’s kind of the point. I guarantee that if The Professor built a spark gap transmitter – and remember, this is the simplest transmitter that can be made out of coconuts and possibly one of Mrs. Howe’s evening gowns – an amateur radio operator would have tracked them down within a few hours. We already know The Professor knew Morse from the season two episode, Ghost a Go-Go, so really there’s nothing stopping the Professor and everyone else getting off the island.

92 thoughts on “How-to: Turn On A Light Bulb

      1. I couldn’t figure out the directionality of screwing the bulb, so I actully put together a bulb screwing adaptive PID algorithm in my x89. still working on the microwave interface with the bulb though…

  1. Why throw all that technology at the problem when Flint and Steel would solve your problem at a tenth the cost?

    Man people just aren’t hands on with their designs any more. Pre packageed batteries, battery holder, light bulb and socket. I bet you didn’t even make that wire…did you?

  2. It’s sad that on the day I boycott Engadget and other sites for taking childish humor and running with it I still have to be disappointed that Hackaday does not have the common sense to leave these ridiculous “Gotcha!” fluff pieces behind. I bring up Hackaday to Security+ and other classes at my school. Please stop embarrassing yourself and me by doing this. We are above this.

    1. If it gets to ya that much your welcome to come join me for a beer and a laugh. While a lot of the A1 jokes are lame, there are some hilarious ones out there, like what a couple of the game developers have put together.

    2. Troll?

      Hackaday has absolutely nothing related to Security+. I can’t even remember the last time it had anything relevant to say to an ITSec professional. I don’t see how you could think it is relevant to low level administration in the slightest.

      Sure in the way back this was the first site to display hacking OSX via wifi, but that and all other assorted security goodness was deleted many years ago with the big changeover to hardware tinkering.

  3. So I was reading a nice tutorial about turning on a light bulb until I got to the last picture. Then completely out of left field, I’m at the conclusion of a treatise on The Professor from Gilligan’s Island.

    What’s going on here? How am I ever going to know how to turn on a light bulb??

  4. This tutorial complete missed the main point — to switch a light bulb on or off. Unless there’s a “Part 2” where different kinds of switches are used, I call the tutorial a failure.

  5. Actually…..even though you couldn’t legally hook one up to a real areal, a post showing how to build (and tune) a basic spark gap transmitter would be pretty cool. There’s *slightly* more to it than just throwing together a bunch or parts on a breadboard.

    1. I’ve been thinking about my ‘desert island book’. A tutorial to build a spark gap generator would be the book I would want if I’m ever trapped on a deserted island.

      Anyone want to fund my kickstarter to write this book?

  6. Nice tutorial here. Always wondered how those things worked. Its just missing a schematic.

    (maybe an April Fools joke?)

    btw, 9V batteries have 6 AAAA cells in them I believe (9v / 1.5v = 6)…

  7. Wow this blog always goes overboard. All that carbon dioxide emissions from making lightbulbs and batteries and Gilligan’s Island. Just use a mirror and the sun.

    Also if you wanted to use the arduino I made this great library for turning on lightbulbs. Just use Light.on(pin) and Check out my lightbulb shield on Tindie.

    1. Doesnt it need to be lightbulb.on and Just light seems like it would not supply enough current. Anyway, when i use an arduino i append “bulb” to brighten things up.

    1. I’ve given 1bit computers a bit of thought, and for some purposes they may be a very good idea. When I say 1 bit computers I’m really meaning computers that send the data in series rather than in parallel, eg if data is sent LSB first a serial full adder needs be little more than a 1bit full adder which feeds in the carry result from the previous step. That adder doesn’t worry about bit size at all, it’s as happy on 8 bit as is on 64bit as it would be on 1024bit. – It would just take more steps to complete the sum, but as it’s simpler each step is probably faster, and of course as simpler, more adders can be placed on a given size/tech chip

      Timing/synchronisation of data (esp. of different word sizes) might be a bit strange though. Probably need to pipe serial results to some kind of serial registers/buffers to allow it to be synced with other serial data.

  8. Edison was a lying, stealing, cheating, back-stabbing jerk! He never actually invented anything, especially the light bulb. He just stole the plans and passed them off as his own by patenting them before others could.

    And, running a light bulb off of mains power would be okay as long as you have a heavy enough resistive load to compensate.

    1. A 60 W light bulb, or any similar size of light bulb, will have enough resistance that putting resistance in series with it will only dim the bulb. They are designed to be inserted directly into a 120 V 60 Hz circuit.

  9. This post needs a large industrial knife switch, a Jacob’s ladder, an obscure reference to some deeply nested Linux subroutines, bacon, and 140,000 LEDs soldered together in a perfect geometric shape.

    1. That’s an idea… making an elaborate rube-goldberg-like electronic contraption to turn on a bulb…

      the jacob’s ladder would obviously need to trigger some sort of mechanical electrostatic switch for example.

  10. im not going to attack HAD on the simplicity … at some point in my life i had the exact same problem im sure of it and had to look up a solution … i used a reed relay controlling a big relay than eventully used a transistor and a relay than a transistor, diode, relay
    im sure we all had to google it our selves at some point to figure out how … for me it was flashing lights on a parallel port but todays generation im sure its an arduino or somthing

    but like i said SOMEONE has to show it

    1. I hope that is explained in part 3!! I was also confused. I’ve tried getting around it by whipping up a quick fuzzy PID logic on my computer to adaptively figure it out direction in real time. Im still working on getting that hooked up to my microwave turn table to screw in/out the light bulb. Trying to get this light bulb figured out before the clock strikes 12.

      Great! Thanks a lot HAD, you could have at least put in a warning about the thermite!

  11. I thoroughly enjoyed this little death-defying leap of logic:

    “Just as with the lid on a jar of peanut butter, you screw the light bulb into the socket by turning it clockwise. To remove the light bulb from the peanut butter, unscrew it by turning it counter-clockwise.”

    If it was intentional you are a comedic genius.

  12. I didn’t get past the phrase “One exception of this is a 9 Volt battery, itself made of eight AAAA (that’s quadruple-A) cells. Seriously. go take a pair of pliers to a 9 Volt battery and see for yourself.” before realising that I had a dead 9V battery and some pliers sitting right infront of me.

    Long story short, I never finished reading the article and now have 6 (not 8!) dead AAAA cells sitting infront of me.

    1. Exactly. because it seems that HAD cant do math. Why they ever though there was 8 in there is utterly silly. AAAA cells are 1.5 volts times 6 = 9 volts. But hey let’s not let silly things like math get in the way of electronics.

  13. Ya know, I’m surprised Tesla’s hopes and dreams weren’t a better light source than tungsten. I’m just sayin’… I think Edison may’ve dropped the ball there.

    1. tesla actually did make his own lightbulbs to light up chicago’s world fair as edison wouldnt let him use them because of the “war of the currents” (tesla saying AC is better than edison’s DC to transmit power long distances), so as the great man that he was he made his own bulbs not using edison’s patents and creating a bulb that was cheaper end easier to produce. though i dont know what kind of filament he used for them but they were designed for AC and were “plug in ones” as not to use edisons “screw in ones”

  14. This might work, except Edison proved without a doubt that a carbonized cotton filament would overheat under conditions like these and that is why Tesla should have won. You should go into more detail about the type of filament used by this light bulb, or else some beginners may make the same mistake and become discouraged.

  15. From watching the idea suggested in the clip…
    Two wire patch cross an existing ADSL line
    Sniff traffic for the SIP registration messages
    Register your own SIP client with that reg string – or publish it on hacker boards
    Deed done.
    Not for imbeciles, but appears to be easy enough
    But I agree that copper infrastructure is woefully under-secured.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.