OSA raspberry pi aquarium controller - controller has been put to work on my 125g
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY


Reply
 
Thread Tools Display Modes
Old 01-23-2014, 03:51 AM   #1
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (15/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,232
Default

OSA raspberry pi aquarium controller - controller has been put to work on my 125g


I've decided to join the automation brigade. I constantly forget to dose fertilizers so decided at the very least I'd set something up to automatically dose those for me... well, i haven't gotten around to that yet.

Right now I've got a system that allows me to schedule relays for daily on/off times, as well as reading the temperature from a waterproof thermometer. Neither of which are actually attached to my fish tank, or all that usable at the moment.

I'm still very much developing, and prototyping, my aquarium controller.

I know a lot of folk go with the arduino; but I didn't. I wanted my choices to be nearly 100% unfettered. I did have to make some concessions... a specific framework and noSQL database did not support the ARM chip, nor did i find a usable, up to date, build for ARM.

Along with not wanting my programming choices to be limited, I wanted a GUI, and I wanted it accessible on my home network. Two things the arduino sort of fails at out of the box. Where the arduino fails, the raspberry shines. While programming it is a lot more involved, options are endless.

My controller is being programmed using node js, and using the web sockets protocol to provide a real time open connection to the Pi. This is important because the Pi is connected to my home network, which makes access to it available on any device with a current browser. phone, iPad, computer... hell, even my PS3 could bring up the GUI. The browser effectively provides a native like application.

The video below demonstrates the, very, basic GUI. Buttons for the 6 relays currently under control, and the temp sensor reporting back. I can schedule each relay independently to turn on or off, the schedule is set for every day of the week. I didn't show this because it checks every minute, and I didn't think anyone wanted to sit and watch a video for 2+ minute of nothing happening.

Future updates will be including the ability to schedule a relay to a data point... namely the temp sensor, so they turn on/off base on a given temp. and then of course the peristaltic pumps will be wired up and tested.

anyway, here is the video.


Last edited by scapegoat; 08-15-2014 at 06:05 PM.. Reason: a
scapegoat is offline   Reply With Quote Quick reply to this message
Sponsored Links
Advertisement
 
Old 01-23-2014, 04:18 AM   #2
Down_Shift
Wannabe Guru
 
PTrader: (23/100%)
Join Date: Sep 2008
Location: Beantown
Posts: 1,538
Send a message via AIM to Down_Shift
Default

i'll be the first to say it- you're on to something here.

Definitely marketable software here.
Down_Shift is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 04:31 AM   #3
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (15/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,232
Default

Quote:
Originally Posted by Down_Shift View Post
i'll be the first to say it- you're on to something here.

Definitely marketable software here.
thank you. the code is not nearly production level; but I intend on cleaning it up with prototype 2. I will be open sourcing the code... since there is no real reason not to.

The code will ultimately get out, since it is all javascript. I can't obfuscate or protect in any way. So, i'll release it to a github account, garner feedback, and more folks helping to make it as good as possible. With the correct license of course.

I wouldn't mind making some cash off the work though, and I've got some plans on how to accomplish that. But for now I'll concern myself with getting it done.
__________________
scapegoat is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 04:52 AM   #4
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,333
Default

Nice. I might have to switch to the pi too. I've built a network interface for the arduino but it's pretty limited.

I've thought about the production/money issue too. It might be best if it's done with donation.

Sent from my iPad using Tapatalk HD
mistergreen is online now   Reply With Quote Quick reply to this message
Old 01-23-2014, 04:57 AM   #5
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (15/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,232
Default

What do you mean donation?
__________________
scapegoat is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 05:26 AM   #6
Whiskey
Planted Tank Enthusiast
 
Whiskey's Avatar
 
PTrader: (1/100%)
Join Date: Feb 2005
Location: Vista, CA
Posts: 578
Default

That is really cool!

I use arduino's for the tanks, but I also have a pi for a media center. Can you do PWM outputs with the pi? I notice a couple of interface boards there, are they shields you bought? Or something you built?

Thanks,
Whiskey
Whiskey is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 05:50 AM   #7
benjaf
Algae Grower
 
benjaf's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2012
Location: Denmark
Posts: 105
Default

Great - now I'll have to buy yet another Pi, and figure out how to use it to control an arduino or similar..
__________________
benjaf is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 07:12 AM   #8
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,333
Default

Quote:
Originally Posted by scapegoat View Post
What do you mean donation?
You can give out the code and spec for free but ask for donations if they want.


Sent from my iPad using Tapatalk HD
mistergreen is online now   Reply With Quote Quick reply to this message
Old 01-23-2014, 02:04 PM   #9
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (15/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,232
Default

Quote:
Originally Posted by Whiskey View Post
That is really cool!

I use arduino's for the tanks, but I also have a pi for a media center. Can you do PWM outputs with the pi? I notice a couple of interface boards there, are they shields you bought? Or something you built?

Thanks,
Whiskey
So that big board on top of the Pi is known as a Gertboard. It is an expansion board that supports a bunch of different functions that you can access via jumper wires. As you can see in the video, I am doing just that. I'm taking advantage of the Open Controller Driver on the right side of the board to bring the relay pins to ground to turn them on.

The gertboard is a great prototyping tool for the Pi. but, I wouldn't use it for a final product. It costs more than the Pi. So in this case I've learned that I want an OCD for the relay control... in fact, I probably want one for everything that is being ran on DC that is turning on/off since it is capable of supporting 50v and 500mA on each port, is completely isolated from the Pi, and doesn't require any flyback diodes. The actual OCD chip is about $5 right away, or waaaay less if bought in bulk.

I just have to learn about making boards next.

The other item with the display is a dc to dc regulator to bring my 12v source down to 5v to run the relay. The ground from this is also running to the ground pin on the OCD, which is how the relays then get grounded.

The Pi has a single PWM pin, but i think the gertboard allows more.

Quote:
Originally Posted by benjaf View Post
Great - now I'll have to buy yet another Pi, and figure out how to use it to control an arduino or similar..
well... if you pick up a gertboard, it has a ATmega chip on it, so it'll run arduino code right on that w/ inputs from the pi. https://projects.drogon.net/raspberr...e-arduino-ide/

Quote:
Originally Posted by mistergreen View Post
You can give out the code and spec for free but ask for donations if they want.
Ah yeah, that thought has crossed my mind. I'm going to give out the code anyway once my site is up and it is completed enough to share.
__________________
scapegoat is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 02:57 PM   #10
mistergreen
No more Bow ties
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,333
Default

You can also hook up your existing arduino to the PI, via the USB ports, I think.

http://www.raspberrypi.org/forum/vie...p?f=44&t=46881

Last edited by mistergreen; 01-23-2014 at 03:23 PM.. Reason: +
mistergreen is online now   Reply With Quote Quick reply to this message
Old 01-23-2014, 04:25 PM   #11
benjaf
Algae Grower
 
benjaf's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2012
Location: Denmark
Posts: 105
Default

Quote:
Originally Posted by mistergreen View Post
You can also hook up your existing arduino to the PI, via the USB ports, I think.

http://www.raspberrypi.org/forum/vie...p?f=44&t=46881
Yes, this is much more likely to be my approach. There are a couple of libraries to handle direct communication, and an Arduino clone is MUCH cheaper than a Gertboard. They are pretty nifty but so expensive!
__________________
benjaf is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 04:29 PM   #12
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (15/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,232
Default

Quote:
Originally Posted by benjaf View Post
Yes, this is much more likely to be my approach. There are a couple of libraries to handle direct communication, and an Arduino clone is MUCH cheaper than a Gertboard. They are pretty nifty but so expensive!
Yeah, i bought it because I didn't have much of a clue as to what was possible with the Pi. It has been perfect for prototyping though.

But i know now I just need a bunch of OCD's on a board of their own, and probably a GPIO expansion board to handle more then what the Pi can by itself
__________________
scapegoat is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 05:07 PM   #13
benjaf
Algae Grower
 
benjaf's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2012
Location: Denmark
Posts: 105
Default

Quote:
Originally Posted by scapegoat View Post
Yeah, i bought it because I didn't have much of a clue as to what was possible with the Pi. It has been perfect for prototyping though.

But i know now I just need a bunch of OCD's on a board of their own, and probably a GPIO expansion board to handle more then what the Pi can by itself
The main reason I would even need any other controller than the Pi is the lack of PWM pins. 1 just doesn't cut it and 100Hz soft-PWM is way to slow for light dimming. But I guess one could just try to find an I2C board for that..
__________________
benjaf is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 06:24 PM   #14
O2surplus
Planted Tank Enthusiast
 
O2surplus's Avatar
 
PTrader: (4/100%)
Join Date: Jan 2010
Location: "The Land of Fruits & Nuts"
Posts: 673
Default

Quote:
Originally Posted by benjaf View Post
The main reason I would even need any other controller than the Pi is the lack of PWM pins. 1 just doesn't cut it and 100Hz soft-PWM is way to slow for light dimming. But I guess one could just try to find an I2C board for that..
Adafruit's got an I2C controllable 16 channel 12bit PWM break out board that would probably serve your needs nicely. Check it out- http://www.adafruit.com/products/815
__________________
225 Gal, Glass "Reef Ready" w/ twin Iwaki Pumps & 2 Ocean Clear inline filters. Custom 320 watt LED Lighting system utilizing a 6' Maker's Heat Sink, 12 BridgeLux Vero 18's,3 purpose built 5 channel A6211 Led driver/Controllers,iAqua Aquarium Controller , and a 20lb CO2 system w/ Milwaukee Ph Controller.
O2surplus is offline   Reply With Quote Quick reply to this message
Old 01-23-2014, 07:12 PM   #15
benjaf
Algae Grower
 
benjaf's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2012
Location: Denmark
Posts: 105
Default

Quote:
Originally Posted by O2surplus View Post
Adafruit's got an I2C controllable 16 channel 12bit PWM break out board that would probably serve your needs nicely. Check it out- http://www.adafruit.com/products/815
12 bit resolution no less, hmm.. I'll have to do some work to safely drive a MOSFET off of that. But that is certainly the right sort of thing!
__________________
benjaf is offline   Reply With Quote Quick reply to this message
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.



Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012