EE281 Project - Ioan Tudosa

Stanford University, Fall 2001


Since I have designed it only as a prototype it doesn’t have a nice shape but a functional one. Depth Control as two components, a transmitter and a receiver. The receiver has a feedback loop implementing a PID control. It senses the depth via a pressure sensor, a Motorola MPX series. Then a volume change is made by a syringe that pumps water in/out, actuated by a stepper linear motor from Thompson-Airpax. The RF link is unidirectional from transmitter to receiver with LC433MHz pair from Linx Technologies. Two microcontrollers Atmega163 are the backbone of both receiver and transmitter, providing the user interface and the PID feedback loop.


The principal mechanic part is the linear actuator, conveniently attached to the end of syringe. The specs of the motor can be found in the catalog of Thomson-Airpax. Basically, it is a stepper motor with the rotor threaded inside, where a shaft is moved in/out. The body of the prototype is a water-tight plastic can that has two holes at the bottom, one for the syringe head, and one for the pressure sensor. There is a tube linking the pressure sensor to the outside environment. Other than this, there is no more moving parts, the transmitter being just a box with buttons and LCD display.


The drive of the stepper motor is done with 4 pins of the Atmega163 using a power buffer (the 8 Darlington transistor array ULN2803A) to handle the 3W of the motor. ULN2803 can handle voltages up to 50V and currents up to 500mA, and has built-in high voltage spike protection (the windings of the motor act like a auto-transformer, so one needs a diode to limit the inverse voltage). The drive sequence is for a unipolar stepper motor.

The MPX pressure sensor are integrated silicon, on-chip signal conditioned type. First I bought a 5050 gauge type one, but this has a pressure range of about 50kPa (5m H2O) and with 10 bit (1024) A/D Converter of the Atmega163 I get 0.5 cm resolution, not very satisfying as the last digits are affected by noise. So I bought also a MPX5010 with a range of 10 kPa (1m H2O), improving the resolution and limiting the range by a factor of 5. So now I have mm accuracy down to 1 meter depth.

The A/D conversion is done 64 times and averaged to improve signal to noise ratio (thermal noise is random so the average over a large number of samplings is zero). To further improve the conversion I use a special sleep mode of Atmega163, where only AD Converter is running, minimizing internal noise, the MCU being woken up by conversion complete interrupt.

The RF link is a LC433 pair module that has only 3 useful pins VCC.GND and DATA. It accepts TTL/CMOS logic level, and the voltage can be from 3 to 6 volts. This link is well suited for serial communication up to 5Kbit/s and it has a small package and low power consumption for a rage up to 300 feet. The only thing I have to do is to connect it to TX and RX pins of the mega163.

The transmitter part implements the user interface part using a mega 163, three push buttons, four potentiometers and a LCD 2x16 character display (hd44780 type controller).

For the receiver I use Lithium based batteries to get a good weight/energy ratio (about 1900mAh at 3.6V). I use 2 batteries one for the microcontroller and one for the motor to decouple the noise coming from motor, and also to protect mega163 in case of high voltage spikes.

Software Interface

Basically I have provided one button for changing different modes of operation for the other buttons and potentiometers. I use a potentiometer for setting the depth; the digital value converted is transmitted to the receiver and has to match the pressure reading. If not matching, the PID loop enters to adjust the position until the transmitted and sensed value match.

The PID loop has to be tuned, and since I cannot access the receiver I use 3 potentiometers to set values for P,I,D parameters from 0-1000 (using 10 bit A/D conversion channels). Potentiometers are easier than push buttons to set large values fast. Optionally I provided three variables for parameters range, basically a scalling factor by 10 to a set power. Two up/down buttons are for setting these range variables.

I transmit these data as a string of bytes with special start and end sequence (“AAA” and “ZZZ”) so that the receiver can make sense of it. I don’t format or convert to string the values read from potentiometers or up/down buttons, I just send them as ASCII characters, and the receiver will interpret them using the start and end sequence flags.

The LCD displays on the upper row the mode and the value being changed, and the set depth on the lower row (maybe I’ll use a bar graph if Ihave time to code it).

Another Picture