Giter Club home page Giter Club logo

grove_orp_exporter's Introduction

grove_orp_exporter

Arduino based grove ORP prometheus exporter, that can be easily integrated into home assistant. It allows you to remotely measure the ORP value of your pool or hot tub, providing a good indicator of water quality. See what is orp in water testing for further details.

Introduction

This project provides a simple to assemble ORP (Oxidation Reduction Potential) monitoring system. It has four main design principles:

  1. Be easy to assemble - no soldering, no drilling.
  2. Be 'not too expensive' - be cheaper than many of the commercial smart ORP monitoring systems.
  3. Expose reading as a HTTP interface - so it can be easily interfaced with different platforms (e.g. home assistant, grafana)
  4. Be 'safe' next to the hot tub - In my case it'll be in a rattan storage unit next to the hot tub, so the case I've used is IP56, which isn't waterproof but is sealed. Depending on your specific setup, you might want to pick a different enclosure that is waterproof (IP68).

At it's heart it uses a Grove ORP sensor kit.

See CONSTRUCTION for assembly instructions.

Software Installation

The board used is a Seeeduino Lotus Cortex-M0+. Follow the board setup instructions on the page to configure the board in the Arduino environment.

The Wifi shield used is a Wifi Shield V2.0. Follow the setup instructions on the page and download the Wifly library to your Arduino library manager.

Upload the sketch to the board, enssuring you've amended:

#define SSID      "YOUR_AP"
#define KEY       "YOUR_PASSWORD"

At this point, it should successully associate with the Wifi and you should be able to see the board output on the 'Serial Monitor'.

Probe Callibration

The Grove ORP sensor kit outlines how to calibrate the sensor and calculate the probe offset. To note, hold and press the black button to get a consistent offset value. Once you have the probe offset, add this to the configuration in the Arduino Sketch:

#define OFFSET -42 //add your value here

You can then use callibration solution to check the sensor is measuring accurately.

Usage

The software exposes three endpoints:

Endpoint Usage
/metrics Exposes the ORP reading in prometheus exporter format
/enable Enables readings to be taken (default)
/disable Disables readings, causing the /metrics endpoint to 404

/metrics

This endpoint returns metrics that can be integrated into Grafana:

# HELP orp_sensor_value_mv Returns the sensor value from the ORP sensor in mV
# TYPE orp_sensor_value_mv gauge
orp_sensor_value_mv 215.83
# HELP orp_sensor_free_memory Returns the board free memory in Kb
# TYPE orp_sensor_free_memory gauge
orp_sensor_free_memory 24607
# HELP orp_sensor_wifi_associations Returns the number of times the wifi has reassociated
# TYPE orp_sensor_wifi_associations gauge
orp_sensor_wifi_associations 0
# HELP orp_sensor_crashes Returns the number of times the board has crashed
# TYPE orp_sensor_crashes gauge
orp_sensor_crashes 1
# HELP orp_sensor_uptime Returns the board uptime in seconds
# TYPE orp_sensor_uptime gauge
orp_sensor_uptime 3867
# UPTIME (DD:HH:MM:SS) 00:01:04:27

/enable | /disable

These endpoints can be used to stop the ORP sensor from taking readings and cause the /metrics endpoint to return a 404 when set to disabled. This can be used in an automation to stop readings if the probe is removed from the water (e.g. if the Hot Tub is turned on).

Integration into Home Assistant

The ORP reading can be easily integrated into home assistant using a REST sensor:

sensor:
 - platform: rest
   resource: http://YOURSENSORIPADDRESS/metrics
   name: hottub_orp
   unit_of_measurement: "mV"
   timeout: 5
   value_template: '{{ value | regex_findall_index("orp_sensor_value_mv (\d+.\d+)\n") }}'

Notes on the build

  • The wifi shield does crash from time to time, but is recovered in the sketch.
  • It should be trivial to add a Grove PH sensor.

grove_orp_exporter's People

Contributors

rjlee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.