Dave wires up an Arduino (Freetronics Eleven) to control his video camera via a learning IR remote control matrix keypad.
More advanced video here: http://youtu.be/BUvFGTxZBG8
NOTE: this is NOT an optimised solution, nor a tutorial on the best way to do this, it's a quick rudimentary hack while showing a few traps. This was the quickest way to do this.
Forum: http://www.eevblog.com/forum/blog/eevblog-505-ir-learning-remote-control-hack/'>http://www.eevblog.com/forum/blog/eevblog-505-ir-learning-remote-control-hack/
EEVblog Main Web Site:
http://www.eevblog.com
EEVblog Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/

Hi just a quick video about hacking this uh, Universal Remote Control I'm trying to build a uh countdown timer for my new segment and I want the timer to be able to switch my camera off and on automatically I thought oh yeah, I could probably either use uh, a genuine Canon remote or one of the imitation ones with the proper key already programmed in there and just, uh, use the Uino to short out the button. That's a pretty easy hack, but uh I got to wait weeks for to get one that get one of those delivered and I don't want to use my uh, genuine one of course. And then I thought oh maybe I'd get this um uh, us B infrared toy from um, dangerous prototypes which I've had uh for quite some time and hooks up to the USB and I can read the IR code from here and I've done just that and it can save it to a file, but unfortunately I thought you could actually program it to spit the code back out. It's even got the uh space on the back for a button, but that doesn't seem to be the case.

It doesn't seem to be a firmware option to actually do that. and yeah, I could probably find a way to, you know, program it manually or something like that to spit out the received IR command and I know there's other ways to do it, more than one way to skin a cat here. As always, I can there's libraries for the Arduino that you can read commands and then IR commands and then spit them back out. but I didn't want to dick around.

So anyway I got this. uh, learning remote control from the local uh supermarket. It's a Scandia uh brand and I thought we'd uh, crack it open and uh, have a look inside see if it's um, it should be easy to hack to get it to. uh, simulate the remote control cuz I've already programmed it.

It's got the learning function here we go. I'll stop it, press the green button there and and there we go. It should have switched back on there and uh I've programmed this button here to switch uh to the other mode and uh, sorry to switch to the playback mode and then if you hold down the learn button there, there we go. Learning key: Okay, we can select key and let's say we wanted to set this one as Zoom for example, waiting then if I zoom Tel photo boom, success, select key that one program that there we go.

So now these two oh and sorry I've got to press Ox again to save it and I should find that these two keys now do my remote control. uh do the zoom. Yes, they do look at that. Awesome! Oh and you can actually see the LED blinking in there because uh, video cameras can actually see infrared uh light.

There you go, you can see it flickering away there. Awesome. So there you go. I've got that programmed in.

so now, uh, we're going to crack it open and uh, see how hackable it is. Let's do it and we can, just, uh, pry this. just pry this sucker open and uh oh, looks like we're our Springs are stuck. Sometimes you got to push those little Springs out Tada and we're in.

like flying. Oh look at that! We got two separate boards here that's actually going to be very handy because I was going to say um, like uh, you know, um if you just wanted a small module. sometimes you can just like hack off uh, the bottom of the board for example, just you know, soore it off or something if you just want a little small, uh, compact board instead of using the big, you know, huge long full universal remote and it looks like we can just desolder can probably cuz this. all this board here does is it's got the conductive um Carbon on there for the membrane overlay.
It's got surface mount leads which light up the uh buttons and a few resistors but that's it. It's got the the battery contacts on here, but it looks like yeah, the battery contacts just go straight down there to pins on that board. hey that's really quite nice I Like that that's a win I thought uh that we'd have to, um you know, maybe sore off the board or something or I could have just used it as the whole board and then in my uh solution I was just going to bend the Uh LED at right angles like that cuz it needs to mount flat on the back of my thing and then poke out through a uh, red perspect window. So I was just going to um, bend the LED at right angles.

but uh, there you go that one. I'm rather rather happy with that. So this brand, this particular model is very hackable. Uh I don't know what model it is actually it's just Scandia I don't know.

uh Scandia is an Australian uh company who just, uh, import these from China so they probably you know are rebadged under 20 different Brands I'm sure. so that one looks like a very nicely self-contained board that you can just rip off and and we can access the pins. The Matrix pins cuz this is the thing about hacking these things is that these keys are in a matrix. You can see there's not many pins I'm I'm sure how many keys are on this thing, you know? 30 or something? I don't know.

40 30 keys or something? I Don't know. there's a lot so they don't have individual pins for each one. so they put them in a matrix uh, configuration and uh, which means they're actually harder to drive. You can do it with just a single uh, you can drive it with an Arduino but you can only usually only just do a single button because of the nature of the Uh switching.

Matrix it'll get uh all confused. I won't go into the Uh details on that but um, we should be able to do at least a single button. So what I'm going to do is Buzz out where's my button? It's going to be that one. it's going to be that one.

So I've got to find which pins on there map through to that button there and that's actually real easy to do because the uh, carbon ink on these things is generally going to be a couple hundred ohms. let's just go from one side to the other. There there we go. 270 ohms.

So if I'm searching for this button here, there's a contact carbon contact on either side so all I've got to do is probe from the carbon contact up to um and find out which pin is on there and here we go I found it. The top contact up here goes to this bottom cor. oh no sorry the top corner pin up here there we go. you got 100 ohms and you can tell because if you go to the other pins they're all you know a couple hundred k or a Meg or something like that.
So there you go, that's a dead giveaway and the other contact down here is oh sorry, not that one that one down there. So there you go. So all I've got to do to activate that particular button Which is my start. I've programmed even start stop button for my remote is put a switch between there and oh there and there.

That's it. And very brief overview of a matrix. uh, keypad like this. they've You've no doubt seen this before.

They've got rows like this and column drivers and there's basically a switch between each row and column. uh, intersection like that and you can have that for as many and make as many keys as you want. And the software sits there just scanning these rows and columns until you push an individual button and by knowing the combination of the two points that, uh, get shorted out, it can determine which key is being pressed. now.

Um, this is a real problem to drive this with external circuitry because these are not ground reference so it's not like you can just use an open collector output here. for example it. You know it could be a mosfet or whatever ins inside a typical microcontroller. for example, like an Arduino Um.

or you can use an external driver transistor for example that will be ground reference like that and you can't just go whack that willy-nilly across one of these switches if this circuitry uses the same ground reference. Now, in this case, I could power this the remote from its um, own individual battery and then that's fine. I can put one individual Um transistor or an output of an Arduino acting as an open collector open drain output like that. So you switch it the output zero or then you switch it to an input which is similar to an open.

Effectively, Uh works as an open collector output like that and in that case, yes, I can drive one individual button for example, this one with my external Arduino But if I want to do more than that, then um I'm going to run into a big problem I'm going to have probably have to use Opto couplers, an Opto coupler for each switch, or a relay, or you know, a little rear relay or something for each Uh switch to short them out. or maybe a Seos uh switch or something like that. but uh, won't go into the details. but because I only need to switch one switch, I'll just power this from its own battery.

Um, and that should last for ages. you know, a year or something. Good enough of a pair of doublea's I'm sure I can measure that current, but I should be able to just hook my Uh one Uh output pin on my Arduino up to the individual switch I want on those pins that I buzzed out and it should just allow me to emulate that switch. Easy.
You can see the Uh carbon ink here. This is the yeah. this is the key that I want to uh do here so you can see that is then jumping down that that conductive carbon ink which as we saw from there to there is you know a couple hundred ohms or thereabouts and we saw and then that drops down to AA so it actually drops down to that Trace down there and it's also shared with that one there but it goes all the way back and up here. We should eventually.

oh where is it should eventually be able to find our way all the way back to the pin over here. But anyway, um usually when you you sometimes you got to hack into these things. If it's just a one board solution like this then you have to probably hack into these uh tracers in here and it's not easy cuz those vas. look this is a single sided board.

The vas don't go through to the other side of the PCB so it's not like you can just solder a wire on the back side onto that. V So so if you've got one of those boards you probably have to uh drill out I was expecting to have to do this I was expecting to have to drill like a hole. You know if I want to access that yeah that Trace there then I'd have to drill into that uh spot down there. and then you know if I wanted the wire to come in from the backside and I wanted to, maybe you know, keep the remote in with the button still on it or something.

Then you know you have to drill through and then solder over to that track and scrape off the solder mask and stuff like that. But you can see how they've made this as a single-sided board. We've got our regular tracers on here with the solder mask as a single-sided board and then they've overlaid the carbon traces on top of there and they've just had the exposed copper. and then the carbon makes uh, contact with the exposed pad underneath there and that's how they manufacture these boards as a single.

Sider But luckily this is a two- board solution and we can just hack directly onto these pins. Oh fantastic. This is almost. This is ideal.

really. it's practically uh designed. look. Nice little compact board.

it's got its own LCD powered from Uh 3 Vols and uh, we can do some wonderful stuff with this. I Really like this particular model and by the way, this is a Sunwave Technology Sr800 and there you go. I've mapped out these four colored buttons here I Could go and do others, but really? I I Only need the uh one. Only need that green key.

but there you go. You can see that all four of those share a common row or a common column there. And then we've got four separate pins over here for the four individual keys. All right, let's give this thing a go see if it works.

I've got a Fre Tronics 11 Arduino Uno compatible board here and uh I've programmed a sketch into this so that digital output uh zero here goes to a logic zero or I.E Uh, shorts out those two pins cuz I've got ground hooked over to here shorts out that record pin that I've pre-programmed into there and uh, that's it and after it, it times out after a little bit and then it sets it back to an input so it doesn't set it to logic High it sets it back to a high impedance input and that's important. So let's plug it in. Um. I've made sure that the camera I'm actually filming this with um doesn't accept the infrared uh code only my secondary camera here will so you can see that it's uh, got an output there and we'll see it, hopefully press record I've got this power from a separate Uh battery here and that's important.
Of course that we're not connecting the common grounds between these two systems. So let's plug it in and see if it outputs our infrared code. uh to switch on and you'll uh see it. when it sends a code, it switches on the backl of this LCD here which is really handy.

So here we go, plug it in. Boom! look at that Bingo switched it on and after a few uh seconds, it should switch that back off. Come on there we go. Bingo Easy.

Works A treat. But unfortunately, look what happens when I disconnect it here. Look, it's just continually transmitting, continually transmitting and it will eventually switch it off. And that actually switched the camera on Unintentionally really, because what it's doing is when it's switching it off.

This remote control, uh, thinks that that button is being pressed all the time, and obviously this firmware in here is smart enough to know that. Oh okay, okay, it's got a stuck button I'm just going to time out I'm not going to transmit anymore so it doesn't waste the uh battery. so it's really handy so that can either be a good or a bad uh function depending on uh, whether or not. Well, if it's taking any extra battery power by having that button effectively pressed all the time, then that could be a problem.

But I can measure that to ensure that's not the case. Otherwise, we have to find a way to, uh, ensure that when the power to this board is removed because we' still got the power. I Mean we could disconnect the power to this as well, but it's better if you're using this remote control from its own. Battery Source just to leave the power hooked up all the times and you can see that with the power uh, disconnected here, then we can't actually, uh, do anything.

We can't operate any the other buttons. you see how it's completely locked that out. but if we turn the power on here, then oh, he just accidentally turned it on then. oh sorry, something wrong with my Uh, then we can still operate our buttons like that.

Um, wh there we go. Just switched it off. Brilliant. So that's not an easy problem to um, overcome.

So I I think the easiest way to uh do that is in my project is just to uh, use a double uh, ganged power switch so that I'm turning off the power to this the same time as I'm turning off the power to the battery to the remote as well. Now you might think because all of our pins Comon up on this one. Well, all of the four colored pins in the row combed up there on the one pin and we're using different supplies that we can have the one common going over and then use our Arduino to drive four. In this case, four different buttons.
Well, I've written a sketch to uh do just that. It operates the Uh Zoom as well. so zoom up and down, zoom in and out. Um, plus it switches the record off and on and also a fourth channel.

Uh, switches it in to playback mode and let's give it a go and we'll find that it is hasn't Swit hasn't switched it on so there's that's not working whereas it should. It should have first switched it on. then it should zoom in and out and it's not doing that. and then it should go into uh playback mode.

and well, it's just. no, it's not doing. You can see that it's uh, attempting to send codes there, but if you flip it over here, you'll find that what's happened is it's going into all these different modes. It's pressing the wrong buttons.

and that's not because I've decoded them incorrectly on the Uh pins here. That's because it's just it's going Burko. It just does not work at all. And of course, for this to send the codes, it needs to be in the Ox mode.

I Could of course program all the other codes into the same codes into all those eight buttons. but jezz, you know, like anyway. I Basically just wanted to show that even though they're all comed up like that, you're still not going to be able to get it to easily work like that. But it does work on a separate Supply with just the one pin, which is all we want.

And let's see what happens if we join up the Common Grounds Between this battery and the Arduino board. here, you can see it's uh, doing its regular cycling through the record, off and on just on that individual button and it's working just fine. Well, if I touch the ground here and join them up, you'll notice that we can sit here. We can wait forever, but it's never going to switch back.

it's just not working anymore so you can't join those two different grounds together. Doesn't work and if I release it, there we go. We eventually switch back once I released it and it's now working again. So what's the final application of this thing? Well let me show you catch you next time.


Avatar photo

By YTB

20 thoughts on “Eevblog #505 – ir learning remote control hack”
  1. Avataaar/Circle Created with python_avatars Work From Home 2021 says:

    Nice project

  2. Avataaar/Circle Created with python_avatars John Coops says:

    No Arduino is needed here. Just connect a press button across the 2 pins. If you want 2 buttons, then connect 2 buttons. Sheesh.

  3. Avataaar/Circle Created with python_avatars Blus cream says:

    You can use a FLIRC usb dongle

  4. Avataaar/Circle Created with python_avatars Yamina M'RABET says:

    Peut on avoir la traduction en français ? Merci

  5. Avataaar/Circle Created with python_avatars Keith thompson says:

    Can you do a vankyo 600 remote please haha customer service are CSuckers and wont release any info for people can use firesticks on the projectors

  6. Avataaar/Circle Created with python_avatars SLYKER001 says:

    Does optocoupler will work as key?

  7. Avataaar/Circle Created with python_avatars Isaac Clark says:

    You don't want to be bothered to "dick around" programming, so instead you buy and then hack open a learning remote. That makes no sense. It seems to me that you just made up a silly excuse to make a video.

  8. Avataaar/Circle Created with python_avatars heyou says:

    So, how would you use all the buttons if you wanted to from the Arduino?

  9. Avataaar/Circle Created with python_avatars Niels Raider says:

    your hacking nothing! the remote itself is already a hacked device. So don't call it hacking you hack!!!!

  10. Avataaar/Circle Created with python_avatars Kazimierz Król says:

    Easy solution to control multiple pins (possibly all) without any additional components:
    1. The grounds of the remote and Arduino must be connected.
    2. Connect all the row and column signals to your GPIO pins.
    3. Write a program that detects the scanning signal of the rows or columns (an interrupt will be most reliable), and outputs states to the columns or rows at the specific times.
    This would effectively make the remote processor see the logic states on the inputs corresponding to the specific keys at the right times.
    A problem with that could be the delay between the scanning signal and the CPU changing the GPIO state, but that would not be hard to overcome.

  11. Avataaar/Circle Created with python_avatars Bob Lewis says:

    This is an old video so I'm not sure how many people will get to see this, but using the Arduino and outputting a 2,3 or 4 bit binary code in conjunction with a cd4066 analogue mux/demux you can emulate physical point to point connections quite easily. The on resistance of the CD4066 is also nearer to the carbon resistance strips than a straight mechanical switch. There are more modern versions of the CD4066 which have lower on resistance but I'd have to do a bit of chasing around to obtain the number. Try Googling for them. The beauty of such devices is that they do not rely on a common ground they literally act like electronic 2 contact switches and are bi-directional too IIRC. There is an 8 channel to one output version too which provides a great way to expand an ATTiny 85's ADC inputs by effectively sampling any one of the 8 by selecting it from the Arduino. THIS technique can enable a multi channel data logger to be built in a TINY amount of space with thee minimum number of chips, external components and size.

  12. Avataaar/Circle Created with python_avatars Koffi Banan says:

    Can anybody explain me why exactly it didn't work driving the four different buttons with the arduino? Is it because he's effectively shorting the pins through the arduino, while pressing a button on the remote would still have a couple 100 ohms resistance between them?

  13. Avataaar/Circle Created with python_avatars Dmax says:

    I was going to do something like this but I could not find one of those remotes so I ended up having to use a picmicro and working out the IR code it took me ages lol but I got there in the end 🙂 , Thanks for the video Dave !

  14. Avataaar/Circle Created with python_avatars Lizlodude says:

    OMG these exist! I don't know how I overlooked them for years but I'm buying one now! all I can ever find are the stupid DeviceCode ones!

  15. Avataaar/Circle Created with python_avatars John the electron man ensor says:

    Are you sure your camera doesn't already have the timer option programmed on it

  16. Avataaar/Circle Created with python_avatars TheTrinityNetwork says:

    i now feel compelled to take apart my TV remote…. hmmm

  17. Avataaar/Circle Created with python_avatars Pedro Vazquez says:

    My friend, we really enjoy your classes! The most intelligent teacher I have had in Electronics…

  18. Avataaar/Circle Created with python_avatars PirateKitty says:

    Why not use the Arduino to read the codes from your remote and store them? Then play them back through a IR diode and a transistor driver? $2 worth of parts + Arduino.
    I made one just like it. No universal remote needed. This was NOT a good hack since the Arduino can easily do the job without the universal controller.

  19. Avataaar/Circle Created with python_avatars shadman1911 says:

    I collect Logitech Harmony remotes… they are exceptionally good

  20. Avataaar/Circle Created with python_avatars Micah Nightwolf says:

    Dave, I'm a bit of a novice when it comes to electronics and hacking. But I was able to figure out a solution for the problem you were facing with the remote pressing buttons when you turn off the Arduino, and this is what I found. You might be able to conquer the power off problem by putting an NPN transistor between the remote and GND on the Arduino, and connecting the base to 5v or 3v3. It should make the connection between the remote and GND on the Arduino and allow the remote pins to be shorted by pin 0 as long as 5v or 3v3 is on. It will cut the connection, thereby removing the short between the 2 remote pins, when 5v or 3v3 goes dark.

    Also, can you power the remote from the Arduino? I'm not talking directly via 3v3. Even I know that won't work. But what about using a voltage divider and powering it from 5v? You may be able to fit the voltage divider inside the battery compartment.

Leave a Reply

Your email address will not be published. Required fields are marked *