IR remote control reverse engineering

If you’re anything like me, or the vast majority of Americans, you are surrounded by IR devices at home, at work, and pretty much everywhere you go. A great number of these devices (round 90%, its kind of the standard) use the 38 kHz SonyIR protocol, but knowing just that doesn’t help much. Especially if you lack a proper oscilloscope, like me. Plus, hell, your remote might be in that mysterious 10 percent. In order to figure out the actual encoding, you need to be able to plot the signals while you fiddle with the remote, and then make a chart relating the independent variable (the fiddling) to the depedent variable, the bursts of 0s and 1s that inevitably ensue.

IR pulses for various button presses on someone else's oscilloscope :-\ man browser up

Trandi has done precisely that, in his reverse engineering a remote controller from a toy chinook to operate his land based Rover and has devised an excellent technique for visualizing the data transmissions from the remote with just an attiny and a IR photodetector IC from radio$hack. Now if you, like me, find your local radio$hack overpriced and understocked, over on the arduino forums its been discovered the same resolution can be had with a plain IR phototransistor and optionally a cheap opamp like the lm741 (or also I hypothesize with a TL082 dual biFET (perhaps wired as a fourth order Butterworth high-pass?) and a IRled. Likely it’d work best reverse biased, reducing the slow response time typical of using an led as a photodiode, at the expense of increased noise. What’s the point? Never had one. And that just burns you up inside!) provided you modify your timings a bit.

A remote much like this one was harmed. Severely.
Continue reading

Arduino on the attiny in 15 minutes

It’s actually fairly easy, you must do precisely this. First, you will need to download the one of the files listed below, depending on which model attiny you’d like to use (I’d suggest installing them all, so it will be easy to change between microprocessors as the situation warrants.) For the example case, I will be using the attiny85, so, I will refer to the file.

First, make sure the Arduino program is *not* currently running, if so, shut it down. Open your arduino folder (arduino_022, or whatever you’ve named it) and create a folder inside your sketchbook folder called hardware (if it does not already exist.) Extract the zip file, and copy the folder within to your newly created hardware folder. The arduino IDE is now prepared to program your attiny. If you have a stand alone ISP, skip down to the ‘my first ardutiny program’ below. Otherwise, you need to configure your arduino (or compatable) to program your bare attiny.

Fortunately, the arduino IDE comes with a sketch built in to handle this task. Connect your arduino, start up the IDE, and select the ‘Arduino ISP’ sketch from the examples menu. Upload the sketch to the arduino, and now were ready to wire this bad boy up.


The picture above shows my setup. Basically, you need to connect the attiny to power and ground, connect three of its pins (5, 6, and 7) to three of your arduino’s pins (11, 12, and 13) respectively. Connect the attiny pin 1 to the arduino’s pin 10; this will allow your attiny to be automatically reset as you program the microcontroller. *If you’re using a teensy or other ‘arduino-compatable’ your pins will be different. If you can’t work it out, feel free to contact me in the comments.*

ardutiny programming
Now, were ready to program. Select ‘attiny85 (w/ Arduino as ISP)’, open up the blink sketch from the examples, and hit program (likely some errors will pop up, ignore these, and carry on). Take a LED, and connect it as shown above, and watch it light up!

This allows the attiny to support the best arduino functions such as digitalWrite(), digitalRead(), analogRead(), analogWrite() this is our PWM! More on this in tomorrow’s article. It also is hip with the time based functionality, such as millis() and pulseIn() another very useful function to be covered this week!

Give your thanks to these folks, if they’re still listening, MIT HLT Lab, and Alessandro Saporretti. Questions, comments and hopefully plenty of b**ching in the comments below, por favor.

the avr motherlode

Create a free website or blog at

%d bloggers like this: