3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Programmable LED

Step 3Schematics

Schematics
Some comments on the schematic.
The reset input is not connected. This is not best practice. Better would be to use a 10K resistor as pull up. But it works fine for me without and it saves a resistor.

To keep the circuit as simple as possible, I used the internal oscillator. That means we save a crystal and two small capacitors. The internal oscillator lets the controller run at 1.2MHz which is more than enough speed for our purpose.

If you decide to use another power supply than 5V or to use another LEDs you have to calculate the resistor R1. The formula is: R = (Power supply V - LED V) / 0.002A = 1650 Ohm (Power supply = 5V, LED V = 1.7V). Using two low current LEDs instead of one, the formula looks like this: R = (Power supply V - 2 * LED V) / 0.002A = 800 Ohm. Please note, that you have to adjust the calculation if you choose another type of LED.

The value of the resistor R2 depends on the used LDR. 1KOhm works for me. You may want to use a potentiometer to find the best value. The cicuit should be able to detect light changes in normal daylight. To save power, PB3 is only set to high, if a measurement is done.

Update: the schematic was misleading. Below is a correct version. Thanks, dave_chatting.
« Previous StepDownload PDFView All StepsNext Step »
5 comments
Mar 8, 2007. 10:01 AMnluken says:
Awesome project! such a beautiful little sculpture at the end. As a newbie, I'd like to try to try adapting the software to use an arduino! Question: shouldn't the mA number in the above formulas be .020 (20 milliamps) vs. the .002 shown? I was under the impression that leds were generally 20 mA or so.
Jul 8, 2009. 2:41 PMmikemich says:
yes you are correct
Aug 23, 2008. 1:20 AMimarzouka says:
Great project!! You can also use this calculator for the resistor values

http://ledcalculator.net
Jun 6, 2007. 11:39 AMJonathan_Clift says:
Hello Alex,

I think you meant to say that PB3 is set high when you take a measurement, not PB2.

Also, the resistor formula is a bit confusing as it stands. Might be better as:

R = (Supply voltage - LED voltage)/0.002

It's also worth noting that although red and amber LEDs generally have a forward voltage of something like 1.7V at a current of 2ma, high brightness green, blue, and white LEDs have a much higher forward voltage (over 3V).

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
45
Followers
4
Author:alex_weber