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.
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.
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.
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.
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.