IR Controlled Led Chaser With ATtiny45
by JanJ123 in Circuits > Microcontrollers
394 Views, 1 Favorites, 0 Comments
IR Controlled Led Chaser With ATtiny45
I was trying a long time to get ATtiny microcontroller working with IR receiver. Now I finally managed to make this circuit consisting of 10 charlieplexed led diodes controlled by basic arduino IR remote. Project contains 9 led effects, which can be turned on by buttons 1-9 on the remote. Number of the effects can be increased after some more programming if you want. Only limit is the number of the buttons on the remote or memory of the microcontroller, which are you using.
This project uses 10 charlieplexed led diodes controlled by 4 output pins, although charlieplexing allows you the maximum of 12 leds (4*(4-1)=12). So, after some changes in the code and circuit you can use 12 led diodes, but 10 leds was the best option for me.
Supplies
1x ATtiny45/85/(25)-20PU
1x VS1838B infrared receiver (almost every 38kHz receiver should work)
4x 100 ohm resistor
10x led diode (I used 3mm blue leds, but almost every led will work)
1x battery clip
1x 3 - 4,5 V battery
1x universal IR remote
1x some attiny programmer (I used arduino nano as ISP)
Make the Circuit
Firstly you need to make the circuit according to this schematic. Best option is to make this circuit on the PCB or just use a breadboard.
Burn Correct Bootloader on Your ATtiny
After assembling all parts together you must burn a bootloader at 16MHz internal on the ATtiny chip. This is necessary, because the IR receiver works best on this frequency. The circuit probably won't work at another frequency.
Programming
After burned bootloader load this program on your ATtiny microcontroller. Do not forget to choose correct frequency (16MHz). This program is pretty simple. The basic method of this program is light_led(number of led from 0 to 9), which lights certain led. With calling method leds_off() you can turn off all leds. With these two basic methods you can make more complicated methods using for cycles. In the main loop are finally these methods (effects) triggered by certain ByteValue, which comes from IR remote to the receiver.
Downloads
Connect the Battery and Enjoy
Connect battery of the voltage from 3 to 4,5 volts. Press the buttons from 1 to 9 on your remote, if you have the same remote like me. Each button will turn on one of the effects. All effects will end automatically. Duration time of the effects can be changed by variable called repeat, which can be found at the beginning of the sketch.