I purchased the analog version of Atlas’ pH sensor kit and am waiting on an ADS1115 to convert the signal to digital for i2c. My question is, what input do I use in MyCodo? I was thinking I would try the actual Atlas pH Sensor (i2c) and just provide the address of the ADS1115 I’m using with it?
Hi. You’ll need to add the ADS1115 Input, then configure it to work with your particular analog device. For example, with the use of a pH sensor, if you find a linear voltage response of 0.15 - 1.15 volts corresponds to a pH range of 2 - 12, you would set these values to the Unscaled Unit Min/Max (voltage) and Rescaled Unit Min/Max (pH), respectively, and select the appropriate Rescaled Measurement (pH). See the screenshot, below.
Thanks for the quick response! Will I still be able to calibrate the Atlas pH sensor with MyCodo?
Are you referring to this product?
No, you will have to refer to the calibration section of the datasheet, which provides an arduino sketch to perform calibration.
Yes, that is exactly what I purchased.Any concerns or feedback on it?
Thanks again, I will refer to the datasheet for calibration instructions
I read some issues with pH values fluctuating if there are any other wires or pipes in the tub with the sensor, e.g. pump. I will be running a pump in my solution (running Top Feed DWC) so a little worried this might cause interference
I didn’t know about this product until now, or at least reviewed the datasheet. One thing I notice in the datasheet is the equation for calculating the pH, so it is not a linear response:
So, you will not be able to directly use the ADS1115 Input, but rather you will need to create your own custom Input that also uses the same ADS1115 library in the ADS1115 Input, but also performs this math on the voltage to yield the pH.
You should check out this post from the old forum that deals with this exact problem with this exact sensor.
Ok, I did see that and wondered if I had to calculate the pH. Sounds like it would be much easier to just pull the trigger on the Atlas pH i2c Sensor kit.
Thanks for the support, really appreciate all that you have done!
The I2C sensor does make it easier to interface, for sure. But building your own custom Input is not that difficult, especially considering the ADS1115 Input already exists. We’d merely have to duplicate that Input and make some tweaks to include the equation. I’d be here to help with that.
I went ahead and got this:
i’ll return the analog version and keep things simple. Thank you again!
You’re welcome. Glad to help. Have fun setting it up.
This topic got me asking myself, why isn’t there an easy way to use an equation to rescale ADC measurements? There exists a way to rescale it linearly, but that’s severely limiting (as demonstrated in this topic).
So I added the ability to select the rescale method, either Linear or Equation, which now allows an equation to be used to rescale the measurement. For this particular sensor, you would merely select Equation as the Equation Method and enter
(−5.6548∗x)+15.509 for the Equation. This removes the extra step of setting up an Equation Function to perform this calculation externally to the Input and has the added benefit of performing the calculation at the time of measurement acquisition rather than on whatever Period the Function is set to.
I also just realized now that all measurements are able to be converted to another unit at the time of acquisition. This will typically allow you to store a measurement in the database as a different unit (e.g. if temperature is measured in degrees Celsius, it can be converted to and stored as degrees Fahrenheit). However, you could also create a new unit, such as ph_equation and set the conversion equation to the above equation, and it would perform the calculation as a part of the conversion. However, this is neither intuitive (as I, the developer, didn’t realize this was an option until now) nor as elegant as having the ability to set an equation in the measurement settings of the Input.
@jkstant if it’s not too late, you might try my custom inputs over at How to create a custom input with associated calibration routine? - #8 by dookaloosy and let me know what you think?
@dookaloosy Thanks for the recommendation. I just ordered the pH sensor with i2c board and it hooked up quick and easy. I will try my hand at custom inputs once I am more familiar with the great system.