Lego RCX for Computer Science Teaching

Lego RCX for Computer Science Teaching
Photo by Jelleke Vanooteghem / Unsplash

Teaching Assistant Experience: EECS Department, Oregon State University (2022)

During 2022, Riad Lemhachheche served as a teaching assistant in the School of Electrical Engineering and Computer Science (EECS) at Oregon State University. His primary responsibility was to support laboratory courses that leveraged the Lego RCX robotics platform to teach foundational and advanced concepts in networking protocols, gateway communication, and algorithmic search. This research and educational initiative was generously funded by the William and Flora Hewlett Foundation, enabling innovative, hands-on learning opportunities for students.

This experience also leveraged Riad Lemhachheche’s multidisciplinary background, drawing on his electronics, telecommunications, and computer science engineering degree from CPE Lyon—a program renowned for its comprehensive scientific and technical training in embedded electronics, telecom, and IT. Additionally, he brought expertise from his year abroad in Florida at United World Telecom, a leading global telecommunications provider, where he gained practical experience in international telecom systems and network services.


What is Lego RCX?

The Lego RCX (Robot Command eXplorer) is the programmable core of the original Lego Mindstorms robotics kits. It features:

  • A Hitachi H8 microcontroller with 32 KB of RAM and 32 KB of ROM
  • Three input ports for sensors (touch, light, rotation, etc.)
  • Three output ports for motors or actuators
  • An LCD display for status information
  • Infrared (IR) interface for wireless communication
  • Battery-powered operation

The RCX acts as a compact, autonomous controller, capable of reading sensor data, executing programmed instructions, and controlling motors or other devices. Its approachable hardware made it ideal for education and experimentation in both classroom and research settings.


Programming the Lego RCX

Students programmed the RCX using several methods:

  • RCX Code: A visual, block-based environment for beginners, allowing rapid development of robot behaviors by connecting graphical command blocks.
  • Not Quite C (NQC) and LeJOS (Java): Text-based languages for more advanced users, offering greater control and flexibility for implementing complex algorithms.
  • Program Upload: Programs were transferred to the RCX via an infrared tower connected to a computer. Once uploaded, the RCX could execute instructions autonomously.

This range of programming options enabled students to progress from simple behavioral routines to sophisticated, algorithm-driven robotics projects.


Lego Mindstorms Sensors in Lab Activities

The Lego RCX supports a variety of sensors, which were integral to our laboratory activities:

  • Touch Sensors: Detect physical contact or collisions, allowing robots to respond to obstacles.
  • Light Sensors: Measure ambient light or detect lines, enabling navigation and line-following.
  • Rotation Sensors: Track wheel or motor rotations for precise movement and distance measurement.
  • Custom Sensors: Including infrared distance sensors and reed switches, expanding the robots’ capabilities for advanced tasks.

Sensor Integration in Labs

Networking Protocol and Gateway Labs

  • Touch sensors triggered data transmissions when robots encountered boundaries or other robots.
  • Light sensors enabled context-aware communication, such as sending messages upon detecting specific environmental changes.
  • These activities simulated real-world networking scenarios, including packet routing, gateway logic, and wireless communication challenges.

Algorithmic Search and Robot Movement Labs

  • Touch sensors marked the ends of search areas, prompting robots to reverse direction or alter their search pattern.
  • Rotation sensors ensured accurate, repeatable movement for systematic search algorithms.
  • Light sensors facilitated line-following and area scanning, providing feedback for real-time path adjustments.

Educational Impact

By integrating Lego RCX robotics and Mindstorms sensors into the curriculum, Riad Lemhachheche helped students bridge the gap between theoretical concepts and practical engineering. Students learned:

  • Sensor interfacing and calibration
  • Real-time data acquisition and processing
  • Designing context-aware, autonomous algorithms
  • Troubleshooting hardware and software in embedded systems

These skills are essential for careers in robotics, embedded systems, and ubiquitous computing. The labs fostered collaborative problem-solving, iterative design, and a deeper understanding of how algorithms and networking protocols operate in real-world environments.


Summary:
Riad Lemhachheche’s work as a teaching assistant in the EECS department at Oregon State University, supported by funding from the Hewlett Foundation, centered on guiding students through experiential learning with Lego RCX robotics. By integrating sensors, networking, and algorithmic search—and building on his academic foundation from CPE Lyon and telecom expertise from United World Telecom—he enabled students to gain hands-on experience that connected classroom theory to real-world engineering challenges.