Introduction: Automata Aquarium
This instructable, composed of other instructables, details the process of creating an animatronic aquarium complete with a 4 degree of freedom fish positioning system and light up jellyfish that come out in the dark. This was a project for the spring 2012 Things That Think class at CU Boulder.
Step 1: Creating Fish
The fish represent the first of a few components for this system, pieces whose construction is described by our instructable at https://www.instructables.com/id/Model-Fish/
Step 2: Jellyfish Construction
The Jellyfish construction process is outlined at https://www.instructables.com/id/Lighted-Jellyfish/.
Step 3: Servo Modification
We outline the process for modifying sub-micro servos for use in this aquarium at https://www.instructables.com/id/Sub-Micro-Continuous-Rotation-Servo-Modification/, focusing on the cost-effective Hitec HS-55 models.
Step 4: Create Positioning System
We describe the process of producing and assembling a four degree of freedom wooden positioning system at https://www.instructables.com/id/Laser-Cut-Wooden-4-Axis-Positing-System/. We also promise that blindly linking to our other instructables will stop soon.
Step 5: Creating the Wooden Frame
The wooden frame can be constructed to fit your specific parameters. However, we suggest a large lower compartment for the positioning system and an upper compartment for hiding the jellyfish. We stuck wax paper on that upper compartment but anything opaque or semi-transparent will do.
Step 6: Add Light Sensor
We mounted the light sensor on the top of the frame and ran its long wires down the side of the frame on the inside as to avoid the casual gaze of onlookers. We attached its 10K resistor at the breadboard for ease but it could also be included up above as well.
Step 7: Mount Jellyfish
Cut out a half circle of wood approx. 3 inches in diameter and attach this to a servo. Mount this servo on one of the top edges of the frame. Hot glue about 16 inches of fishing line to the top of each jellyfish. Attach a long piece of wood across the top of the frame and drill a hole in the center. On the bottom of this cross piece screw in an eye hook at every spot where a jellyfish will hang. Rout the fishing line from the jellyfish through their eye hooks and up through the hole in the center of the wood. Hold jellyfish at the desired heights and knot all fishing lines together. Tie a longer piece of fishing line around this knot, pull it taut, and glue it to the half-wheel on the servo. If needed, more eye hooks can be added on top to route the fishing line to the servo wheel.
Step 8: Wiring
We placed an Arduino Mega at the bottom of the 3D positioning system with a small breadboard, a setup with power distribution simply facilitated by jumpers and the Mega's 5V port. Admittedly this step was a bit of a pain but, using the default code, the following pin assignments are used:
Light sensor on AIN pin 12
Control line for the x servo on digital line 4
Pot feedback line for x servo on AIN pin 4
Control line for the y servo on digital line 5
Pot feedback line for y servo on AIN pin 5
Control line for the z servo on digital line 6
Pot feedback line for z servo on AIN pin 6
//Control line for the theta servo on digital line 7 (disabled in stock code . . . see code step)
//Pot feedback line for theta servo on AIN pin 7 (disabled in stock code . . . see code step)
Jellyfish servo control line on digital line 9
Jellyfish LED control on digital line 12
You will notice that the LED's in the jellyfish needed a little extra "umph" and required a MOSFET. So, as depicted below, signal in is connected to gate, power to source, and signal out to the drain. Signal out goes through the LEDs to ground.
Step 9: Setting Up Logic
Our code is currently hosted at https://github.com/Samnsparky/AutomataAquarium. There is, unfortunately, a calibration step for the servos since small differences in resistor resistance can shift the value that is sent to the peripherals when the servos should stand still. So, after wiring, you will need to uncomment lines 34, 36, and 38 for the first run and then comment them back out afterwards. This simply runs diagnostics and saves the results to EEPROM. Those calibration values will continue to be used for future iterations (or at least until you clear EEPROM). The default behavior is just to have the fish wiggle forward and to have it stop when the environment is dark, allowing the Jellyfish to drop down and light up. However, this behavior can be changed by altering the aquarium_onFishReachedGoal function.
That's it! Try it out and tell us how it went.