Chat

Welcome to Flux

Treat Flux like your intern. Tell it what you'd like to build and it'll get to work. You can also ask it questions, brainstorm ideas, and teach it your preferences. Learn More

Explain project
Write a project description
Find schematic issues
Create a test plan
Simulate a circuit
Prepare for Manufacturing
Component Selection Workflow
New Subsystem Wizard
U1
C5 P1 - C6 P1
C9 P1 - R9 P2
U2 VINB- - R4 P1
U3 VINB- - R13 P1
C10 P1 - C14 P2
J1 Signal - R3 P1
R14 P1 - U1 ADDR
R15 P2 - C2 P1
R14 P1 - U1 ADDR
R15 P2 - C2 P1
C10 P1 - C14 P2
U2 VINA- - R5 P1
C5 P1 - C6 P1
C8 P2 - C12 P1
R15 P2 - C2 P1
J5 Signal - R12 P1
J3 Pin_2 - R11 P2
C7 P1 - U2 VINA+
J2 4 - U1 SCL
R15 P2 - C2 P1
R12 P2 - C13 P1
R15 P2 - C2 P1
J5 GND - C16 P1
J1 Signal - R3 P1
R15 P2 - C2 P1
J5 GND - C16 P1
R15 P2 - C2 P1
U1 SDA - J2 3
J3 Pin_2 - R11 P2
C2 P1 - U1 VCC
R15 P2 - C2 P1
J2 4 - U1 SCL
C5 P1 - C6 P1
C5 P1 - C6 P1
U3 VINB- - R13 P1
J5 Signal - R12 P1
R15 P2 - C2 P1
C8 P2 - C12 P1
R1 P2 - U2 VINB+
C11 P1 - U1 A0
C9 P1 - R9 P2
R12 P2 - C13 P1
R15 P2 - C2 P1
J5 GND - C16 P1
C5 P1 - C6 P1
R1 P2 - U2 VINB+
C8 P2 - C12 P1
C8 P2 - C12 P1
C10 P1 - C14 P2
R15 P2 - C2 P1
R15 P2 - C2 P1
J2 4 - U1 SCL
J5 GND - C16 P1
U2 VINB- - R4 P1
J3 Pin_2 - R11 P2
C7 P1 - U2 VINA+
C9 P1 - R9 P2
R15 P2 - C2 P1
R9 P1 - U3 VOUTA
C11 P1 - U1 A0
U1 SDA - J2 3
C5 P1 - C6 P1
R1 P2 - U2 VINB+
C11 P1 - U1 A0
R1 P2 - U2 VINB+
C2 P1 - U1 VCC
U1 SDA - J2 3
C7 P1 - U2 VINA+
R1 P2 - U2 VINB+
R15 P2 - C2 P1
R12 P2 - C13 P1
C9 P1 - R9 P2
J5 GND - C16 P1
C10 P1 - C14 P2
U2 VINA- - R5 P1
C11 P1 - U1 A0
R15 P2 - C2 P1
R9 P1 - U3 VOUTA
C4
Capacitance
1 µF
R12
Resistance
1000000 Ω
GND
GND
R3
Resistance
1000000 Ω
R11
Resistance
4700 Ω
C1
Capacitance
100 nF
GND
C8
Capacitance
100 nF
R6
Resistance
1000 Ω
C17
Capacitance
10µF
R5
Resistance
1000 Ω
R10
Resistance
1000 Ω
GND
C2
Capacitance
100 nF
GND
GND
C18
Capacitance
100nF
GND
C10
Capacitance
100 nF
GND
R9
Resistance
1000 Ω
GND
C6
Capacitance
100 nF
GND
R8
Resistance
10000 Ω
GND
C11
Capacitance
100 nF
GND
R14
Resistance
10000 Ω
C7
Capacitance
100 pF
GND
GND
C13
Capacitance
100 pF
GND
GND
GND
R4
Resistance
1000 Ω
R13
Resistance
1000 Ω
R2
Resistance
100000 Ω
C16
Capacitance
100 nF
C14
Capacitance
100 nF
GND
C12
Capacitance
100 nF
C9
Capacitance
100 nF
GND
GND
R1
Resistance
100000 Ω
C3
Capacitance
10 µF
C5
Capacitance
10 µF
GND
R15
Resistance
10Ω
C15
Capacitance
100 nF
R7
Resistance
10000 Ω
J1
J3
J2
U2
U3
J5

Refine this doc
Ask about this doc
Firmware Starter: ESP32 Interface
Hardware Interface
The current board connects to the ESP32 through J2 only.

Table


J2 PinSignalESP32 Firmware Function
13.3VPower supplied by ESP32 board/regulator
2GNDCommon ground
3ADS1115 SDAI2C SDA GPIO
4ADS1115 SCLI2C SCL GPIO
5DS18B20 DQ1-Wire GPIO
Libraries
Typical Arduino/ESP32 libraries:
  • Adafruit ADS1X15 or equivalent ADS1115 driver
  • OneWire
  • DallasTemperature
ADS1115 Settings
  • I2C address: 0x48
  • pH channel: differential A0-A1
  • ORP channel: differential A2-A3
  • Data rate: low/medium for stable readings
  • Gain: choose a range that supports the expected signal
    • pH expected differential: about ±414mV
    • ORP expected differential: about ±1000mV
Example Arduino-Style Skeleton

Cpp


#include <Wire.h>
#include <Adafruit_ADS1X15.h>
#include <OneWire.h>
#include <DallasTemperature.h>

// Set these to the actual ESP32 pins used with J2.
static const int PIN_I2C_SDA = 8;
static const int PIN_I2C_SCL = 9;
static const int PIN_ONEWIRE_DQ = 10;

Adafruit_ADS1115 ads;
OneWire oneWire(PIN_ONEWIRE_DQ);
DallasTemperature ds18b20(&oneWire);

float readAdsDiffMv(uint8_t mux) {
  int16_t raw = 0;
  if (mux == 0) raw = ads.readADC_Differential_0_1(); // pH
  else raw = ads.readADC_Differential_2_3();           // ORP

  // Adjust multiplier to match selected ADS1115 gain.
  // For GAIN_ONE on Adafruit ADS1X15, scale is commonly 0.125 mV/bit.
  return raw * 0.125f;
}

float filteredAdsMv(uint8_t mux) {
  const int N = 15;
  float sum = 0;
  for (int i = 0; i < N; i++) {
    sum += readAdsDiffMv(mux);
    delay(20);
  }
  return sum / N;
}

void setup() {
  Serial.begin(115200);
  Wire.begin(PIN_I2C_SDA, PIN_I2C_SCL);
  ds18b20.begin();

  if (!ads.begin(0x48)) {
    Serial.println("ADS1115 not found at 0x48");
    while (true) delay(1000);
  }

  ads.setGain(GAIN_ONE); // confirm range/noise tradeoff for ORP
  ads.setDataRate(RATE_ADS1115_128SPS);
}

void loop() {
  ds18b20.requestTemperatures();
  float tempC = ds18b20.getTempCByIndex(0);

  float phMv = filteredAdsMv(0);
  float orpMv = filteredAdsMv(1);

  // TODO: replace with calibrated conversion.
  float ph = phMv;   // placeholder
  float orp = orpMv; // mV before calibration offset

  Serial.printf("T=%.2f C, pH_raw=%.3f mV, ORP_raw=%.3f mV\n", tempC, phMv, orpMv);
  delay(1000);
}
Calibration Notes
  • pH requires calibration with known buffer solutions.
  • Store pH zero/offset and slope.
  • Apply temperature compensation using DS18B20.
  • ORP can be stored directly as differential mV plus calibration offset.
Simulation-Based Limits
  • pH range ±414mV remains within ADC input rails.
  • ORP range ±1000mV remains within ADC input rails.
  • Analog bandwidth is ~481.8Hz, so firmware should prioritize stable low-rate measurement rather than high-speed sampling.
  • The filtered 3.3V rail attenuates high-frequency ESP32 noise; differential reads reject most common-mode rail movement.
  • Hardware Interface

  • Libraries

  • ADS1115 Settings

  • Example Arduino-Style Skeleton

  • Calibration Notes

  • Simulation-Based Limits

Documents

  • Firmware Starter: ESP32 Interface

  • Project Specification

  • Routing Guide, Component Purpose, and BOM

  • Firmware Architecture Handoff

  • 3.3V Supply Noise Sensitivity

Assets

Assets are files uploaded to this project which can be used in various ways.

ESP32-C3 ADS1115 pH ORP Sensor Interface 4412 thumbnail
3.3 V-powered pH and ORP probe interface using an ADS1115 module, MCP6002 through-hole buffers, and DS18B20 temperature sensing. External ESP32 connection is through one 5-pin header carrying 3V3, GND, SDA, SCL, and DQ; ADS1115 ADDR is fixed locally and ALERT is unused.

Properties

V

Pricing & Availability

Distributor

Qty 1

Arrow

$4.37–$4.85

Digi-Key

$0.00

LCSC

$11.18–$11.88

Mouser

$5.18

TME

$0.81

Verical

$4.23–$9.15

Controls