terahurts
Posts: 5
Joined: Wed Sep 18, 2013 10:14 am

Aquarium project for a beginner?

Wed Sep 18, 2013 12:20 pm

I've been lurking since discovering the RPI a few months before it was released but have held off on buying one as apart from running it as a media centre I couldn't come up with anything 'cool' to do with it and not being able to justify the expense (disabled wife, I'm her carer, money is tight etc). However with xmas a few weeks away and having recently developed an interest in tropical fishkeeping I've been thinking about using a RPI to do some simple data logging and automation. However I've not done any coding since finishing my GSCE Computer Studies course on a BBC B in 1989 and my electronics skill are at about the same level.

What I'd like to do is (including my ideas/notes):

1. Monitor the tank and room ambient temperatures using i2c sensors (DS18B20 sensors) with data logging.

2. Control the tank lights (240v fluorescents and 240v blue LED lightbar) via relays based on local sunset/sunrise times (Blue light strip comes on a set time before sunrise, then switch to fluorescents at sunrise with the reverse happening at sunset). I believe I can use the pyephem library to calculate these rather than relying on pulling the data from an internet weather source.

3. Push-button manual override of the lighting

4. Use a 4 line LCD to display temps, local time, and time to next automatic light change via SPI.

5. Optional; ability to take photos of the tank and upload to local/dropbox/external host.

Since my electronics and soldering skills are rusty I'll be looking at using as much pre-assembled equipment as possible as cheaply as possible.

There's a nice writeup of a similar project here: http://www.thereefuge.com.au/threads/ra ... ject.3475/.

My current plan-of-action is to get myself up-to-speed with Python by getting a working sun rise/set and offset calculator working on my (Windows) PC, then tackle each part of the project individually as finances permit starting with the temp sensor and LCD screen. Does this sound like I'm about to bite off more than I can chew?

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Aquarium project for a beginner?

Wed Sep 18, 2013 2:19 pm

Hi,
and welcome to the forum. Most or all of that is very feasible. However I would be very careful about mixing water with mains powered kit, especially if you are not knowledgeable about electrics/electronics. I am refering to the relay powered lighting - how do you intend to do this? Perhaps there are usb controlled mains switchers you can use, rather than any wiring of your own.
And of course I would recommend using one of my touch panel TFT displays, rather than use a standard 4-line LCD panel ;)
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

terahurts
Posts: 5
Joined: Wed Sep 18, 2013 10:14 am

Re: Aquarium project for a beginner?

Wed Sep 18, 2013 3:03 pm

Thanks

I'm more proficient with mains level wiring than I am with things running at less than 240v, so I'm reasonable confident I can avoid electrocuting the fish/myself.

I was planning on using some like this:

http://www.ebay.co.uk/itm/New-5V-2-Chan ... 5504566%26

for a relay board, situated well away from any sources of water, and in a separate enclosure to the RPI. I just need to get my head around level shifters.

Those TFT screens are nice, and would be ideal since they could double up as the physical controls as well so I'll be adding one to my project spec, although I assume I'm now going to have to work out a way to produce a GUI, which now that I think about it will give me something to do until my RPI is ordered.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Aquarium project for a beginner?

Wed Sep 18, 2013 4:34 pm

Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Gavlar30
Posts: 2
Joined: Wed Sep 18, 2013 7:17 pm

Re: Aquarium project for a beginner?

Wed Sep 18, 2013 7:23 pm

I have been doing a similar project only I use the Arduino as it has lots of input/outputs but I would like to integrate the Pi at some point maybe coupled with a camera to keep an eye on things!

My advice on the lighting would be to skip the 240v stuff and get in to LEDs you can get some decent LDD drivers from Meanwell that will control the LEDs using PWM (Pulse Width Modulation) so are fully dimmable, the other option would be to use a dimmable ballast with a PWM signal only I had trouble sourcing one you tend to find 0 - 10v but not so much PWM control just a couple of ideas that would work on the Pi or Arduino :)

Kaserpick
Posts: 2
Joined: Tue Sep 03, 2013 3:30 am

Re: Aquarium project for a beginner?

Fri Sep 20, 2013 4:54 am

I think this is a great idea! I currently utilize an Apex Jr to tank care of my Reef Aquarium automation, but I've thought the RPi would be a great DIY options.

Monitoring is nice, but equipment control is a much better use for a controller. For instance, you could be controller powerhead pumps, dosing pumps for additives, and the most common thing, auto-top-off. I believe Tunze Streams are controlled via PWM as well. Also, with the apps out for controlling the RPi's GPIO via the net, you can change things while you're away. Heck, automatic water changes could be done with the RPi.

As far as lights go, I would change over to LED's, solely for the purpose of control. They've a unique look, so be sure to check some out before buying any. Not to start a lighting debate, but I'm a T5 fellow myself.

As with anything in automation, make sure you set up some redundancies, especially since you're dealing with water. A sensor/switch without a fail safe could mean gallons of water on the floor. :P

terahurts
Posts: 5
Joined: Wed Sep 18, 2013 10:14 am

Re: Aquarium project for a beginner?

Fri Sep 20, 2013 8:21 am

I'd love LED lighting, but looking at the prices put it out of reach for the time being unless I use those el-cheapo RGB strips from ebay/Amazon and I'm not sure I'd trust the health of my fish to them (my original idea was to use RGB strips to simulate a 'proper' swing from full dark to blue to yellow to white light and back again). That's probably doable with our current 40 litre tank, but the wife's xmas present from the kids this year is supposed to be a 200 litre upgrade.

As far as full automation goes, I want to start simple and then expand as my budget permits (and at this point I'm not sure I trust my coding skills enough to control automated syphoning/top offs and heaters etc).

Until I actually have a Pi on my desk I'm pretty limited with what I can do since 90% of what I want to do involves GPIO; so far I've got the beginnings of some Python code that calculates local first light, sunrise, sunset and last light as well as a shopping list of parts that grows and changes with each new project or break-out board or add-on I find on the web.

Gavlar30
Posts: 2
Joined: Wed Sep 18, 2013 7:17 pm

Re: Aquarium project for a beginner?

Fri Sep 20, 2013 12:18 pm

LEDs are not as expensive as you think but it all depends on the rig you plan on building!

I have a Chichlid tank so lighting doesn't need to be heavy but even so my tank is 500l (5 foot long) and I run 12 CREE XPG LEDs 6 are cool white and 6 are natural and more of a yellow but mixed together they make a nice light, LEDs cost me £20 power supply was free from a friend (24v 6amp) and LDD drivers were around £10 each I used old Xbox 360 GPU heatsinks that were £2.50 each off of the bay of e and then just add the cost of the Pi and bits of wire ect a good cheap project :)

I run 4 of the LEDs per heatsink, I will be swapping half of those for RGB LEDs you can get 3w ones from the bay of e for about £2 each but make sure you get the 6 wire version if going with the LDD drivers and get the 350ma versions (I am running 1000ma on the Cree LEDs)

terahurts
Posts: 5
Joined: Wed Sep 18, 2013 10:14 am

Re: Aquarium project for a beginner?

Fri Sep 20, 2013 3:12 pm

I was with you up until you started talking about LDDs. And I'm already in information overload with I2C, 1Wire, level shifters and whatnot..... I'll that to my list of thing to spend money on at a later date.

My current (subject to change on advice/brainwaves) idea for hardware is something like this:

RPi -> I2C interface -> (Logic level shifter?) -> 2/4 line LCD & Keypad -> Relay board -> I2C/1Wire interface -> Temp sensors

Assuming I've not got the wrong end of the stick regarding I2C and 1Wire protocols.

Kaserpick
Posts: 2
Joined: Tue Sep 03, 2013 3:30 am

Re: Aquarium project for a beginner?

Fri Sep 20, 2013 6:06 pm

Yeah, I must have been pretty tired when I posted that reply last night. Sorry for all of the grammatical mistakes; I usually read my replies before posting.

I can definitely understand the desire to start slowly. You could really do some damage if you mess up your code. Temp sensors (and the like) should give you a feel for things, so that's a good choice.

Now, concerning LED's, I meant to say, 'Do NOT buy LED's solely for the purpose of control.' They're not bad, but they're not for everyone, mainly if you're interested in coral. You can kill things, if you don't know what you're doing. They're pretty powerful. But, they are still a very well suited option for corals; you just need to read carefully about them. Since you've mentioned that you already feel overloaded, you may just want to stick to fluorescents at first, or a Metal Halide.

If the light is for fish, then LED's are fairly straightforward. The main concern for coral is that you make sure to dial in the intensity just right. With fish, that's not an issue.

Check out http://www.rapidled.com for some great kits (geared towards aquaria purposes). I'd recommend looking at their freshwater retrofit kits for a fish only saltwater tank as well. They say freshwater, but they simply lack a higher count of LED's, since you won't need super high intensity. That makes them great for freshwater or fish only saltwater. I'm gathering that you're in the UK. Their shipping rates a very fair, and the US Postal Services have some pretty good international shipping rates for smaller parcels (their paticular courier).

Food for thought.

Return to “Automation, sensing and robotics”