Watermeter with ESP8266

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

juppetup
Posts: 14
Joined: Monday 14 March 2016 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Groningen
Contact:

Watermeter with ESP8266

Post by juppetup »

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.

Image

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.

Image

Two CNY 70 reflective sensors:
Image

Image
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.
User avatar
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

Post by sincze »

Very nice design!

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.
jmleglise
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

Post by jmleglise »

Bravo !

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
User avatar
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

Post by sincze »

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
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.
juppetup
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

Post by juppetup »

jmleglise wrote:Bravo !

Do you know the power consumption of your card ?
And do you think it's possible to use battery ?
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....
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.
juppetup
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

Post by juppetup »

The ESP8266 runs 104 days now without any problem and has counted 48.813 liters...

Image

Domoticz V3.4834
Last edited by juppetup on Sunday 02 April 2017 21:57, edited 1 time in total.
NdyGen
Posts: 5
Joined: Tuesday 17 January 2017 9:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter with ESP8266

Post by NdyGen »

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!
Kubra
Posts: 22
Joined: Wednesday 01 April 2015 22:06
Target OS: NAS (Synology & others)
Domoticz version: latest
Location: Hollanda
Contact:

Re: Watermeter with ESP8266

Post by Kubra »

NdyGen wrote:Could you tell me how go got domoticz to count decimals in the m3 measurement.
In Domoticz, which value do you have under "Settings > Meter/counter > RFXMeter/Meter dividers:"?
juppetup
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

Post by juppetup »

@ NdyGen

These are my settings:

Image

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.
Kubra
Posts: 22
Joined: Wednesday 01 April 2015 22:06
Target OS: NAS (Synology & others)
Domoticz version: latest
Location: Hollanda
Contact:

Re: Watermeter with ESP8266

Post by Kubra »

Divider of 1000 seems ok. Setting it higher, for instance 100000, makes no difference?
juppetup
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

Post by juppetup »

1000 seems right to me: 1m3 is 1000 liter. Try and find out what happens.
Kubra
Posts: 22
Joined: Wednesday 01 April 2015 22:06
Target OS: NAS (Synology & others)
Domoticz version: latest
Location: Hollanda
Contact:

Re: Watermeter with ESP8266

Post by Kubra »

What value do you get from the ESP (menu Devices)?
Kubra
Posts: 22
Joined: Wednesday 01 April 2015 22:06
Target OS: NAS (Synology & others)
Domoticz version: latest
Location: Hollanda
Contact:

Re: Watermeter with ESP8266

Post by Kubra »

juppetup wrote:1000 seems right to me: 1m3 is 1000 liter. Try and find out what happens.
Sorry, I thought I was answering @ NdyGen. It works for you :lol:

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.
juppetup
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

Post by juppetup »

@ 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.
NdyGen
Posts: 5
Joined: Tuesday 17 January 2017 9:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter with ESP8266

Post by NdyGen »

@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.
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Watermeter with ESP8266

Post by mvzut »

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!
Image
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
juppetup
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

Post by juppetup »

@ 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!
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Watermeter with ESP8266

Post by mvzut »

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!
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?!
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
MaikelK
Posts: 41
Joined: Saturday 01 November 2014 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter with ESP8266

Post by MaikelK »

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, ...........
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!
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Watermeter with ESP8266

Post by mvzut »

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!
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.
In ESPEasy, I added a device on the Devices tab with the following settings:

Image

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
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest