The Planted Tank Forum banner

DIY Aquarium Touchscreen Controller

87K views 207 replies 26 participants last post by  Darkblade48 
#1 ·
After seeing some amazing DIY controllers, I'm gonna have a go at it. Just had my Arduina Mega and 3.2" touchscreen delivered yesterday.
The plan is to monitor Temp, pH, dissolved Oxygen and eventually filter output flow. Want to also be able to control my heater, Co2, and LEDS with this controller.
I have never written code before, so this is going to be a learn as I go project :)

Used an existing sketch (Jarduino 1.1) to test everything out, and to give me an idea on how all the code ties in together.



Mike
 
See less See more
1
#123 ·
Don't forget that you can add a relay board (to control things) and also an ethernet/wireless shield if you want to control things via a web interface.

Besides the DS1307 RTC, you can also consider using the DS3231 chip; it does not cost significantly more than the DS1307.

Something like this (though this is an old photo; I've cleaned up the wiring, added a few components and switched to the TFT LCD Touchscreen)

 
#127 ·
as I was working I was thinking about this, on how people would plug in a probe etc to monitor/control their PH, co2, salinity, temp etc.

my other concern was how small the screen is I was hoping to have a screen at least 6x6 inches so it could be easily seen from a distance. Maybe something we could look into?

Dark PM me to please I have an idea I want to run by you that is kinda off topic.
 
#126 ·
The relay board is just an electrical switch that controls a mains line. When a 5V signal is sent to it, it will open. You can get the standard mechanical relays, or the more expensive solid state ones.

That RTC chip looks pretty cool, DarkBlade, thanks for pointing that out!

Is that pH probe the same as e Bay item 170752579436? I've been thinking about snagging it but dont know if it's any good. Are pH probes a "you get what you pay for" kinda thing? Also, what board are you connecting the probe to?
I personally like the DS3231 chip, since the DS1307 does seem to drift. The libraries are interchangeable, so there is no extra work involved.

I just got my pH probe locally; cost me $15. The one I am using seems to work fine. I am connecting the probe to a pH meter breakout board; there are lots out there. I got this one from a friend who had a spare. You can build your own for ~$10-15, and save some money, though (I was going to go this route).
 
#129 · (Edited)
wireless interesting

i have my jarduino working and i am making the individual probes and sensor boards etc. darkblade you mentioned wireless i have been trying to figure out how to run the temperature probes wirelesslyusing a wireless shield. i already have a web shield working and have done some research on using a radio freq to control them two i plan to use wirelessly do you have another idea? i am not aware of any working code using a wireless web shield i think jamie TheDOdblG on UK Reefs the author of Jardunio is looking into it but is limited in time do you have some code to look at? i have also thought of doing a ph probe also remote just for giggles and practice. perhaps you can direct me to some cheaper probes then i have seen on fleabay. i am very interested in this project and hae already signed onto the mentioned website in this thread for collaboration on the bells and whistles as well as DIY projects any help would be great.
doc
:alien:
 
#130 ·
i have my jarduino working and i am making the individual probes and sensor boards etc. darkblade you mentioned wireless i have been trying to fogure out how to run the temperature probes wirelessly. i already have a web shield working and have done some research on using a radio freq to control it wirelessly do you have another idea i am not aware of perhaps some code to look at. i have also thought of doing a ph probe just for giggles and practice perhaps you can direct me to some cheaper probes then i have seen on fleabay. i am very interested in this project and hae already signed onto the mentioned website for collaboration on the bells and whistles and DIY projects any help would be great.
doc
:alien:
I am unsure how you would run/what the advantage of running the temperature probe wirelessly would be. You would still have to plug the temperature probe into a wireless shield/module, and then have it communicate with the main controller. Why not just have the probe hooked up to the main board?

As I mentioned, I just picked up my pH probe locally; there are lots of options on eBay for ~$20. They will probably work OK; you could always get the Pinpoint pH probe (a little more expensive). You probably get what you pay for, but at this point in time (prototyping), I just needed a pH probe that could measure pH, and do all the things I wanted it to do.
 
#132 ·
I personally like the DS3231 chip, since the DS1307 does seem to drift. The libraries are interchangeable, so there is no extra work involved.
See above.
 
#133 · (Edited)
mainly for the removal so many wires as my unit will be on the outside of my stand and thought i would use the sd card on the web shield to gather data over time. i love data and thought it would be cool to do this. i had already decided for now to use extra long sensor cables just to make sure they made it to the controller.
doc
 
#134 ·
Interesting

Interesting, I am going to bookmark this thread. I have begun working on the design of a more simple system based on an inexpensive PLC. I have both a planted freshwater tank and a reef tank. My goal is to automate several of the functions on the saltwater tank but I am starting with the simpler freshwater tank. I have a temperature probe and it now reports temperature. I have a pH prob and it reports pH levels. I can have the PLC turn on and off the heater using the temperature input and can turn on and off the CO2 based on the pH level. And the PLC turns on and off the lights according to time of day. I am planning to establish a water top off this weekend as I just received two micro level sensor which can detect water level. The above is easy and relatively inexpensive.

Next, I want to measure ammonia and CO2 directly and looking for sensors for these. I am also going to work on a semi-auto water change system, (mostly in view of the larger saltwater tank not the smaller and easier freshwater tank.) Going to put two water barrels in the garage and run plumbing into where the tanks are. Eventually, I will push a button to empty a certain amount of water into a waste barrel, then, push a second button to move a pre conditioned amount of water into the tank from the clean barrel.
 
#135 ·
Next, I want to measure ammonia and CO2 directly and looking for sensors for these. I am also going to work on a semi-auto water change system, (mostly in view of the larger saltwater tank not the smaller and easier freshwater tank.) Going to put two water barrels in the garage and run plumbing into where the tanks are. Eventually, I will push a button to empty a certain amount of water into a waste barrel, then, push a second button to move a pre conditioned amount of water into the tank from the clean barrel.
The following CO2 sensor (for air) was looked at by mistergreen:

http://www.co2meter.com/collections/co2-sensors/products/k-30-co2-sensor-module

Thread: http://www.plantedtank.net/forums/showthread.php?t=195988

It certainly is cheaper than CO2 sensors made specifically for aquatic purposes.

Ammonia probes run about $300 and up, last I checked.
 
#138 ·
Found this thought I would post it

http://www.youtube.com/watch?v=fCxzA9_kg6s

and here is something I am more famalir with myself the .NET framework http://www.youtube.com/watch?v=jOAqTpAy8-g
Just to let you know, that video is using an older version of the Arduino IDE, many libraries now do not work with Arduino IDE versions 1.0 and lower.

I suppose a simple "Hello World" sketch would be as good as any place to start programming.

Be aware that the project will get much more difficult, very quickly :)
 
#142 ·
Hey Scapegoat, opensourceaquatics.com is showing a "Page Not Found" error. You can still get to the Wiki page though.

I'll post up the hardware page soon. I am really looking forward to getting started on this.

DarkBlade, I just found your aquarium controller thread on gta aquatics, really impressive work. You will definitely have to share your code on the wiki page once that gets rolling.
 
#145 ·
I'm waiting to play with everything a little before I post on scapegoat's site. i've been watching the tracking for everything all week, it all finally came in today, but the office manager closed the office early so i couldnt pick it up! So frustrating...

Darkblade, you should post up the work you did on your controller, you've done a great job.

Mike in MD, any progress on your controller?
 
#147 ·
Darkblade, you should post up the work you did on your controller, you've done a great job.
It's been stagnating because I've been busy with other projects.

I did finally manage to get the RTC working; now I just need to program adjustable RTC, light timer, and auto-dosing, and I'll be done. If I actually work at it, a couple weeks work, at most...but real life comes first :)
 
#150 ·
The buttons and some of the layouts are based off of Jarduino.

The backend coding is all new.

Jarduino version 1.1 will only compile on older versions of the Arduino IDE (prior to version 1.0). Some libraries will only work on newer versions of Arduino IDE.

So, either you will have to:

a) use an older Arduino IDE so you can compile Jarduino, but rewrite some libraries
b) use a newer Arduino IDE so you can use newer libraries, but scrap Jarduino
 
#153 ·
I'm getting nothing but errors when I try to compile Jarduino.

Any advice would be great, because I am getting nowhere over here.

Code:
Jarduino_v1_2_beta2:153: error: no matching function for call to 'DS1307::DS1307(int, int)'
/Users/DJW/Documents/Arduino/libraries/DS1307/DS1307.h:50: note: candidates are: DS1307::DS1307()
/Users/DJW/Documents/Arduino/libraries/DS1307/DS1307.h:47: note:                 DS1307::DS1307(const DS1307&)
Jarduino_v1_2_beta2:154: error: 'DS1307_RAM' does not name a type
Jarduino_v1_2_beta2:156: error: 'Time' does not name a type
Jarduino_v1_2_beta2.ino: In function 'void TimeDateBar(boolean)':
Jarduino_v1_2_beta2:894: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:894: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:900: error: 'class DS1307' has no member named 'getDateStr'
Jarduino_v1_2_beta2:900: error: 'FORMAT_LONG' was not declared in this scope
Jarduino_v1_2_beta2:900: error: 'FORMAT_LITTLEENDIAN' was not declared in this scope
Jarduino_v1_2_beta2:906: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:906: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:923: error: 'class DS1307' has no member named 'getDateStr'
Jarduino_v1_2_beta2:923: error: 'FORMAT_LONG' was not declared in this scope
Jarduino_v1_2_beta2:923: error: 'FORMAT_LITTLEENDIAN' was not declared in this scope
Jarduino_v1_2_beta2:927: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:927: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:964: error: 'class DS1307' has no member named 'getTimeStr'
Jarduino_v1_2_beta2:964: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void LED_levels_output()':
Jarduino_v1_2_beta2:1106: error: 't' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void TimeSaver(boolean)':
Jarduino_v1_2_beta2:1699: error: 'class DS1307' has no member named 'getTimeStr'
Jarduino_v1_2_beta2:1699: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1707: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1709: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1714: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1716: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1721: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1729: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1734: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1744: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:1755: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1755: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1761: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1761: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1765: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1765: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1783: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1783: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1789: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1789: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1795: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1795: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1812: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1812: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1818: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1818: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2:1824: error: 'class DS1307' has no member named 'getMonthStr'
Jarduino_v1_2_beta2:1824: error: 'FORMAT_SHORT' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void mainScreen(boolean)':
Jarduino_v1_2_beta2:2180: error: 't' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void clockScreen(boolean)':
Jarduino_v1_2_beta2:2460: error: 't' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void feedingTimeOutput()':
Jarduino_v1_2_beta2:3683: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:3693: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:3702: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:3712: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:3721: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:3731: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:3740: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:3750: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2.ino: In function 'void setFeederTimesScreen(boolean)':
Jarduino_v1_2_beta2:3776: error: 't' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void processMyTouch()':
Jarduino_v1_2_beta2:4104: error: 't_temp' was not declared in this scope
Jarduino_v1_2_beta2:4104: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:4179: error: 'class DS1307' has no member named 'setTime'
Jarduino_v1_2_beta2:4180: error: 'class DS1307' has no member named 'setDate'
Jarduino_v1_2_beta2:4292: error: 't_temp' was not declared in this scope
Jarduino_v1_2_beta2:4292: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:4344: error: 't_temp' was not declared in this scope
Jarduino_v1_2_beta2:4344: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2.ino: In function 'void setup()':
Jarduino_v1_2_beta2:5769: error: 'class DS1307' has no member named 'halt'
Jarduino_v1_2_beta2:5771: error: 't' was not declared in this scope
Jarduino_v1_2_beta2.ino: In function 'void loop()':
Jarduino_v1_2_beta2:5785: error: 't' was not declared in this scope
Jarduino_v1_2_beta2:5785: error: 'class DS1307' has no member named 'getTime'
Jarduino_v1_2_beta2:5807: error: 'class DS1307' has no member named 'getTime'
 
#158 ·
Are you sure you are using the right library?

I am not sure what is included in Jarduino version 1.2 beta, as I did not pay to see the source code.

From what I understand though, he has switched from Joyce's library to Karlsen's.

I assume you are using the newer version of the Arduino IDE as well?

As mentioned before, this project is not as simple as "plug and play"...
 
#160 ·
I wound up starting completely over. I re-installed Arduino, continued having bad luck with Jarduino, but I was able to get another aquarium controller sketch called Stilo to work. Except after loading the first screen it just flashes and reloads every second. I think this is because I don't have the RTC installed yet. I will do that today.

flc, thats a good idea to check out dorkbot. They have a meeting tonight, I just might have to stop by.
 
#161 ·
I never tried Stilo myself, but it sounds odd that not having an RTC installed would cause the entire sketch to reset itself every second.

Usually, without an RTC, any time/date functions won't work. The only thing I can think of is that the sketch relies on the RTC to do something (i.e. check on the status of the sketch so that it can request new data from the temperature/pH probe), but there are better ways than querying the RTC.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top