Encoder Front Page
SRS Home | Front Page | Monthly Issue | Index
Search WWW Search seattlerobotics.org

Autonomous Robotic Fish

Dan Massie dan@velocimech.com , Mike Kirkland, Jen Manda, Ian Strimaitis

An autonomous, micro-controlled fish was designed and constructed using sonar to help guide it in swimming. It was predetermined that constructing a mechatronic fish would be a large and demanding project due to the complex shape of a fish body, the unfamiliar territories of sonar sensing, the intricacies of fluid propulsion, and the challenge of keeping submerged electronics dry. However, the team was willing to put in a lot of time and produced an exceptionally successful first prototype by the name of Dongle.


Design and Construction

RTV Rubber Tail & Polycarbonate Head

The tail of the fish was made out of Room Temperature Vulcanizing (RTV) rubber, which is waterproof and flexible. The head of the fish was made by using a custom made vacuum formed shell of polycarbonate. The tail and head are each bonded to ABS flanges, and the flanges are screwed together with a gasket between them creating a waterproof fish body to protect the electronics.

The tail was first sculpted with soft-clay. A wooden box was constructed to house the clay tail as it was cast in REPRO, a solidifying molding mixture. One half of the clay tail was submerged in the REPRO at time. The two halves together created a negative impression of the tail. The RTV would be poured inside this void, creating a flexible tail. However, a void inside the RTV tail was required, so a REPRO "plug" was made. REPRO was poured into the tail mold and allowed to harden. Once removed, it was sanded down until it was the size of the required void. Now, an RTV mold could now be made from the three REPRO pieces. The original tail looked great but functioned less than adequately, so a second was made. The second tail had no top or bottom fins, and pieces were even shaved off to create a thinner skin in order to allow the servos to move easier.

The head was sculpted from a material called RENShape. It was sanded down until it reached a desired size and shape. Measurements were taken of the board and batteries to produce a perfectly sized head. A sheet of polycarbonate plastic was heated and vacuum formed on the RENShape head, creating a beautiful plastic head. This rigid head needed to connect to the not-so-rigid tailpiece. Two interfacing plastic flanges were machined to fit the head and the tail together. This connection created a waterproof seal with the help from a VCR drive belt which functioned as an o-ring.

Tail Servo and Gear Assembly

One of the highest priorities of the team was to have the fish swim as life-like as possible. The movement of the fish tail was controlled by two servos in series. In order to move the tail with the necessary amplitude to propel the fish forward at an acceptable speed it was necessary to increase the torque output of the servos. This was accomplished by adding an additional gear assembly for each servo. In doing this modification, which was necessary for the basic movement, the maximum amplitude of the tail's movement was limited in turning.



The BOTBoard with sonar electronics

A 68hc811e2 micro-controller was used to control all operations of the fish. A prefabricated board, called a BOTBoard, was purchased, and the 68hc11 and sonar circuitry was mounted onto it. This board-chip combination was chosen because it has an internal timer, multiple input and output ports, and the capability to control up to four servos.

The SBASIC language used to create the main program. SBASIC is a language designed specifically for the 68HC11 and HC12 chips. The SBASIC interpreter converts SBASIC code to assembly code, and then an assembler generates the downloadable S19 file. Finally, a special downloading program talks with the 68HC11 in bootstrap mode via an RS232/TTL cable connected to BOTBoard's serial port, and it loads the EEPROM with the correct object code.

The program perform three main functions: 1) move the tail servos in the correct pattern to produce forward and turning movements, 2) to sense objects in the water using sonar, and 3) avoid any objects in the water. View the final Program Listing.

Sonar Electronics

The transducer has a natural frequency of 200 kHz; therefore a 200 kHz input signal will cause it to generate an ultrasonic chirp in the water. Using an analog swtich IC, the same transducer can then act as a microphone listening for the resulting echo. The transducer converts this echo back into a sinusoidal voltage. The echo signal is passed though an analog band-pass filter/amplifier, which amplifies signals around 200 kHz, and rejects all other frequencies. This amplified echo signal is compared against a reference voltage, and the comparator's output is sent to the MCU. The circuit shown accomplishes this task.

Sonar Filter/Amplifier and Signal Routing Circuit


Symbol Value
R1 5.3 k
R2 105
R3 1 M
R4 1 k
R5 10 k
C1 1 nF
C2 0.022 uF
C3 0.01 uF
C4 0.1 uF
Circuit components

The software controlled the sonar as follows: for every timer overflow (signaled by the timer overflow interrupt) the program chirps the sonar, records time of chirp, waits briefly for ring to go away, and then starts listening for an echo. If an echo is heard (echo signal is connected to input capture pin and generates an interrupt) before the next TOF, the distance is calculated. If no echo is heard, the distance is null (or zero). Once an echo is heard, the board stops listening for echoes until the next chirp has occurred.

For the purposes of this application, the actual distance to a sound-reflective obstacle is not needed. Knowing that an object is in the way is all that is necessary.

NOTE: Transducer needs to be in the water to work correctly.
NOTE: Speed of sound in 20 deg C water = 0.0583 in/usec


Performance Discussion

Both the aesthetics and performance of the mechatronic fish turned out quite well. The fish is about 2 feet long and weighs approximately 5 lbs. It travels at about .2 ft/s (.14 mph) in calm water. The fish project was an absolute success, and it may well be the world's first autonomous robotic fish!


There were, however, a few things the team would change if a second prototype were to be constructed. The amount of control that the team expected to have with the tail was not as good as initially expected. The servos initially produced little torque, which corresponded to little movement. The team modified the servos to produce more torque creating a more forceful movement of the tail. Once the servos were modified to produce a powerful tail movement for swimming, the desired range of motion was limited from the gearing down of the design. It was determined that the servos also needed to be able to produce a larger range of motion when the fish is turning. The team concluded that the servos used were underpowered and unable to meet the performance expectations. It would be recommended to use servos with a higher torque output to allow for quicker and more forceful, full-range propulsion from the tail. This improvement will provide faster swim speeds and better turning abilities.

The RTV rubber used for the tail skin was of acceptable flexibility when the thickness was under 0.1 inches thick. As the walls increased in thickness the force required to bend the RTV rubber became too high for acceptable flexing for the low-torque servos used. It would be recommended to pay closer attention to the details in the skin thickness and geometry when constructing another tail skin. A slightly larger body would also be recommended to allow for more freedom in the design of the tail mechanics.

The sonar system used was very simple and allowed for distance sensing only. It would be recommended to add a second sonar transducer to give the fish a sense of relative closeness. In other words, it would know if an obstacle was on the left or right. This would lead to intelligent on course adjustments. Right now, the fish is simply programmed to always turn right.