Watermeter lezen met raspberry en Inductieve NPN sensor Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Benneton
Posts: 30
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Benneton » Sunday 10 December 2017 15:22

Hi,

I have the water meter working, great instruction, thanks for this.
I was now wondering if I could use the same instruction to do the gasmeter.
Use of course different GPIO pins to read the values.
I found this piece of hardware:
https://www.tinytronics.nl/shop/nl/sens ... sor-module

And should work with Raspberry PI. As I am a complete nobe on reading pins, programing etc. I was thinking to hook it up and use the same scripts etc. as for the water meter.

Anyone any thoughts on this? Otherwise I will just go for it and try.

Bernard

Hobbybob
Posts: 147
Joined: Monday 01 May 2017 19:03
Target OS: Raspberry Pi
Domoticz version: Stable
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Hobbybob » Sunday 10 December 2017 15:53

I use a this on my watermeter (as can be seen earlier in this topic, I could not get the iduction-sensor to work with the disc on the meter).

It works well, and the RPi has no problem with it whatsoever. I do have additional reading every now and then, one thing to be very carefull about using this is the shielding of the led's. Since this just measures if the sensor (one of the 2 little balls) receives light from the led (the other little ball), the "leaking" of this light is something that it is sensitive for.

I don't know if you have a smart meter, but if you do chances are you can read your gas-meter with a P1-cable from that. That would be much more reliable.

sammyke007
Posts: 33
Joined: Monday 08 May 2017 20:48
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: Belgium
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by sammyke007 » Sunday 10 December 2017 16:06

Benneton wrote:
Sunday 10 December 2017 15:22
Hi,

I have the water meter working, great instruction, thanks for this.
I was now wondering if I could use the same instruction to do the gasmeter.
Use of course different GPIO pins to read the values.
I found this piece of hardware:
https://www.tinytronics.nl/shop/nl/sens ... sor-module

And should work with Raspberry PI. As I am a complete nobe on reading pins, programing etc. I was thinking to hook it up and use the same scripts etc. as for the water meter.

Anyone any thoughts on this? Otherwise I will just go for it and try.

Bernard
Bernard, my father in law is running the same setup with that TCRT5000 sensor on a Belgian gasmeter from Schlumberger. It's working great. The sensor works the same. it gives 0s and 1s.

Benneton
Posts: 30
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Benneton » Sunday 10 December 2017 17:44

Hi Sammyke,

Thanks I will order and try to get it working if these scripts do not do the trick.
Will keep you all posted.

Bernard

Benneton
Posts: 30
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Benneton » Sunday 10 December 2017 19:42

Hi Hobby Bob,

No I do not have smart meter for gas, water & electric.
For electric I use the youless, device, works very simple out of the box.
For gas I could not find similar, so I will count the silver dot on the 6 in my meter.
Thanks for the idea.

Bernard

Benneton
Posts: 30
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Benneton » Tuesday 12 December 2017 19:56

All,

Ordered the TCRT5000 module and installed it today.
Did follow same process as installing the watermeter sensor.
Changed ofcourse the GPOI pins, file names and counter name.

Up until now it works, need to check how stable/precise it will be.

Bernard

rleunk
Posts: 4
Joined: Friday 06 January 2017 22:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by rleunk » Monday 05 February 2018 23:57

Hi all,

No really an expert in all this, but managed to get my watermeter working with the python script and this https://www.kiwi-electronics.nl/inducti ... anel-mount sensor.
All setup on a spare / test raspberry pi, when all works well the sensor will be connected to my slave pi in the metercabinet.

But now i am looking for a good way too get my reading from the slave pi to the master pi.
Anyone managed to get this working?

clubeddie
Posts: 79
Joined: Saturday 19 March 2016 22:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by clubeddie » Tuesday 06 February 2018 0:46

Look, this is a nice addon for my installation and not expensive.

I have only a couple of issues. My watermeter is on the other side of the house inside the basement, approx 7 meters from my 'meterkast', inside the meterkast i have my synology with domoticz on it. Anyone any idea if i can extend the cable from the watermeter for 7 meters and ig still can read the data?

I have a raspberry pi as printserver and could connect to it, but can i transfer the data? I can install another domoticz installation on it but how can i sync this. Hope anyone has a situation like this and solved it.
Edit: the second question seems to be answered.
https://www.domoticz.com/wiki/Setting_up_Device_sharing

Now the first one about the length.

User avatar
bbqkees
Posts: 512
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by bbqkees » Tuesday 06 February 2018 10:45

clubeddie wrote:
Tuesday 06 February 2018 0:46
Look, this is a nice addon for my installation and not expensive.

I have only a couple of issues. My watermeter is on the other side of the house inside the basement, approx 7 meters from my 'meterkast', inside the meterkast i have my synology with domoticz on it. Anyone any idea if i can extend the cable from the watermeter for 7 meters and ig still can read the data?

I have a raspberry pi as printserver and could connect to it, but can i transfer the data? I can install another domoticz installation on it but how can i sync this. Hope anyone has a situation like this and solved it.
Edit: the second question seems to be answered.
https://www.domoticz.com/wiki/Setting_up_Device_sharing

Now the first one about the length.
7m might work. But make sure you provide enough voltage for the sensor.
Using another Domoticz install just for one sensor is a bit overkill.
Another perhaps simpler option would be to use a ESP8266 or NodeMCU with ESPEasy firmware.
Just connect the sensor to that one and set it up as a counter in the firmware.
Very easy to do. The ESP will send the data to your Domoticz.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

User avatar
philchillbill
Posts: 208
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by philchillbill » Tuesday 06 February 2018 11:06

clubeddie wrote:
Tuesday 06 February 2018 0:46
I have a raspberry pi as printserver and could connect to it, but can i transfer the data? I can install another domoticz installation on it but how can i sync this. Hope anyone has a situation like this and solved it.
No need for Domoticz on the secondary pi connected to the watermeter. The python script that reads the meter value updates Domoticz via http/json and the Domoticz instance does not have to be on the same machine. The syntax in the script is like this:

url = 'http://192.168.1.2:8080/json.htm?type=c ... r(Counter)
request = urllib2.Request(url)

so whatever url your main domoticz instance has is where the data will go, even if on a remote machine !
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

clubeddie
Posts: 79
Joined: Saturday 19 March 2016 22:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by clubeddie » Tuesday 06 February 2018 21:51

bbqkees wrote:
Tuesday 06 February 2018 10:45

7m might work. But make sure you provide enough voltage for the sensor.
Using another Domoticz install just for one sensor is a bit overkill.
Another perhaps simpler option would be to use a ESP8266 or NodeMCU with ESPEasy firmware.
Just connect the sensor to that one and set it up as a counter in the firmware.
Very easy to do. The ESP will send the data to your Domoticz.
Okay, that i a new technique i am not familiar with. I just checked some info about the ESP. I see that this has a wifi module. So that can solve a couple of things. But in short, i connect the pulse meter with the esp. Get some power trough something and program a little bit, then it should be working. :lol:
Okay, where can i find the intel on this?

User avatar
bbqkees
Posts: 512
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by bbqkees » Tuesday 06 February 2018 22:21

clubeddie wrote:
Tuesday 06 February 2018 21:51
Okay, where can i find the intel on this?
Please see https://www.letscontrolit.com/wiki/index.php/ESPEasy

In your case you could use a NodeMCU.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

rleunk
Posts: 4
Joined: Friday 06 January 2017 22:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by rleunk » Tuesday 06 February 2018 22:53

rleunk wrote:
Monday 05 February 2018 23:57
Hi all,

No really an expert in all this, but managed to get my watermeter working with the python script and this https://www.kiwi-electronics.nl/inducti ... anel-mount sensor.
All setup on a spare / test raspberry pi, when all works well the sensor will be connected to my slave pi in the metercabinet.

But now i am looking for a good way too get my reading from the slave pi to the master pi.
Anyone managed to get this working?
Managed to get the info from the slave to the master rapsberry with a script from an other topic viewtopic.php?f=6&t=7303&start=20#p58622

User avatar
philchillbill
Posts: 208
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by philchillbill » Wednesday 07 February 2018 19:49

Managed to get the info from the slave to the master rapsberry with a script from an other topic viewtopic.php?f=6&t=7303&start=20#p58622
Why do you even need a slave Domoticz to do this? As I explained a few posts back, it's overkill and a second pi will happily update Domoticz on a first pi just through http/json. No magic needed - this is how the basic Python script for this watermeter project already works !
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

rleunk
Posts: 4
Joined: Friday 06 January 2017 22:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by rleunk » Thursday 08 February 2018 1:15

philchillbill wrote:
Wednesday 07 February 2018 19:49
Managed to get the info from the slave to the master rapsberry with a script from an other topic viewtopic.php?f=6&t=7303&start=20#p58622
Why do you even need a slave Domoticz to do this? As I explained a few posts back, it's overkill and a second pi will happily update Domoticz on a first pi just through http/json. No magic needed - this is how the basic Python script for this watermeter project already works !
Thnx philchillbill, I will give it a try for sure, the slave domoticz isn't only for my watermeter it connects to my smart meter aswell for gas and electric. It works for now. Next i will try it as you discribed.

clubeddie
Posts: 79
Joined: Saturday 19 March 2016 22:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by clubeddie » Tuesday 13 February 2018 21:38

bbqkees wrote:
Tuesday 06 February 2018 10:45
7m might work. But make sure you provide enough voltage for the sensor.
Using another Domoticz install just for one sensor is a bit overkill.
Another perhaps simpler option would be to use a ESP8266 or NodeMCU with ESPEasy firmware.
Just connect the sensor to that one and set it up as a counter in the firmware.
Very easy to do. The ESP will send the data to your Domoticz.

Okay, it is not my knowledge but after looking for some info i think it is possible if i do the next steps.

Hardware needed
https://nl.aliexpress.com/item/1PCS-Wir ... autifyAB=01PCS Wireless module CH340 NodeMcu V3 Lua WIFI Internet of Things development board based ESP8266

https://nl.aliexpress.com/item/THGS-DC6 ... 0.0.vezpIz4mm Tubular Inductieve Proximity Sensor Switch LJ12A3-4-Z-BX

https://nl.aliexpress.com/item/MB102-So ... 0.0.vezpIz
Breadboard power module + MB-102 830 punten Solderless

And some kind of usb power adapter 5V, 1A.

I flash de NodeMCU ESP8266 with ESPEasy, configure this and wire the hardware together. I connect the sensor to the hardware and my watermeter.
After i flashed ESP board, i can config it to connect it through my wifi network so it can send the data directly to my domoticz configuration.

In basic lines? Is this what it is?
Is it save to buy the hardware from aliexpress? Hope someone can help me with these questions, it is not my knowledge but i think with the right info i can build this.

User avatar
bbqkees
Posts: 512
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by bbqkees » Tuesday 13 February 2018 22:43

Yes Aliexpress is usually safe.

Here is one usable circuit for the ESP: https://www.letscontrolit.com/wiki/index.php/LJ12A3
But of course there are numerous ways to connect it.
This is ok too but you need to change the resistor values to your microcontroller:
https://i.imgur.com/TyU1xMk.jpg

I had to use 12V otherwise the sensor did not detect the meter.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

User avatar
philchillbill
Posts: 208
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by philchillbill » Wednesday 14 February 2018 19:15

Given than an RPi-zero-W costs about EUR 11 and runs Python so the script can run unmodified, I'd just use a pi if I were you and if you buy it locally you won't have to wait 3 weeks for the stuff to arrive from China. Nothing unsafe about AliExpress, it's just slower than local webshops and not really worth it to save a few Euro's on a 20-Euro project. Just saying...
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

clubeddie
Posts: 79
Joined: Saturday 19 March 2016 22:12
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by clubeddie » Wednesday 14 February 2018 20:40

philchillbill wrote:
Wednesday 14 February 2018 19:15
Given than an RPi-zero-W costs about EUR 11 and runs Python so the script can run unmodified, I'd just use a pi if I were you and if you buy it locally you won't have to wait 3 weeks for the stuff to arrive from China. Nothing unsafe about AliExpress, it's just slower than local webshops and not really worth it to save a few Euro's on a 20-Euro project. Just saying...
If that is possible then it is a good idea. But can you tell me if i can connect the sensor right on it and if i need power adjustment 5v/12v?
And how to build this?

User avatar
philchillbill
Posts: 208
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by philchillbill » Wednesday 14 February 2018 20:59

See Hobbybob's post long ago in this thread - that schematic should do it for you. There are also posts that show using zener diodes to make sure the pi GPIOs never see more than 3v3 despite a 5v or 12v supply to the inductive sensor. Just search earlier topics in this thread.

EDIT: I have subsequently posted a schematic using a FET which I think is actually better from an electronic engineering perspective.

viewtopic.php?f=28&t=17123&start=222
Last edited by philchillbill on Tuesday 27 February 2018 11:20, edited 3 times in total.
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests