Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Robo-Tank Isolated PH Circuit
#1
Well today was a good day, I'm happy to say I will have a PH circuit available in a week or two. I've been working on this a while and finally everything is looking good, now I just need to write some code for all the functions.

The circuit is fully isolated from anything else on the controller, the GND, power, SCL and SDA pins are all isloated using a high quality isolator. 

I've been doing tests comparing it to the Atlas PH circuit using a brand new low end probe. I have things setup so I just move the probe BNC from circuit to circuit. The Atlas circuit is connected to Robo-Tank and I have the new circuit running on a Mega 2560 for easy testing. 

Last night I mixed up a batch of 4.01 buffer so I had a true number to test with. The Atlas circuit settled at a rock solid 4.06 and this one I left overnight and it settled at a rock solid 4.01 all through the night. Now I wonder which one is truly correct, I have to go with Atlas just because but the buffer is 4.01 and that's what my circuit likes, hmmm....

I've also done some tests with different PH levels and the difference is always the same across the board so I'm sure once both circuits are calibrated to the probe they would be a perfect match.

The resolution is in thousands from .001 - 14.000, here's the last 10 readings.

4.011
4.011
4.013
4.012
4.011
4.012
4.014
4.013
4.012
4.012

To produce a reading it takes about 1.8 seconds, slightly slower than Atlas, I think that one takes 1.6 seconds. Everything is done on the circuit and values are sent to the controller so no load is on the controller, same as the Atlas.

Now I'm trying to get all the features nailed down , this is what I have so far, if anyone can think of something let me know.
  • Output PH and estimated CO2
  • Change I2C address
  • Save I2C address in eeprom
  • Temperature compensation
  • 1, 2 and 3 point calibration
  • Save calibration data
  • Clear calibration data
  • User can input KH value to generate estimated CO2 levels (once a real KH probe can be used that number can update circuit)
  • Save KH value
  • Circuit will calculate and track the slope (degradation) of the probe and report to controller so you can monitor probe condition.
Here's some pics. The board has a high quality OpAmp, processor, isolator, linear voltage regulator and a reverse polarity schottky diode and the PCB is 70mm x 30mm in size. The board can be connected to the controller using the USB ports on Gen3 hardware and the header pins can be used to connect to Gen2 or directly to any Arduino. The header pins can also be used to daisy chain multiple circuits together. You can use multiple PH and I hope to have a circuit for ORP and conductivity soon. 

[Image: pH_Front.jpg]

[Image: pH_Back.jpg]
Reply to top
#2
What would be the cost of this Nice thingy?
Reply to top
#3
Anyone who has the controller can have them at $40 a circuit, that's half price compared to Atlas. I won't have any probes though but you can get that anywhere.
Reply to top
#4
I just listed the new pH circuit in the store as a pre-order expected to ship March 6th. You likely got an email and some of you will get more than one. I typically only send emails using the list from the store side of website but well over half the users on the forum aren't registered in the store so they never get emails, for this I want them to get something as well and currently I have no way of syncing emails from the store and forum. Sorry about this, it won't happen again for a while. :)

Here's a link to the listing.
https://www.robo-tank.ca/en/Robo-Tank-Pl...82c83.html

Anyone who has the controller will have a coupon code so the cost will be $40, the coupon is good for 30 days. That might sound expensive for a small board but the components are very expensive and it takes quite a bit of time to assemble as the IC needs to be programmed before mounting. If I could offer it cheaper I would. So please share a link on your social media as this can be used without having Robo-Tank. I'm hoping to sell enough to order an Atlas EC and ORP circuit and probes, I have the Exacto™ circuits working but nothing to compare with. Yes I'm calling all the probe circuit the Exacto™ line. Yeah I know a little corny but hey... 

The circuit is obviously setup for the controller but I'm also going to have an open source library for it so you can use directly on any Arduino, PI or any other microcontroller that has I2C. Using the library it'll be super easy to setup and use. 

I basically have all the code done for the circuit and it's working great. In the next few days I'll be setting up the display and controller for them, I have most of the mock up done for the display and added the pictures below. 

The circuit will output pH, pOH and estimated CO2 based on a kH value sent to the circuit. I didn't use the standard formula to calculate the CO2, I found another that adjusts a bit because of objects in an aquarium. So hopefully a little better but still obviously an estimate.

I added an auto scan feature, with this if its connected directly to an Arduino with the test sketch the circuit will be plug and play, no messing with I2C addresses or configuring the circuit.

I did take 3 point calibration for granted, I scoured the web and couldn't find any formula to use 3 point, then I checked some other popular aquarium controllers and they only offer 2 point which makes me wonder. I know 3 point isn't necessary for an aquarium but the option should be there for the radicals. Definitely disappointing, if anyone knows of some data showing math for 3 point please let me know.

With that said I do have the 2 point working and setup an auto calibration system. I call it auto because once you start the process it will decide when the reading is stable enough to continue, the goal is to have a stable reading for 60 seconds. If it reads 7.055 and 60 seconds later the current reading is +/- 0.005 or less it will pass the test and send the calibration to the circuit. It does the check in 10 second intervals. If a reading on an interval is more than +/- 0.005 it'll start the timer over. It sounds impossible but it's pretty easy to achieve. 

Here's what's checked during calibration to ensure the probe is in good working condition.
  • When you calibrate a probe the 1st point should always be 7.0 solution, then anything for 2nd point. If the probe reads more than +/- 25mV away from the 7.0 the probe might need cleaning because of build up or may need replacing.
  • Next check is the slope, this divides the mV the probe read by the theoretical voltages expected. Even a new high quality probe won't be perfect because of the nature of measuring ph but checking the slope ensures the probe falls in the industries acceptable range of 90% - 105%.
  • Response time
I got the first check from Hanna, this is important because a probe could be +/- 50mV off point 1 and still have a good slope, when that occurs the probe likely just needs to be cleaned. Obviously I don't have Hanna's algorithm but I'm going to make my own which can be tweaked over time as this will be on the controller side of things. It'll looks at slope, point 1 offset and responsiveness and give your probe a health rating. The real trick will be trying to create a pattern it can also be based on so the health meter can be updated continuously and not only during calibration. I'm hoping it will also be able to tell you its time to calibrate and not just based on a schedule.

This is the sensor probe screen from the hardware menu. When you add a new circuit you press the "Scan For Circuits" button and it'll setup the circuit. It'll look at other circuits connected and then select an available I2C address so almost plug and play. I don't really want a scanning system running non-stop as new hardware isn't added often so going with the single press of a button.

[Image: hardware_probes.jpg]

When you select a circuit to calibrate you get the following screen. Instead of using a temp sensor I'm going to have the user set the temperature of the calibration solution as it can get messy for some using a probe. Plus people typically store things in the same location so temps are always the same, this will be saved to eeprom so only need to change if you know something is different.

[Image: hardware_probes_cal1.jpg]

When you select the type of calibration you get the screen below. Here you set the pH of the solution which is also saved to eeprom and hit start. Then once the controller is happy it'll go to point 2 calibration if applicable and you repeat this step and calibration is complete.

[Image: hardware_probes_cal2.jpg]

This is what I'm going to start with on the health screen for probes. As I mentioned above the x of 10 is calculated based on slope, response time and point 1 offset. The color of text will change accordingly. To start this will only be updated after calibration but when I have more time I'm going to be trying things to have it update consistently. 

[Image: hardware_probes_health.jpg]

If anyone can think of more let me know.
Reply to top
#5
(02-20-2019, 03:13 PM)Rob F Wrote: math for 3 point

I guess it's just 2 ranges, each being a 2 point calibration.
Cal A < Cal B < Cal C. 

If pH < B, use 2 point math for A-B
else use 2 point math for B-C.
Reply to top
#6
Ah thanks whitebox, that makes sense and now I see why other aquarium controllers don't offer it, that would only be useful if your over/under 7.0. There probably isn't a tank under 7.0 so there would never be a need for calibrating both sides. I spent so much time looking for an answer and found a couple others at some point searching the same. Now I know I am going to add it to the circuit but not offer the option on the controller. I always thought it was useful in any scenario.
Reply to top
#7
Looks great! How will this connect to the controller if both USB ports are used? Can I use a USB hub?
Reply to top
#8
Thanks, you can't use a USB hub but I do have something that will turn the a USB into 4 USB's, that board would be $10 for now.
Reply to top
#9
Probably going to order as soon as my paycheck comes in :D
Is it already implemented and tested in v5.02?

Btw does it work with jumperwires? Don’t have any USB Ports with I2C if I’m correct
Reply to top
#10
Will there be the possibility of having more than 4 USB in the future as well? I was thinking I would want 3 relay boxes and 2 pH probes.
Reply to top
#11
(02-21-2019, 03:02 AM)fietsenrex Wrote: Probably going to order as soon as my paycheck comes in :D
Is it already implemented and tested in v5.02?

Btw does it work with jumperwires? Don’t have any USB Ports with I2C if I’m correct

Technically it's not added in v5.02 but I have the working code ready so it can be added quickly. There isn't anything to really test on the controller for the circuits functionality. The controller simply receives the pH from the circuit, if it works on one Arduino it'll work on any. For example if you setup a sketch to work with the circuit you would use the following line of code with the library I made.

float myPhVariable = ph.getPh();

With that the Arduino will have the pH in the myPhVariable and you can do whatever with it.

You can connect the circuit using jumperwires, those 8 headers on the board can also be used, one row of headers for Arduino to circuit and then the other row of headers if to connect multiple circuits together so you don't need to run a 2nd set of wires to the Arduino. Doesn't matter which row is input or output. The circuit can also be powered using 3.3v, 5v or 12v. The USB is 12v and the header pins are 3.3v/5v. If powered with 12v the onboard regulator will drop it down to 5v, if powered with 3.3v/5v the regulator is bypassed.

(02-21-2019, 06:19 AM)aquaalgae Wrote: Will there be the possibility of having more than 4 USB in the future as well? I was thinking I would want 3 relay boxes and 2 pH probes.

There isn't a limit on ports, the only catch is another I2C buffer might be required. If you add to much wire/devices to an I2C bus it will overload and lock up.

The buffer I use puts out 1800pf, after mounted and connectors/traces my guess is its down to 1500pf. I'm guessing you use 6ft USB cables for each power bar, with those I guess your down to say 800pf. Add more cables with connectors and it'll drop again, once it gets too low problems happen so you need to amplify the I2C bus so it can handle more. Just plugging in a 100ft USB cable with nothing connected will likely lock up the I2C. These numbers are strictly guesses, and every setup will be different with the same connected because lots of variables involved. 

As I'm still unsure what this buffer can truly handle I only made a simple 4 port USB hub that does nothing but gives extra USB plugs. But I have my doubts all 4 could be used with 6ft of cable on each as that's a lot of connections. Eventually I will have a USB hub with a buffer and I'm thinking of adding a buffer / USB port on the power bar so you can plug something into it without needing a hub. Either way you won't have a problem running that and there's a good chance you can connect everything to the bus as is.
Reply to top
#12
Will this hub be available in the store soon? I would like to purchase it with the pH circuit. Also, Do you have files to 3d print a case for the ph circuit?
Reply to top
#13
Yeah I'll assemble one tonight and post a listing. I don't have any cases designed yet but I will have before I ship and can send you the files.
Reply to top
#14
Sounds great! I'll be ordering this weekend! :)
Reply to top
#15
Thanks aquaalgae!
Reply to top
#16
just ordered the circuit :D
now onward seeking a trustworthy probe :P
Reply to top
#17
Thank-you fietsenrex, I saw that, hope you got my message. The way time flies it won't be long till I ship it.



I also added that USB expansion hub to the pH listing as an addon.
Reply to top
#18
yeah got your e-mail ;)
Reply to top
#19
Hello Rob.
I'm using a second-generation controller. I want to order a robo-tank Isolated ph circuit.
Should I order I2C buffer?
I use ph probe with a 1.5 meter cable.
Is the I2C buffer assembled?
Reply to top
#20
Hi vilich, I think it might be best to get the buffer as there's already a lot on the line with the stuff on the controller. The buffer would be assembled and best to mount as close to the controller board as possible and then you can plug pH circuit into it.
Reply to top


Possibly Related Threads…
Thread Author Replies Views Last Post
  AC Power Bar Circuit Boards Rob F 29 52,033 07-27-2018, 03:52 PM
Last Post: Rob F

Forum Jump:

Current time: 03-18-2024, 09:18 PM