Arduino library for Gravity: Analog pH Sensor / Meter Kit V2, SKU: SEN0161-V2
Chapter 3 code_Project_72 The second part 2 of "The Arduino World Book" code_Project_72
- code_Project_72
- By:Farkad Adnan فرقد عدنان - -E-mail: farkad.hpfa95@gmail.com -inst : farkadadnan
- #farkadadnan , #farkad_adnan , فرقد عدنان#
- FaceBook: كتاب عالم الاردوينو
- inst : arduinobook
- #كتاب_عالم_الاردوينو
- #كتاب_عالم_الآردوينو
- facebook : https://www.facebook.com/profile.php?id=100002145048612
- instagram: https://www.instagram.com/farkadadnan/
- linkedin : https://www.linkedin.com/in/farkad-adnan-499972121/
Analog pH meter V2 is specifically designed to measure the pH of the solution and reflect the acidity or alkalinity. DFRobot ph sensor is commonly used in various applications such as aquaponics, aquaculture, and environmental water testing.
2.Input calph commands in the serial monitor to start the calibration. The program will automatically identify which of the two standard buffer solutions is present: either 4.0 and 7.0. In this step, the standard buffer solution of 7.0 will be identified.
- After the calibration, input exitph command in the serial monitor to save the relevant parameters and exit the calibration mode. Note: Only after inputing exitph command in the serial monitor can the relevant parameters be saved.
//By:Farkad Adnan
#include "DFRobot_PH.h"
#include <EEPROM.h>
#define PH_PIN A1
float voltage,phValue,temperature = 25;
DFRobot_PH ph;
void setup(){
Serial.begin(115200);
ph.begin();
}
void loop(){
static unsigned long timepoint = millis();
if(millis()-timepoint>1000U){
timepoint = millis();
voltage = analogRead(PH_PIN)/1024.0*5000;
phValue = ph.readPH(voltage,temperature);
Serial.print("temperature:");
Serial.print(temperature,1);
Serial.print("^C pH:");
Serial.println(phValue,2);
}
ph.calibration(voltage,temperature);
}
float readTemperature(){
}