Watermeter with ESP8266
Moderators: leecollings, remb0
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Watermeter with ESP8266
Hi,
Here some pictures of my watermeter for Domoticz. I use two CNY 70 (Reflective couplers) instead of one like in most other designs. With only one sensor you'll always get spurious pulses one day..... I use a ESP8266-01 to communicate by Wifi with Dz. So no wires between RaspberryPi and watermeter! Adjusting is made easy with two green LED's. They will light if there is reflection. A blue LED will light when a pulse is send to the ESP8266.
With some logic inside a PIC i create a pulse-output which is connected to a GPIO of the ESP8266.
The ESP8266 runs ESPEasy software. I'm still able to see the readings on the meter with this shape of board.
Two CNY 70 reflective sensors:
The board needs 5V power which can be connected via the mini USB-connector.
The watermeter has an opto-coupler output so you can connect it the way you like. For instance a Nodemcu-board. Also 5V is available on the 4-pin header. The power can also be supplied on this 4-pin header instead of the mini USB-connector.
If you want to build it yourself: send me an e-mail and i''ll send you on request the diagrams, Gerberfiles and hex-file for the PIC.
Here some pictures of my watermeter for Domoticz. I use two CNY 70 (Reflective couplers) instead of one like in most other designs. With only one sensor you'll always get spurious pulses one day..... I use a ESP8266-01 to communicate by Wifi with Dz. So no wires between RaspberryPi and watermeter! Adjusting is made easy with two green LED's. They will light if there is reflection. A blue LED will light when a pulse is send to the ESP8266.
With some logic inside a PIC i create a pulse-output which is connected to a GPIO of the ESP8266.
The ESP8266 runs ESPEasy software. I'm still able to see the readings on the meter with this shape of board.
Two CNY 70 reflective sensors:
The board needs 5V power which can be connected via the mini USB-connector.
The watermeter has an opto-coupler output so you can connect it the way you like. For instance a Nodemcu-board. Also 5V is available on the 4-pin header. The power can also be supplied on this 4-pin header instead of the mini USB-connector.
If you want to build it yourself: send me an e-mail and i''ll send you on request the diagrams, Gerberfiles and hex-file for the PIC.
Last edited by juppetup on Sunday 02 April 2017 21:54, edited 6 times in total.
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Watermeter with ESP8266
Very nice design!
Sent from my SM-G925F using Tapatalk
Sent from my SM-G925F using Tapatalk
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: Watermeter with ESP8266
Bravo !
Do you know the power consumption of your card ?
And do you think it's possible to use battery ?
Do you know the power consumption of your card ?
And do you think it's possible to use battery ?
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Watermeter with ESP8266
Battery most of the time not ideal for this kind of meters. Or you should be very good in customising an arduino. But I am still waiting for a good solid solution. For now it is usb powered for me.
Sent from my SM-G925F using Tapatalk
Sent from my SM-G925F using Tapatalk
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Re: Watermeter with ESP8266
Hi, i do not know the exact power consumption. At the moment i don't want to switch it of because i'm testing how long the ESP8266 runs without a reboot.... 22 days now....jmleglise wrote:Bravo !
Do you know the power consumption of your card ?
And do you think it's possible to use battery ?
The ESP8266 consumes quite lot so a battery isn't a good idea. Peak current 300mA at startup! But thats only for a short period. I think +-150mA idle.
Last edited by juppetup on Sunday 12 February 2017 12:17, edited 1 time in total.
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Re: Watermeter with ESP8266
The ESP8266 runs 104 days now without any problem and has counted 48.813 liters...
Domoticz V3.4834
Domoticz V3.4834
Last edited by juppetup on Sunday 02 April 2017 21:57, edited 1 time in total.
-
- Posts: 5
- Joined: Tuesday 17 January 2017 9:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Watermeter with ESP8266
Could you tell me how go got domoticz to count decimals in the m3 measurement. My pulse meter sents the correct values to domotics but it seems the daily usage is rounded down.
So if I use 500 litres per day I only register 1m3 every second day.
thnx!
So if I use 500 litres per day I only register 1m3 every second day.
thnx!
-
- Posts: 22
- Joined: Wednesday 01 April 2015 22:06
- Target OS: NAS (Synology & others)
- Domoticz version: latest
- Location: Hollanda
- Contact:
Re: Watermeter with ESP8266
In Domoticz, which value do you have under "Settings > Meter/counter > RFXMeter/Meter dividers:"?NdyGen wrote:Could you tell me how go got domoticz to count decimals in the m3 measurement.
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Re: Watermeter with ESP8266
@ NdyGen
These are my settings:
My watermeter gives one rotation / liter
Domoticz V3.4834
These are my settings:
My watermeter gives one rotation / liter
Domoticz V3.4834
Last edited by juppetup on Sunday 02 April 2017 21:58, edited 1 time in total.
-
- Posts: 22
- Joined: Wednesday 01 April 2015 22:06
- Target OS: NAS (Synology & others)
- Domoticz version: latest
- Location: Hollanda
- Contact:
Re: Watermeter with ESP8266
Divider of 1000 seems ok. Setting it higher, for instance 100000, makes no difference?
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Re: Watermeter with ESP8266
1000 seems right to me: 1m3 is 1000 liter. Try and find out what happens.
-
- Posts: 22
- Joined: Wednesday 01 April 2015 22:06
- Target OS: NAS (Synology & others)
- Domoticz version: latest
- Location: Hollanda
- Contact:
Re: Watermeter with ESP8266
What value do you get from the ESP (menu Devices)?
-
- Posts: 22
- Joined: Wednesday 01 April 2015 22:06
- Target OS: NAS (Synology & others)
- Domoticz version: latest
- Location: Hollanda
- Contact:
Re: Watermeter with ESP8266
Sorry, I thought I was answering @ NdyGen. It works for youjuppetup wrote:1000 seems right to me: 1m3 is 1000 liter. Try and find out what happens.
BTW I myself am using a inductive proximity sensor (my water meter has a metal rotating disc). I find this design much more sturdy, no electronics involved (except for the esp) and fairly accurate (< 0,3% p/wk, mostly due to instability/reboots of the esp). I have also tried the infrared sensor but got false readings/offset all the time.
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Re: Watermeter with ESP8266
@ Kubra
I use the V120 ESP-easy firmware and don't have any reboots at all! As mentioned, it's running non-stop for 104 days now!
With this pcb and the two reflective infrared devices i don't miss a rotation at all.
I use the V120 ESP-easy firmware and don't have any reboots at all! As mentioned, it's running non-stop for 104 days now!
With this pcb and the two reflective infrared devices i don't miss a rotation at all.
-
- Posts: 5
- Joined: Tuesday 17 January 2017 9:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Watermeter with ESP8266
@kubra,
thnx, that was the solution. I had the dividers in Domoticz set on 1 and did all the pulse to kwh, m3 gas/ water calculations in the script. Once I let domoticz do the math and send the raw values from the script I got fractional values.
thnx, that was the solution. I had the dividers in Domoticz set on 1 and did all the pulse to kwh, m3 gas/ water calculations in the script. Once I let domoticz do the math and send the raw values from the script I got fractional values.
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Watermeter with ESP8266
Nice solution juppetup!
I also have an Aquadis water meter that I connected to Domoticz. I personally use a simple TCRT-5000 infrared contrast sensor module, and don't experience any missed or double pulses (running stable more than half a year already).
Note that there are several versions of the TCRT-5000 module, I used the most simple version without a pot meter for threshold control. I tried a more "advanced" version first, but I couldn't find the right pot meter setting for it. It does involve careful fixation at the right position and angle, but I quickly found the "sweet spot" and fixed it with nothing else than hot glue.
The largest component on the picture is actually the power supply PCB, as I needed both 3.3 and 5 volts. If I would have to do it again I would probably have used a NodeMCU which can easily be powered with a micro USB adapter and supplies all the voltages.
Total cost is around 10 euros!
I also have an Aquadis water meter that I connected to Domoticz. I personally use a simple TCRT-5000 infrared contrast sensor module, and don't experience any missed or double pulses (running stable more than half a year already).
Note that there are several versions of the TCRT-5000 module, I used the most simple version without a pot meter for threshold control. I tried a more "advanced" version first, but I couldn't find the right pot meter setting for it. It does involve careful fixation at the right position and angle, but I quickly found the "sweet spot" and fixed it with nothing else than hot glue.
The largest component on the picture is actually the power supply PCB, as I needed both 3.3 and 5 volts. If I would have to do it again I would probably have used a NodeMCU which can easily be powered with a micro USB adapter and supplies all the voltages.
Total cost is around 10 euros!
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
-
- Posts: 14
- Joined: Monday 14 March 2016 21:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Location: Groningen
- Contact:
Re: Watermeter with ESP8266
@ mvzut
Ok, it might work but there is a change that one day the metal reflective part will stop just under the TCRT-5000 module (or edge) and you'll get many pulses!
Ok, it might work but there is a change that one day the metal reflective part will stop just under the TCRT-5000 module (or edge) and you'll get many pulses!
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Watermeter with ESP8266
Yes, I was afraid of that myself. But this hasn't happened once since more than half a year! I guess there's some kind of debouncing function programmed in the ESPeasy code?!juppetup wrote:@ mvzut
Ok, it might work but there is a change that one day the metal reflective part will stop just under the TCRT-5000 module (or edge) and you'll get many pulses!
Last edited by mvzut on Tuesday 14 February 2017 7:27, edited 1 time in total.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
-
- Posts: 41
- Joined: Saturday 01 November 2014 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Watermeter with ESP8266
Hi mvzut,mvzut wrote:Nice solution juppetup!
I also have an Aquadis water meter that I connected to Domoticz. I personally use a simple TCRT-5000 infrared contrast sensor module, and don't experience any missed or double pulses (running stable more than half a year already).
Note that there are several versions of the TCRT-5000 module, ...........
Im currently working on the same style-project as you.
Would you share with me your settings in ESPEasy and in Domoticz? Which counter do you us in Domoticz?
Thanks in advance!
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Watermeter with ESP8266
I created an incremental counter using the virtual device hardware component in Domoticz. Write down the IDX it gets (check under Setup > Devices). Edit the device and tell Domoticz it is a water meter.MaikelK wrote:Hi mvzut,
Im currently working on the same style-project as you.
Would you share with me your settings in ESPEasy and in Domoticz? Which counter do you us in Domoticz?
Thanks in advance!
In ESPEasy, I added a device on the Devices tab with the following settings:
Fill in the Domoticz IDX of the device you just created, and the GPIO port you connected your TCRT-5000 to. Of course, don't forget to tell ESPEasy where it can find your Domoticz system, you can do this under the Config tab. As protocol I use "Domoticz HTTP".
I think this was it. It's already a while ago I set this up, can't exactly remember if there were more steps involved.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
Who is online
Users browsing this forum: No registered users and 0 guests