My Raspberry pi DIY aquarium controller - The Planted Tank Forum
 
LinkBack Thread Tools Display Modes
post #1 of 14 (permalink) Old 12-16-2014, 01:13 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2014
Location: Athens,Greece
Posts: 6
My Raspberry pi DIY aquarium controller

Hello to all DIYers of this forum.

This is my first post in "Planted Tank" although I am following your conversations for a long time.
I'd like to present an open aquarium controller I am working on for some time.
The controller is based on a Raspberry pi B+ and a custom PCB.




It is designed to be completely WEB based. The controller provides the following characteristics :

- Lights controller : 3 channels PWM with configurable output levels + 3 relay switches. The light controller is driven by 3 programmable arbitrary waveform generators and a time scheduler so sunrise/sunset, peak hours and moonlight effects can be easily programmed.
The scheduler gets information from a .ini style file. Among others this file contains the scheduler section. This section looks like this:

[Lights]
A1=10:30,0
A2=11:00,50
A3=13:00,50
A4=13:30,100

B1=10:00,0
B2=10:10,10
B3=10:30,10

...etc

Every channel currently supports up to 16 points per day. Between points the controller ramps up or down linearly.

- High quality instrument grade pH sensor 20bit interface with automatic temperature compensation.

- CO2 controller with programmable set point, hysteresis, alarm points etc

- High quality RTD (pt100) 20 bit temperature sensor.

- Temperature controller with programmable set point,hysteresis,alarm points etc and separate outputs for heaters and coolers/fans etc.

- on board RTC (DS1307) with battery backup (in the case of internet connection failure).

- Three (3) auxiliary 20bit differential analog inputs for other sensors (TDS, pressure, level etc )

- Two One-Wire interface conectors wit 3/5V interface. I am currently using one of them to interface an AM2302 Temperature/humidity sensor.

- i2c and I/O expansion connector for future upgrades like more pwm channels,extra i/o etc.

- On board buzzer for alarms.

- Mysql database logging.

The main controller app is programmed in plain ansi C. It is still under development but it is fully operational. What is missing is the WEB part.
I abanoned my initial idea to base the web part on Apache/PHP server and I am currently working on a NodeJS version. Since my experience in web programming is limited, this is gonna take some time
I was hopping to find people willing to contribute in coding but I am still working on it alone.
Currently I am using the .ini file to configure the controller. You can download the current snapshot of the code from my GIT repository here.

The hardware part of the controller is based on a custom board called piAquarium shield.

You can download the pcb files from my piAquarium site here. I admire that it's assembly is not for the fainthearted but I am sure that many people here are able to build it successfully.

Feel free to comment.
Attached Thumbnails
Click image for larger version

Name:	piAqCap1.PNG
Views:	946
Size:	142.6 KB
ID:	404442  

Click image for larger version

Name:	piAquariumA.jpg
Views:	15133
Size:	127.6 KB
ID:	404450  

Click image for larger version

Name:	RaspiAq1.JPG
Views:	658
Size:	74.2 KB
ID:	404458  

Click image for larger version

Name:	WiringPCB.png
Views:	656
Size:	204.3 KB
ID:	404466  


Last edited by abrous3d; 12-16-2014 at 02:06 PM. Reason: Email notification added
abrous3d is offline  
Sponsored Links
Advertisement
 
post #2 of 14 (permalink) Old 12-17-2014, 01:11 AM
Wannabe Guru
 
PTrader: (0/0%)
Join Date: Jun 2014
Location: Cape Coral, Florida
Posts: 1,286
Do you have information on the sensors used?

I did a light controller (for the LED+) but when I started shopping for sensors, other than temperature, they seemed ridiculously expensive.

I tried a flow meter (to monitor my filter), and the inexpensive flow meters added huge resistance, dropped flow in half from the meter.

I did see some decent level meters to track water level.

But I'd love to track other parameters, if there are relatively inexpensive ways.

Linwood

Latest tank build:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Linwood is offline  
post #3 of 14 (permalink) Old 12-17-2014, 06:52 AM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2014
Location: Athens,Greece
Posts: 6
Quote:
Originally Posted by Linwood View Post
Do you have information on the sensors used?

I did a light controller (for the LED+) but when I started shopping for sensors, other than temperature, they seemed ridiculously expensive.

I tried a flow meter (to monitor my filter), and the inexpensive flow meters added huge resistance, dropped flow in half from the meter.

I did see some decent level meters to track water level.

But I'd love to track other parameters, if there are relatively inexpensive ways.
I have no experience with flow sensors, I've never used any.
For temperature sensing I use DIY RTDs (pt100). You can buy the row sensor from Mouser. It is something like this (http://gr.mouser.com/ProductDetail/H...qx4XlXXg%3d%3d) or this (http://gr.mouser.com/ProductDetail/H...KZonGX4A%3d%3d). It is fairly easy to impregnate and wire them like this :



For pH Sybon Scientific will do if you want a cheap solution (http://fish.aquaristic.net/Sybon-Sci...ard-grade.html).
For level metering a pressure sensor is the cheapest solution. See the TI paper here. Probably I'll add this feature to piAquarium sometime soon.
Another interesting sensor I support in piAquarium (although not directly related with the tank itself - but a nice addition for those interested to monitor the surrounding environment as well) is the environmental AM2302[/url] (Temperature/Humidity). It is dirt cheap (~4 Euro) and impressively accurate. It is available through Amazon.
Attached Thumbnails
Click image for larger version

Name:	temp.jpg
Views:	5666
Size:	20.1 KB
ID:	404634  


Last edited by abrous3d; 12-17-2014 at 06:56 AM. Reason: links didn't work for some reason
abrous3d is offline  
 
post #4 of 14 (permalink) Old 12-17-2014, 12:38 PM
Wannabe Guru
 
PTrader: (0/0%)
Join Date: Jun 2014
Location: Cape Coral, Florida
Posts: 1,286
Thank you. That ph sensor is much closer to what I had in mind. I tried to find some specs on it, and can't, but will keep looking. Yes I want cheap, but would like to know how accurate it is also.

For level sensing, this is one thing I found that was intriguing, also a bit pricey though:

http://www.adafruit.com/product/464

Not sure I'd drive a top-off system with it (at least without a double check for safety), but an interesting thing to use to monitor evaporation rates, especially if you had the ambient humidity/temp as you mention with that last sensor.

Have you ever seen affordable sensors for other water parameters, like nitrates especially?

Linwood

Latest tank build:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Linwood is offline  
post #5 of 14 (permalink) Old 12-17-2014, 01:25 PM
Planted Tank Enthusiast
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Edmonton, Alberta, Canada
Posts: 797
Here's another cheap PH probe. I have 2 arriving today or tomorrow, just need a stamp now to get it working.

http://www.banggood.com/PH-Electrode...-p-912723.html
robsworld78 is offline  
post #6 of 14 (permalink) Old 12-17-2014, 04:28 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Quote:
Originally Posted by Linwood View Post
I tried a flow meter (to monitor my filter), and the inexpensive flow meters added huge resistance, dropped flow in half from the meter.
Yeah, I hope they make a cheap non mechanical flow sensor sometime. There are ones using light or ultrasound which is awesome because it doesn't restrict flow but they're hundreds of dollars.
mistergreen is offline  
post #7 of 14 (permalink) Old 12-20-2014, 02:46 PM
Algae Grower
 
jmelvin's Avatar
 
PTrader: (1/100%)
Join Date: Aug 2014
Location: Florida
Posts: 75
I have a question about the pH probe you are using. My controller is web based as well using html5 with 11 inputs accepting 0-5v, 0-10, 10k out 4-20ma. Does the probe you are using use any of those types of inputs? I will go deeper into my setup in another post when it's done. Thanks

Edit: Flowline makes great level sensors and +GF+ George Fisher makes a wide variety of flow meters along with pH, temp, ORP, alkalinity, acidity. Granted they are rather expensive but you get what you pay for. Lol

Sent from my Tweaked N3.

From the depths of my substrate!
jmelvin is offline  
post #8 of 14 (permalink) Old 12-20-2014, 03:09 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2014
Location: Athens,Greece
Posts: 6
This is my very first attempt with the web interface. I abandoned the traditional Apache/PHP approach in favor of Node.JS. My knowledge for both is very basic so it does not make any difference. The interface is ugly and limited in terms of functionality but I'll improve it.

Attached Thumbnails
Click image for larger version

Name:	piwebCap2.jpg
Views:	6258
Size:	57.4 KB
ID:	405770  

abrous3d is offline  
post #9 of 14 (permalink) Old 12-20-2014, 03:19 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2014
Location: Athens,Greece
Posts: 6
Quote:
Originally Posted by jmelvin View Post
I have a question about the pH probe you are using. My controller is web based as well using html5 with 11 inputs accepting 0-5v, 0-10, 10k out 4-20ma. Does the probe you are using use any of those types of inputs? I will go deeper into my setup in another post when it's done. Thanks

Edit: Flowline makes great level sensors and +GF+ George Fisher makes a wide variety of flow meters along with pH, temp, ORP, alkalinity, acidity. Granted they are rather expensive but you get what you pay for. Lol

Sent from my Tweaked N3.
I am using a native pH electrode. pH electrodes have extremely high output resistance in the GigaOhm range so in order to interface them with any type of A/D you have to use an op-amp as buffer. This op-amp must have input bias in the range of fA like the one I am using in my circuit. This is necessary to keep biasing errors low.
If you don't want to mess with ic's and pcb stuff probably this is what you are looking for (http://atlas-scientific.com/product_...pberry_pi.html and http://atlas-scientific.com/product_...ts/ezo_ph.html).

Last edited by abrous3d; 12-20-2014 at 03:34 PM. Reason: add info
abrous3d is offline  
post #10 of 14 (permalink) Old 12-20-2014, 04:49 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Cyprus
Posts: 47
Γεια σου φιλέ
I am using an arduino controller for lights, co2, dosing pumps and I was thinking about a pH probe. Is it possible to have the probe in the water 24/7 or you put it in the water occasionally? Also how do you maintain that and what's its life expectency? (PH probe)

Ευχαριστώ
ichristos is offline  
post #11 of 14 (permalink) Old 12-20-2014, 05:48 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2014
Location: Athens,Greece
Posts: 6
Quote:
Originally Posted by ichristos View Post
Γεια σου φιλέ
I am using an arduino controller for lights, co2, dosing pumps and I was thinking about a pH probe. Is it possible to have the probe in the water 24/7 or you put it in the water occasionally? Also how do you maintain that and what's its life expectency? (PH probe)

Ευχαριστώ
Γεια σου,

pH probes are designed to stay submersed 24/7. With the proper maintenance and re-calibration they can operate for many years. To maintain your probes you need a pH probe cleaning solution and a pH probe maintenance solution.
To interface such an electrode with your arduino you need a pH board interface like the one listed in one of my previous posts.
abrous3d is offline  
post #12 of 14 (permalink) Old 12-21-2014, 03:43 AM
Algae Grower
 
PTrader: (0/0%)
Join Date: Mar 2007
Location: Ind
Posts: 122
Not every pH probe can be submerged 24/7. The electrolyte in them can spoil soon. The test/lab ones are the cheaper ones, used to measure a sample and store.

There is a whole different line for measuring 24/7, seen them mentioned as online-meter probes.


That apart, yours is a very interesting build coming up! Will be waiting for more.
saiko is offline  
post #13 of 14 (permalink) Old 12-21-2014, 08:22 AM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Nov 2014
Location: Athens,Greece
Posts: 6
Quote:
Originally Posted by saiko View Post
Not every pH probe can be submerged 24/7. The electrolyte in them can spoil soon. The test/lab ones are the cheaper ones, used to measure a sample and store.

There is a whole different line for measuring 24/7, seen them mentioned as online-meter probes.
That's true for special purpose electrodes like soil, foodcare, meat etc. General purpose glass or plastic electrodes are usually ok but in any case is good to check the datasheet.
I prefer Hanna Instruments or American Marine electrodes but a year ago I tried a cheap Sybon Scientific Instruments and I must say that it rocks for its price (22 Euro).
abrous3d is offline  
post #14 of 14 (permalink) Old 12-21-2014, 08:40 AM
Algae Grower
 
PTrader: (0/0%)
Join Date: Aug 2012
Location: Near Amsterdam
Posts: 43
extremely interesting this!
wijnands is offline  
Reply

Tags
None

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:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



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
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome