Here is a quick setup guide to start measuring ph using the Dormant Labs PH Module V2.
You will need:
You will need:
- PH 4 and 7 Calibration Solution
- A Arduino
- Dormant Labs PH Module V2 (available here)
- A PH Probe
- Three small cups, two to hold the two calibration solutions, and one to hold water for rinsing the ph probe
- 4 dupont male to female cables
First connect the ph probe to the ph module
Then
- Connect V+ to Arduino 5v or 3v pin
- Connect GND to Arduino GND pin
- Connect SDA to Arduino SDA pin(For UNO it is A4)
- Connect SCL to Arduino SCL pin (For UNO it is A5)
- Attach USB to Arduino
Get the source code from here:
https://gist.github.com/rezahussain/bb7715534688d8dc0520
and upload it using the Arduino IDE. If you do not have the arduino IDE get it from the arduino site.
After uploading the code, open the serial monitor and you should see output like this:
You are now ready to calibrate your ph probe.
Fill one cup with PH 4.0 calibration solution, one with 7.0 calibration solution, and a third with water.
Remove the cover from the ph probe and rinse it with water.
Then dip the probe in the 4.0 solution, swirl it around for a little bit, and write down the value you see for the avgPhVolts. For me, I saw 0.95v.
Rinse the ph probe in the water, then dip in the 7.0 calibration solution and write down what you see for avgPhVolts.
Here are the values I got:
Now I replace the volt4, volt7, and calibrationTempC, then re-upload to the Arduino.
After re-uploading your probe is now calibrated! The serial monitor of the arduino IDE will show the correct information. Edit the code as you like now.
Saludos, ¿que tipo de sonda de Ph seria la recomendada?
ReplyDelete¿la temperatura seria ambiental o del liquido?
gracias
This post really help me a lot and I have learnt some new things from your blog.
Deletedosing pump manufacturer in india | chemical dosing system | water treatment equipments | metering pump manufacturer in india
Hello, I use this one at home http://www.omega.com/pptst/PHE735215_735315.html
ReplyDeleteThe sensor measures ambient/environment temperature, if your liquid temp is different, then you will need to measure that using a temp sensor.
is hardware open source? I want to check if it has galvanic isolation.
ReplyDeleteHello, it is not open source, but it does have galvanic isolation.
DeleteIs there a way to calibrate with 7.0 & 10.0 solutions?
DeleteHello David, I have ordered ph 10 calibration solution and will amend this tutorial or make another for 7 & 10 calibration.
Deletewhen it arrives
DeleteHere is the 7 & 10 ph calibration tutorial
Deletehttp://rezaalihussain.blogspot.com/2014/07/measuring-ph-with-dormant-labs-ph.html
Hello - I am creating my first arduino project to dose acid in a swimming pool. I am trying to pick a ph board. I see several on the internet. I find yours and the atlas most interesting with the most support documentation. I still have a couple of questions, what is the resolution that can be read? Can it read 2 decimal points? How stable is it over time? How many do you have running? What if any is the major issues (it seems pretty simple , can't be many). And I see some units on the internet do not seem to be able to read both acid and base solutions without a jumper change because it sounds like the arduino cannot read negative voltages and lastly what is the advantage of reading Voltage instead of getting serial data like the atlas unit?
ReplyDeleteThank you,
Anthony
Sorry for the late reply just saw this post,
DeleteThe board has more than 0.01 resolution, but that is probably the limit you will hit because that is the limit of ph probes. The board doesnt do hardware averaging, so you can use the ph readings from your probe in real time, but the example code does do averaging to stabilize the reading. You can increase the averaging or reduce it, but the averaging used in the example code is what I use in my own projects. The only major issue is if you want to use multiple versions of this board together you will need to learn i2c multiplexing.
The arduino cannot read negative voltages, I solved that problem on this board by shifting the negative voltage into the positive range via an op amp.
Ok, the advantage of reading a voltage is that is what the ph probe outputs. With the code here you get to see exactly how the voltage is converted to ph, and verify that that is the correct way, or make your changes.
If you just get a serial output like you say is on the atlas stamp, then you have to trust that they are doing the voltage to ph conversion correctly. You don't have to trust my version, you can just read the code and see.
I just purchased one. I decided the activity and commitment of this blog will make all the difference in the would if I need help.
ReplyDeleteAnthony
Thanks!!
DeleteI know there is temp comp on the board. It this to comp for the liquid temperature or the board temperature? If it is for the liquid, does the board heatup during operation enough to be above the ambient that the liquid would be at?
ReplyDeleteHi Anthony
DeleteThe temp comp on the board is to provide an ambient temp reading that can be used to temp-adjust the ph reading.
if my pool temp is ar 90F, should I override the board temp with this temp in C?
ReplyDeleteyes
DeleteHi! We are group of high school students from the Philippines who are interested with your PH module. We would like to adopt it in line with our Science Investigatory Project. We would like to buy your device and innovate it. How long would the shipping take? We are willing to pay for the shipping if it would take lesser days. (Ideally, we need it as soon as possible, probably within 3-5 days with FedEx) And can you PLEASE assist us with our project by sending us the already assembled device? We are expecting for your reply as soon as possible. And we hope that you could help us. Thank you!
ReplyDelete~Thea Kaylee Libunao
~Daryll Allam
~Jude Guliman
~Dayl Mendoza
Hello, email me at crownonfire@gmail.com or reza@dormantlabs.com, I have replied to you on tindie and facebook as well. Its the weekend so I will stay up late to reply, since we are in different timezones.
DeleteFirst.... To all looking at buying this.. I highly recommend. Awesome product. I bought this and a few other ones, but the Galvanic isolation on this one is helping me to get consistent data. I got this working on my Arduino Uno, but I ran out of pins so I switched to a Mega and now the only output I'm getting is "avgMeasuredPH-" from the first serial.print command after initializing the serial connection. I just copied & pasted code. I'm sure it has something to do with the SDA & SCL. pins (20 & 21). any help would be awesome!
ReplyDeletenever mind
ReplyDeleteI just got some free time(weekend), did you get it to work? In this tutorial http://rezaalihussain.blogspot.com/2014/07/measuring-ph-with-dormant-labs-ph.html I do use an arduino mega.
DeleteThere are two known cases of people saying they have trouble getting it to work with an arduino mega now.
For a mega the first things I would check are that you are using 5v for the module, since the mega's i2c pullups are for 5v, and then that the usb cable is connected directly to the computer.
I am using an 2560 mega in the linked tutorial.
Let me know
Im used to using ph meters, but my first time building one ,I need accuracy so I need to be able to calibrate it often without having to reupload a sketch everytime I would like to calibrate just wanted to know if you had a tutorial or know of one where I could calibrate with a button or something? Thanks in advance
ReplyDeleteThe module v1 had this functionality but everyone that emailed me wanted a to upload a sketch instead of pressing a button. https://www.tindie.com/products/rezahussain/arduino-ph-shield-by-dormant-labs/
Deletehttp://rezaalihussain.blogspot.com/2012/09/arduino-dormant-labs-ph-shield-tutorial.html
I have one of these units left that you can buy, but v1 doesn't have galvanic isolation. Email me at crownonfire@gmail.com if you still want it.
I will be uploading a tutorial for v2 using a pcduino and button, but it might be awhile before it comes out.
Hello Reza – I am confused on you temp compensation. I am not seeing where the actual temperature during normal use is being compensated to the calibration temp. I am seeing calibration temp being compensated to 25 deg. When the subroutine “getRoomTemperatureC” returns the current ave temp in celcius, it just prints it.
ReplyDeleteThank you,
Anthony
Okay - After some research I think I answered my own question. It seems that temperature does not matter at 25 deg cel and / or a ph of 7. deviate from those values and then is is a concern. In my case I am measuring a solution near 7 (about 7.5) at a temp of less than 32 deg cel. looks like my error will be about 0.03 according to a chart I found. It looks like the math in the script will be about 0.06.
ReplyDeleteWow, I left out the code for final room temp compensation. It seems I took a shortcut for the calibration code too. I unified it and updated the code.
Deletehttps://gist.github.com/rezahussain/bb7715534688d8dc0520
Give me your values for volt4,volt7,calibrationTempC and a room temp and I can confirm by calculating by hand as well.
Got the sensor running on my Netduino and need to calibrate it.
ReplyDeleteProblem is, that I can only get a PH solution of 6.85 and not 7.
Looking at the code, you have used fixed values like 4 and 7 in your calculations.
Can I replace the value 7 with 6.85?
PS. Anyone using a Netduino - you need pull up resistors,.
One from 5V to SDA and one from 5V to SCL.
I used 2.2KOhm
Yes, you should be able to replace the 7 with 6.85 in the loop() function, but the other functions should remain as is.
DeleteGood morning, I am mistaken or this device also measures the conductivity of electrons of the solution?
ReplyDeleteHello, sorry this does not measure EC levels in solution or connect to EC probes.
DeleteDo you know any sensor that can measure the conductivity of electrons?
DeleteNot off of the shelf... if I had to get an EC reading into my arduino, I would hijack the signal from an existing EC meter like this..http://www.ebay.com/itm/EC-Electrical-Conductivity-Meter-Tester-Water-1999-s-cm-ATC-Backlight-Aquarium-/131299303440?pt=Vintage_Electronics_R2&hash=item1e920c6010
DeleteYou will need to do some soldering but it should be fairly straight forward
DeleteThe temp that shows up is the ambient temperature. With that said, should I recalibrate seasonally if say the room varies between colder in winter and warmer is summer? When I say varies, I'm talking up to 85f in the summer and down to 55f in the winter. Perhaps, I should calibrate based off the reservoir, that varies 60f - 75f?
ReplyDeleteHello, you would modify this line, and find a way to feed the reservoir temp into it. That is the best way.
Deletedouble roomTempCompensatedMeasuredPH = adjustPHBasedOnTemp(measuredPH,roomTempC);
You do not need to recalibrate, you just need to do correct temp compensation.
Hello, I would like to use this, but I am using an arduino mega and I use sda and scl pins for the clock, Could I use others pins for the comunication??
ReplyDeleteThank you
Do you mean you have a clock i2c device communicating with the arduino on the i2c pins? If so then it will work you just need to make sure that the i2c device doesnt have the same i2c address as the ph module.
DeleteDo you have available datasheet for this sensor?
ReplyDeleteHello, there is no datasheet sorry
Deletehi reza i am mohammedrady can you helpme in this projcte
ReplyDeleteHello, what do you need assistance with?
DeleteGood day, friend you have the source code of this project (Dormant Labs PH Module V2) to work with pic microcontroller?
ReplyDeleteHello, no I haven't had a chance to work with pics yet. Still using arduino for small stuff and ARM for bigger stuff.
DeleteHeya, I am going to be using this module in a few freshwater aquariums. Would it be better to calibrate to water temp instead of room temp?
ReplyDeleteHello Sheldon,
Deleteyou should calibrate using room temp, because that is what your calibration solutions are at. Once calibrated, you should change the line
double roomTempC = getRoomTemperatureC();
double roomTempCompensatedMeasuredPH = adjustPHBasedOnTemp(measuredPH,roomTempC);
To
double aquariumTemp = 25;//assuming your aquarium is at 25 deg celsius
double aquariumTempCompensatedMeasuredPH = adjustPHBasedOnTemp(measuredPH,aquariumTemp);
Then change the rest of the program accordingly.
Is it possible tot read the value out of te arduino bij UDP to my domotics system?
ReplyDeleteIt is, but is beyond the scope of this tutorial.
DeleteWhat is the measure of the BNC connector?
ReplyDeleteReza, fantastic product. Will recommend it to all my friends. BTW, I'm just wondering whether you have any EC module available for sale?
ReplyDeleteThanks! At the moment there is no EC module or plans for one. That could change in about 2 years time.
DeleteHi Reza, I just wondered if your module Dormant Labs PH Module V2 can be run
ReplyDeletewith any PH electrode or not. I'm thinking about this one, it's very cheap:
http://www.aliexpress.com/item/PH-Electrode-Probe-BNC-Connector-for-
Aquarium-PH-Controller-Meter-Sensor-gib/959990218.html . Will it work?
And next question - is it galvanically separated? I'm thinking of using together with some EC module (didn't choose which exactly) and I'm worried a little 'bout interference between them.
DeleteHello ytubeadmin,
DeleteYes that ph probe will work, but remember its cheap because it has 0.2ph error.
For question number 2 yes the ph module galvanically isolates the micro controller from the probe.
Hi Reza
ReplyDeleteI need 10 of these for an experiment I am going to run, can you supply that number in a short time scale?
Dave
ps. Excellent how to by the way
Thanks!
DeleteI have updated the tindie store (https://www.tindie.com/products/rezahussain/dormant-labs-ph-module-v2/?pt=full_prod_search), I only have 10 units left, after that I start R&D on v3 which might take a year or 2.
This comment has been removed by the author.
ReplyDeleteHi Reza
ReplyDeleteThanks for updating tindie, by the time I got the boss to pay for them there were only 8 left!...will you be getting any more made up or is that it?
Cheers
Dave
Yikes, sorry that is it until v3 comes out.
DeleteWhat will version 3 bring to the table?
ReplyDeleteThe big two are configurable i2c addressing + ORP. Then other mostly minor improvements.
DeleteThis comment has been removed by the author.
ReplyDeleteDear Mr Hussain,
ReplyDeleteI just bought yout pH module and a good probe with a good accuracy.
I have 2 calibration solution (pH 6.863 et 4.something)
I have changed 2 lines in the for loop to manage this difference as you explained previously.
I have a 10.0 ph solution for test and I read 9.75 wich is too low
I measure the tap water and I got 8.25 wich is way too high
I have the ambiant temperature = 30 Celcius (it seems too much here)
I follow line by line your very well done tutorial but now I need, the accuracy is under my expectations ans I dont know why.
Regards,
Phil
Hello Phil,
DeleteFor this tutorial you need 7 ph calibration solution and 4 ph calibration solution. 6.863 and 4.something won't work bc the calibration code is designed to work across a 3ph difference between solutions.
That is what I would check first.
Best Regards,
Reza
Hi Reza,
ReplyDeleteThanks for your quick reply.
I have solutions at pH2, pH4, pH7 et and pH10
I used the pH 4 solution and pH7 for calibration.
I measured those solutions with a professionnal pHmeter and I got :
pH2 = 1.853
pH 4 = 4.023
pH7 = 7.00
pH10 = 9.62
With your module I got :
pH2 = 1.65
pH4 = 3.95
pH7 = 7.00
pH10 = 9.51
Those differences are not acceptable.
may be it's a temperature compesation problem.
Your module display 27.75 celcius ! (a way too high)
please help me to resolve this big accuracy problem.
Regards,
Phil
Hello Phil,
Delete1. Do you know your ambient temp?
2. Also are your solutions at room temp?
3. can you give the outputs for avgMeasuredPH and roomTempCompensatedPH?
Thanks,
Reza
To clarify, the temp is important because if the temp isn't 25 deg C, then your professional ph meter is wrong.
DeleteHi has anyone tried this probe and a Intel Edison board can't get the probe to Work cant see it on i2c or with the sketch :/
ReplyDeleteHello Christian,
DeleteI haven't worked with an edison board but it seems from here https://communities.intel.com/thread/55439 that you should try using 4.7kohm pullup resistors and or change the i2c frequency.
okay thanks, i was debugging on the the board and i fried the board i got from you :( sucks biiip :/
DeleteDo you have any more left ?
DeleteDamn Sold out since Apr 30, 2015
Deleteany plans to restock ?
Sorry no plans to restock, v3 is the next time it will be on sale.
DeleteWith the info on this site I got it to work in no-time.
DeleteCalibration is fine also.
But when I add your code to my excisting code I get this:
avgMeasuredPH-avgMeasuredPH-inf roomTempCompensatedPH-inf avgRoomtTempC-23.8125 avgPhVolts-0.7201 7CalVolts-0.6700 4CalVolts-0.9864 4CalTempAdjusted-3.9550
Not sure were to look for. Can you give me a pointer?
This comment has been removed by the author.
ReplyDeleteIt was due to #include SoftwareSerial.h
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteAm using the board in a green house and it is pretty humid in there.
ReplyDeleteShould I coat the board in some way, or will it be ok?
Not sure if any components will rust
I haven't had mine rust yet, and I haven't had any reports of rusting. It shouldn't bc all pads are covered with solder. If you really want to then I recommend you use a silicone conformal coating. Something like this http://www.amazon.com/MG-Chemicals-Silicone-Conformal-Coating/dp/B004SPJOKK
DeleteHi, this instrument can I use for long time/ continuos ? For example, I need to use in an tilápia tank / aquarium and I need to get some information about ph. Can I put the instrument intro the water all the time or I need to mesurement and desintall? Thanks!
ReplyDeletehi reza thank you i want buy this device how can buy it thanks reza
ReplyDeleteHi Reza
ReplyDeleteHave you completed the V3 yet with ORP?... I need a PH and ORP board for a project. How long unitl it is ready if you have not finished it?
Is there any way to install a LCD display to make it portable?
ReplyDeleteHow is version 3 coming?
ReplyDeleteAgain having some issues. Last time results shown 'inf' due to software serial libra en this time to virtual wire library. Is there a fix since I cant work around it.
ReplyDeleteThe other issue seems to be that a master-slave setup is being used to communicate with the pH pcb. I already have master slave arduino setup so my slave can't access the PH. If I try the I2C bus locks up since it can't be master and slave at the same time.
Hello!
ReplyDeleteAny updates on v3? Any plans for EC? Or can you recommend any alternatives?
Thanks!
Hola, sabes como activar un dosificador de Acido Hidroponico cuando la lectura del PH supere 6,5. Es para controlar una plantación de Hortalizas.
ReplyDeletehallo,
ReplyDeletewann kommt V3 auf den Markt. Einzige Bord mit Isolation trennung im Netz.
Hi I really appreciate your all efforts which is specially for the ph test well done.
ReplyDeleteph test
good as no reaction comes I have found an alternative
ReplyDeletehttps://www.whiteboxes.ch/product-category/boards/?v=3a52f3c22ed6
I have been your silent reader for a while, and now I think you should know how valuable and helpful the information and tips you have shared with us. Thank you for sharing. Would love to see your updates again and maybe we can share ideas and collaborate with each other in the future.
ReplyDeleteElcometer
This is Great Information...
ReplyDeleteThanks for Sharing...
pH Meter, Data Logger, Temperaturer Logger, Humidity Meter, Controller
Do you still producing this module? We are looking to get some. Thank you
ReplyDelete