Skip to content
Snippets Groups Projects
Commit 1f64807b authored by Jan Grewe's avatar Jan Grewe
Browse files

add README

parent 8e6d18f1
No related branches found
No related tags found
No related merge requests found
......@@ -3,3 +3,4 @@
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
/.vscode/settings.json
# PH-260BD
## Description
This PlatformIO project allows you to get the pH, EC and temperature values from the cheap online water quality monitor PH-260BD
## Usage
Open this project in PlatformIO and write it to an ESP32. No further hardware or wiring needed.
You'll get the values from the PH-260BD, which it sends every second, written to the serial monitor every 5 seconds.
## Hints
* The EC values are calculated based on the currently selected display unit, because that's what the PH-260BD sends.
* The PH-260BD uses the factor `700` for `mS` <-> `ppm` calculation, which seems to be the standard in the Australian (and most likely Asian) part of the world.
* You can change that factor at the top of the code to `500` (US) or `640` (EU), but that will of course only affect the calculated values, not the display on the PH-260BD.
* The most accurate units to chose on the display for the calculation are probably `uS` and `ppm`.
* The calculated values are properly rounded as expected.
* The temperature value is truncated when the device is set to display `ppt`, which is why it's ignored from that data packet (but taken from `pH`).
## Credits
* [Bo Jeanes](https://bjeanes.com/), for his [ESPHome implementation](https://gist.github.com/bjeanes/4310d30393a093bc2f1f2bd113fa820bm) of this (which i read less than i really should have)
\ No newline at end of file
......@@ -44,7 +44,7 @@ void bleDataCallback(const char *match,
}
else if (unit == "uS")
{
sensorData->put("ec_ms", value.toFloat() / 1000);
sensorData->put("ec_ms", (double) value.toFloat() / 1000);
sensorData->put("ec_us", value.toFloat());
sensorData->put("ec_ppm", value.toFloat() / 1000 * factorMsToPpm);
sensorData->put("ec_ppt", value.toFloat() / 1000 * factorMsToPpm / 1000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment