Electrical
This project contained two separate electrical systems: one in the watercraft, and one in the helm. The watercraft was reponsible for receiving wireless data, and translating that to craft motion. The helm was responsible for collecting user input, and transmitting the appropriate signals wirelessly to the craft.The Craft
Block Diagram of Craft Electronics
Zigbee-PIC16F690 Board
The Zigbee board performs most of the control of the boat. The Zigbee module receives data from the helm, and sends it to a PIC16F690. This PIC runs code that decodes the incoming data, sends back data if necessary, lights the team affiliation indicator LEDs, and controls the PWM board via SPI. The PWM functionality was off-loaded from this PIC due to the inability to readily output multiple, different PWM duty cycles simultaneously from a single PIC, as well as to the project specification requiring us to implement inter-processor communication in the project.
PWM Board
As forementioned, the PIC on the Zigbee board outputs SPI data (containing 3 duty cycles, and 3 directions) to the PWM board. This board contains 3 PIC16F690s. Each PIC runs identical code, but at startup reads its 'address' from 3 lines on the PIC to determine which motor it is controlling, and which SPI messages it should be monitoring. From the stream of SPI data, each PIC isolates the message intended for it, and extracts the correct duty cycle and direction from it. Each PIC then uses the PIC16F690 hardware PWM subsytem to drive a single 5208 motor driver board. Because of the two wire input to the 5208 boards, the logic for forward and reverse PWM on the chips is accomplished through use of the register settings for the PWM subsystem which control the output to be active high, or active low, and pair this change with a change in the state of the second bit.
Power Board
The power board on the craft controls the distribution of power from three standard 1500 mAh hobby batteries. To keep logic power independent from motor/pump power, all circuitry except for the 5208 driver chips operates off of a single 7.2V battery, which is regulated down to 5V by an LM2940CT-5.0 chip and then distributed among the other boards on the watercraft. The high current actuators are driven by two unregulated 1500 mAh batteries operated in series at 14.4 V.
The Helm
Block Diagram of Helm Electronics
Helm Power Board
The Helm Power Board runs two batteries in parallel. This 3000 mAH, 7.2V supply is then fed into the E128 (since it has an on-board regulator), and two 5V regulators (for the other electronics). We used two regulators so that each one only has to source half of the 5V current supplied to the helm.
Zigbee-E128 Board
In the helm, the Zigbee board includes a Zigbee module, which sends and receives wireless data, and routes that data to an E128 for processing. This board also serves as the interface between the iButton and the E128, and between the analog sensors (the accelerometer, the force-sensing resistor, and the microphone board output) and the E128.
Schematic of the E128 Zigbee board
To sense the operator's voice and determine our throttle setting, we used an electret microphone. The signal generated by the microphone was faint, and due to the nature of sound waves, resulted in an AC signal. The circuit, seen below, conditions the signal to increase the output voltage and low-pass filters it allow for a consistent A/D reading on the helm. All op-amps shown here are on LM324N chips.
The first stage powers the electret microphone and amplifies the signal 501 times. The second stage both buffers the circuit to prevent a current path to ground and rectifies the signal, cutting off all negative voltages. The third stage, a non-inverting amplifier, amplifies the signal another 1001 times, but also uses a virtual ground to cutoff any DC offset introduced by the first stage (amplification of base noise). The virtual ground uses a simple voltage divider and a potentiometer to allow for tuning of the exact output voltage. In case we had trouble tuning, a jumper was present, allowing us to connect the top of the voltage divider directly to +5V, thus creating a constant, and known, virtual ground output. The output of the virtual ground itself is buffered. After the second amplification stage, we used another buffer. The final stage is a low pass filter with a cutoff frequency of ~ 8 Hz (7.96 Hz). This smoothed the incoming signal so that a fairly consistent A/D reading could be recorded.
The output was a steady voltage proportional to voice volume, varying almost linearly from 1.5 V to around 3 V.
E128 Digital Board
The E128 Digital Board handles all of the digital I/O for the E128. All of the LEDs on the helm are plugged into the digital board, including the 7 segment display. The two digital inputs, the special buttons, also are connected to this board.