Want to build this project?
View Parts


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

:

 

happy Right.jpg


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

  1. I want to see Goldie in real time, at all times.
  2. Move the camera stream around the tank to where Goldie might be
  3. Cut the power to the tank’s filters and air bubbler
  4. Feed Goldie at manually
  5. Sense the tank temperature
  6. 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.

block2.jpg

 

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

schematic.JPG

 

Code

 

    

Product Name*DescriptionSupplier
Raspberry Pi Model BA credit card-sized board with a Broadcom BCM2835 System-On Chip running Linux.Raspberry-Pi
Buy NowBuy Now
Arduino UnoThe Arduino Uno is a microcontroller board based on the ATmega328.Arduino
Buy NowBuy Now
Pre Programmed, MicroSD, 8GB, Raspberry PiRaspberry Pi 8GB SD Card pre-loaded with NOOBS—a collection of 6 operating systems.Raspberry-Pi
Buy NowBuy Now
Breadboard, Solderless, 400 Tie PointsBreadboard, Solderless, 400 Tie PointsTwin Industries
Buy NowBuy Now
Budget Pack, Raspberry PiBudget Pack for Raspberry Pi (Mostly unused, only for parts)Adafruit Industries
Buy NowBuy Now
BUD BoardganizerMulti-development Board Enclosure KitBUD Industries
Buy NowBuy Now
Raspberry Pi Camera ModuleThe Raspberry Pi Camera Module is a custom designed add-on for Raspberry Pi.Raspberry-Pi
Buy NowBuy Now
Omron Electronic Components - D2HW-BL201M - Micro SwitchSnap-action switch for reliable ON/OFF actionOmron Electronic Components
Buy NowBuy Now

*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 - breakdownQUANTITYUnit PriceVENDORVendor Part#PRICE
Raspberry Pi Model B1$35.00element1443W5302$35.00
Arduino Uno1$29.95element1478T1601$29.95
PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI1$17.99element1497W1422$17.99
BREADBOARD, SOLDERLESS, 400 TIE POINTS1$7.35element1456T0249$7.35
BUDGET PACK, RASPBERRY PI (Mostly unused, only for parts)1$49.95element1444W3511$49.95
BUD Boardganizer2$16.32element1488W3963$32.64
Raspberry Pi Camera Module1$25element1469W0689$25.00
OMRON ELECTRONIC COMPONENTS - D2HW-BL201M - MICRO SWITCH2$6.55element1425C4430$13.10
Raspberry Pi Camera Cable 1 meter1$20.86Alienspec313-100$20.86
Fish Tank feeding wheel1$16.00AmazonNA$16.00
Small Reduction Stepper Motor - 5VDC 512 Step2$14.00Adafruit324$16.00
Waterproof DS18B20 Digital temperature sensor + extras1$9.95Adafruit381$9.95
4-channel I2C-safe Bi-directional Logic Level Converter1$3.95Adafruit757$3.95
12V 5A switching power supply1$24.95Adafruit352$24.95
Zitrades (SaneSmart) 5V 8 Channel Relay Module for Arduino DSP AVR PIC ARM1$14.25AmazonNA$14.25
Palm Touchpad 5V 2A microUSB power supply1$5.00AmazonNA$5.00
Linear Motion Slide Actuator Nema 17 mount1$15.00EbayNA$15.00
Power strip1$3.95Home DepotNA$3.95
3M Dual-Lock strips1$14.95TargetNA$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)