You when something annoys you so much you just have to fix it especially if every one else nags you. Our television remote falls in this category, its a "Dick Smith" brand unit and has a dodgy intermittent remote. I've used universal remotes before and even after hours of programming them they are not so flash. So what to do? Our Panasonic DVR we use has a more than adequate universal section built in but in spite of talking to 100s of other devices our TV is not one of them. If only it spoke the lingo!
Arduino IR library and Nano on the jobDid you know with a couple of parts you can receive, analyse and send IR codes with even the smallest Arduino? So with not much more than the example sketch you can work out what codes in what protocol gets sent from your remote for each button. With a couple more lines of code you can send another code that you would like substituted for the the first code.
So in no time at all you have built yourself a transcoder. Receives codes of one remote and re-transmits them as if from another. "Piece of Pi" or maybe Arduino? I even put in the start of an overlay function so I can use all of the remote buttons for the TV if the original device is off, I used a RGB LED indicator to show when your in that mode to avoid user confusion.
Anyhow, all that is left now is to give the remote to family members to test and suggest while you watch for bugs.
The circuitVery simple, due to the IR receiver doing a lot of the heavy lifting. It has the automatic gain control and many other items needed to successfully demodulate the 38 kHz signal that is passed to the Arduino. There is no current limmit resistor on the two IR LEDs. I was expecting scorch marks on the couch while testing but it seems to work fine at 5V with the LEDs I bought. Trying this was a response to what seemed a pathetic range at 20 ma, "More power Igor !"
You can see the proof of concept test unit with the breadboard to the left of our TV. The Arduino Nano is mounted on a prototype shield to the right. These prototype shields are neat as no toolkit should be without one!
Not all beer and SkittlesThere are some subtle things at play in the project and its all in the timing of the reception and transmission of the new code. but as always "Professor Google" has most of the answers that you seek.
Worthwhile?Definitely, I only need one remote which I didn't have to buy. I can change functionality (Include some macros) if I wish. Most importantly I learned a lot about IR remote controls.
But wait there's more... ESP to the rescue!All the parts for the final build sat on my bench for 12 months, assigned to the back burner after some success with a soldering iron and the actual TV remote. In the mean time I learned about the ESP8266. So when it can to put the unit in a box I thought why not make it run on a NodeMCU board. So with that thought in mind the final chapter and build was started.
So the software was rearranged and refactored to suit the new and better IR library for the ESP8266. The tri-color LED was used as follows. Red flash for IR transmit, Blue flash for WiFi Receive and Green flash for IR receive. The Blue LED also flashes fast during the boot phase as it attempts to login to the WiFi. The built in LED is used as a confidence meter / heart beat.
The unit has both soft AP and WiFi client, This makes configuration easier as there is always a configuration port available.
The remote control page uses some in-line CSS in the web response to set the style of the form buttons which form the basis of the remote control page. The page works nicely on mobile phones due to the "viewport" command which helps the phone get a better "perspective" on how it should display the content. These represent a departure from my usual web M.O but I am trying to "up skill" a bit.
But wait... how could I build a remote control that has WiFi with making it programmable via the WiFi and IR port. So a new web page and interface was designed so I could capture an IR code and assign it to a button in the control matrix. In fact you can reprogram it all via this interface. There is a factory reset to return it to the original state if you completely loose your way.
Actually I found the virtual remote on a mobile web page much handier than just a gimmick. Every member of the family has some sort of device and can now operate the TV even if the remote has scurried away into the deepest recesses of the sofa.
Hmmm.... works well but could be better. I found myself wanting more devices on the virtual remote. There be enough EEPROM memory so lets Implement 3 pages of 48 buttons (4 x 12). This doesn't really impact the rest of the code and really just increases the lookup table for the transcode function. So that will no doubt be the next improvement..
Strangely enough the wee transcoder box helped shine some light on our troublesome TV remote. I was under the impression it wasn't transmitting at all. However I noticed the green light flashing (code received) but the TV not responding. So what curiosity led me to the setup page where I discovered the remote was sending the wrong codes! No wonder the TV doesn't respond, but armed with knowledge a fix may me close at hand.
As usual, thanks to all those that helped and happy coding!
Update June 2019Yes I've sort of finished the code for the multipad version shown above, it's listed in GitHub and it's running in our living room. Constructive comments welcome.
Comments