POCO : Programming Project : Robot Networks
The Big Idea

In my Robotics class, we're building simple robots out of Legos and Handy Boards and we have advanced to the point where we are ready for the robots to work together. We are trying to simulate a bee hive, and we need some way to transmit locations of nectar and other bee-goodies. The problem is, we cannot find an efficient way to transmit such information between the robots. After weeks of searching, I have not been able to find any information on such networks for Handy Boards. There have been a small number of attempts at using infared and other similar modes, but in our case, these have yielded less than encouraging results. Our idea is simple: to create a network between our robots capable of transmiting and recieving simple messages at a reasonable speed. Our initial trial will try to use radio communication. (The radios are actually gutted walkie talkies we got cheap from Radio Shack.)

Here is a picture of the walkie talkie stripped of all its extraneous parts. If you look real hard, you can see the holes where the microphone attaches. There are two holes on the bottom of the board, inbetween two resistors and a capacitor.Notice the antenna wire (the orange looking wire on the top), and the two wires we short together with the relay to induce transmissioin.
Hardware

The idea came to me as a fleeting thought: "How can we get these things to talk to eachother?" Reliability wasn't an issue at that point. After some initial reading and some playing with a bridge rectifier, a capacitor and a resistor, we managed to make the AC speaker output a DC voltage that the Handy Board could listen to.

Our conversion circuit is a simple rectifying circuit that makes the sound from the speaker output of the walkie talkies into an identifyiable voltage. The Handy Board can then monitor the voltage "highs and lows" being created by the walkie talkie speaker, listening to the noise transmitted by other robots. To transmit, we use a relay tied to one of the motor ports. By turning on the motor, we activate a relay which closes the transmit switch. Future versions could use a transistor connected to the only digital output available on the Handy Board. Once the walkie talkies are transmitting, we use the IR ports connected to the microphone inputs on the walkie talkies to create a sound. The best frequency we found was around 1000 Hz.

interfaceboard.jpg (7929 bytes)interfaceboard_b.jpg (9258 bytes)These two images are of the front and back of the interface board I made to go inbetween the walkie-talkie and the Handy Board. Note the relay and the rectifying circuit in the left hand picture.

I have been unable to remove noise and static from the signal, but I'm still working on that. However, I have had limited success with the boards, and I am planning on continuing my work over Christmas break.

Software : Protocol Specification

The Handy Boards have analog inputs which allow us to monitor voltage. By monitoring the voltage from the speaker outputs on the walkie talkies, we can detect when another 'bot is sending signals.Bits will be represented by the amount of time that the circuit is 'high' or there is voltage coming from the radio. In other words, a "1" would be a signal that is high for approximately 100 milliseconds, and a "0" would be a signal that is high for approximately 60 milliseconds. Similarly, a start bit would be represented as a delay that is longer than the "1"s and "0"s.

Packet Structure

Packets are what we will use to send information between the bots. Each packet will contain no more than eight smaller packets called frames. These frames are what will contain the bits of our transmission. Every packet will start with a "start bit" which has a longer duration than a normal bit. This longer bit will also indicate the start of a new frame. Each frame will consist of eight data bits. In addition, each packet will be terminated with a stop bit, similar to the start bit. An example packet is shown below.

I figured that the packets would need some sort of error detection, so I am going to try to implement Hamming Codes into the packet assembly and disassembly. The only problem is parity bits are used to detect inverted bits. What happens when a bit is missing? My thought on this is to time the distance between bits. If a silent time greater than a "1" occurs on a bit before a stop bit, then we've missed a bit and we'll assume its a "0"..

Each packet can be used for different purposes. For instance, a two packet structure could allow for a command / parameter structure for maintaining network services. This structure could be used for more than just network communication. For example, we could define a small, psudo-frame that consisted of four bits that represented up to sixteen different bot control commands. The remaining frames could contain parameters for the commands.

The Code

The current version of the code is available online, but it only supports the smallest number of these specifications. I chose to start with something simple and reliable and work by way up to something more complex. I did it this way because I've found the most reliable code and structures I've made have been ones that have been grown rather than built all at once.

Future Plans

I don't plan on stopping here. In the past few weeks, I've stumbled on a few web resources that have sent me in new directions. The first of which was the possibility of the use of the Handy Board's Serial Peripheral Interface (SPI). The SPI is a high-speed serial port that can be used to communicate with any SPI- capable device. Check out page 8-15 in the M68HC11 Reference Manual.If we were able to find a way to connect the SPI port of the Handy Board to some kind of D/A converter, we could possibly create a neat wireless packet modem. The reference manual for Motorola's 68HC11 processor (the one on the Handy Board) has a diagram that is something like what is shown to the right. The SPI generates a clock signal that can be used with a DAC. Bits can be sent along either of the MOSI (Master Out Slave In) or the MISO (Master In Slave Out) lines. Another neat idea is we could use the Slave Select (SS) line to initiate radio transmission (I'm just guessin' now). To go the other way, the 68HC11 has an on-board Analog to Digital converter. We could use it to change a recieved signal back into a digital stream.

Unfortunately I'm not an Electrical Engineer (although I thought about it), so I don't have the know-how to do ANY of these things. If you have ideas or any helpful information, I would LOVE to hear from you! I really feel that there is a future for this and with a little time, I could come up with something cool.

Some Interesting Links
Radio
Communication
Network Protocols and Specifications
Processor Information
DAC / ADC Information
  • Lab 1 - Some beginner engineering lab work with some slightly useful information about DACs.
Other Programming Project Pages
Untitled Document

Network communications for robots

A Mac-1 assembler

Static memory for LogicSim

A Simple Expression Compiler

A stack machine assembler

CS63
homepage

A 1-bit ALU hardware implementation

N64 architecture revealed

A simple machine using Logic-Sym

An 8-bit ALU using Logic-Sym

A stack machine simulator


Copyright © April, 1998, Jim Garlick (garlija@earlham.edu)
Copyright © 1997, Jim Garlick (garlija@earlham.edu).