Home / Experiments / In (Remote) Control with the HiTechnic IR Link Sensor

In (Remote) Control with the HiTechnic IR Link Sensor

IRLink Sensor [Taken from HiTechnic.com] The HiTechnic IR Link Sensor allows you to use IR signals to communicate with the Power Functions IR receivers, the remote controllable Lego trains and the venerable RCX.

I bought myself one a few weeks ago and have been busy tinkering with it ever since.  I contacted the HiTechnic company to ask for some documentation on how this sensor worked but for various business reasons (NDAs, etc) they were unable to give me *all* the details. However, one of their engineers, Steve, was very helpful explaining how the Power Functions part worked.  The sensor has a few modes, one for each device you can control with it (NXC, PF or Train).  The idea is that the sensor’s functionality is kept as generic as possible, putting all the intelligence in the software controlling it, RobotC in my case.  Using the Lego Power Functions RC document and the detailed description of the encoding mechanism given to me by HiTechnic, I was able to cobble together a nice implementation of the Combo PWM Mode.  Once I had that completed, I also implemented the Combo Direct Mode based loosely on the NXC example code Steve had provided.  For details on the encoding scheme, I suggest you read through the code attached to the end of this post.  I have added plenty of comments throughout the code.

Power Functions Test Bed @ HiTechnic

That is a picture of what Steve used to test my driver.  That’s a pretty sweet setup if you ask me.  How it must suck to make a living working with Lego and sensors all day!  My test setup is a little less impressive looking.  I only have the PF stuff that came with the Bulldozer.  With this RobotC driver, I can control not only the direction of the motors but also the speed at which they rotate.  This is not possible with the standard PF remote which implements only the Combo Direct Mode.  Using the Combo PWM Mode I have a lot more control over the motors.  The driver can handle all 4 channels, allowing you to control up to 8 motors simultaneously.

Without further ado, here is the driver: LINK.  Future additions might include routines to control the RCX and those remote controlled trains. I will keep you posted.

Edit: Version 1.1 is out and available here.  The main task is no longer enabled by default.

About Xander

Xander Soldaat is a Software Engineer and former Infrastructure Architect. He loves building and programming robots. He recently had the opportunity to turn his robotics hobby into his profession and has started working for Robomatter, the makers of ROBOTC and Robot Virtual Words.