Arduino PH Meter Project
I search for build a PH meter for my fish tank. I want a PH reading , have a LCD display , can also provide a temperature information. I search on market , I can't find any similar PH meter module except this one.
After find the hardware , then start build up this Arduino PH Meter project. Hardware that you need :
1x PH Meter Board
1x Arduino UNO R3
1x LCD Keypad Shield
1x Case
For PH meter board , I choose to use this one. This provide PH reading and two temperature sensor , one is LM35 for measure room temperature , one is DS18B20 for measure water temperature.
Download the Assembly Guide in here.
Enclosure :
For the Case , I use my 3D printer for print the case that fit the Arduino UNO R3 + LCD Keypad Shield + PH meter board. I also put the design on thingiverse.
Wiring :
On the PH meter baord , there have 6 pins.
Vcc - Connect to Arduino 5V for provide power supply to PH meter board
Gnd - Connect to Arduino GND
Gnd - Connect to Arduino GND
Po - That is analog output , connect to Arduino A2 (A0 already use for LCD Keypad Shield)
T1 - That is analog output , connect to Arduino A1 (That is connect the build-in LM35 temperature sensor)
T2 - That is digital output , connect to Arduino D2 (That is connect the DS18B20 temperature sensor)
After wiring everything , then I start the develop the Arduino Sketch. Download the most update Arduino Sketch in here : https://github.com/kevinlohk/ArduinoPhMeter
Thanks for France customer , Clément Saillant , his Arduino Sketch support write the Calibration value on EPPROM.
https://github.com/vjclearscreen/ArduinoPhMeter
For the Library that using in my Sketch :
LiquidCrystal : http://arduino.cc/en/Reference/LiquidCrystal
OneWire : http://www.pjrc.com/teensy/td_libs_OneWire.html
DallasTemperature : http://milesburton.com/Dallas_Temperature_Control_Library
Following is my desire function list that I want to implement.
Informative :
- In the first page , provide PH , Room Temperature and Water Temperature reading. This is basic function , already implement.
Calibration :
- Two point calibration. This function already implement.
- For the future , I wish will have the off-line calibrate function. That mean enter the Calibration Mode , put the PH probe in the PH4 buffer solution , and then press the key on keypad. Store the value in EPPROM. And then put the PH probe in the Ph7 buffer solution , press the key on keypad and store the value in EPPROM.So no need to connect computer for complie the code and upload to the UNO anymore. But this function not yet start develop. Special Thanks for Clément Saillant , who made this happen. :)
Communication :
- Serial port communication via UNO 's USB port. Now already implement four command : Read PH , Read Room Temperature , Read Water Temperature and Read all reading.
- For future , I will build an small program for Raspberry Pi , so that Pi connect PH meter via USB cable , and then read all the information and store in Pi's SQLLite database and I can visit it via Web.
Calibration Procedure :
Now I just implement two point calibrate , compare Ph7 and Ph4 reading and calculate the ratio.
1) Put the PH Probe into Ph 7 or Ph 6.86 buffer solution.
2) Press "Right" key on Keypad, write down "R:" value on paper.
3) Put the PH Probe into Ph 4 or Ph 4.01 buffer solution.
4) Write down "R:" value on paper.
5) Open Sketch file , put the value and download to the UNO.
double Ph7Buffer = 6.86; <-- If you are using Ph 6.86 buffer solution , input 6.86 , if you are using Ph7 buffer solution , input 7
double Ph4Buffer = 4.01; <-- If you are using Ph 4.01 buffer solution , input 4.01 , if you are using Ph4 buffer solution , input 4
double Ph7Reading = 528; <-- Input the value that you write of Ph 7 or Ph 6.86 buffer solution
double Ph4Reading = 655; <-- Input the value that you write of Ph 4.01 or Ph 4 buffer solution
Serial Communication Protocol :
Serial Port setting : 9600,n,8,1
Command 1 : Enquiry DS18B20 Value
Syntex : (in Hex format)
AA 01 01 BB
Command 2 : Enquiry LM35 Value
Syntex : (in Hex format)
AA 01 02 BB
Command 3 : Enquiry PH Value
Syntex : (in Hex format)
AA 01 03 BB
Command 4 : Enquiry DS18B20 , LM35 and PH Value
Syntex : (in Hex format)
AA 01 04 BB