Here I am presenting one more LED chaser. As the title suggests, it’s not just simple microcontroller-based LED chaser but its IR remote controlled LED chaser. Means the LED chasing effects can be changed by remote control. Not only that but the blinking rate of LEDs can be also increased or decreased to make chasing effect faster or slower using a remote.
The project given here demonstrates how to generate a different chasing effect on different colour LEDs using IR remote (like TV, DVD, AC, STB etc) with the help of Arduino. Also, it varies the speed of chasing effect using a remote. The project uses a normal set top box (STB) IR remote, TSOP IR sensor, different colour LEDs (red, green, blue, yellow, white) and an Arduino UNO board. Anyone can use any type of IR remote. Just he has to change the remote codes in the Arduino sketch (program) for the remote. This procedure is also described here while explaining the operation. So let us see how this is done. First, see the circuit diagram followed by its description and operation.
As shown in the figure, there are very few components in a circuit like different colour LEDs, resistors, IR sensor TSOP1738 and the main is the Arduino UNO board.
• The sensor TSOP1738 has 3 terminals (1) Vcc (2) Gnd and (3) output. Its Vcc terminal is given 5 V from board and Gnd terminal is connected to the ground of board. Sensor output is connected digital input pin 2 and 3 of arduino board. Pin 2 of Arduino board is used as interrupt pin and pin 3 is used to receive IR remote code. When the code is received by sensor pin 2 generates an interrupt.
• Digital pins 4 to 13 of the board are connected to anodes of different colour LEDs through current limiting resistors of 470Ω. The cathodes of all LEDs are shorted to board ground.
• The stepper motor and ULN2003A chip is given external 5 V supply
Here is the snap of circuit arrangement.
First, we have to decide, which are the different buttons of IR remote, that we will use to generate different chasing effects and vary its speed. We want to perform following actions -:
1. Generate 5 different types of chasing effects. Like generate 1st effect when button 1 is pressed and likewise
2. Increase/decrease chasing effect speed
I have used set-top box (STB) remote that has many buttons like 0-9 digit buttons, volume control buttons, channel up/down buttons, arrow key buttons etc. From all these buttons I have selected following 7 buttons for different operations.
That means when any digit button between 1 to 5 is pressed, the LEDs start displaying different chasing effect. The volume up button will decrease LED blinking delay so chasing effect speed becomes faster and volume down button will increase LED blinking delay so chasing effect speed becomes slower.
After deciding the buttons next is to decode the codes of these buttons. As we know when any button is pressed from remote, it will send one code and based on this code the action is performed. So to decode these codes I have used IRremote library for arduino, readily available on the internet.
So download the library and use the example to decode the codes of remote buttons. Upload the program into arduino microcontroller and connect IR sensor as shown in the figure. Now point the remote control towards IR sensor and press the button. Open serial monitor and you can observe the code of pressed button in form of numbers. Note down the codes of required buttons like I have noted the codes as per the following table -:
In the arduino sketch above codes are used corresponding to button pressed to perform an action as per the previous table. Now let us see the actual operation.
There are five different chasing effects.
Effect 1: one by one all LEDs will turn ON from left to right and again they will be turned OFF from right to left.
Effect 2: one by one all LEDs will blink from left to right and again from right to left
Effect 3: two LEDs at a time will blink from left to right and again from right to left
Effect 4 - Water Fall: one by one LEDs will turn ON from both ends and reaches to center and then turns OFF from center to both ends. This kind of effect looks like a waterfall.
Effect 5 - Fountain: one by one LEDs will turn ON from the centre and reaches to both ends and then turns OFF from both ends to again center. This kind of effect looks like fountain
• The arduino board is given supply through USB
• Initially, LEDs are OFF the message is displayed on a serial monitor of arduino IDE as “IR remote controlled LED chaser”. The Arduino will wait for an interrupt from IR sensor
• Now when digit 1 button is pressed from remote, IR sensor receives code and pin 2 generates interrupt
• The Arduino jumps to ISR (interrupt service routine) and decodes the code for pressed button
• When it gets code for button 1 it will start generating chasing effect 1 on LEDs and again waits for any new button pressed from remote
• Similarly, when any of the digit buttons is pressed the Arduino will decode and get the code from ISR and start generating any of the 5 chasing effects
• When volume up button is pressed, the delay applied between LED blinking is decreased. So LED blinks at faster rate - that means chasing effect speed increases and the message is displayed on serial monitor as “blinking speed increased”
• Similarly, when volume down button is pressed, the delay applied between LED blinking is increased. So LED blinks at slower rate and the message is displayed on serial monitor as “blinking speed decreased”
• After increasing or decreasing the speed again when any button 1 to 5 is pressed the chasing effect becomes slower or faster
• The LED blinking delay is changed in step of 25 mili seconds (ms) from 50 ms to 200 ms
Complete functionality of project is because of the program downloaded into arduino board microcontroller ATMega328. The program is the soul of the project. The program (also known as sketch) is written and compiled in arduino IDE software tool. And it is burned (embedded) into ATMega328 using built in software programmer tool AVRISP MK-II through the USB port.