Introduction: Making Mindstorms RCX Work Again
I found one of the original Lego Mindstorms kits at a garage sale and I had to buy it. I have wanted one of these for a while, but I never got around to buying one. Now that they are somewhat antiquated, you can usually pick them up pretty cheaply. Because these sets are nearly 20 years old, there are usually some problems, so once I got my set working I thought I would document the process for others to follow.
The main problem with Mindstorms RCX is the lack of support from Lego for these old sets. According to what I have read and some experience, the sets only really work well under Windows 98. People found ways to make them work under heavily patched copies of Windows XP, but since Microsoft no longer supports XP and the patches from Lego aren't available anymore, I had to find an alternative to the Lego software.
There are still a few sites around that support the original Mindstorms RCX sets, but they are disappearing and the information on them is less valuable as we move away from the versions of Windows that were supported. There are still a handful of good sites out there and they may not be maintained, but you can use the Wayback Machine to read the pages they used to link to.
Step 1: Testing Parts
This Mindstorms set is version 1.5, which includes an RCX brick that does not have an external power connector. I plugged in 6 AA batteries and tried to turn it on. Everything worked so I tested the sensors. When you attach and press the push sensors, a little arrow appears on the LCD below the number that the sensor is attached to. I plugged a motor into the motor port and cycled through the programs that were already saved on the RCX. I found a program that ran the motor forward and stopped it if you pressed the push sensor.
After the batteries have been out for a long time, all programs that were loaded on the RCX will be wiped out. The brick will default back to the standard programs.
I found this site that has the original inventory parts list for this set. I didn't actually go through the list to check everything. I just looked to see how many motors and sensors were supposed to be here and went from there.
Step 2: Disassembling the RCX
These pictures are from another RCX brick that I bought separately because it was an RCX 1.0 with the external barrel jack connector. This allows you to power the RCX brick and your whole project with an external power supply instead of batteries. Included in the auction was one of the RCX IR remotes that came from a different set. This allows you to remotely control movements and begin any of the 5 saved programs.
It's not actually necessary to disassemble the RCX unless you have to repair something, but I like to take things apart and I was already thinking of a future project, so I decided to take the brick apart. It's handy to know what parts go into something. The RCX is basically an LCD display, a microcontroller chip, a couple H-bridges, a speaker, an IR LED and receiver and some button and Lego wire connector contact. This is a good site that details the internals of the RCX brick.
The safest way to do this is to remove all the screws and press the first and last battery contacts out of the battery compartment. To push the contacts out you have to press the little release clip on the contact that prevents it from slipping back through the hole in the plastic. Once that is released, you can gently pry and work the plastic shell apart. Work slowly because it can get bound up and you could easily crack or break something. There are a few tiny pieces that hold the PC board to the upper case that will break if you are not careful.
Step 3: Repairing an RCX
I bought another RCX to do some more tinkering, and unfortunately it arrived with a lot of battery corrosion. I made another Instructable about the process I used to clean off the corrosion, which is a common problem with these RCX bricks. I'm very pleased with the results, but it was definitely a lot of work. If you find a set with a corroded RCX brick, you can replace it with one from eBay for around $20.
Step 4: Serial Port
There are some sets that came with a USB version of the RCX IR tower, unfortunately I don't have that one and serial ports are getting hard to find on laptop computers. I bought this USB to serial adapter because it has a very long list of supported operating systems and includes drivers for each. I also liked this one because it didn't have a wire so it just plugs onto the end of whatever serial device you have and converts it to a USB device. It works great and I have been very happy with this adapter.
I have since heard that the USB drivers are not supported in more modern versions of Windows. If you have the serial version, it still works in Windows 7 (32 & 64 bit) as long as you use NQC instead of the original Lego software.
Step 5: Software Possibilities
My set didn't come with the original installation disk, but I wanted to
try programming the RCX brick with the LEGO OEM software before branching out. Unfortunately, you can't find this software on the Lego website anymore. You can buy replacement disks on Ebay, but you can also find a few torrents still floating around where you can download the Lego Robot Invention System (RIS) 2.0.
The websites that tell you how to patch and install the old RIS software are slowly disappearing, but you can usually still find a website or two that is still linking to a site that used to contain some good information. I was able to paste these links into the Wayback Machine and gather the information I needed.
This software was originally written for Windows 98se, but it will still work under Windows XP (32 bit only) with patches that Lego distributed. Unfortunately, those patches are no longer available, so my best option was a virtual machine running Windows 98se. I downloaded Oracle's VirtualBox software which allowed me to create a virtual machine running 98, but I couldn't get the USB to Serial adapter I bought to pass through the host computer to the 98 client machine. I could have bought another adapter, or bought a USB version of the Lego IR tower off Ebay, but I decided to scrap the original plan and start with something that will work on my Windows 7 machine.
According to what I have read, the Lego IR USB tower has drivers that will work under XP, or Windows 7 32 bit, but not 64 bit. The serial tower will work in Windows 7 64 bit, but since most computers don't have serial ports, you still need the adapter. I recommend the serial tower and serial adapter I mentioned in the last step. I have used this under Windows 7 64 bit and they work great.
There are a handful of different programming languages (NQC (Not Quite C), ROBOTC, LEJOS, etc) or after market IDE's (BRICXCC, etc) that are available to use with the RCX. There is even a Perl package on CPAN that interfaces with the RCX through a serial IR tower. Since it seems like the most has been written about NQC and BRICXCC, I decided to go this route.
Step 6: BRICXCC & NQC
BRICXCC and NQC are terrific. The language is easy to understand for anyone who has any experience with C/C++ or any language with C like syntax. People familiar with Arduino will definitely be able to pick this up. The tools built into BRICXCC are very powerful, intuitive and robust. Here is one of the many great NQC tutorials available online.
To use the BRICXCC controls and my IR remote control, I had to update the firmware on my RCX brick with one of these OEM firmwares. You can use an after market firmware, but I wanted to keep things as original as possible to limit the troubleshooting later.
One odd thing I noticed while programming the brick with the IR tower, I was changing the channel on my TV and it caused the communication to fail. There is an awful lot of communication between the RCX brick and the IR tower, and while I had them right next to each other, the TV remote being used anywhere in the room caused the communication to fail. It also caused the TV not to get the signal from the remote.
Step 7: Final Thoughts
I got into Arduino before I ever bought a Mindstorms kit. I loved playing with Technic when I was a kid, but Mindstorms didn't come out until later. There are some quirky little things that I dislike, like how the brick loses your programs and updated firmware if you take the batteries out for too long. I assume this is because Flash memory wasn't very common until after digital cameras drove the price down. Overall, I really enjoy this set and I find that I could have avoided building more complex projects if I had Mindstorms to use in projects like my Mets Apple.
The RCX speaker is very easy to use and the BRICKXCC software includes a tool for converting music files to code for the RCX brick to play. The code is not all that different from how I have created music files (by hand!) for Arduino in my Mets Apple and Super Mario projects. In the future, if I need to make music with Arduino I will open up BRICKXCC and use their tools to generate the code I need and adapt it to fit Arduino. This is a big improvement over doing this manually.