Hunter X's Arduino Whole Tank Controller (52K Warning) - Page 7
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-13-2014, 08:39 PM   #91
pianofish
Wannabe Guru
 
pianofish's Avatar
 
PTrader: (24/100%)
Join Date: Jan 2010
Location: Lafayette, Louisiana
Posts: 1,038
Default

I've decided to do this via pic micro controller and a raspberry pi instead of arduino, I'll let yall know how it comes out. Gives me more options than arduino, although a bit more research will be required.
Joshua
pianofish is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 01-13-2014, 08:41 PM   #92
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (14/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,192
Default

nevermind
__________________
scapegoat is offline   Reply With Quote
Old 01-20-2014, 02:17 PM   #93
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (14/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,192
Default

Looks like i'll be sharing some things sometime this weekend.

I believe I have all my major components except for that FET board. I've been using a 12v AC adapter for prototyping. I've currently got the Pi set up to read, and display, temps from probes, on a web page hosted by itself.

Further, I am capable of turning 6 of the 8 outlets on and off via that same web page. Last night I started work on the scheduling code. I'll be able to set the schedule from the GUI, and save it. Right now it'll accept military time in the following format 00:00. on and off each day. I may change that to just be a daily on/off, instead of doing it by the day. that'll be easier, and makes more sense since it's really just lights on/off and co2 on/off.

The next part of that, though, is having the option to set the outlet based on a data from probes. in this version, just the temp.

I'm debating on wiring up 2 of the pins to control 2 outlets each, so all 8 are controlled as 4x1 and 2x2, or keeping 2 always on. I need to consider what i have need for. I do have 2 heaters.

Once the FET board comes in i'll handle the pumps and their schedules. I've just been using a breadboard on my desk to do this, but i'm thinking it's time to slice off a piece of plywood to mount everything to in order to produce a full prototype that doesn't have to be put away in parts each night. (2 year olds and electronics laying around don't mix)

I've some ideas for way down the line, but i have a second Pi for developing more things. I need to go through and clean out code and move some code off to their own files for easier maintenance. this was a lot easier than I thought.

Many thanks to Hunter for providing a beautifully laid out controller that was easy to follow. Much inspiration was had by all!
__________________
scapegoat is offline   Reply With Quote
Old 01-20-2014, 02:26 PM   #94
HunterX
Planted Tank Obsessed
 
HunterX's Avatar
 
PTrader: (22/100%)
Join Date: May 2012
Location: Springfield MO
Posts: 360
Default

I just bought a 120 gallon tank for $450. Let me know if you think I got a good deal on it.

http://springfield.craigslist.org/for/4292091129.html

Scape,

That is awesome. I haven't dealt wit the Pi's at all but it sounds like you're all over it. I wish I was able to control my controller from the net as well. I have to travel all the time because of the Army and that would be a very convenient feature to have. I can't wait to see what you have come up with!

Last edited by HunterX; 01-20-2014 at 02:57 PM.. Reason: typo.
HunterX is offline   Reply With Quote
Old 01-20-2014, 02:43 PM   #95
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (14/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,192
Default

Quote:
Originally Posted by HunterX View Post
I just bought a 120 gallon tank for $450. Let me know if you think I got a good deal on it.

http://springfield.craigslist.org/for/4292091129.html

Scape,

That is awesome. I haven't dealt wit the Pi's at all but it sounds like you're all over it. I wish I was able to control mine controller from the net as well. I have to travel all the time because of the Army and that would be a very convenient feature to have. I can't wait to see what you have come up with!
It's been a bit of a trial and error... it isn't secure enough to be accessed outside the network. It wouldn't be difficult to add in some authentication, which i plan to do. My biggest concern is that I've been unable to run it outside of being root user; which is a huge security hole for this project. the GPIO pins require root access, and i've tried some plugins that are supposed to give me that access. I might have to just change ownership of the gpio files to the pi user.

I do want to, eventually, make it live so folks can go to the url and see parameters. that would be even more useful if you're away and you've got a number of probes set up.

Once things started coming together, making things happen was easy. figuring out the best way to make the system configurable outside code is a little more difficult.

I've got a database that is getting pinged every minute for outlets w/ an on or off of the current time. The temperature sensor file, on the other hand, is being read every second. though, I figure I can probably change that to once a minute as well.

I want to get a pH probe hooked up soon to graph co2 introduction and pH drop, to control when the co2 gets turned on/off while the lights are on.

I think the end product will be neat. using some libraries out there, it'd been a rather trivial project, so I'm excited to share.
__________________
scapegoat is offline   Reply With Quote
Old 01-22-2014, 01:14 PM   #96
bigd603
Planted Member
 
PTrader: (1/100%)
Join Date: May 2011
Location: Portland, OR
Posts: 260
Default

Quote:
Originally Posted by scapegoat View Post
It's been a bit of a trial and error... it isn't secure enough to be accessed outside the network. It wouldn't be difficult to add in some authentication, which i plan to do. My biggest concern is that I've been unable to run it outside of being root user; which is a huge security hole for this project. the GPIO pins require root access, and i've tried some plugins that are supposed to give me that access. I might have to just change ownership of the gpio files to the pi user.

I do want to, eventually, make it live so folks can go to the url and see parameters. that would be even more useful if you're away and you've got a number of probes set up.

Once things started coming together, making things happen was easy. figuring out the best way to make the system configurable outside code is a little more difficult.

I've got a database that is getting pinged every minute for outlets w/ an on or off of the current time. The temperature sensor file, on the other hand, is being read every second. though, I figure I can probably change that to once a minute as well.

I want to get a pH probe hooked up soon to graph co2 introduction and pH drop, to control when the co2 gets turned on/off while the lights are on.

I think the end product will be neat. using some libraries out there, it'd been a rather trivial project, so I'm excited to share.
Scapegoat, I'm really excited to see what you've done with the Pi. I've been using Arduino for a while now, but just recently got a raspberry pi. Keep plugging along and let us know what you come up with!

Sent from my Galaxy Nexus using Tapatalk
bigd603 is online now   Reply With Quote
Old 01-22-2014, 02:33 PM   #97
HunterX
Planted Tank Obsessed
 
HunterX's Avatar
 
PTrader: (22/100%)
Join Date: May 2012
Location: Springfield MO
Posts: 360
Default

Good stuff everyone. I'm so glad to see all the input everyone is providing.

I have never used the Pi or read anything about it. Anyone care to detail the major differences between the Pi and Arduino?
HunterX is offline   Reply With Quote
Old 01-22-2014, 02:48 PM   #98
benjaf
Algae Grower
 
benjaf's Avatar
 
PTrader: (0/0%)
Join Date: Mar 2012
Location: Denmark
Posts: 105
Default

The Raspberry Pi is actually a small ARM based computer, complete with USB, Ethernet and the ability to run a normal Linux. Unlike most other micro computers it also has a number of I/O pins that allow you to control hardware directly much like an Arduino.
__________________
benjaf is online now   Reply With Quote
Old 01-22-2014, 04:00 PM   #99
scapegoat
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (14/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,192
Default

Quote:
Originally Posted by bigd603 View Post
Scapegoat, I'm really excited to see what you've done with the Pi. I've been using Arduino for a while now, but just recently got a raspberry pi. Keep plugging along and let us know what you come up with!

Sent from my Galaxy Nexus using Tapatalk
thanks. i'm super excited about it to. I just got my FET board in and need to research how to wire it. I'm hoping to get the rough time scheduling system down for the relays tonight and start my own thread w/ a video of it in action. I need to get the thermometer reattached to the prototype and play with scheduling the relays based on data tonight as well.

once i get the FET board wired up it'll be time to throw together a full working prototype though, and get it going on my tank. Once some freelance checks come in I'll be ordering all the components a second time to work on a second prototype while the first is running my tank.

Quote:
Originally Posted by HunterX View Post
Good stuff everyone. I'm so glad to see all the input everyone is providing.

I have never used the Pi or read anything about it. Anyone care to detail the major differences between the Pi and Arduino?
Quote:
Originally Posted by benjaf View Post
The Raspberry Pi is actually a small ARM based computer, complete with USB, Ethernet and the ability to run a normal Linux. Unlike most other micro computers it also has a number of I/O pins that allow you to control hardware directly much like an Arduino.
yeah, the Pi is pretty sweet. It's a full blown computer the size of a credit card (dimensions anyway).

I've the model b w/ 512mb ram, 2 usb, ethernet, hdmi and audio out. the entire operating system is kept on a 4gb SD card. I chose the Pi because I wanted to decide my programming language. That makes things a little bit more difficult as I had to further research libraries to get things going.

I'll explain myself even more once i get a thread going.
__________________
scapegoat is offline   Reply With Quote
Old 01-22-2014, 05:15 PM   #100
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
I'll explain myself even more once i get a thread going.
Looking forward to that, I plan to eventually replace (or at least supplement) my arduino controller with a Pi. Just itching to implement lighting and logging in a more advanced programming language!
__________________
benjaf is online now   Reply With Quote
Old 01-23-2014, 12:37 PM   #101
HunterX
Planted Tank Obsessed
 
HunterX's Avatar
 
PTrader: (22/100%)
Join Date: May 2012
Location: Springfield MO
Posts: 360
Default

I recieved my Adafruit CC3000 WiFi breakout board today. I can't wait to get off of work and get it hooked up.
HunterX is offline   Reply With Quote
Old 01-25-2014, 09:58 AM   #102
HunterX
Planted Tank Obsessed
 
HunterX's Avatar
 
PTrader: (22/100%)
Join Date: May 2012
Location: Springfield MO
Posts: 360
Default

Quote:
Originally Posted by Fluffles View Post
Wow, this is looking great!
Thanks so much for the parts list. I've had an Arduino Mega controlling my LED lights for about a year now and wanted to expand it to a complete aquarium controller but never knew how to approach this. Your thread has given me a clear path on how to get things started.
I actually ordered most of the components already and it looks like I'll be building a clone of your project. Thanks again!

Btw, I see that your dosing pumps and fan are connected to the 4 channel MOSFET board. Did you consider placing a diode in parallel to each pump/fan to protect your transistors from flyback?
http://en.wikipedia.org/wiki/Flyback_diode
I think Shift's dosing pump project has some of these installed, but it seems like the transistors are pretty beefy though so it might not be necessary at all. Maybe someone here with electrical experience might be able to offer some advice.
Fluffles,
Did you get started on your project yet?


My wifi board is hooked up and passed the test sketch. I'm now working on adding the required code to my sketch. It's been pretty busy over here lately so I haven't had any time to work on it. I have tomorrow off so I should be able to get my controller "online" by tomorrow afternoon.

Last edited by HunterX; 01-26-2014 at 11:11 AM.. Reason: edit
HunterX is offline   Reply With Quote
Old 01-26-2014, 11:18 AM   #103
HunterX
Planted Tank Obsessed
 
HunterX's Avatar
 
PTrader: (22/100%)
Join Date: May 2012
Location: Springfield MO
Posts: 360
Default

My controller is "online" Here is the link if you want to check it out.

https://xively.com/feeds/76312450

I am concerned about the code used to connect the CC3000 (WiFi board) to the net. It has several "while" commands in it. This causes the whole project to become unresponsive while the CC3000 is connecting and doing it's thing. Even worse, if the CC3000 is trying to connect and a connection is not available, it will hang in the "while" loop causing the controller to be rendered useless. It could be a major issue if the controller hangs while the heater is on. The heater would stay on and boil the tank. Same scenario with any number of the connected devices.

Any one out there willing to take a look at the code and see if I could substitute the "while" commands with something else? Below is a link to the code I used from Adafruit's website.

http://learn.adafruit.com/adafruit-c...arduino-sketch
HunterX is offline   Reply With Quote
Old 01-26-2014, 05:30 PM   #104
Fluffles
Algae Grower
 
PTrader: (1/100%)
Join Date: Jul 2012
Location: Canada
Posts: 38
Default

Quote:
Originally Posted by HunterX View Post
Fluffles,
Did you get started on your project yet?
Most of the parts are in, but I'm still missing the 8-channel relay board, 4x24 LCD, and the 10P terminal blocks. They are coming in from China so it still might be 1-3 weeks from now. Also, I ordered a wood box for the project since I don't have any woodworking skills or tools. That's still about 2 weeks away from arrival. I don't think I'll really be able to start before getting the box.

Here's a quick pic of where everything stands:


This will be very similar to your project except I have less space to fit everything in so it will be a bit of a challenge.

I will be adding an in-line fuse for the AC line before the terminal blocks just to be safe.
Also, I'll have a second LCD screen inside the box (above the power supply). The screen has pushbuttons so I was thinking of making the second screen a menu that will allow me to select LED brightness, morning ramp-up time, nightime, time set, and fan speed.

I kinda decided not to do temperature or PH readings from the tank. My tank is a small 10G rimless tank, and I'd like to minimize the amount of wires going in and out. I won't be doing any sort of ethernet/wireless communication since I don't see the point with my specific setup, it also keeps things simple.

I think the biggest thing for me is that I'll be able to control relays, LEDs, and dosing pumps from the same RTC module. Right now I have 3 different timers in my tank and already had several accidents happen while I'm on a trip. Also, with pushbuttons to control the relays, it will be a breeze to disable outlets for doing maintenance.

Thanks again for posting your project up so everyone can see it. It made me take the plunge and get started on this. I'll keep you posted on any new ideas or discoveries I make while working on this.

Last edited by Fluffles; 01-26-2014 at 10:51 PM.. Reason: Picture Size
Fluffles is offline   Reply With Quote
Old 01-27-2014, 04:35 AM   #105
bigd603
Planted Member
 
PTrader: (1/100%)
Join Date: May 2011
Location: Portland, OR
Posts: 260
Default

Hey guys, what are your thoughts about keeping the ends of the fertilizer tubes in the tank, as opposed to having them hang over the edge and dripping in? When they just drip in you have to clean the ends of the tubes every day or so, while leaving them in the water will eliminate this problem. My only concern with this is slowly leaching excessive fertilizer into the tank throughout the day. Do you think this extra amount of fertilizer wouldnt be a concern as long as I'm doing weekly water changes?
bigd603 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not 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:20 PM.


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