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 ads by
Signing UpStep 1: How it works
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.









































Visit Our Store »
Go Pro Today »




What happens when the memory runs out?
Simple but nice.
Keep up the good 'ibles. :)
Also i think i may copy your method of "Ubersimple-3V-supply". Simply mindblowing ;)
5/5
Which am i supposed to program?
What is the other one for?
Good luck! and please reply back with any more questions.
Thanks
http://enigmaker.org/post_project4_reveal.html
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.
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.
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.
I answered exactly this question (scroll down a bit to see it).
and i AM HOPE TO BE FUN WITH GOOD HEALTH.
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.
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
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.
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
http://www.abra-electronics.com/products/catalog/Boards-orderby0-p-1-c-7.html
I am using now the USBtinyISP programmer from adafruit. Very handy.
http://www.ladyada.net/make/usbtinyisp/
You will need a breadboard to setup an programming environment, as you can not program the Programmable LED in circuit. You first have to program the controller and then solder everything together.
Here is another good starting point to learn how to program microcontrollers:
http://www.instructables.com/id/Ghetto-Programming%3a-Getting-started-with-AVR-micro/
The circuit enters the recording mode by a light pulse, "dark - bright - dark", or the other way round, "bright - dark -bright". That way it should not take up outside influences. Although, I saw it on time happen as it got slowly darker, the ambient light triggered the switching.
Cheers,
Alex
http://home.cogeco.ca/~rpaisley4/PhotoDetectors.html
yes, they would. Take a look at my other instructable for an example.
http://www.instructables.com/id/Synchronizing-Fireflies/
Cheers,
Alex
http://drskippy.net/blog/2007/04/picbased_programmable_led.html
http://www.sparkfun.com/commerce/product_info.php?products_id=31
http://cgi.ebay.com/ATMEL-ATTINY13V-10PU-IC-MCU-AVR-1K-FLASH-10MHZ-8DIP_W0QQitemZ380075597783QQcmdZViewItem
http://cgi.ebay.com/USBasp-ATMEL-AVR-ATMEGA-ISP-Programmer-USB-AVRDUDE-5-2_W0QQitemZ230302731460Q
Take a look at http://www.instructables.com/id/Ghetto-Development-Environment/
It's a good tutorial to get started. It uses another programmer, the USBtinyISP which I can recommend.
http:www.grobot.gr
http://ledcalculator.net
I got my ATtiny13's, button cells and RGB leds from Sparkfun (recommended!). They didn't have the ldr you used but they did have a neat little ambient light detector that easily takes its place (had to adjust the THRESHOLD a bit though).
A fun project. I like seeing how far I can stretch that 1K of program space.
This project inspired me to haul out the stk500 I got a couple of years back and update my AVR tools on the Mac. FYI for those that want to do AVR programming on the Mac, I can strongly recommend a binary pre-built package that lets you work in XCode, and you can download it for free at
http://www.obdev.at/products/avrmacpack/index.html
I also recommend downloading the very nice AVRFuses freeware for the Mac , available at
http://www.vonnieda.org/software/avrfuses
It makes selecting fuses a snap and can upload to many types of AVR programmers via common USB to serial dongles.
Thanks again for a fun project, Alex!
as maybe another suggested adder... i couldn't find an equivalent LDR, so had to modify the 'threshold' to get it to read. so i thinks to myself: why not automatically set this threshold. i added an autocalibration routine at power up to read the ambient light and set the threshold number 50 counts away so the LED lights in ambient.
somewhere before "if (programming)" insert:
int THRESHOLD;
THRESHOLD = (int)get_adc(CHANNEL)+50;
(delete the "define# THRESHOLD 800" line)
reading the data sheet, i found that operating the circuit below 1.9v can cause the memory to not be saved, so the 3v battery is fine.
heres the link: http://www.atmel.com/dyn/resources/prod_documents/2535S.pdf
See this link for more info on LEDs as sensors: http://projects.dimension-x.net/technology-and-projects/ledsensors
I can recommend this USBTinyISP from adafruits:
http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=46
It's fast, very well documented and costs $22.
Cheers,
Alex
I am now hosting a gallery of all Programmable LEDs at http://tinkerlog.com/2007/11/28/programmable-led-gallery/
If someone else has a version to contribute, please let me know.
Cheers,
Alex
"-D" stands for the define symbol, "F_CPU" is the symbol that defines the speed of the ATtiny. If it is set to a wrong value, your ATtiny will wait too long or too short in the "_delay_ms()" calls.
Hope this helps.
And don't forget to post pictures, when you are done ;)
Cheers,
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).
http://drskippy.net/blog/2007/04/picbased_programmable_led.html
Dave
Smart LED Prototypes
He uses an RGB LED and a touch sensor. Very nice.
Not very organic yet!
Cheers,
Dave
have a look at Synchronizing Fireflies if you like. It's about infecting each other, in a way.
Regards,
Alex
Click here for a priced list of the available PICkits and daughterboards at Mouser.com.
I just learned that a 'PICkit 2' is now available. Mouser has it for $34.99, $1 less than they price the PICkit 1's out at! Seems that DIY DSP is headed our way...
Click here to view the PICkit 2 specifications at Microchip's website.
I also have a Zilog Z8 Encore! starter kit that is along the same lines as Microchip's offerings.
Most every uC manufacturer carries or offers a beginners kit to get folks like US to discover the ease (?) with which one can implement the devices.
It used to be that there were only 'Developers Kits'. These kits were designed for a seasoned propellerheads (engineers) with every imaginable option included. Price? ~$2,000 - $10,000!!!
Nowdays, some uC mfg's are distributing their newbie starter kits using the 'developers kit' moniker, just to confuse issues. But YOU won't be confused. Why? Because you are INSTRUCTABLE :) !
I'd throw more links in, but I've gotta get back to work...
Ff
I realized that I didn't say squat about the uC being used in this elegantly simple Instructable.
The Atmel ATtiny13 device family page is HERE.
Atmel indeed has a starter kit for the ATtiny's, the ATSTK500, which can be examined HERE.
You can purchase the ATSTK500 kit at Digikey for $79, (Digikey Part Number ATSK500-ND). Mouser does not carry it.
Just wanted to be sure to at least mention a kit that is related to the uC involved in this Instructable.
Ff
You could do the free-form version with a chip holder, to save the chip from clumsy-soldering heat damage, and include the serial download socket in the circuit, then the chip can be programmed and re-programmed in situ.
I had a blast, and they are available as inexpensive kits for those that want to play around.
The blinky you get is pre-programmed, with various patterns. There are linear (19 leds), circular, 5x7, and recently 4 RGB color LEDS (so they could make "any" color by duty cycle pulsing).
For <100 you can get a programmer for these PICs, and hook to USB and program your own. Buy additional chips (such as from DigiKey or Jameco) for a few bucks.
http://www.2dkits.com
http://www.youtube.com/watch?v=tUcOaGawIW0
I bought mine here http://shop.embedit.de/product__258.php. They ship in germany only I think. Sorry, I don't have another link.
Regards,
Alex