Lego Robotics Invention System 2.0 Software



This article provides instructions for installing the necessary drivers to use the RCX USB tower with ROBOLAB for LabVIEW. These instructions have been tested on Mac OS X 10.9 and 10.10 as well as 32-bit and 64-bit Windows 7.

For RCX USB tower support…

1. Install LabVIEW for LEGO MINDSTORMS and/or the relevant MINDSTORMS add-on. See https://decibel.ni.com/content/docs/DOC-15615 for more details and links to these downloads.

2. Install ROBOLAB for LabVIEW.

Mindstorms Infrared Message Reader is an application for viewing, converting and logging infrared messages sent from the Lego Mindstorms Robotics Invention System 2.0 (RCX2). Lego Spike is the latest application of their research. Photo: Lego Back to basics. I remember when the original Lego Mindstorms, called the Robotics Invention System, came out back in 1998. Mindstorms NXT 2.0 combines the unlimited versatility of the LEGO building system with an intelligent microcomputer brick and intuitive drag-and-drop programming software. The new 2.0 toolkit features everything you need to create your first robot in 30 minutes, and then tens of thousands of other robotic inventions that do what you want! LEGO Set 3804-1 Robotics Invention System, Version 2.0 - building instructions and parts inventory. CD-Rom for Robotics Invention System Upgrade Kit (2.0). Mindstorms Education NXT Software 2.0 (Single License). Some LEGO® sets contain small parts that are.

3. Install NI-VISA…

  • Windows: http://www.ni.com/download/ni-visa-14.0.1/5023/en/
  • Mac OS X: http://www.ni.com/download/ni-visa-14.0/4913/en/

4. If installing on Windows, you will have to run the VISA Wizard

a. Find it in your Start menu

b. Choose USB:

c. Select the LEGO tower (the tower must be plugged in to appear):

d. Give your INF files a name (default is fine)

e. Allow the wizard to install and hit finish.

f. Restart LabVIEW and run ROBOLAB for LabVIEW (Tools > Robolab 2.9.4d…)

The following two tabs change content below.
I'm a teacher in Tasmania, Australia, and have been using LEGO MINDSTORMS with my students since 2001. I'm the editor in chief for LEGO Engineering (this site) as well as the content editor for LEGO Education Australia (LEGOeducation.com.au).
  • Obstacle Course - 26 August 2020
  • Crash Test Dummy - 26 August 2020
  • The Wave - 21 May 2020

Related Posts

A note to the reader: some of these links may be unreachable. I'mleaving them here if only to give credit where credit is due. Neweritems are added to the bottom of each section, so look there for news.

The LEGO®MINDSTORMS(tm) (#9719) product is a robot-kit-in-a-box. Itconsists of a computer module (the 'RCX(tm)'), and an inventory ofmany TECHNICS(tm) parts. It appears to be a productized version ofthe MIT Programmable Brick, as the following table will show you.

boxsizesensorsmotorsurl
Cricket:4x622url
RCX:8x1233url
Brick:9x1364url

The LEGO-Robotics Mailing List

A group of people have figured out how to talk to the RCX fromoperating systems unsupported by The LEGO Group. Wired Online has noticed us.

This group of people gathers at the lego-robotics mailing list.You may subscribe to this list by sending asubscription request. Nothing special is needed in the subject orbody of the message. You can also get off thelist. You can also read the mailing list via HTTP (web pages) or via NNTP at LUGNET, and if you want to receivemessages in digest format, LUGNET also offers news-by-mail delivery withseveral digest options.

General MINDSTORMS Info

You can buy the MINDSTORMS RIS (Robotics Invention System) at the stores listed below (presuming they have it in stock), and many fine toy outlets. Also available are RIS extension kits. Also available are two other, less capable, MINDSTORMS sets: RDS and DDK. Fred Martin has a robot builder's guide.

Places to buy MINDSTORMS (not a comprehensive list):

  • The Construction Site in Waltham, MA
  • Active Robots (UK)

Erik Brok has an introduction toprogramming with MINDSTORMS page.

Kin W. Lau has a page of resources for using MINDSTORMS in education.Franz-Michael S. Mellbin has one also.

Books

Jonathan Knudsen has written an O'Reilly book onLEGO MINDSTORMS. You can buy it at Amazon.He's got a bunchof links to LEGO and MINDSTORMS resources.

Michael Gasperi has, with Dave Baum, Ralph Hempel, and Luis Villa,written a book entitled ExtremeMINDSTORMS.

Joe Nagata's LEGO MINDSTORMS Idea Book

Mario and Giulio Ferrari, with Ralph Hempel as technical editor,have written BuildingRobots with LEGO MINDSTORMS.

Core LEGO MINDSTORMS Programming: Unleash the Power of the Java Platform by Brian Bagnall

Jin Sato's LEGO(r)MINDSTORMS(tm): THE MASTER'S TECHNIQUE is an excellent teachingbook on the details of how to put lego pieces together in ways you maynot have thought of before; ultimately those techniques are used tocreate MIBO, a dual-RCX, six motor dog. Slashdot Review.

Jim West has a page covering Mindstorms Books.

Notes

Todd Graham is working on a remote-control and remote-viewing robot he calls a Telerobot.

Cindy Salwen pointed out a description of the protocol for the serial interfacebetween the computer and the Dacta Control lab. This may or may notbe related to the protocol used by the RCX, but if you're reading thispage, it's probably interesting information anyway. She alsocontributes another URL: National Instruments (LabVIEW)pages. Robolab is available for sale from Pitsco.

FredMartin, arguably the father of the RCX (well, given that LEGOredesigned the Programmable Brick from the ground up for productionreasons, the *grand*father), has a page on LEGO MINDSTORMS.

Kekoa Proudfootsays 'toast that warranty!' He took apart his RCX and took somepictures of the inside of it. Healso looked up the numbers for some of the chips. Peter Ljungstrandbought a CyberMaster kit, disassembled the main unit, and took pictures.

Patrick R. Gili has some notes on disassembling the RCX

Dave Baum says that RCX toRCX communication is pretty simple. There's a low level command inthe RCX to send a message which contains a single 8 bit number aspayload (plus the protocol 'wrapper'). The RCX also remembers thelast 'message' it has seen, and this value can be used to makedecisions. Pretty basic stuff, but still enough to do some reasonablethings.

Dave also talks about the various LEGOmotors. The motors that come with MS are the 5225 Gear Motor.Such motors may be purchased at LEGO Shop at Home. Philippe Hurbainhas comparedLego 9 volt motors.

Dave is also 'pretty sure' there are 32 global variables that can beused in RCX coding.

Peter Liu says that 'Do you byte, when I knock?' is the key to UnlockFirmware().

Jonathan Woodward was curious about which colors of LEGO reflect infrared thebest.

Matt Jadud and Greg Hanek at Indiana University are doing a lotwith LEGO Robots.

So are Carlos Raez and Brenda Groff of the Fort Wayne campus.

Some students in a Luxembourg boarding school have a LEGOMINDSTORMS users' group called Robobull.

Dean Husby has building instructions for a device which expands theRCX's I/O called the (MS)2 Expander

ELPMIS trains students inSingapore in Lego Mindstorms, robolab and also RIS.

Building

Jim Studt built a public Magic 8 Ball. Enter yourquestion and press the Ask button, and you see a video of an RCXspinning the 8 ball, along with the final answer that floats to thetop.

René Schalburg wrote Creating aSpider Robot using LEGO-MINDSTORMS.

Doug Carlson has a four-wheel synchro robotwhich can move in any direction. He uses two angle sensors (availablefrom Pitsco/Dacta), and can make it move in a perfect square.

Wes Matchett built a differenttype of synchro drive.

Gavin Smyth has pictures of a walkerthat uses universal joints to make the leg rods 'bend'.

Alex Wetmore built a robotic platform using theplans for the adder/subtracter found on Leo's LEGO. The platformallows you the robot to get the normal four motions (forward, reverse,spin left, spin right) with a perfectly straight forward andreverse. One of the motors is used to move the robot forward andbackwards. To turn the robot left and right you use the other motor.

Fredrik Glöckner created a triple gait cycle hexapodusing the CyberMaster. He has other TECHNICS models.

Bill Clagett has a few TECHNICS and MINDSTORMS creations.

Robert Fay has posted pictures and a QuickTime movie of his new verticalmill.

Ben Erwin has the only site with K-12 RCX-related lessonplans (that he knows of).

Henrik Hautop Lund is the head of LEGO Lab at the University ofAarhus.

Ben Williamson has built several robots, including:

The FetchBot searches for dark objects to grab, lift and depositelsewhere. The grabber and the arm are driven by one motor. Thepage includes an animation of the arm grabbing a block, and photosof the gearing and cams that make it work.

The Truck is a robotic tractor-trailer vehicle with rack-and-pinionsteering. The tractor contains sensors and the steering and drive motors,while the trailer carries the RCX controller and an earthmover. The Truckcan back up in a straight line by using the sensors to determine if thetrailer is off centre.

BTW, he got some fun feedback from The Probe robot that he posted earlier,including mail from someone who works for Digital Instruments.Apparently they hold the patent on the technique that his robot uses, theyjust do it on a somewhat finer (nano) scale. Sounds like a theme for acompetition: how many patents can you infringe using LEGO? :)

Rich Thompson has been playing around with the 'radar' created byusing IR messages and has posted some pics and code examples (in BotCodesince the C skills are rusty, and BotCode feels more likeassembly...).

Chris Stanley made a radarbot bytransmitting IR data.

Dave Astolfo has pics of a Fire Extinguisher. It seeksout candlelight, and blows it out.

Simen Svale Skogsrud built a LEGO-scanner. He alsoput in descriptions and code examples for proximity-detection andusing the FOS-light unit as a rotation sensor. Be welcome. No actualpictures of LEGO creations yet, but lots of attractive illustrations.

Michael Powell's directional transmission shows one way to dodifferent things based on the direction of themotor.

Mario Ferrari built a two-leggedwalker

Jin Sato has made some niftyrobots.

Linda Hamilton is doing lots ofthings with her math classes.

Brian Cooper builds combat robots called InfraDreadnaughts.He demonstrated them at the MIT MindFest.

David Mattison has done some work on improving the IR Radar capabilities,and he's also designed a robot similar to Ben Williamson's probe, butscanning the ceiling.

As a group project at Loughborough University we have beendeveloping an autonomous explorer robot using LEGO MINDSTORMS. Theresults of this years work are now complete. From this linkclick on the 'planetary explorer project'.

In March Chris Busse ran a MINDSTORMS maze running competition fora company gathering, 'Geeks at the Beach' in Miami. 16 teams fromdifferent cities in 4 countries participated! Each team was given aMINDSTORMS kit, rules, and three weeks to prepare a robot that couldnavigate one of three possible maze routes. Pictures andrules are available.

Jennifer Clark built four TECHNICcreations: a dumpster carrier, a mini excavator, a skid steerloader and a mobile crane, which received rave reviews on the mailinglist.

A Lego-robot withcamera controlled by Matlab. The project goal was a robot that iscontrolled by Matlab in realtime using the cameras signal as input,combining image analysis and robotics.

Interesting robot withpneumatic lifts and a wireless webcam. It's controlled via acellphone over bluetooth to a Palm PDA talking to the RCX via IR.

Heroes

Kekoa Proudfoot has done the work to figure out the opcodesin the packets, which seem also to be the programming opcodes as well!He is a minordeity!

Programming

The LEGO MINDSTORMS Group has an official SDK. ThisTechnical Reference document tells you how to use SPIRIT.OCX directlyto write LEGO MINDSTORMS RCX or LEGO TECHNIC CyberMaster programs,providing more detailed control over the LEGO Programmable Bricks.

Thomas Dow is using his HP-100LX to generate RCX IRcodes.

Bjarne Rene has made a web page on how to make a C++program that can communicate with the RCX.

Paul Haas has a Perl program totalk to the RCX from a Linux box.

Owen Stenseth has some RCX perltools, to disassemble RCX opcodes.

Dave Baum has a simple C-like language called NQC(Not Quite C) that can be used to program the LEGO RCX. It runs onWindows, Macintosh, Linux, and OS/2.

Brian Connors has written NQCIPC,very simple interprocess messaging package for NQC for use onMINDSTORMS and Cybermaster. It provides semaphore services and asimple intertask messaging system, all implemented as NQC macros.

Kekoa has IRIX source for a very simple Unixtool for communicating with the RCX.

Laurent Demailly has written TclRCX.

Dario Laverde developed the first 100% Java API for theRCX. This RCX Java API Library is available with source code andexample applications.

Tramm 'Foo' Hudson has a program to downloadfirmware into the RCX.

Eric Brok has made a Visual Basic program (for Windows) that allowshim to control the RCX and download certain programs. The program iscalled MindControl. Mind Control can be used to interprete the user's owntext files (with Spirit commands).

Lego Robotics Invention System 2.0 Software

Sean Hearne and David Hanley at the Waterford Institute ofTechnology, Ireland, have put together a course for programming the RCXwith Visual Basic.

Gary Kacmarcik has written a H300 disassemblerin Perl. This script takes the firm0309.lgo file (which you'llneed to copy from your MINDSTORMS CD) and a separate comment file, andmerges the output of the disassembly with the comment file to producea commented disassembly.

There's a shareware BotCode program.Don't know much about it.

Gordon's BrickProgrammer is an alternative visual programming interface forMINDSTORMS. It provides a folding editor, symbolic variables, accessto the RCX data log, a simple debugger and its free!

Brian Cwikla has written a program editor/tester/debugger thatallows you to writeprograms for the RCX with all the functions listed in theMINDSTORMS SDK and not have to know VB.

Invention

Mark Overmars has created the RCX Command Centerfor Windows. It's a program that assists you in programming the LEGOMINDSTORMS Robots. It provides a higher level interface to the RCX,the programmable brick that forms the heart of the LEGO Robots. JohnHansen has made some changes to his version.

A new web page with examples of RCX programming using ROBOLAB.

Peter Hesketh wants to program the RCX in MS QBasic under DOS. He has written twoprograms so far: a talkrcx and a firmware download, both of which willwork on any PC with DOS and QBasic.

Andy Bower has written Bot-Kit, aninteractive object oriented environment for the RCX and Cybermasterusing the Smalltalk programming language. It uses the Spirit OCX as abase and runs under Win95/98 and NT4 systems.

Ralph Hempel has a firmware replacement which runs forth, called pbFORTH.pbForth has a GUI.

Ralph also has a suite of Tcl/Tk tools for theRCX.

Malcolm S Powell has written Gordon's BrickProgrammer as a replacement for the MINDSTORMS ProgrammingEnvironment. Tree view based instead of blocks: point and click toadd commands, drag to move them, allows variables, and nested loops.No C or Visual Basic programming required!

Chris Stanley has a utility called RCXInterrogator. It will (hopefully) tell you everything there is toknow about the state of your rcx: variables, sensors, motors, memorymap and more.

Nick H. has written WebSpirit, which enablesyou to control the RCX Via the ActiveX Control, and JavaScript

Richard Maynard has written Brainstorm which is aUCBLogo version for MINDSTORMS. Win95/NT.

Denis Cousineau is distributing RCX_command.RCX command is a program editor for the LEGO RCX programmable brick.Using RCX command, you can build programs, and download them to theRCX. You can also send immediate command (ex. PlaySystemSound, orPBTurnOff). You can also retrieve information from the RCX usingcommands such as Poll, or MemMap. RCX commands are compatible with theLEGO SPIRIT.OCX library. Complete documentation is available on theLEGO MINDSTORMS web site.

Kekoa's librcxis intended to be a lowest-level driver for the LEGO RCX. It providesan interface between your C code and the ROM. The intent is to allowyou to easily explore the ROM interface. It is also possible to usethis code as a starting point for writing something moresophisticated, along the lines of LegOS. Librcxrequires the GNU H8 development environment.

Scott Lewis has a 100% pureJava interface for communicating with the RCX. It provides anobject-oriented interface for downloading tasks/subroutines into theRCX, as well as sending arbitrary RCX commands. Source included withGPL license.

David Van Wagner has written codeto write simple programs onscreenusing the RCX buttons. Version 1.0 contains only enough functionalityto be useful. Gotos, Outputs, and Delays are implemented with amaximum of 16 instructions. Later releases should have morefunctionality.'

Jan Newmarch wrote a Jini/MINDSTORMSdriver as part of his Jini tutorial.

Aviv Eyal has been programming his RCX using Java and Visual J++6.0 COM features. He's generalized the code so others may use hisclasses to program RCX programs (tasks+subroutines) from Java. Hecalls it MJSDK -MINDSTORMS Java Software Development Kit.

Mitchell 'the dude' Wagner and a fellow CS major at IndianaUniversity have been working on a version of Scheme forthe LEGO Robots.

Jose Solorzano has a JVM for the RCX. Healso is working on leJOS.

John C. Quillan has a perl module to allow you to communicate withyour RCX, called LEGO::RCX.

Daniel Berger has an interfacein VC++ which accesses the serial port directly (without thespirit.ocx). It also describes how to enable streaming video input inVC++ and how to use the video image to control the robot.

Jos van Kempen has made a spirit2.ocx with most ofthe functions from spirit.ocx but for RCX2.0 and USB.

legOS

Markus L. Noga has written some replacement firmware: legOS-0.1. legOS allows you toprogram the LEGO MINDSTORMS RCX in assembler and standard C. Beyondthe bytecode barrier, arrays, structures, pointers and arbitraryuser-defined data types await.

Luis Villa has written a legOSHOWTO.

Dave Madden has a web-basedcompiler for legOS. Drop your C/C++ code into a form, presssubmit, and you get back a link to the compiled code.

Marco Beri and Mario Ferrari just released the first version of emulegOS,a software emulator of legOS and the RCX itself. Emulegos is C/C++code to compile and link together with your own legOS code. So it'snot an application but requires a development system. Our firstversion runs under the Borland C++Builder IDE, but we put a greateffort in keeping the code as much portable as possible, so itshouldn't be a pain to move it to other platforms/compilers. We'llappreciate anybody's help in this.

Barry Fagin is teachingrobotics programming using ADA and theMINDSTORMS system.

Jason Gilder's Computer Engineering senior design project was spentcreating a new programming language for the Lego Mindstorm. It uses Asynchronous StateMachine (ASM) charts to illustrate the behavior of the robot.

TinySoar is an implementation of the Soar artificial intelligence architecture that is intended to run on amemory-constrained device, like a robot.

CommonLisp and Scheme implementations for Mindstorms. Marc Feeley ofthe Universit=E9 de Montr=E9al specialises in embeddedScheme interpreters (extremely small footprint) suitable forMindstorms.

Peter Whalley has developed a language for the RCX called actor-lab. It's a parallel,object-orientated control language designed to introduce the ideas ofcontrol technology and robotics in the classroom. It's a zero-costdownload for Mac and PC.

Communication

The RCX uses a 38kHz carrier, which is pretty typical for TVremotes. As for the sampling rate, the RCX runs at 2400 bps, whichmakes each bit approx 417us. Sony remotes (which aren't the fastest),use pulse widths of 600us and 1200us, so we're in the right ball park.I think a learning remote would do pretty well.

Peter Middlestorb reports that a learning remote does indeed work.He used a Casio Model 1174 CMD-40 watch.

Robert Eddings says that the OmniRemote successfully learned andplayed back the LEGO MINDSTORMS command codes. He has a page with atrained OmniRemote.

Pacific Neotek havereleased the OmniRemote Development Kit, and RoboRemote, which givesyou simple and complete control over your LEGO Scout and RCXMINDSTORMS (like the official MINDSTORMS Remote Control) with anIR-enabled PalmOS device.

The IR protocol associated with sending a 'message' to the RCX is prettysimple. Bit encoding is 2400 bps, NRZ, 1 start, 8 data, odd parity, 1stop bit. A '0' is coded as a 417us pulse of 38kHz IR, a '1' bit is 417usof nothing.

At the packet level, all packets look like this:where D1...Dn are the message body, and C = D1 + D2 + ... Dn.

The data for sending an IR message is F7 followed by the 8 bit 'message'.For example:is a packet sending the message '0x12' to the RCX.

Kekoa writes:

The scheme used to transmit data results in an equal number of zero bitsand one bits, allowing a receiver to compensate for a constant signal bias(caused by ambient light) simply by subtracting the average signal value.Note that the header also has an equal number of ones and zeros; this warmsup the receiver before the real data arrives.

The data portion of each message starts with an opcode. An opcode iseither a request (PC to RCX) or a reply (RCX to PC). Requests have 0x80clear, replies have 0x80 set. The reply corresponding to a given requestis the request's complement and vice-versa. Opcodes seem to come in pairs;that is, there are two opcodes to specify each request, and there are twoopcodes to specify each reply. These 'dual' of a given request or replyopcode is the exclusive or of that opcode with 0x08.

Example:
Op 0x10 Alive Request / Op 0xef Alive Response
Op 0x18 Alive Request / Op 0xe7 Alive Response
0x10 and 0xef are complements
0x18 and 0xe7 are complements
0x10 and 0x18 differ only in 0x08 bit
0xef and 0xe7 differ only in 0x08 bit

Dave believes the IR device loops back DTR/DSR, and the PC softwareuses this to detect if the IR device is attached.

Kekoa has a trace of a firmware downloadsession.

Vadim Strizhevsky and Owen Stenseth have a program which lets yousend and receive packets from RCX on a Palm Pilot viaserial line. It can also decode/encode the packets and find out if RCXis on-line.

Mike Kory wrote a Palm Pilot program to control the RCXthrough a serial cable connected to the RCX's IR tower.

Lego Robotics Invention System 2.0 Software

Len Holgate tells us about WebRemote. The WebRemoteDevice Controller allows you to control devices across a NetMeetingconnection. If you have devices to control then you simply run thedevice controller, add the drivers for your devices and connect toNetMeeting to make the devices available. If you want to controlsomeone's devices then just run the device controller and connect toNetMeeting. Once connected available devices will be displayed. Youcan select a device to control and if you don't have the appropriatecontroller installed you can download it from the web automatically.

Kevin Gott has developed a program called Remote Control X thatallows someone to control their RCX by using a game contollervia the infrared transmitter.

MindstormsIR-communication, by Stef Mientki, written May 2001.

Michael Brownjohn write a server in VB using Winsock andspirit2.ocx, to allow people to send commands over anetwork to the server, to then control an RCX 2.0.

RC commands

Lu contributes the following table of RC commands:
Command Parameter(s) Vague explanation
On (outport A/B/C) turn on one or more things connected to port(s) A, B or C
OnFor (outport A/B/C)(time in tenths of a second or random)
Off (outport A/B/C)
SetPower (outport A/B/C)(1=low to 8=max)
SetDirection (outport A/B/C)(left or right)
ReverseDirection(outport A/B/C)
Wait (time in tenths of a second) possible values are 1-3276
Beep (sound type 1 to type 6)
Tone (frequency)(time in tenths of a second) possible frequency values are 0-20000 (a chart shows places middle C at 523) possible time values are 1-25
ResetCounter set the built in counter to 0
AddToCounter adds 1
ResetRotation (inport 1/2/3) to 0 if an angle sensor is connected
ResetMessage clears a received IR message
ResetTimer reset to 00:00
SendToRCX (integer 1 to 255) send IR message to another RCX
Flow control
Check&Choose (sensor 1/2/3)(True/False) pick sensor(s) connected to port 1, 2, or 3 and check the status
Check&Choose (counter/timer/RCX)(value range)(True/False) here's where you check for a message from another RCX
Repeat (integer or random)
RepeatForever moms just hate this
RepeatWhile touch sensor (1/2/3) repeat while sensor is pressed
' timer (0-3276) while timer value = preset val
' counter (0-32767) '
' RCX (1-255) while message val = preset val
' light sensor (1/2/3)(dark range/bright range) there are 2 ranges with a total range from 0-100
WaitUntil (sensor 1/2/3) until sensor condition is true
Sensor Watchers
Touch (sensor 1/2/3)(pressed/released)
Light (sensor 1/2/3)(dark value range/bright value range)
Rotation (sensor 1/2/3)(0 to 160)(forward/backward) 16 counts per rotation
Temperature (sensor 1/2/3)(cold value range/warm value range) C or F
Counter (range from value/to value) 0-32767
Timer (range from value/to value) in tenths of a second 0-3276
RCX (range from value/to value) 1-255

CPU

Kekoa writes:

Here are the specs on part number HD6433292,which you can see in the picture of the bottom of the circuit board:
Series H8/3297
Product name H8/3292
Part number HD6433292
ROM size 16K
RAM size 512
Speed 16MHz @ 5V
8-bit Timers 2
16-bit Timers 1
A/D Conversion 8 8-bit
I/O pins 43
Input only pins 8
Serial port 1
10mA outputs 10

Thanks to Patrick Gili for pointing Kekoa toward the Hitachi page withpointers the chip's manual in various formats.

Lego Robotics Invention System 2.0 Softwaren System 2 0 Software

Sensors

Rotation and temperature sensors are available from Pitsco.

Dave Baum relates: The rotation sensor works very well for thissort of thing. Its 'raw' value is one of 4 analog voltages, each ofwhich correspond to a 22.5 degree segment within a quadrant. Simplybased on raw readings, it is impossible to tell which quadrant thesensor is in. However, the RCX firmware samples this sensor quitefrequently and can keep track of how many quadrants have been 'movedthrough'. The end result is a reading that tells you the number ofrevolutions in 1/16 of a revolution increments. Sample rate isgood...I have been able to use the sensor directly on the 'gear' motorand not miss any rotation. In one of my models I then geared down themotor by a worm -> 24t and a 8t -> 24t gear reduction. The result wasI could measure the position of the gear reduced 'arm' at better than1/3 a degree.

Frank Angeli disassembled his lightsensor. He has pictures, too. MichaelGasperi figured out the light sensor schematic.

Malcolm S Powell has devised a simple optical sensorthat can sense linear motion or rotation.

Wes Matchett has been working on constructing atouch sensor from parts of old devices. He discovered that themicro switches from a MS mouse and a Logitech mouse are the exactwidth of the inside dimensions of a 2x LEGO brick. Here are theinstructions and two pics of the results. The price is right, $0.00

DCPMicro has some sensors for sound, voltage, temperature, pH,angular position, humidity and air pressure. They have created an interface to make them workwith the RCX.

Wes Matchett constructed an IOExtenderthat uses relays to increase the number of sensors & motors the RCXcan use. The IOExtender connects the RCX to a total of 6 sensors and4 motors, if this design is pushed to its limit. This version isdesigned to allow the RCX to control the syncro drive mentioned above.

Dan L says 'You can place a 1X2 beam in front of the light sensor.This blocks the LED but not the sensor.'

Don Hewitt has built a rotation sensor from theExtreme Creatures Fiber Optic parts.

Bert van Dam has a page for his robots, and homemade sensors. He also has dataand programs in Visual Basic.

Likewise for Michael Gasperi, who has a MINDSTORMS page that talksabout how thesensors work, as well as some building he's done, in particular, arecreation of Gray Walter's robotic turtle. He also has a bookentitled ExtremeMINDSTORMS, written with Dave Baum, Ralph Hempel, and Luis Villa.

Michael Nielsen has some great info about implementing RCXsensors.

Dennis Clark has a homemade sensor to do IR proximitydetection.

Peter Smoldershas some homemade sensors and a hexapod robot.

HiTechnic manufacturesa range of sensors, controllers, and mechanical accessories forrobotic projects, many of which are compatible with LEGO MINDSTORMSproducts.

Some folks at Trinity College in Hartford, CT that created a customsensor for an IRdistance sensor. No more banging into walls to detect them!

Many many lego-compatible sensors are available from Mindsensors. They use a PCBwith brick-compatible holes that plugs into a connector brick.Excellent stuff here.

Hardware

Chip numbers, as discerned (with a magnifying glass!) by Kekoa,with some additions from Martin Legault and Mark Bellis. Mark hasreverse-engineered schematics for the IR tower[Brickshelf], RCX power supply[Brickshelf], and RCX sensor interface[Brickshelf]. Welldone, Mark.

Numbers for elements on the top (LCD side) of the board (power connector onthe right), moving generally from left to right:
2 IR LEDs ?
1 IR receiver TK19 / TFM. / 749 / 1380
1 The CDC-P83 is an NPN transistor, type BCX68-25, 20V, 2A, hfe=250, pin-out ECB, tab=Collector CDC / P83
8 PNP transistors scattered on left half BC858B
3 NPN transistors scattered on left half BC848B
1 capacitor to right of IR receiver leads 4.7uF
3 red cylinders w/ two black lines, two leads diac
5 resistors, yellow label on black 10K
1 resistor, yellow label on black 1M
5 resistors, yellow label on black 2.2K
1 resistor, yellow label on black 22K
3 resistors, yellow label on black 3.3K
3 resistors, yellow label on black 39
1 resistor, yellow label on black 47K
3 resistors, yellow label on black 10K 1%
1 resistor (?), yellow label on black IRD (?)
1 resistor (?), white label on green 560
3 Probably capacitors for power line filtering ?
1 LCD display ?
1 speaker (under LCD) ?
1 LCD controller (under LCD) PCF8566T / 61875 / YSM98061
1 metal can capacitor, 100uF H2 / 100 / 16V
1 voltage regulator LM2936M-5
1 power connector 8 (on back) / 22 (on top)
12 scattered brown boxes are capacitors ?
24 scattered diodes SM 4002
12 clips ?
Numbers for elements on the bottom (microcontroller) side of the board(power connector on left), moving generally from left to right:
1 small chip, leftmost on board, zener diode, 6.8v Z5 / P / 7d
1 N-channel MOSFET with schottky flywheel diode, type RFD3055LESM (Fairchild)F3055L / H7 / 01
1 tantalum cap 10uF, 6V
2 small chips, right of 3055, three leads 3K / P / 81
1 gray box, two leads ?
3 motor controllers (?), 16 leads ELEX 10402B / 9980A 4597
1 bank of three input NAND gates, 14 leads 74HC10D
1 small chip beneath 74HC10, zener diode, 6.2v Z4p
1 small chip above right of 74HC10, three leads 1K / P / 82
1 bank of flip flops, 20 leads 74HC377D
1 crystal, above microcontroller 16Mhz
1 small chip above microcontroller, three leads P 005
1 microcontroller, 64 pin QFP HD6433292B02F
1 RAM, 32K (?), 28 pins D43256B60-70LL / 9752XD077
1 capacitor, upper right, two leads 4.7uF
1 small chip, right edge center, three leads 3K / P / 81
1 small chip, right edge bottom, three leads 1K / P / 82
1 resistor, yellow label on black 10
1 resistor, yellow label on black 100
1 resistor, yellow label on black 10K
10 resistors, yellow label on black 100K
1 resistor, yellow label on black 12K
1 resistor, yellow label on black 150K
4 resistors, yellow label on black 22K
1 resistor, yellow label on black 220K
1 resistor, yellow label on black 330
1 resistor, yellow label on black 390K
6 resistors, yellow label on black 47K
1 resistor, yellow label on black 470K
4 brown boxes, two leads ?
Software

Paul Haas has figured out that the RCX generates a signal which cancontrol a servo. His Hitec HS-300 servo responds to 1 millisecond(ms) pulses by rotating to one extreme and 2 ms pulses by rotating tothe other extreme. You can make the RCX generate pulses like that.It takes 3 resistors to get the voltage right and the wave form shapeclean enough. His Servo is only rated up to 6 volts, so he used 4 AAbatteries for it. Now the servo goes to either extreme under thedirection of the RCX.

John Kittelsrud wrote step-by-step instructions on a way to connect R/Cservos to LEGOs.

Allen Martin wrote something about H8 interrupts.

Johann Borenstein has written a bookentitled 'Where Am I? -- Systems and Methods for Mobile RobotPositioning'. While it's about non-LEGO robots, it's got quite a bitof applicable information. This book, which you can download forfree, contains nearly 300 pages with *great* illustrations. It's apretty weighty tome, though (comes in at over 13.5MB, but is in PDF(Adobe Acrobat) format).

Terry King has made some homemade LED bricks. The two pictures 2leds.jpg and 2ledcopp.jpg are pretty self-explanatory.

Mathias Uhr reports that the power circuits are different betweenrevisions. He writes:I disassembled all versions of the rcx bricks and had alook at their power circuits.Here are the results:

  • RCX 1.0 (with power plug)
    • The two inputs (plug and batteries) are completely independent. There isn't even a direct ground connection between them.
    • The external power source is rectified with a bridge rectifier (4 diodes), filtered with 6 caps of 330uF each and then stabilized with a voltage regulator ic.
    • The positive pole of the battery first runs through a diode to avoid voltage applied to the batteries from the external source.
    • The internal batteries don't get disconnected when an external power plug is inserted - at least not mechanically.
  • RCX 1.5 (mine says '1.0' on it, but has no power plug) and RCX 2.0
    • The RCX 1.5 and 2.0 versions seem to have an identical circuit.
    • The sophisticated stabilization circuit is omitted (no caps, no regulator, no rectifier diodes and no plug of course).
    • Instead, there's a big cap (1000uF) - probably to keep the memory when changing batteries - and a ferrite 'ring' (probably for some kind of filtering if someone still connects an external power source) behind the battery input.
    • I couldn't find a diode behind the positive battery pole.
    • The piezo beeper sits where the 6 caps have been in 1.0, no longer under the display.

    Conclusions:

  • The RCX 1.0 (with power plug) is the one to get! it has a great power circuit. Lego is obviously cutting costs by omitting all these parts in RCX 1.5 and 2.0. Since you can use 2.0 soft- and firmware for the 1.0 as well, there is no reason to use something else. Get as much of those sturdy oldies but goldies as you can!
  • Because of the rectifier circuit in the 1.0, the polarity of the external power plug doesn't matter, you can even attach an ac source (which i tested) and even more than 12v (which i didn't test, don't sue me!). I wouldn't recommend this though, cause the regulator ic would then probably produce too much heat.
  • For my 'accu pack application', this means that it is perfectly safe to attach an accu pack (or any other power source) of up to 12v to the external power plug of an RCX 1.0 along with normal batteries in the brick! It has, however, to be tested first, which ones get consumed quicker. For charging, the accu pack can remain connected, as long as the charger's voltage doesn't rise above 12v. but I still recommend you disconnect it from the RCX...

Electuur has an I2C Interface for Lego RCX 'Brick'.

Repairing adamaged RCX button using a spare rubber button of a cheapcalculator.

Firmware

W. Craig Trader writes:

Since the RIS software downloads the firmware to the RCX brick, itshould be possible to identify the firmware and disassemble it; I'mguessing that ...FirmFirm0309.lgo is the firmware file. I looked atit and it appears to be in Motorola S-recordformat.

Matthew Cross writes: I have sucessfully built a set of binutilsthat can disassemble the RCX firmware.

  1. Download binutils source: ftp://prep.ai.mit.edu/pub/gnu/binutils-2.9.1.tar.gz
  2. Run the configure script with the option--target=h8300-hitachi-hms. I also added--prefix=/usr/local to install it under /usr/local. Thenrun 'make' and 'make install'
  3. To disassemble the RCX firmware: /usr/local/bin/h8300-hitachi-hms-objdump -b srec -m h8300 --disassemble-all Firm0309.lgo

Lego Robotics Invention System 2.0

I just disassembled it last night and will be starting to analyzeit today. I'll be very interested in trading notes with anyone alsoworking on this. Be sure to snarf a copy of the h8/300manuals.

I believe that they would operate the chip in mode 2 - Expandedmode with on-chip ROM. So the memory map should be the center one onpage 60 of h83297h.pdf (the hardware manual). It seems that they havean on-chip ROM because there is no external ROM on the RCX board, andalso note that the S-Records load at address 0x8000, which lines upwith where the external address space starts on this memory map.

Olof Åstrand has similar instructions for NT users:

  1. download cygnus cygwin32.
  2. Then download the gnu binutils.
  3. Install the cygnus package. Create a /bin directory. Copy sh.exeto there.
  4. Unpack the gnu-binutils. Winzip will do this for you. I think youhave to help it with the extentions ( .tar.gz or .tgz).
  5. In a Cygnus-shell, at the binutils toplevel, type

I did get some errors when compiling ldemul.c but the rest of thetools installed fine. They install under /usr/local/bin. This is onyour default disk. To access other disks use //c //d .

Copy Firm0309.lgo firmware.srecThen do /usr/local/bin/h8300-hms-coff-objdump -m h8300 -D--no-show-raw-insn firmware.srec > firmware.s

Now you should have your firmware dump.

Kekoa has instructions on getting acomplete ROM image. He also has a writeup on how to download new firmware to the RCX.

Lego Robotics Invention System 2.0 Software Download

Dick Swan measured the time it takes to execute an RCX instruction.

Lego Mindstorms Invention System 2.0 Software Download

Send suggestions for improvement to Russell NelsonLast modified: Fri Jan 19 14:08:35 EST 2007