This repository is dedicated to the development of the predatory robotic fish, developed at the Theoretical Ecology and Evolution Laboratory, Indian Institute of Science.
The robotic fish developed was used to study the aggregation and swarming characteristics of the Serpae tetra species of fish.
-
The body of the Fish is made of extruded polystyrene (thermocol). The design was made in SolidWorks, and carved using a crafting blade.
-
The Fish is maneuvered using a joystick controller through the pygame library for Python. A list of supported controllers is given here. We have tried out a number of joysticks, such as the XBox 360 controller, and the Logitech Extreme 3D Pro Gamepad.
-
The Fish is controlled through an Arduino UNO, which communicates with the computer running
pygame
through a Bluetooth module, mounted on it's head. -
A SHARP Distance Sensor GP2Y0A21YK0F was used to judge the distance between the fish and obstacles up ahead.
-
The Fish was encased in a layer of polythene to ensure waterproofing while operating underwater. Specifically, the joints between successive links was encased in a skin-like layer of polythene.
-
The necessary propelling movements were provided by a series of 3 Tower SG90 Servo Motors.
-
A pair of 9V batteries were used in series to provide the necessary electric power for the operation of the fish.
-
The electrical connections are made as shown in the Fritzing diagram.
-
Once the connections are made and checked (to prevent short circuiting underwater!), the batteries are connected to the battery headers provided in the circuit.
-
The SHARP sensors are obstructed to check if the necessary commands are executed (in this case the
C_MOVE()
function would be executed). -
Once the Joystick.py has been executed, wait for 5 seconds as the EEPROM_Code.cpp script executes and flushes the EEPROM on-board the UNO to prevent interferences from previous stored values.
-
The Fish can be maneuvered as required using the left analog stick of the joystick. Three movements are possible:
- Forward- The Fish moves in an S-type movement.
- Left- The Fish moves in a C-type movement, deflecting towards the left.
- Right- The Fish moves in a C-type movement, deflecting towards the right.
- Obstacle Avoidance- The Fish moves in a C-type movement, deflecting towards the left.
-
The Fish operates either through the controls of the user, through the joystick, or it continuously moves in an S-type fashion, until it encounters an obstacle, thereafter which it executes a C-type movement.
You can check out the build-log for a detailed progress report.
-
Occasionally, the Bluetooth module on-board losses communication link with the Bluetooth on the PC. When this happens, close the pygame dialog and rerun the Joystick_Code.py script to establish control once again (this issue has now been resolved by connecting the Bluetooth module to a 3.3V voltage supply.)
-
The Arduino will reboot, if sufficient power is not provided. Thus, we suggest the use of LiPo batteries to provide a more reliable and lasting power source. We are currently using 12V, 2000mAh LiPo batteries (testing this right now).
-
Communication link between the UNO and the computer will not be active until the
EEPROM_Flush_Code.cpp
has been executed (approx 5 seconds), thereafter which the LED on the UNO associated with GPIO pin 13 will glow a bright orange (depending on the make of the Arduino board).