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 1: How 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.
1-40 of 218Next »
techno guy says: May 19, 2012. 5:28 PM
can this be done on an arduino? if so, what's the code?
diy_bloke says: Sep 9, 2012. 2:36 AM
Yes it can, use the main C source code. Load that into yr arduino and compile. Often that will give you some error messages coz c specific code might be used but in thi scase it compiles without problems so I guess it would work.
rabril says: Nov 20, 2011. 8:10 PM
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?
ovan der beek says: Apr 21, 2012. 10:56 PM
use an arduino
Orngrimm says: Apr 21, 2012. 2:27 PM
Haha! Cool idea! I like it.
Simple but nice.

Keep up the good 'ibles. :)

Also i think i may copy your method of "Ubersimple-3V-supply". Simply mindblowing ;)
caarntedd says: Oct 21, 2011. 12:31 AM
Love how this is put together, sort of looks like a primitive robot. Can robots be primitive? 5 stars.
thelastonekills says: Aug 22, 2011. 12:56 AM
that is soo cool. and a nice twist on a Throwie and aslo something good to improve skills.
5/5
robot1398 says: Jun 17, 2011. 2:00 AM
can i do this project with a pic by any chance and if yes schematic please
elecsl says: Jan 4, 2011. 1:43 AM
Greate project. Thanks for sharing. lk-tech
brooklynlord says: Apr 19, 2010. 8:06 PM
I don't really understand the C file and hex file....

Which am i supposed to program?
What is the other one for?
raykholo says: May 23, 2010. 5:38 PM
 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.
raykholo says: May 23, 2010. 5:36 PM
 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
cefn says: Mar 27, 2010. 3:38 PM
Those commenting on the project might be interested by this alternative approach...
http://enigmaker.org/post_project4_reveal.html
knektek says: Mar 25, 2010. 2:19 PM
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.
Junkyardmaster14 says: Dec 7, 2009. 4:56 AM
how can you connect the IC to the computer? what is the connector, adapter or something to connect it and program to a computer?
godofal says: Dec 18, 2009. 6:22 AM
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.
seandogue says: Jan 13, 2010. 2:27 PM
(removed by author or community request)
godofal says: Jan 16, 2010. 12:12 PM
or, switch it on and power it from the battery, then u wouldnt need that jack!
zebratangozebra says: Dec 27, 2009. 7:23 PM
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.
penester says: Dec 21, 2009. 3:23 AM
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.
alex_weber (author) says: Dec 21, 2009. 5:36 AM
Ehm, are you the same guy as zezba9000? Or have you just copy'n'pasted the question?
I answered exactly this question (scroll down a bit to see it).

penester says: Dec 23, 2009. 10:59 AM
Thank you so much my dear / alex_weber .
and i AM  HOPE TO BE FUN  WITH GOOD HEALTH. 
DjFluorescent says: Nov 24, 2009. 6:46 PM
 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.......    :)
alex_weber (author) says: Nov 24, 2009. 11:38 PM
In theory, yes. If you succeed, please let me know.
zezba9000 says: Nov 23, 2009. 11:53 AM
 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.
alex_weber (author) says: Nov 23, 2009. 1:39 PM
Hi,
take a look at http://www.avrfreaks.net
They have nice tutorials.
Or, another good starting point, especially for software developers, is the Arduino project. Really easy to get started.
http://arduino.cc

trouble01 says: Nov 15, 2009. 1:02 PM
greeeaat!!!
aliasjanedoe says: Oct 12, 2009. 4:15 PM
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?
alex_weber (author) says: Oct 16, 2009. 10:21 AM
Yes, you could make it fading. For that you should google for PWM (pulse width modulation).

The recorded sequence is stored in RAM, so it would be lost if the battery goes dead. But you could store the sequence in EEPROM.
brunoip says: Oct 5, 2009. 7:52 AM
What is the difference between an ATtiny13V and an ATtiny13A ? Bruno
alex_weber (author) says: Oct 16, 2009. 10:18 AM
The ATtiny13A is a replacement for the now "old" ATtiny13V and should be pin-compatible.
Jodex says: Oct 14, 2009. 11:19 AM
Looks like really cool!
ktalex says: Oct 4, 2009. 10:27 PM
is their such thing as a cell that powers when there is no light then when there is light?
bambangpe says: Sep 7, 2009. 7:31 AM
from electric become art so called electricart
shandoo says: Sep 3, 2009. 2:14 PM
Very nice one! Funky gadget!
tintenfisch says: Nov 29, 2007. 1:04 PM
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
Rportal says: Jul 25, 2009. 1:46 AM
sparkfun.com wide variety and stock. reasonable prices.
alex_weber (author) says: Nov 29, 2007. 3:50 PM
Hi tintenfish,
looking at your nick, I assume you are living in a german speaking country?
For cheap ATtiny, have a look at: http://www.csd-electronics.de/de/index.htm
They have breadboards and other components as well. For a programmer, check out the USBtinyISP from adafruits.
Cheers,
Alex
tintenfisch says: Dec 1, 2007. 11:59 AM
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
hoonflap says: Dec 17, 2007. 1:27 AM
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.
1-40 of 218Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!