Pool/Spa Kit
This kit includes the following components permanently mounted onto a PCB. All connections are made through the use of screw-terminals. Probes are threaded for easy use in a pool/spa plumbing.
Measures | Hardware |
---|---|
pH | Isolated - mod-pH - Industrial pH Probe |
ORP | Isolated - mod-ORP - Industrial ORP Probe |
Temperature | Thermowell Temperature Sensor |
Pin | Function |
---|---|
GND | Ground for the board |
VIN | 3.3-5.0 volt power supply |
SDA | Data line for I²C interface |
SCL | Clock line for I²C interface |
1W | 1-Wire signal |
EN optional | ENable pin, LOW to enable, HIGH to disable modules |
1.1 | Provides a connection to the sensing electrode of a pH probe |
1.2 | Provides a connection to the reference electrode of a pH probe |
2.1 | Provides a connection to the sensing electrode of a ORP probe |
2.2 | Provides a connection to the reference electrode of a ORP probe |
- all same-name pins are internally connected
- SDA/SCL/1W pins are pulled HIGH through a 4k7 Ohm resistor
- EN pin is pulled low through a 4k7 Ohm resistor
1.
🔽 Install Arduino IDE
Install the Arduino IDE
2.
📦 Install the libraries
Start the Arduino IDE, press the Sketch menu, and then Include Library > Manage Libraries
. Search for and install Microfire_Mod-pH
, Microfire_Mod-ORP
, and DallasTemperature
.
3.
🔢 Code
Create a new sketch and copy/paste the following code.
#include <Microfire_Mod-pH.h>
#include <Microfire_Mod-ORP.h>
#include <OneWire.h>
#include <DallasTemperature.h> // https://github.com/milesburton/Arduino-Temperature-Control-Library
Microfire::Mod_pH::i2c ph;
Microfire::Mod_ORP::i2c orp;
OneWire oneWire(A1);
DallasTemperature ds18b20(&oneWire);
void setup()
{
Serial.begin(9600);
Wire.begin();
ph.begin();
orp.begin();
ds18b20.begin();
}
void loop()
{
ds18b20.requestTemperatures();
float ds18b20_tempC = ds18b20.getTempCByIndex(0);
orp.measureORP();
ph.measurepH(ds18b20_tempC);
Serial.println((String)"pH: " + ph.pH);
Serial.println((String)"mV: " + orp.mV);
Serial.println((String)"ds18b20_tempC: " + ds18b20_tempC);
delay(1000);
}
4.
➡️ Upload the code
Pick the board and port, then Upload the code.
5.
🔎 View the output
Open the Serial Monitor, measurements should be displayed in the monitor, with updates every second.
This example YAML is very similar to using the individual components. Ensure the board
, wifi
and i2c
sections are correct. Also make sure the dallas.pin
section is the correct pin (from the board’s 1W
pin to your host controller).
substitutions:
friendly_name: Microfire pH+ORP+1Wire
device_name: microfire-ph-ec-orp
esphome:
name: $device_name
esp32:
board: esp32dev
framework:
type: arduino
logger:
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: $device_name
password: !secret wifi_failover
captive_portal:
# import the components
external_components:
- source:
type: git
url: https://github.com/u-fire/ESPHomeComponents/
# https://esphome.io/components/i2c.html
i2c:
sda: 21
scl: 22
# https://esphome.io/components/sensor/dallas.html
dallas:
- pin: 23
id: dallas_temp
sensor:
- platform: dallas
index: 0
name: "Temperature"
id: water_temp
on_value:
then:
- component.update: ph
- platform: mod_ph
id: ph
update_interval: never
name: pH
temperature_sensor: water_temp
- platform: mod_orp
id: orp
name: ORP
button:
- platform: template
id: ph_calibrate_low
name: pH Calibrate Low 4.0
icon: mdi:format-vertical-align-bottom
on_press:
lambda: |-
id(ph).calibrateLow(4.0);
- platform: template
id: ph_calibrate_mid
name: pH Calibrate Mid 7.0
icon: mdi:format-vertical-align-center
on_press:
lambda: |-
id(ph).calibrateMid(7.0);
- platform: template
id: ph_calibrate_high
name: pH Calibrate High 10.0
icon: mdi:format-vertical-align-top
on_press:
lambda: |-
id(ph).calibrateHigh(10.0);
- platform: template
id: ph_calibrate_reset
name: pH Calibrate Reset
icon: mdi:restore
on_press:
lambda: |-
id(ph).calibrateReset();
- platform: template
id: orp_calibrate_low
name: ORP Calibrate Single 400 mV
icon: mdi:format-vertical-align-center
on_press:
lambda: |-
id(orp).calibrateSingle(400);
- platform: template
id: orp_calibrate_reset
name: ORP Calibrate Reset
icon: mdi:restore
on_press:
lambda: |-
id(orp).calibrateReset();
- platform: factory_reset
name: Restart with Factory Default Settings
There are more examples for various combinations of sensors/modules on our ESPHomeComponents GitHub repo.