Want to build this project? |
|
Update (7/15/14): Check out my new Goldie skateboard! Part of my new line of Goldie Fishwater products?
Disclaimer: I’m an engineer, not a pro film maker. Be advised.
Disclaimer: I’m an engineer, not a pro film maker. Be advised.
"pro-tip" - I recommend watching all the times in bold below...
Video time map.. see what you want:
00:00 The story of Goldie, opening animation
03:25 Video start, my opening thoughts
05:47 Boardganizer overview
10:56 I show the components of the system
12:24 The fishfeeder
13:05 The limit switches
14:00 AC power
14:10 The moving platform
14:40 Powering the system accidentally...
15:05 Goldie gets stuck in the circuit!
15:30 Showing the moving platform and fishfeeder working, relay too
16:37 The web interface, how this system is controlled. Early test of all components.
20:09 Alienspec Pi Camera cable extension, 2 meters long!
21:00 Setup of the moving platform
22:06 Horizontal test of the system on the actual tank!
24:22 Change from horizontal to vertical
24:48 Vertical real world test!
27:14 Feeding Goldie!!! The reason for the system!!!
28:00 Temp sensor, moot point.
28:21 Fishfeeder and AC portion working.
30:30 Thoughts on the system, more Goldie shots.
31:35 My final thought.
33:00 Goodbye Goldie, closing animation
:
I never thought I could love a fish.
But I do. Goldie Fishwater is a survivor – she’s so strong. Truly, she is an inspiration to me… to us all…
I went on a trip recently, and found myself worrying about Goldie’s well being more often than I ever imagined I would. I had a friend stop by my place to check on her. Unfortunately, my friend didn’t know what to look for, and my automatic fish feeder broke during my trip!
The tank was action packed with food. To no surprise, Goldie ended up getting over fed. In fact, she doubled in size! I returned to another traumatic, near death event for Goldie. I hopped to save her. While changing the filters and tank water twice, I thought I could not let this happen again. I want to see Goldie in real time, and feed her myself. There is no love in an automatic fish feeder.
Here were my requirements of
- I want to see Goldie in real time, at all times.
- Move the camera stream around the tank to where Goldie might be
- Cut the power to the tank’s filters and air bubbler
- Feed Goldie at manually
- Sense the tank temperature
- Above all, do all this through a network - and ultimately via the Internet
I knew The Raspberry Pi and Pi camera would be perfect for #1 and #6. An Arduino Uno would be a good choice for #2 through #5. I came up with this block diagram.
Curious about all of Goldie’s hardships?
- Attacked twice by other fish. All fins and tail ripped off
- Ammonia burns on her wounds
- Swim bladder damage from being attacked, then infection. She couldn’t swim!
- Fungal infection
- Overfeeding and contaminated water
Project by sections
- Motor control
I chose two small Nema 17 mount stepper motors from Adafruit for my driver components. Of course, I used the Arduino Motor Shield to make short work of the motor controls. This was fairly straight forward type of connection. Coils A & B go to their designated spots on the motor shield, see the datasheet. Each motor had a different task. One needs to rotate 360 degree to dump fish food from the container. However, the other needs to allow for movement in both directions.
Limit switches also had to be incorporated to keep the motor from traveling too far in either direction. I used some Omron plunger micro-switches. I attached rare-earth magnets to each, so I can adjust the movement range as needed.
- The moving platform
I originally wanted the create a leadscrew driven platform for the camera movement. However, I opted for a surplus belt driven motion platform, mainly for price. The difference being $60 versus $15. This platform also gave me more travel that I had originally planned. This is great for viewing the entire length of the tank.
- Temp sensor
I used a waterproof DS18B20 Digital temperature sensor, for obvious reasons. Although Goldie, and her former roommate, are fresh water fish where room temperatures are ok, too cold or hot could be an issue. My building has a tendency to lose the air conditioning/heat exactly when inconvenient. This would alert me to any particular issue. IE: Direct sunlight overheating the water.
- Video
I needed a video stream to watch Goldie, I had a choice between VLC and Gstreamer. Although Gstreamer is a common choice for Raspberry Pi, I went with VLC for the ease of use. Mostly due to the out of the gate support Windows. Gstreamer may have needed some further development on my part. However, going with VLC was not a perfect solution. VLC suffered from a buffered delay that seemed to build over time. I wanted the highest resolution stream of course, but VLC seemed to really bog down over 640x480 pixels at 15 frames per second. So, I stuck with those settings.
Though, I will admit, I would like to do better in this area.
- Relay (AC power)
I wanted to use an off the shelf relay actuated AC outlet, the Powerswitch tail 2. However, it was out of stock. I took an off the shelf AC power strip and cut the black wire (the hot), internally, and sent two leads to the relay board. Easy, but, not as safe as I would have liked.
- Goldie the Diva
‘Nuff said.
The difficulties
- Mounting the system and long camera cable
I had intended to mount the entire system on the moving platform, since the Pi Camera ribbon cable was so short (6 inches or 15.54 centimeters). But, as I added features and cabling, it became too bulky and heavy. So, lengthening the camera cable was the only way. I could have adapted an old IDE cable from a derelict desktop in the mountain of surplus I have. However, I found several companies making solutions for my problem already, and a bit more elegant. The one I chose was from AlienSpec, a 1 meter long ribbon cable, just like the oem one… but longer. They were nice enough to rush ship me one right away. They even sent a 2 meter long one! This was a more logical solution.
- Motor control, switch from another dev board
There is no documentation say which wires on the stepper motors are part of what coil. So, measuring the resistance across the wires was the only way. Wires that are part of the same coil will show some sort of small resistance, while the others look like open circuits.
When I started out on my endeavor, I used a Chipkit Pi. However, I found it easier to adapt the motor shield to the Arduino Uno.
- Fish feeder
I wanted a better solution, but I used the original feeder drum from the malfunctioning feeder that made Goldie huge. It is a simple trap door that opens briefly when rotated completely around. I machined a sleeve to fir over the motor shaft and into the feeder’s mount hole. Simple enough, but it isn’t perfect. The drum need to be indexed a certain way, but the stepper motor might slip. Moving the motor back induces back current… not good for the stepper driver shield!
- Internet connectivity
I did not work on port forwarding, and access to the public Internet. That was my intention, but a few things turned me away. Opening up my home network, not that big of a deal, but more importantly… home safety. I was worried that my system, especially the AC portion, would start a fire. More trials will be needed before I go this route.
- Fire
An ever present worry…
Pics and system
Schematic and Design
Code
Product Name* | Description | Supplier | ||
Raspberry Pi Model B | A credit card-sized board with a Broadcom BCM2835 System-On Chip running Linux. | Raspberry-Pi |
| |
Arduino Uno | The Arduino Uno is a microcontroller board based on the ATmega328. | Arduino |
| |
Pre Programmed, MicroSD, 8GB, Raspberry Pi | Raspberry Pi 8GB SD Card pre-loaded with NOOBS—a collection of 6 operating systems. | Raspberry-Pi |
| |
Breadboard, Solderless, 400 Tie Points | Breadboard, Solderless, 400 Tie Points | Twin Industries |
| |
Budget Pack, Raspberry Pi | Budget Pack for Raspberry Pi (Mostly unused, only for parts) | Adafruit Industries |
| |
BUD Boardganizer | Multi-development Board Enclosure Kit | BUD Industries |
| |
Raspberry Pi Camera Module | The Raspberry Pi Camera Module is a custom designed add-on for Raspberry Pi. | Raspberry-Pi |
| |
Omron Electronic Components - D2HW-BL201M - Micro Switch | Snap-action switch for reliable ON/OFF action | Omron Electronic Components |
|
*Products and resources listed are listed to help members build their own Pi Projects. They are suggestions and listed for educational purposes. For substitutions of any parts, please post a question asking the original author.
Project Goldie - breakdown | QUANTITY | Unit Price | VENDOR | Vendor Part# | PRICE |
Raspberry Pi Model B | 1 | $35.00 | element14 | 43W5302 | $35.00 |
Arduino Uno | 1 | $29.95 | element14 | 78T1601 | $29.95 |
PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI | 1 | $17.99 | element14 | 97W1422 | $17.99 |
BREADBOARD, SOLDERLESS, 400 TIE POINTS | 1 | $7.35 | element14 | 56T0249 | $7.35 |
BUDGET PACK, RASPBERRY PI (Mostly unused, only for parts) | 1 | $49.95 | element14 | 44W3511 | $49.95 |
BUD Boardganizer | 2 | $16.32 | element14 | 88W3963 | $32.64 |
Raspberry Pi Camera Module | 1 | $25 | element14 | 69W0689 | $25.00 |
OMRON ELECTRONIC COMPONENTS - D2HW-BL201M - MICRO SWITCH | 2 | $6.55 | element14 | 25C4430 | $13.10 |
Raspberry Pi Camera Cable 1 meter | 1 | $20.86 | Alienspec | 313-100 | $20.86 |
Fish Tank feeding wheel | 1 | $16.00 | Amazon | NA | $16.00 |
Small Reduction Stepper Motor - 5VDC 512 Step | 2 | $14.00 | Adafruit | 324 | $16.00 |
Waterproof DS18B20 Digital temperature sensor + extras | 1 | $9.95 | Adafruit | 381 | $9.95 |
4-channel I2C-safe Bi-directional Logic Level Converter | 1 | $3.95 | Adafruit | 757 | $3.95 |
12V 5A switching power supply | 1 | $24.95 | Adafruit | 352 | $24.95 |
Zitrades (SaneSmart) 5V 8 Channel Relay Module for Arduino DSP AVR PIC ARM | 1 | $14.25 | Amazon | NA | $14.25 |
Palm Touchpad 5V 2A microUSB power supply | 1 | $5.00 | Amazon | NA | $5.00 |
Linear Motion Slide Actuator Nema 17 mount | 1 | $15.00 | Ebay | NA | $15.00 |
Power strip | 1 | $3.95 | Home Depot | NA | $3.95 |
3M Dual-Lock strips | 1 | $14.95 | Target | NA | $14.95 |
Rare earth magnets, wire, wire nuts, solder, | |||||
Total | $355.84 |
Other uses of the system
- Any pet control, watch the dog/cat/hamster/spider/ whatever. Feed them too.
- Any system observation and control. Watch your front porch for packages with VLC.
If I had more time and money
- Full internet control. This is going to happen, but not yet.
- Better AC control. I want to try the Powerswitch Tail device. I was also considering actuating a wireless control system too.
- More sensors. PH level, ammonia, Nitrate levels are a concern too.
- Better feeding system. This is going to happen too, but need to come up with a better way. I am considering a paddle wheel option.
- Full observation of tank. I want to create a 3D style observation arm. Think a robotic arm with a camera at the end.
Oddities and observations
- Powering the dev boards by turning the stepper motors. Turning the stepper motors would create a current that would flood every board with power. When adjusting the stepper motors I would end up activating the relays. What is a generator? An electric motor driven externally.
Cabe
http://twitter.com/Cabe_Atwell
(all cartoons, by Cabe Atwell)
Top Comments