/ / Programmable LED
This is a tiny blinking device. The blinking sequence can be reprogrammed with the use of a flash light. It detects changes in lighting and records these changes and finally plays them back.
The LDR (Light Dependent Resistor) is used as input sensor to detect the light changes. It is attached to an ADC (Analog Digital Converter) port of the microcontroller. If the controller detects short light changes (dark, bright, dark or the other way round) it switches into recording mode. It records up to 10 seconds with 40 samples per second. Then it switches back to playback mode and plays the recorded sequence.
Parts and Tools
parts
- ATtiny13v, microcontroller, 1024 bytes flash memory, 64 bytes RAM, preprogrammed
- Resistor, 1k (brown, black, black, brown, brown)
- Resistor, 10k (brown, black, black, red, brown)
- Low power LED, 2mA, red or green
- LDR, photocell
- Coin cell, 3V, 220mAh, CR2032
- Paperclip
The follwing tools are needed:
- Soldering iron and solder
- Pliers
- Third hand
Program it
When you insert the battery, the LED should flash 5 times. That’s a kind of hello. Next, it switches to programming mode, because it has no recorded sequence. Switching to programming mode is signalled with 5 fast flashes. Now you can record a 10 second sequence of light and dark before it switches to playback mode, signalled with 5 fast flashes as well.
You can re-enter the programming mode by giving it a short flash of half of a second. A flashlight works well or cover it with your hand to cast a shadow for half a second.
To program the chip before soldering navigate to
liz_arum_classes:assignments:physical_programming:2009:leds:progled. Simply type
make
make fuse
make flash.
Source: Alex Weber/Tinkerlog