The Planted Tank Forum banner

Aquarium Monitoring/Control System

10168 38
Hey everyone!

Been a few years since I have had a planted tank and decided it was time to get back into it. In the mean time I have been progressing as an electrical engineer and working long hours. Needing an outlet and hobby I wanted to try my hand at planted tanks again! So I thought I would blend the two together a little bit. My wife and I are currently out on a field assignment and moving back home here in the next few months. Figured I would get my tank and everything once I got back home as to not disturb the bacteria/fish/plants. In the mean time I decided to go forward with designing and building a little aquarium monitoring system!

My plan is to turn this into a short weekly journal about my overall progress, issues I have run into, solutions I have found, and questions for everyone.

So Ill start off where I began the process, keep in mind I am an electrical engineer and not a mechanical/process. I created a crude P&ID (Process and Instrumentation Diagram) to begin with as an overall layout for the project. You can see that attached as a PDF. I appreciate any comments or thoughts on the overall layout. Ill give a short description of each system as it stands now.

I had an Arduino Uno laying around from a Christmas gift to my wife that she opted not to use, so I am now putting that to use as a control system. I am planning on bringing in a pH, ORP, Dissolved Oxygen, Temperature and Conductivity probes purchased from Atlas Scientific into the Arduino through a Tentacle Shield (see attached photos of my work in progress with the pH sensor, Tentacle Shield and a small LCD screen). Ideally I will also have an Atlas Scientific flow meter for the outlet of the filter to maybe warn of filter cleaning time, etc. This will be the monitoring part of the tank, I am hoping to use accrued data after a few months of operation to implement a control scheme with hiccups I may have to manually fix during the time and data from the probes. Ill get more into the electronics part of the project next week. Mostly just excited not to have to do the drop color pH tests anymore :)

Second is the CO2 injection system, which we are all familiar with. I am planning on buying a nice GLA system once moving back. Ideally at some point Ill be able to incorporate the solenoid into my control system and make my own pH controller or tank system controller.

Third, dosing pumps. I plan on having at a minimum two dosing pumps shown in the P&ID. These will be Macros and Micros using the PPS Pro Method at the moment. Simply chose this since it seemed most suited to a dosing pump application, but still considering EI as well. Let me know what you prefer :) I think before this gets implemented I will add a small top off dosing pump as well, but not sure on how I will supply the treated water consistently for this at the moment. Hoping to have an RO system at this point.

Fourth, but not least, the tank system basics. Currently slated to be an Aquamaxx 12 gallon (hoping for bigger), a Hydor professional canister filter, Hydor inline heater, and Finnex Planted+ 24/7.

That is all I have for this week, let me know what you think. Next week will be related to control cabinet design, terminal block layout, specifications, etc based on the P&ID.

Have a good week!

Attachments

  • Like
Reactions: The Dude1
21 - 39 of 39 Posts

· Registered
Joined
·
224 Posts
Pretty sure that EC can be done with a future 8 power cord and a cheap noise circuit. I know how to smooth the values in code now

Temp is a $2 sensor.

I am close to having. $5 solution for water level


Sent from my iPhone using Tapatalk
Have you considered using analog circuits instead of the atlas stamps? Would be cheaper with these and even cheaper if you could just get the circuits and then get cheaper probes off [Ebay Link Removed]

Conductivity
ORP
pH
Analog isolation
 

· Registered
Joined
·
132 Posts
Have you considered using analog circuits instead of the atlas stamps? Would be cheaper with these and even cheaper if you could just get the circuits and then get cheaper probes off [Ebay Link Removed]



Conductivity

ORP

pH

Analog isolation


I am certainly all ears. Definately EC is simple. But I don’t know what the man behind the curtain is doing in a ph or orp circuit. If I had a clean value from either, the rest could be done in code


Sent from my iPhone using Tapatalk
 

· Registered
Joined
·
132 Posts
I also think that and ESP8266 WiFi module could be used to eliminate the issue of isolation all together. They are about $5 It used arduino type code


Sent from my iPhone using Tapatalk
 

· Premium Member
Joined
·
373 Posts
If you are not opposed to spending just a little bit of money... take a look at the circuits/sensors built by Atlas-Scientific.com . Basically you communicate with any underlying micro-controller using a a UART or I2C interfaces. Each of their products comes with sample code for integration with Arduino / Rasberry Pi. They are a bit more money, but they solve allot of problems for you.
 

· Registered
Joined
·
13,335 Posts
In the butting in when not qualified dept.....

All these sensors are mostly ADC type stuff..
"Just" need to clean up the analog signal and digitize it..
https://www.omega.com/Green/pdf/pHbasics_REF.pdf
or
http://www2.emersonprocess.com/siteadmincenter/PM Rosemount Analytical Documents/Liq_ADS_43-014.pdf
THE MEASUREMENT OF ORP
An ORP sensor consists of an ORP electrode and a
reference electrode, in much the same fashion as a
pH measurement.
Basically measure the mV of a reference compared to the mV of the reading sensor..
http://www2.emersonprocess.com/siteadmincenter/PM Rosemount Analytical Documents/Liq_ADS_43-014.pdf

so there is the people behind the curtain..

See simple /s
https://www.elcircuit.com/2012/04/ph-sensors-lmp91200.html
http://www.ti.com/lit/ds/snas571e/snas571e.pdf
 

· Premium Member
Joined
·
373 Posts
Derby and DiverJoe,

you guys are up my alley. I'm a process controls guy from way back (DCS, PLCs, SCADA). Presently building my own aquarium controller, but I've traded out controllers and changed direction a few times.. Arduino Duo, TI TM4C Tiva Series, Rasberry Pi3 running Win10 IoT Core , etc...

Just getting back into the fish keeping hobby which has encouraged me to finish my own controller.
 

· Registered
Joined
·
132 Posts
Derby and DiverJoe,



you guys are up my alley. I'm a process controls guy from way back (DCS, PLCs, SCADA). Presently building my own aquarium controller, but I've traded out controllers and changed direction a few times.. Arduino Duo, TI TM4C Tiva Series, Rasberry Pi3 running Win10 IoT Core , etc...



Just getting back into the fish keeping hobby which has encouraged me to finish my own controller.


Keep the arduino for daq and the Pi with Debian Linux for data manipulation and process control


Sent from my iPhone using Tapatalk
 

· Registered
Joined
·
55 Posts
Discussion Starter · #28 ·
Derby and DiverJoe,

you guys are up my alley. I'm a process controls guy from way back (DCS, PLCs, SCADA). Presently building my own aquarium controller, but I've traded out controllers and changed direction a few times.. Arduino Duo, TI TM4C Tiva Series, Rasberry Pi3 running Win10 IoT Core , etc...

Just getting back into the fish keeping hobby which has encouraged me to finish my own controller.
Awesome join the club! Like diver said seems the general trend (of this thread anyways) will be using an Arduino for data gathering and use the raspberry pi for manipulation and control.

I'm a fan of the atlas scientific stuff as well, seems well made and the documentation is excellent. Which can't be said for every manufacturer lol.

I am tempted to break into the Arduino IoT boards as well for the wireless functionality but we will see...more research needed...

Sent from my Pixel 2 XL using Tapatalk
 

· Registered
Joined
·
224 Posts
I am certainly all ears. Definately EC is simple. But I don’t know what the man behind the curtain is doing in a ph or orp circuit. If I had a clean value from either, the rest could be done in code


Sent from my iPhone using Tapatalk
ph and ORP probes give out a negative to positive range voltage (-2 to +2 for ORP, -400mV to +400mV for pH), all these boards are doing is converting those ranges to 0-5V to be used for arduino. EC I'm actually less clear on, appears to generate a signal that it puts through the probe and then does some signal conditioning to get a 0-5V signal. They provide the schematics so you can see exactly what the circuit contains.

Compared to the cost of that tentacle board and 3 atlas stamps it's a huge difference. But you would then have to implement your own code for calibrating and turning that 0-5V signal into ph/orp
 

· Registered
Joined
·
132 Posts
I am currently using atlas for EC and pH. One of my side goals was to come up with an inexpensive DIY replacement for what is out there. Once I have a signal, turning it to a readable value is easy. So is calibration. For example peristalic dosing pumps. Measure what they actually do, and store that as a constant and perform whatever math from there. EC - the water is a known 1000 micro seimens, it says it is 945. Store the delta and apply it to the readings as they change. When it is not linear, then you have to do a bit of fancy math, but usually nothing beyond high school. I have also come to realize that we really are not managing to 5 digits. The sensors themselves are not that good.
 

· Registered
Joined
·
132 Posts
ph and ORP probes give out a negative to positive range voltage (-2 to +2 for ORP, -400mV to +400mV for pH), all these boards are doing is converting those ranges to 0-5V to be used for arduino. EC I'm actually less clear on, appears to generate a signal that it puts through the probe and then does some signal conditioning to get a 0-5V signal. They provide the schematics so you can see exactly what the circuit contains.

Compared to the cost of that tentacle board and 3 atlas stamps it's a huge difference. But you would then have to implement your own code for calibrating and turning that 0-5V signal into ph/orp

I actually got a $2 EC working - just thought that it was messed up because I did not understand signal conditioning or isolation. The sensor is literally 2 pins in the water! They are usually stainless or carbon. Or, in my case a figure 8 power cord from a router with 2 stainless screws in the 2 holes and the tops ground off! I was able to get the values to track right along store bought. If the pH and ORP sensors give me a value +-2 to an adc (i.e. arduino analog pin) then the rest is just math and process control. Most of that is documented.
 

· Registered
Joined
·
55 Posts
Discussion Starter · #33 ·
Post 2 - Starter Schematic

Hey everyone,

Been a little over a week since I last updated. I have been working on drawing up a schematic for how I want to wire up the control system. My plan is to have a little Hoffman enclosure or something similar with some din rail, terminal blocks etc. Just a preliminary wiring diagram/schematic so comments are certainly welcome.

At the moment I have the top section divided by voltages (120VAC, 12VDC, 5VDC and 3.3VDC). I plan on bringing the 120VAC into the enclosure via a cord from a wall outlet, this will drive a 12VDC power supply (Phoenix Contact 2938756 for now...) and the filter, heater, etc. through relays. I had to try and find some low coil power relays for the Arduino to be able to drive via 5VDC without overdrawing on any given pin. I did not want to go through and use transistors or anything to drive the relays like I noticed on some sites. Currently planning on using some TE Connectivity R10-E1Z2-S140 relays for this as they should pull max 20mA from the pin which is acceptable.

Otherwise I drew up the I2C bus, going to need a UART to I2C converter for the flow meter. I realize I could probably just bring this in directly via UART to the Arduino, but for now I am going to try and do all communication via I2C. Going to try and use a NXP SC16IS741IPW,118.

Another note, I did some napkin calcs. I think all should be fine feeding the pump, heater, etc. from the one wall plug on my 20-40 gallon tank. Similar to a power strip but via terminal blocks. Any bigger than this and I might get a little nervous and would need to do some more in depth calculations. I plan on doing this, just haven't yet.

See attached for the PDF! When I am finished I will have this available in .dxf for whoever would like it in CAD. I am currently using QCad which is a nice setup, close enough to AutoCAD to pick up quickly.

Have a good one!
 

Attachments

· Registered
Joined
·
132 Posts
This is great! Take a look amz or eekbay and search for 8 channel relay 5v. It is great opto isolated you can power the 5v side from a power supply and only use the signal from the arduino or Pi to trigger the change. They can do 12-240v on the high side.

I have a 8 gang junction box wired with one of these that is driven by an ESP8266 WiFi board. The Pi talks to the board directly and turns things on/off


One other thing is that I2C may be a little prone to bus locks and signal noise - something to consider

Sent from my iPhone using Tapatalk
 

· Premium Member
Joined
·
373 Posts
Otherwise I drew up the I2C bus, going to need a UART to I2C converter for the flow meter. I realize I could probably just bring this in directly via UART to the Arduino, but for now I am going to try and do all communication via I2C. Going to try and use a NXP SC16IS741IPW,118.
I talked to Jordan over at Atlas-Scientific a few months back (wow 9 months ago) about adding I2C to both the EZO-Flow Universal Flow Meter Totalizer and EZO-RGB Embedded Color Sensor.
He mentioned their focus was on moving into their new much larger lab before continuing with further product development. However, it is something he would like to do with those two products. They moved into the new lab last fall. Perhaps, we will see something from them soon. (They have that EZO-Co2 Embedded NDIR Co2 Meter still in development.)

I own several of the previous flow meter boards and older color sensors. No desire to move to the EVO versions of them without I2C. In fact, I'm not going to convert to I2C for anything (no EVO) until I can receive all of my analog inputs (sans my level tape) over I2C. When they put I2C on those final two stamps, I will do an upgrade and replace all of my sensor circuits with new EVO stamps (Temp, pH, ORP, D.O., Conductivity, Flow, Color) and use I2C exclusively for communication. Right now I do Serial with two of the older 4 port serial port expanders... and my Temps are the older analog models.
 

· Registered
Joined
·
55 Posts
Discussion Starter · #36 ·
I talked to Jordan over at Atlas-Scientific a few months back (wow 9 months ago) about adding I2C to both the EZO-Flow Universal Flow Meter Totalizer and EZO-RGB Embedded Color Sensor.
He mentioned their focus was on moving into their new much larger lab before continuing with further product development. However, it is something he would like to do with those two products. They moved into the new lab last fall. Perhaps, we will see something from them soon. (They have that EZO-Co2 Embedded NDIR Co2 Meter still in development.)

I own several of the previous flow meter boards and older color sensors. No desire to move to the EVO versions of them without I2C. In fact, I'm not going to convert to I2C for anything (no EVO) until I can receive all of my analog inputs (sans my level tape) over I2C. When they put I2C on those final two stamps, I will do an upgrade and replace all of my sensor circuits with new EVO stamps (Temp, pH, ORP, D.O., Conductivity, Flow, Color) and use I2C exclusively for communication. Right now I do Serial with two of the older 4 port serial port expanders... and my Temps are the older analog models.
Gotcha that's good to know that they are working on transitioning those over, hopefully we will see them soon! And a CO2 sensor sounds awesome :)

Sent from my Pixel 2 XL using Tapatalk
 

· Premium Member
Joined
·
373 Posts
Gotcha that's good to know that they are working on transitioning those over, hopefully we will see them soon! And a CO2 sensor sounds awesome :)
Sent from my Pixel 2 XL using Tapatalk
The EZO-Flo, EZO-RGB and CO2 Sensor (ambient air, not water) over at Atlas-Scientific are all I2C capable now. The FLO was of interest to me and I snatched it up the first day it was available. I use the Temp, pH and Flow stamps from them over I2C... so much nicer than using a UART multiplexer.

They have a net little app for monitoring their various I2C capable sensors with a RaspberryPi3 and Windows10 IoT Core. (they haven't configured it to work with the FLO yet, but Jordan tells me that's coming). i tried it for Temp and pH. Update: Flo works on the newer version of the app.... but because the Flo meters don't plug neatly into the recommended Tentacle T3 shield, they don't promote it (you have to remove the BNC connector on the non-isolated side and do some drilling, jumpering and soldering).

http://www.sonoratechnical.com/images/Projects/phTempRaspbPiWinIOT.jpg
 

· Premium Member
Joined
·
373 Posts
I've become a bit concerned with three limitations of the Atlas-Sci IoT software:
1. It's based on Win10Iot for RaspPi which hasn't seen an update in 2 years. Feels like it will just fade away.
2. It's locked in to the 1Gb 1.5Ghz RaspPi3B (no + or 4 options w/out breaking critical features)
3. It's monitor only, with no provisions to open it up to users for control.

I really like the Atlas-Sci stuff and the flexibility of I2C connectivity, so I started looking for something a bit more 'native' for the Raspberry Pi 4.

Re-visited Node-Red and played around with it. Wow, it's come along way and folks are really running with it. With it achieving v1.0 status and adoption by Opto-22 for thier EPIC-Groov line of controllers, it's time to adopt that.

All of my IO is via I2C.... That's Atlas-Sci for sensors (Temp, pH, ORP, Conductivity, DO and Flo). Dosing is I2C as Well. Level switches, pumps, valves, etc... are all brought in via I2C expansion boards.

There are good I2C node/flow examples for the major I2C enabled chips that I will be using. For harder I2C integration (like the EZO stuff), folks are just embedding the Atlas-Sci python code right in a node, instead of trying to force the community-I2C lib node to work.

Node-Red runs directly on Debian Buster, which means I get to take advantage of the Raspberry Pi 4, it's mature drivers, overclocked speeds from 1.75Ghz - 2.0+Ghz, the GPU overclocked to ~800Mhz and 4GB of ram. Performance should be good. The Dashboard components have really matured so that it can serve as an interactive hmi of sorts for monitoring/controlling the processes.

I can always push key variables via MQTT up to a number of other Cloud IIoT offerings so that I will be able to monitor remotely with something like Graphene. (I would imagine it's only a matter of time before Node-Red will have some kind of Cloud IIoT w/ Visualization itself... rather than having to subscribe to AWS or Azure).

Primary focus will be local monitoring, followed by remote monitoring, ending with local control (won't add automation until I can see what's going on when I'm not there). For remote control, I could always RDP into a PC at my place, open a browser and then pull up the NodeRed Dashboard from the RaspberryPi (same network) in the short term.... I suppose that might work for remote monitoring as well in the short term...

Diver Joe, I'll be looking at your stuff, since I seemed to be moving in a more parallel direction with you..
 
21 - 39 of 39 Posts
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