Building transceivers

It is possible to equip any electronic device with a mindstorms compatible transceiver, which opens a variety of possibilities. Devices can send commands or informations to a robot or their behavior can be controlled from the robot. Very few standard components are needed to build a transceiver, a basic version is shown in the image below. Transmission data is injected into TX, received bits can be read from RX. Both pins use TTL signal levels which may be shifted to RS-232 levels if needed.

[transceiver circuit]

The LMC555 IC, C3, R3 and R5 form an 38 kHz oscillator that can be controlled by the reset input. A high level on TX shuts the oscillator down and no carrier signal will be emitted in this case. The output signal of the IC controls the driver for the IR LED IR1, consisting of T2, R4, R6 and R7. The driver makes sure that a current of abut 100 mA flows through the LED during transmission. The receiver IC2 needs no further components, it outputs directly the demodulated signal. The bypass capacitors C1 and C2 should be placed as close to the ICs as possible.

This circuit can of course be adapted to different environments.

  • If the transceiver should be connected to a microcontroller, its application can generate the carrier signal itself, eliminating external components for the oscillator. R4 and RX can be connected directly to the microcontroller in such scenarion.
  • The range of the sender can be increased by using several IR diodes in a serial connection. These must be driven by a higher voltage as every diode might cause a 2 volt drop.
  • The receiver module TSOP1138 can be replaced by a TSOP1738, but this will decrease the maximum transmission speed to 3800 baud.
  • Level shifters like MAX232 can be used t connect the transceiver directly to a serial port of any PC.

It is possible to build a fully compatible replacement for the tower using the basic circuit described above and adding a MAX232. This circuit does not need energy saving, so it is able to receive data at any time without the keepalive mechanism.

[serial port interface]

Lego Mindstorms Towers

The older serial tower and the recent USB version from Lego are mainly compatible, but they differ in their properties and the way they are programmed. The serial tower must work as long as possible with a 9 volts battery and used several tricks to reduce power consumption. It is disabled by default and activates only if real data shall be sent. Afterwards, it stays on for about 4 to 5 seconds. This makes sure that no energy is wasted by the reception circuit, but you need to send at least a single byte every 4 seconds to keep the tower alive if you want it to receive continuously. Many programs using this function name it keepalive mechanism.

The tower also receives its own transmissions because the signal is reflected back to it by walls or other objects in the environment. This could be used to verify data that has been sent and to detect collisions, but in reality this does not work reliably because of the temporal jitter caused by the serial port and its fifo buffers. The serial cable between PC and tower uses only the pins GND, RXS, TXD, RTS and CTS. RTS is looped back to CTS by the tower to allow programs to detect its presence. The other wires are used to transfer data into both directions.

[tower printed
circuit board]

Several improvements were realized with the USB tower. The device gets its power from the PC and thus doesn't need power saving tricks. It can receive data anytime without the keepalive mechanism. Detecting and avoiding collisions is done inside the tower hardware by analyzing the infrared echo, and this can be done reliably in comparison to the RS-232 counterpart. Several new functions have been planned for future extensions, including higher speeds up to 19200 baud, a configurable carrier signal and modulation scheme and the possibility to use radio frequency transmissions. None of these features work until now.

[USB tower
printed circuit board]