This is a small IR remote capable of copying any 5 buttons of any Remote using IR. I was studying IR signals and this came into my mind. And guess what,it also has a jammer button,that can be deployed to block any other IR signal transmission.
So,here are some pics. I haven't done any video yet,but can assure you that it is working perfectly as it should.
At the heart of it,there's a Mega 328p-pu.,and the switch just beside it is the reset button. The board is a homemade Mega328 board (w/o any USB interface).
This is the "Shield" I've designed for the board to convert it to a IR remote. It has an IR LED, an IR detector, six momentary push to on switches, one on-off toggle switch,(and some resistors and wires...:P)
Can I call this a *PCB* ????
The five switches in the middle are programmable . The two LEDs are status LEDs. I choose green diffused ones,cause I don't know why,but I strongly feel that they consume the least amount of current. The button at the right-bottom corner is the jammer button.
There's a 7805 on-board to regulate the voltage for the MCU.
For the jammer part,as soon as I press the "Jam" button,the LED sends out 38Khz carrier wave,with no information,which blinds the TV IR receptor.
When this device starts,I need to point the remote at it,and press any 5 keys. It takes the raw IR data and stores them in RAM.
IR signals are pretty fast and the digitalRead(),digitalWrite() functions are too slow,that's why I am using the direct pin access method.
digitalWrite(12,HIGH) can be replaced with PORTB |=_BV(PORTB4); which is a lot faster than digitalWrite()
digitalWrite(12,LOW) == PORTB &= ~_BV(PORTB4); PORTB4 is Arduino digital Pin 12.
if( PIND & _BV(PORTD2) ) == gives the same result as if( digitalRead(2));
pin mapping of mega168/328
OK,now,I have found two problems....
1. While playing with the TSOP IR sensor,I found out that,it "filters" out the 38Khz signals,making the MCU unable to calculate the frequency. For a device to work with ALL IR remotes,it must be able to calcualte frequency. This one works at around 38Khz. I've attached a small program to callibrate the frequency As +-1,until the TV signal gets blocked.
2. The memory- storing the IR signal data can be pretty memory consuming. I am using two 60 X 6 arrays of unsigned integers (2bytes). So that requires 2 X 360 X 2 = 720 X 2 =1440 bytes of RAM. So I choose Atmega328. I have searched for a way to write data in the flash memory itself,but it is a difficult job. Only the bootloader section can write FLASH on the run ,but for that I need to edit the bootloader,which is beyond my knowledge at this moment. on chip EEPROM isn't sufficient either. But an external EEPROM can be used. If anyone finds or already have found a way to write flash on the go,then please share it. It would be very useful.