Programmable LED

Programmable LED
Inspired by various LED Throwies, blinking LEDs and similar instructables I wanted to do my version of an LED controlled by a microcontroller.

The idea is to make the LED blinking sequence reprogrammable. This reprogramming can be done with light and shadow, e.g. you could use your flashlight.

This is my first instructable, any comments or corrections are welcome.

Update 12/08/2008: There is now a kit available at the Tinker Store.

Here is a video of reprogramming it. Sorry for the quality.


 
Remove these adsRemove these ads by Signing Up
 

Step 1How it works

An LED is used as output. As input I used an LDR, a light dependent resistor. This LDR changes its resistor as it receives more or less light. The resistor is then used as analog input to the microprocessors ADC (analog digital converter).

The controller has two modes of operation, one for recording a sequence, the other for playing back the recorded sequence.

Once the controller notices two changes of brightness within half of a second, (dark, bright, dark or the other way round), it switches to recording mode. In recodring mode the input of the LDR is measured multiple times a second and stored on the chip. If the memory is exhausted, the controller switches back to playback mode and starts to play the recorded sequence.

As the memory of this tiny controller is very limited, 64 bytes (yes, bytes!), the controller is able to record 400 bits. That is space enough for 10 seconds with 40 samples per second.
« Previous StepDownload PDFView All StepsNext Step »
214 comments
1-40 of 214next »
Nov 20, 2011. 8:10 PMrabril says:
Is there anyway you could program an L.E.D. to stay on for one hour, turn off and turn back on after 11 hours?
Oct 21, 2011. 12:31 AMcaarntedd says:
Love how this is put together, sort of looks like a primitive robot. Can robots be primitive? 5 stars.
Aug 22, 2011. 12:56 AMthelastonekills says:
that is soo cool. and a nice twist on a Throwie and aslo something good to improve skills.
5/5
Jun 17, 2011. 2:00 AMrobot1398 says:
can i do this project with a pic by any chance and if yes schematic please
Jan 4, 2011. 1:43 AMelecsl says:
Greate project. Thanks for sharing. lk-tech
Apr 19, 2010. 8:06 PMbrooklynlord says:
I don't really understand the C file and hex file....

Which am i supposed to program?
What is the other one for?
May 23, 2010. 5:38 PMraykholo says:
 if you want to use this for its intended purposes, upload the HEX file to the chip using an avr programmer.   (AVR Studio works to upload the hex).  If you want to change the code, then you would go to the "main.c" file...
Good luck!  and please reply back with any more questions.
May 23, 2010. 5:36 PMraykholo says:
 I am trying to read a pot using ADC on my attiny25v chip (same family as yours).  Is there anything I should know in regard to using your code as an example for my program in AVR Studio?  (this is for a Servo Tester - 10k pot to servo position, and also a button to center it).  
Thanks
Mar 27, 2010. 3:38 PMcefn says:
Those commenting on the project might be interested by this alternative approach...
http://enigmaker.org/post_project4_reveal.html
Mar 25, 2010. 2:19 PMknektek says:
instead of the low current led, perhaps a transistor would be handy, if you wanted to do it the other way round, use a mosfet.
Dec 7, 2009. 4:56 AMJunkyardmaster14 says:
how can you connect the IC to the computer? what is the connector, adapter or something to connect it and program to a computer?
Dec 18, 2009. 6:22 AMgodofal says:
with a programmer of course :D
for this type (attiny13 is an AVR chip) u can use the ghetto programmer described by the real elliot (just search it here) that works with the serial (printer) port of ur PC
or make/buy a USBtiny from www.ladyada.net that's a bit more expensive, but it works with ur USB port and doesnt need a power source.

hope it helped, if u have questions about the ghetto programmer, just PM me.
Jan 13, 2010. 2:27 PMseandogue says:
(removed by author or community request)
Jan 16, 2010. 12:12 PMgodofal says:
or, switch it on and power it from the battery, then u wouldnt need that jack!
Dec 27, 2009. 7:23 PMzebratangozebra says:
I love this !
Great ideas !
The freestyle assembly and minimal parts make it a less is more thing.
Thinking it might be interesting to maybe use a few more parts to make it look like a man or robot or something.
Dec 21, 2009. 3:23 AMpenester says:
Hi Alex, im a c c++ c# programmer but am very interested in programing circuits as a hobby. 
Your tutorial is very simple im sure, but is there a chance you could point me to a ultra nubby circuit programing tutorial?

Any help would be good as ive never tackled this before.
Dec 23, 2009. 10:59 AMpenester says:
Thank you so much my dear / alex_weber .
and i AM  HOPE TO BE FUN  WITH GOOD HEALTH. 
Nov 24, 2009. 6:46 PMDjFluorescent says:
 would the chip used here, to program the led, work with sound instead of an LED? i do alot of DIY synth projects and circuit bends. this would be a great addition if compatable.......    :)
Nov 23, 2009. 11:53 AMzezba9000 says:
 Hi Alex, im a c c++ c# programmer but am very interested in programing circuits as a hobby. 
Your tutorial is very simple im sure, but is there a chance you could point me to a ultra nubby circuit programing tutorial?

Any help would be good as ive never tackled this before.
Nov 15, 2009. 1:02 PMtrouble01 says:
greeeaat!!!
Oct 12, 2009. 4:15 PMaliasjanedoe says:
Can this only blink on and off, or can it fade also?  Such as if you program it using a light with a dimmer switch.  And does anywhere sell just the chip (not a full kit) with the program already on it?  When you remove the LDR, does the chip remember the last sequence entered from then on, even if the battery goes dead and has to be replaced?
Oct 5, 2009. 7:52 AMbrunoip says:
What is the difference between an ATtiny13V and an ATtiny13A ? Bruno
Oct 14, 2009. 11:19 AMJodex says:
Looks like really cool!
Oct 4, 2009. 10:27 PMktalex says:
is their such thing as a cell that powers when there is no light then when there is light?
Sep 7, 2009. 7:31 AMbambangpe says:
from electric become art so called electricart
Sep 3, 2009. 2:14 PMshandoo says:
Very nice one! Funky gadget!
Nov 29, 2007. 1:04 PMtintenfisch says:
Hi, can you recommend a store where I can get the Atmel ATtiny13v, the other components and the tools required? (breadboard and AVR programmer) Cheers, Jonathan
Jul 25, 2009. 1:46 AMRportal says:
sparkfun.com wide variety and stock. reasonable prices.
Dec 1, 2007. 11:59 AMtintenfisch says:
Hi, thanks for your reply :) You are almost right.. it is a German word and I'm from Sweden, but I live in New York City right now.. Do you know any stores in the states? Also, should I get SOIC or PDIP? Is there any difference between them? Cheers, J
Dec 17, 2007. 1:27 AMhoonflap says:
sparkfun carries most of the atmel chips, and this instructable is a great intro to avr, with instructions on how to build a cheap programming cradle.
Nov 29, 2007. 1:57 PMDeyus says:
You Can get a few different types of breadboards on this site how ever I don't know where to get the AVR programmer

http://www.abra-electronics.com/products/catalog/Boards-orderby0-p-1-c-7.html
Jul 24, 2009. 1:11 PMRedgerr says:
looks cool at the end and functional! very nice O-o im sure you could sell the programed ATtiny chips or sold everything in a pack to build yourself O_o just a thought ;)
1-40 of 214next »

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!
41
Followers
4
Author:alex_weber