The Lego RCX, Inside And Out

Ranked #231 in Hobbies, Games & Toys, #2,328 overall

A Collection Of Details On Using and Working With The Lego RCX

The Lego RCX is a superb microcontroller, genre defining- and this is all about the amazing things you can do with one, getting hold of one, and building awesome stuff (like robots!) with Lego. Find out here to get up close and inside the RCX.

Included is some basic info on the device - what it looks like, what kits it was part of, and why I think it was genre defining.
Also is information on programming and my personal favourite way to program it.

I have included information on opening up the RCX so you can get inside it and see what makes it tick - this can serve either as clear instructions on taking a look and putting it back together, or taking a look at the closeups and chip identifications to save you having to butcher your own RCX. Since they have become rare, there is some info and links to places to buy an RCX so you can reproduce the experiments here and generally have fun playing with it.

On the more advanced side here, there are circuit diagrams for interfacing with the RCX for getting power from both motor and sensor ports, and also for building active sensors. Finally there are links to other sites and books with a great deal more information to get the best out of this cool toy.

Although it is becoming a little long in the tooth, having been succeeded by the NXT, it still holds its own as one of the really great things created by the Lego Company.

The RCX was truly genre defining. Although there were robotic controllers available before, even those that interfaced with construction toys, This was an accessible, easily programmable, versatile controller. It came with all the kit needed to build quite sophisticated robots, wheels, gears, axles. It also came with all the programming software and leads needed (often an extra for other kits). It came with plenty of information and instructions, and the software was not a dry language IDE, but a full interactive introduction to the kit. The RCX and Mindstorms was available to the consumer as well as schools, at a reasonably affordable price. It has an online community maintained by Lego, and made it easy to become a member of it. Designs and programs are still being swapped now. It was this kit, and the accessory or lightweight kits like the Droid developer kit, the Mars Mission kit, Vision Command (which included a web cam and computer vision software), that started a new glut of hobby robotics. This hit a few years before robot wars, and resulted in things like the "Real Robot Magazine". Other toys started to catch on, but still, none have the versatility or accessibility that the Lego ones do.

The Lego RCX, combined with the Lego Robotics Construction Kit that it was sold to in retail, brought many people who had though they had grown out of Lego back to buying and using Lego. It also brought many others into building robotics.

The RCX has been used in schools and extra-curricular children's clubs, including one I ran myself from 2004 to 2005. It can be used to teach children engineering principles, mechanical concepts, control engineering and programming, about the use of sensors and motors and many other useful lessons. It is also great fun to tinker with.

Take my Squidoo Lego Survey!

I'd love to hear about you and Lego - what your favourite ever models were, how long you've been playing with it, and which models you'd most love to see Lego bring back.
Loading

Lego RCX Basic Details

The RCX is a Lego computer, capable of controlling 3 Motors, or more with some tricks, and respond to inputs from a 3 or more sensors. It houses a simple microcontroller, and is sold as a complete package with software, building bricks, interfaces and firmware designed for Lego and their MindStorms brand.

RCX is an acronym for the Robot Command eXplorer.

The version 1.0 RCX has Lego part number 884u.

It comes as part of the Robot Inventor Sets (RIS 1.0, 1.5 and 2.0), and is shipped with an IR communication tower and windows software. As of version 2.0 - the tower is USB, before this it used a 9 pin serial cable.

It was also shipped with Lego DACTA sets intending the RCX for use in classrooms. These generally came with multiple RCX's.

The V1.0 came with an external 9v power jack, that was later ditched. I have seen this used with other kinds of battery packs - thus allowing the bottom panel to be empty. This can lead to better even distribution of weight and other advantages.

It is commonly programmed in RCX Code, but Lego also provided Robolab for the DACTA users. There were many other languages, for example NQC, produced by hobbyists.

What is Lego Dacta?

Now known as Lego Education

Lego DactaLego DACTA is the School consortium branch of the Lego company. It is sold through a number of outlets, and some of the older kits may be available via Bricklink or eBay.

The Dacta range includes some excellent robot building kits- including multiple Lego RCX kits, and Robolab software, as well as specialist stuff like the Lego energy centre "eLab" including the Lego Solar Panel. There is an up-to-date range now for the NXT and Power Functions sets.

A number of UK Redistributors are prepared to sell this to hobbyists and small Lego clubs or groups. It is also a good way to get bulk sets.

Lego RCX Books and Gear

The Lego RCX is no longer available, but there are many books on the subject worth reading, as well as accessories, and even some to allow the newer NXT controller to be used with kit from the RCX generation.
Loading

Programming The Lego RCX with NQC

NQCThere are many programming languages for the RCX. While I was using it a great deal, I found NQC made the most sense to me.
NQC is an acronym for "Not Quite C". It is a C-Like programming language, API and compiler toolkit aimed at Lego's range of Programmable Bricks. Being an embedded C programmer by trade, it was an obvious choice for me.

Learning a more advanced language like this is a vital step in working with Lego Robots as it gives you a great deal more control and flexibility than the supplied MindStorms, CyberMaster or SpyBotics software. It gives access to more programming concepts than the construction toy style SDK's provided. On the downside, it could be more complicated for those not familiar with C, and for those who are, its differences (the not-quite aspects) may be a little frustrating.

The language draws highly from C, although some concepts, like the way tasks are handled are fairly specific to the language. It has a few caveats - like not being able to return arguments from subroutines and having a limit of subroutines (which is governed by the target - RCX 1.0, RCX 2.0 etc.). These limitations mean that you will often need to use global variables.


task main()
{
  OnFwd(OUT_A);
  OnFwd(OUT_C);
  Wait(200);
  Off(OUT_A + OUT_C);
}


NQC is a command line compiler, and not a development environment, so I suggest using it with a text editor - for example Gedit on Linux, Notepad++ on Windows or Textmate on the Mac. The NQC website has the details for installing it on windows, although it is a bit more involved on the Mac and Linux. NQC does not require the original RCX software to be installed to run.

Some other advanced systems for programming Lego P-Bricks are LegOS and BrickOS. NQC is the easiest, but the others are also worth a look.

Even more NQC info

Loading

Low friction RCX rotation sensor

The RCX has an optional rotation sensor that could be bought for it, but they are now fairly difficult to get hold of. They also used a brushed contact based system for sensing, so could be prone to wear and introduce friction into your drive chain. On the positive side, the RCX could have its sensor ports set into a mode that would automatically count the revolutions based on the sensors encoding.

I investigated ways to make a friction free sensor, and while it requires a little more programming than using the rotation sensor, it also has the benefit of being able to be constructed from parts shipped with the Robotic Invention System (the basic RCX kit).

The animation below shows the basic construction, which can be altered to suit your model, but the important thing is that the light sensor is close to a pulley wheel, with light and dark round studs pressed into it to give a readable pattern to show rotation.
powered by Youtube

Lego Mindstorms on eBay

eBay often has many Mindstorms kits going
Loading

The RCX Specifications

The Lego specifications first:

Its part number is 586346. There are two types of version 1- one with, and one without an external DC power input. The DC power input was a useful

Max Length

12 Studs (Approx 95mm)


Max Width

8 Studs (Approx 63mm)


Max Height

4 Bricks/12 plates/40 mm(including top studs)


Weight(with Batts)

Approx 250g





Weight(without)
I will post the measurement without when I do not need to retain the batteries!

It uses 6 AA batteries - with a combined voltage output of 9v.

It has three input(sensor) pads, and three output motor pads - all using the Lego stud type connector.

It has an LCD display, capable of displaying 5 digits(with a little walking man between them).

Internally it uses a Hitachi "H8/3292" MicroController.

The output ports can output 9v, and use PWM techniques to control motors speeds. It does not adjust the actual voltage output - so take this into account when driving circuits from it.
It uses three MLX10402CA motor controller chips(one for each port).

Inside The RCX

Photos of The Innards

Other robot kits for kids

The Lego mindstorms kits are a little pricey, so if you are looking for alternatives as gifts for kids (or big kids!), then please take a look at my robot kits gift guide!
Loading

Opening An RCX

If you are very technically minded, as I am, you may be the sort that would like to open an RCX, just see what is inside it. I have provided plenty of information to help you get a lot from it without needing to, but sometimes if you have that itch, you just have to try it.

I will start by making it clear that this is not something you want to do unless you really know what you are doing. If you do try this - I can offer no warranties for broken or non-working RCX's as a result.

This said - there may be benefits from this. First - you can get a better idea of the innards of the beast. Secondly - you may wish to wire it to an external power source, or use it to power other devices, although the better method for this is to make a simple battery box insert with a notch for the first, and use a brick style connector for the latter.

If you are really determined to disassemble your RCX, please read the safety guide and continue. Please note that after doing this you will need to re-flash the firmware and upload your programs again.

Safety Requirements
You will be prying this open, so please wear goggles as things may ping up at your face while doing this.
Please work in a well lit desk area - this will minimize your chances of breaking something, loosing something, or injuring yourself with a prying tool.
The voltages in the RCX are low, and you will remove the batteries, so there are no special considerations needed there.
That said, you may wish to wear an anti static band to reduce your the low chance that you might fry the circuits on board.
Tools
A flat-head jewellers screwdriver.
Steps
First you will need to remove the battery box, and all batteries.

Then lift one side of the battery holder carefully, and observe two slots, using a fine flat head screwdriver(or jewellers screwdriver) - insert into one of the slots, keeping the cover face down, and click the PCB off the clip holding it to the yellow front cover. Repeat on the other side. These clips connect the PCB to the input/output pads so do not damage these.

Keep it face down - so stuff like the pads and buttons do not fall out. At this point, you should have a PCB clipped to the battery holder. There are clips keeping the two together - which can be undone by rotating the PCB carefully clockwise, and sliding it out from these.

To reassemble - follow the same steps backwards. You may need to lightly bend the power clips down before popping the board back into place.

Items recommended For Opening The RCX

These items will help you to open up and look inside an RCX. Make sure you don't skimp on the tools, or the safety gear.
Loading

Details on the Hitachi H8

The Hitachi H8 is the microcontroller serving as the main processor on board the RCX.
Specifications:

Lego Chip Exact Name

HD6433292VF10


Clock Speed

10Mhz


ROM

Mask ROM (As opposed to a PROM )


Internal ROM

16 kb


Internal RAM

512 bytes


Registers

8 16-bit or 16 8-bit


Package

64-Pin QFP (FP-64A)





The H8 operates in three modes, The three modes are:

Mode 1

Expanded Mode with on-chip ROM disabled


Mode 2

Expanded Mode with on-chip ROM enabled


Mode 3

Single-chip mode



Getting Hold of an RCX on Ebay

The RCX is quite hard to find, especially at a good price, and while the more recent NXT has a lot to offer, this is still a classic kit. It is worth asking a seller if the RCX can come with a DOA guarantee so you will get it in working order.
Loading

Getting Power From an RCX Motor Port

When powering some devices from the port that are not motors, you may require a smooth current that is not pulsed.

Normal operation of the RCX motor ports produces a PWM - Pulse Width Modulated signal, where the power is turned off many times a second, and it is the ratio of on power to off power that will determine the speed of a motor. This signal is not suitable for more sensitive electronic devices.Also, as the Lego connectors are multi-way, you will want to rectify it for a circuit that will only take power one way.

A circuit is required to smooth and rectify this signal.

This can be done in a simple way by using a diode bridge to enforce the polarity, and a capacitor to smooth it. This will give an almost constant voltage. There will be some ripples.

The diodes will drop the voltage by about 0.6v each.

By setting the output on full, you can leave out the capacitor - but this still means at any orientation you will have two diodes in series, one at at the positive and negative terminals for your circuit, so you will have a current drop of around 1.2v - and end up with a total output of 7.8v.

The circuit diagram is simple, and used with a Lego connector will allow you to use it with the RCX and also the Cybermaster devices.

Building a Powered Sensor For The Lego RCX

RCX Active Sensor SchematicThe RCX supports two modes of sensor, passive sensors, which allow simple devices like switches and resistors, or active sensors. Active sensors can draw power and return a signal.

This active mode drives the sensor port in a cycle, where one part of the cycle is power, and the other part of the cycle is used to read from the sensor.

You can either use this to drive your own sensors, or power other devices. Note that the output current here is pretty low at only around 50mA. Also you will only get around 7v with this circuit. This is more than enough for a number of recent electronic devices where 5v can power them.

D1 to D4 should generally be low power diodes - such as the 1N4148.

Changing R1 will change the characteristic of the output curve from any connected sensor. Recommended resistances are 1k, 2.2k or 4.7k.

Getting The RCX Software Running On Newer Machines

The Lego RCX IR TowerComputers are now running Windows XP, Windows Vista and Windows 7. The Lego Mindstorms software for the RCX with the original Robotics Invention System is now nearly 10 years old and will not always run on them. With a little perseverance, and a few patches, there are many ways to get the RCX working.

It is one thing to get it running with the likes of NQC and Lejos, but another to get the original CD and its presentations working. It not only requires somewhat dated driver interfaces, but also an older version of flash, in some areas that are no longer backwards compatible.

The first way is to consider using Virtual Box. This allows you to forward USB ports and serial ports to a virtual machine, in which you can then run an older version of Windows and then run the original Mindstorms disks as is.

You may get somewhere in using an older version of Quicktime to prevent errors in the default software. The exact version needed is 6.5.2 for the RIS 2.0 software (the most recent). This can be downloaded from Oldversion.com.

Virtual Box is freely downloadable at Virtualbox.org. You will just need a version of Windows - I recommend 98 as there are no patches needed for it. Just make sure you use it only for Mindstorms and do not go on the net with it.

In Windows 7, with the more expensive editions (which you can purchase through an Anytime upgrade), you get a version of Virtual PC, with an older version of Windows running in it, for just this kind of compatibility problem. However that is XP, and the compatibility patches that Lego were hosting have long since been removed.

Unfortunately, Lego do not support the consumer RCX so much any more, so you may need to look for files on their education site.
LEGO Education - MINDSTORMS®: download.

For a simpler route in terms of drivers and so on, you may find NQC and Bricx Command Centre easier, although programming them takes more work and patience.

More Lego Lenses

Please enjoy some of my, and other lensmasters articles on Lego. There is plenty to read on a toy that inspires such passion and creativity.
Loading

More robot lenses

I love all things robot, both Lego and non Lego.
Loading

Bookmark My Lego RCX Info

If you found my info on the RCX informative and fun, please bookmark and share it so you can find it again later.

Add this to your lens »

Bookmark and Share

What have you done with an RCX?

Have you used the NXT? Would you like to get hold of one?
If you have some info to add, or comments to make, please let me know. They don't need to be all sugar coated - I can take criticism if you think there is something to fix here.

HTML is permitted, comments are moderated for relevance and content.

submit
  • Reply
    skiesgreen Feb 9, 2012 @ 7:05 pm | delete
    It all sounds a but technical for my old brain but you have given so much good information and obviously know the subject well. Blessed and featured on Blessed by Skiesgreen 2012 and also on Games for Young and Old. Hugs.
  • Reply
    Dave Jan 25, 2012 @ 8:41 pm | delete
    My only laptop that had a 9-pin connector was repo'd by my workplace, forcing me to accept a laptop with only USB ports. Is there a way to get the original RCX software to recognize the IR module through a USB? (I installed a USB -to -9-pin cable, and installed the cable software, but the Lego RCX software still won't recogize the connection).
  • Reply
    dannystaple Feb 6, 2012 @ 4:41 pm | delete
    This is a wild conjecture, but perhaps with some driver trickery you could do so. Have you tried simply assigning the USB serial port to a low port number - COM1/COM2?
  • Reply
    aprilandcaleb Dec 27, 2011 @ 9:48 pm | delete
    I have an Lego Mindstorm RCX that I dissembled. I got a new set and am selling the older set on ebay. Problem, I was asked if the RCX had corrosion so I opened it up and there is none. Now I am tried everyway possible to put it back together and I can't get it to work. It was working before I dissambled it. :-(

    Anyhow I even made sure the clips are in place and I still cannot get it to work. Please help. Do you have any photos of the assembling the inside of the RCX back together again?

    Thank you
  • Reply
    dannystaple Dec 28, 2011 @ 5:24 am | delete
    Hi there. When you say it doesn't work - what happens on it?
  • Load More

Love My Lego RCX Lens?

Please give me a thumbs up if you enjoyed reading this.

This module only appears with actual data when viewed on a live lens. The favorite and lensroll options will appear on a live lens if the viewer is a member of Squidoo and logged in.

Add this to your lens »

About Danny Staple

Loading

Anyone come across Kleekbots? iPad NXT control?

18/01/11 1:58 pm

Some awesome team have gone and built software so your IOS (iPad/iPod/iPhone) can control the Lego NXT via bluetooth!

Rather awesome I think.

Kleekbots Vid on youtube

Website: http://www.kleekbots.com/

To all robot/Lego/Mecanno or gadget builders in London

14/12/10 8:02 pm

It is quite short notice, but I have a friend looking for someone who would be able to exhibit on Saturday the 18th December in the Greenford area.

The event is a Winter Wonderland, and the gadget should have a visual wow factor aimed to impress 10 yr old kids and adult fans of Lego or similar gadgetry.

It is in Ravenor Farm, Greenford, UB6, and you can get in touch with me, or with jim (underscore) wong at hotmail dot com if you have something, and he will provide further details.

The space is 2m by 1m, or 2m by 2m, and the exhibit will be shown between 11am and 4pm, with setup from 9:30am, on the 18th.

The space was previously occupied by some mecanno gadgetry, but the exhbitior will not be able to make it.

You'd also be able to promote your gadgets, club or site at the event.

Again - email jim underscore wong at hotmail.com.
Thanks,
Danny

Writing about my favourite hobbies- Lego and Robotics!

17/01/10 12:26 pm

I decided it was about time to write about the Lego RCX, which combine my love of Lego with my interest in robotics. It gets better because in this lens I talk about opening one up to see what is inside one. I present to you The Lego RCX, Inside and Out. Enjoy!

by

dannystaple

I have two children - a girl and a baby boy, and we live in West London, Uk. I program computers for my day job. In my spare time I build stuff, grow stuff,... more »

Feeling creative? Create a Lens!

The Lego Mindstorms NXT 

NeXT generation Lego Robotics

LEGO Mindstorms NXT 2.0 (8547)

Amazon Price: $262.91 (as of 02/14/2012)Buy Now

While the RCX was groundbreaking, the next Mindstorms level is the NXT. It uses Bluetooth, USB and comes with a high-level programming interface. This is the perfect Christmas or birthday gift for either a very technical child, or an adult that loves to tinker. A recipient of an NXT would not be disappointed!

My Lego Blog 

What am I getting up to with Lego today?

Loading Fetching RSS feed... please stand by