Subject: ESP32 pH Sensor Project with Water Pump Integration
Hello Arduino Forum,
I hope this message finds you well. I would like to share and seek assistance with my ongoing project involving an ESP32-based pH sensor. The current state of the project is a functional pH sensor using the ESP32 platform. The next step is to integrate two water pumps to manage a water solution effectively.
Hardware Used:
- ESP32
- Gravity: Analog pH Sensor/Meter Kit V2
- Dupont cable
- USB micro type B cable
Connection Details:
My connection from the Dupont cable to the pH Signal Conversion Board to the ESP32 is GND, 3V3, and GPIO 35.
Code Snippet:
#include "DFRobot_ESP_PH.h"
#include "EEPROM.h"
DFRobot_ESP_PH ph;
#define ESPADC 4096.0
#define ESPVOLTAGE 3300
#define PH_PIN 35
float voltage, phValue, temperature = 25;
void setup() {
Serial.begin(115200);
EEPROM.begin(32);
ph.begin();
}
void loop() {
static unsigned long timepoint = millis();
if (millis() - timepoint > 1000U) //time interval: 1s
{
timepoint = millis();
voltage = analogRead(PH_PIN) / ESPADC * ESPVOLTAGE;
Serial.print("voltage:");
Serial.println(voltage, 4);
Serial.print("temperature:");
Serial.print(temperature, 1);
Serial.println("^C");
phValue = ph.readPH(voltage, temperature);
Serial.print("pH:");
Serial.println(phValue, 4);
}
ph.calibration(voltage, temperature);
}
float readTemperature() {
// Add your code here to get the temperature from your temperature sensor
}
Project Expansion:
Now, I'm looking to integrate two water pumps into the project. I would greatly appreciate your guidance on the materials needed and the connections required to make this integration possible. Any tutorials, documentation, or references you can provide will be immensely helpful.
Thank you in advance for your assistance! I'm looking forward to your valuable insights.
Best regards, Leo