Circuit Boards, Speech Module, and Wireless Modem

(article continued from previous page)

As discussed earlier, StreamHawk is a semi-autonomous robot capable of exploring various rooms in a house while transmitting video, sound, and data back to a PC. This page describes the circuit boards inside of the robot.

A side view of a wireless exploration robot.

A side view of a wireless exploration robot.

Most of my robots contain only custom-designed printed circuit boards (PCBs). However, many robot builders find it a better use of their time and brain-power to purchase off-the-shelf modules. So, due to the complexity of the wireless and speech components, StreamHawk is a combination of custom PCBs and off-the-shelf circuit boards.

Robot guts and electronic circuitry for the StreamHawk robot.

Robot guts and electronic circuitry for the StreamHawk robot.

Other than the speakers, motors, and LiPoly batteries, the robot’s circuitry consists of:

  1. Custom-made motherboard
  2. Electric motor connector adapter boards
  3. Digi/MaxStream 9XCite wireless serial modem
  4. Devantech SP03 speech module
  5. Transistor breadboard for enabling/disabling power to the camera and light
  6. Single AA cell holder for camera voltage boost
  7. Cut-off AC adapter power cable for the wireless camera
  8. Wireless camera with custom machined ring-light PCB
  9. Bicolor LED to indicate power on and robot state

An obvious problem of assembling a robot from misc components is that there are a lot of extra wires and connectors. If the complete robot was designed from scratch, all of the electronics could be combined onto a single board or pair of boards. That would save space and weight.

Robot Motherboard

The motherboard contains the key parts of the explorer robot. Everything comes together on this circuit board.

Custom-manufactured robot motherboard with voltage regulator, microcontroller, and four motor drivers.

Custom-manufactured robot motherboard with voltage regulator, microcontroller, and four motor drivers.

  1. Power Supply: The far left side of the motherboard includes a power connector for the batteries, a power switch, a reverse-battery protection MOSFET, a PPTC short-circuit protection resetting fuse, bulk capacitors, and a 5V voltage regulator. Smaller capacitors are scattered throughout the board, especially underneath. A 5.6V zener diode is snuck in beside the microcontroller (on the right side of the chip near the lettering “A6”). Thus, this board contains all of the best practices described in the book, Intermediate Robot Building. When the power switch is turned off, power is cut off from all circuits throughout the entire robot.
  2. Brains: The robot’s brains consist of a single Atmel AVR ATmega644 microcontroller. The microcontroller is programmed in C, but part of the program is a homemade interpreter to allow code to be written remotely in pseudo-BASIC. This model of microcontroller was selected because it includes plenty of space for my onboard programming language and the operator-generated program (64KB of flash, 4KB of RAM, and 2KB of EEPROM). Another benefit of the newer Atmel microcontrollers is that nearly every pin can generate an interrupt. This was critical for optimizing the motor encoder reads.
  3. ISP6 Header: The microcontroller’s embedded software is modified by connecting an Atmel STK500 compatible programming board to the 6-pin ISP connector on the motherboard. This is faster, easier, and more flexible than writing boot code to update the embedded software using the wireless serial connection.
  4. Serial Connector: The serial connection has +5V, RX (receive), TX (transmit), GND (ground), and a flow control pin. The flow control pin is discussed later in the article. RX and TX are set for 38400 baud, which is what the wireless module supports natively. If needed, the serial connector can be attached to a RS-232 converter and plugged into a standard serial port or USB converter on a PC.
  5. Infrared Remote Receiver: A Panasonic PNA4602 IR 38 kHz demodulator is wired to the input capture timer on the microcontroller. (The PNA4062M is obsolete. See the Vishay TSOP4038.) By reading the pulse lengths, the microcontroller can decipher commands from a standard Sony remote control. For example, aiming a Sony DVD remote control at the front dome of the robot allows it be manually controlled (play button=forward, stop button=stop, fast-forward and reverse buttons=turn right/left).
  6. Spare Analog Inputs: Surprisingly, there are some spare pins available on the microcontroller, as well as plenty of processing power. When I get tired of optimizing the dead-reckoning techniques, there are four analog-to-digital (AD) pins waiting for alignment sensors.
  7. Motor Encoders, LED Connector, and I2C: Two pins are used for the motor encoders and two pins for the bicolor LED. The LED is visible through the dome, just underneath the video camera. The LED can be solid red, solid green, or flashing either color. The I2C connector allows for a 400 kHz or higher data bus between multiple modules or microcontrollers. In this case, I2C is used to talk to the speech module.
  8. Motor Drivers: The StreamHawk motherboard contains four bidirectional Infineon TLE 5206-2 H-bridge motor drivers. Two motor drivers are presently used for powering the left and right Maxon motors. The two remaining motor driver chips are unused at the moment.
  9. Adapter Plate: The motherboard and the lithium-polymer cells are approximately the same width and length (2.5 x 3.8 inches). Although that means that the battery pack fits nicely underneath the motherboard, the motherboard’s mounting holes can’t reach the base plate at the bottom of the robot’s body canister. The solution is to extend the motherboard slightly with a thin piece of non-conductive Delrin plastic with mounting holes.

Devantech SP03 Speech Module

The off-the-shelf speech module can interface with I2C, an RS-232 serial port, parallel port, or ordinary switches. It uses 5V and hobbyist-friendly 0.1-inch header connectors. Free Windows software and documentation are available online.

The speech module is compact (about 1.6 inches square). It does a good job of converting ordinary English text into speech. On-the-fly phrases can be up to 81 characters.

Devantech SP03 speech module with speaker holes labeled.

Devantech SP03 speech module with speaker holes labeled.

Unfortunately, one of the common complaints about this module is that it isn’t loud enough, even with the volume set to the highest amount. When enclosed in the robot’s body, it was impossible to hear. So, I desoldered the attached speaker and added connectors for a pair of external cone speakers.

Two 8-ohm speakers can be wired in series for 16 ohms or parallel for 4 ohms. The output is much louder at 4 ohms. Connecting 4 ohms to a speaker driver that expects 8 ohms is technically abusive, and could lead to hardware failures due to overheating if wired that way on a cranked-up home stereo system. But, speech is used only occasionally on this robot -- so I doubt any harm will occur.

Besides being too quiet, there are a few minor issues with this module. (I apologize if I’m being overly critical, as I am satisfied with the purchase and I appreciate all the hard work that went into it.)

Devantech speech module protected by a plastic envelope.

Devantech speech module protected by a plastic envelope.

To protect the board when inserted into the robot, I folded and taped together an envelope made from moderately thick clear plastic recycled from common blister-pack packaging. A nylon screw and nut keep the board from sliding out of the open end where the cabling attaches. A nylon screw is a better choice than a metal screw for this application, since the idea is to toss the envelope on top of another circuit board. A metal screw could short circuit the other board.

Before trying recycled plastic, I previously tried ordinary press-and-seal sandwich bags. But, the speech module header pins poked holes through the thin bag.

Digi 9XCite Wireless Network

The other commercial hardware module used in the StreamHawk robot is a Digi 9XCite 38400 baud 900-MHz wireless serial modem. It can send and receive data wirelessly, as though the robot and computer were connected by a long serial cable. Seriously, it’s that easy.

The complete kit (part# XC09-038-DK) is $149. You'll receive two wireless RF modules, two RS232 development boards, two power supplies, and a bunch of cables and adapters.

Additional modules are available for $40. The module ID, ID mask, and channel can be changed on-the-fly, so the wireless module can have conversations with different robots or groups of robots.

Digi (MaxStream) wireless radio-frequency serial data modules.

Digi (MaxStream) wireless radio-frequency serial data modules.

This is the simplest setup.

  1. Wireless module connected to the robot’s microcontroller serial UART (universal asynchronous receiver transmitter) and robot’s power supply (2.85V to 5.5V). [Robot not pictured]
  2. Another wireless module with the same channel (hopping or single frequency) and ID as the other module.
  3. RS232 module adapter board to supply module power and to convert the data to RS232 voltage levels that the computer understands.
  4. AC power adapter.
  5. Standard DB9 serial cable connected to the computer.

On the computer, run HyperTerminal or write your own serial application using C, .NET, or whatever.

Unlike old-fashioned transmitters, the Digi 9XCite doesn’t care what data values are to be sent. Send a bunch of zeros in a row. It doesn’t care.

The wireless module automatically checks for errors and retries packets if necessary. (Actually, I have experienced lost bytes on rare occasions. But, my firmware was old.) The wireless data module has excellent noise tolerance and a decent range. Other frequencies and transmit power levels are available.

Although the maximum over-the-air rate is 38400, the module accepts data at up to 57600 and will buffer it. If the buffer runs low, either hardware or software flow control can alert the microcontroller to wait. I chose to use a single input pin for hardware flow-control.

Notes to be aware of:

Two smaller PCBs not discussed on this page are the motor connector adapter boards. Why are they needed...