Monday, December 28, 2009

Radio Control to Lego IR converter

When initially building my Lego rover I came across the Lego Power Functions Remote controls. However I quickly discounted them for a number of reasons, foremost being they are InfraRed only, and so useless if you are running out of Line Of Sight.

The speed control remote, while you can control the speed, its awkward to do so. While with the standard remote, you have no speed control, you merely control if a motor is running backwards or forwards, it will always run at full speed. As a result I ended up going with a radio controlled plane transmitter and receiver set.

This has a lot of benefits, but again drawbacks.

When I was looking at a different version of the rover I came across the NXT Packbot.



Being that it uses the NXT Mindstorms it it possible to include automated functions, like the ability to right itself if it gets flipped (this needs an accelerometer). But you still need to be able to control it remotely.
The company that makes an accelerometer sensor for the NXT also make an IR Receiver, that can respond to the Lego IR remote codes. I had already found code for an Arduino to decode the PPM signal, so it it was only a matter of the IR signals, something I had already done something similar for on another project. A little more digging and I found an Arduino library for the Lego IR codes. The rest was pretty easy.


The case contains a Arduino Pro Mini 5V/368, with a small daughter board containing an IR LED and transistor to boost the power of the LED.

Code : HERE (beware the code may be messy and contain un-needed stuff)

Of course before I even finished I realised what the next step was - directly connecting the RC receiver to the NXT. Although this current project works well for controlling the Power Functions remote as-is, it needs the Hi-Technic IR receiver to work with the NXT. The NXT communicates with its more complex sensors using I2C, something the Arduino can do quite happily, so it shouldn't be that hard... right?

1 comment:

  1. Hi there, where did you get that case for the Mini ? It looks perfect.

    ReplyDelete