Introduction: Dark Lights LED

Picture of Dark Lights LED
An led not only lights when power is applied, but also generates a tiny voltage when light is applied. A PICAXE microcontroller can be used to monitor this voltage. I will show you how to make a electronic candle that will flicker an led when it gets dark.

Step 1: Assemble the "candle"

Picture of Assemble the "candle"

The candle part of the circuit is a piece of perf board with a green led, 220 ohm resistor, diode,capacitor and a M08 picaxe. I used molex connectors to make the perf board detachable from "power stalk" made from twisted 18 gauge enameled wire. You can use insulated solid wire such as building wire for the stalk. You can also use a yellow or red led. White and blue leds don't work well as light sensors. The diode protects from reverse polarity and allows using alkaline cells by dropping the voltage to the picaxe a bit. Nicad cells work well with picaxes.

Step 2: The Power Source

Picture of The Power Source

For the power source use 4 AA cells in a battery holder that has a 9 volt style snap connector on top. I took apart a depleted 9 volt battery and used the snap connector to mount the power stock. You can make the stock straight or add a "coil" to it. You can even wrap it with green florist tape and make a flower out of it. When done, place it in a vase to hide the battery.

Step 3: Program Your Picaxe

Picture of Program Your Picaxe

As you picaxers know, you will need to program the picaxe. Below is the program:

'picaxe program to flicker led like a candle when dark

input 1 'make pin 1 an input before reading with ADC
pause 200

low 1 'discharge led before reading
input 1
random w0 'get numbers to set flicker rate
readadc 1, b2
if b2 < 10 then dark
goto main

'led will flicker depending on value of b0 and b1
high 1
pause b0
low 1
pause b1
goto main

Cut and paste the program into your latest copy of the free picaxe programmer software. For newbies with the picaxe go to this site for info about the picaxe.

For a simple programmer use this circuit to build a programmer. Program the picaxe and remove to place the picaxe in the candle.

Step 4: Front Side of Candle

Picture of Front Side of Candle

The candle circuit is simple enough to use perf board for the construction. Front side showing the Picaxe mounted on a socket.

Step 5: Backside of Candle

Picture of Backside of Candle

Construction using tinned solid wire to make the connections on the backside of candle.

Step 6: You Candle Is Done.

Feel free to modify the program. You can also make the candle do the reverse. Run this program to make it go on only when its bright.

' led goes out in the dark


low 1
input 1
readadc 1, b0
if b0 > 10 then dark
goto main

high 1
pause 100

goto main

Have fun with the idea.

Step 7: Parts List

List of Parts:

Candle part:

Piece of Perf board about 5/8 by 7/8 "
Picaxe M08
8 pin IC socket
1N4005 diode
.1uf ceramic capacitor
220 ohm 1/4w resistor
Green,red or yellow led
Bare tinned copper wire
Molex header 22-23-2021 (Digikey WM4200-ND)

Power stalk and Battery:

Molex housing 22-01-2027 (Digikey WM2011-ND)
2 feet of solid insulated wire or #AWG 18 enamaled wire
9 volt battery snap connector
4-AA battery holder (Radio Shack, Frys)


9 pin D connector, female
22k 1/4 watt resistor
10k 1/4 watt resistor
200 ohm 1/4 watt resistor
Piece of perf board to mount components (Radio Shack, Frys)
8 pin IC socket


thecookiemonster (author)2009-06-20

YAY PICAXE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! go picaxe!!!go picaxe!!!go picaxe!!!go picaxe!!!go picaxe!!!go picaxe!!! nice idea, i like the way the led is the input AND output!!!! i like picaxe!!!

NetReaper (author)2009-02-20

This looks really cool but I cant help but think a photoresister would be easier

botronics (author)NetReaper2009-02-20

Oh sure, you could use a photo resistor, a resistor and a transistor to eliminate the pic too. This is just a way to demonstrate the dual function of the led with a programmable device such as a pic. By changing the program, you can make it blink, flicker or come on when light is present. Easier is welcomed, but not always better.

Da_Fudge (author)2008-04-14

go picaxe! go picaxe! woo hoo! great 'ible

WattSekunde (author)2008-02-12

Great idea to use the LED as a sensor too.

Radical Dreamer (author)2008-02-10

Very well done.

GorillazMiko (author)2008-02-10
This Instructable is:
  • Very nicely done.
  • Very neatly done.
  • Great job!
  • Great pictures.
  • Great detail.
  • Great everything.

You did everything just fantastic, and I hope to see more, this Instructable is really and I mean really good.

Great job.
+1 rating.
botronics (author)GorillazMiko2008-02-10

Well thanks!, it good to share.

Buzz_Kill (author)2008-02-10

I love it. Q: How long will this run on a set of batteries? And how dark does it need to be before it is triggered?

botronics (author)Buzz_Kill2008-02-10

The picaxe is low current, It should run for days on a set of batteries. You can adjust the theshold of turning on in the software. Mine goes out in a partly lit room. Does not need complete darkness. Somewhere I have a light meter, thats a good thing to measure and graph.

About This Instructable




Bio: I like to tinker and experiment with electronics, robotics, programming, and photography. Along with my latest interest in Steampunk.
More by botronics:Convert 3-AAA Flashlite to LithiumPole Grenade PropSteampunk Vacuum Tube Night Light
Add instructable to: