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.

Moderators: leecollings, remb0

JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

akamming wrote: Monday 23 December 2019 21:41
JeeGee wrote: Monday 23 December 2019 9:28 So you don't use any resistors at all?
Correct. I only configured the internal pull up resistor
Forgive my stupidity, so no resistors at all and configure pull up in the settings.
And that pullup is build in the Pi, that ineternal 10k or something?

Gonna try that, but comared to yours, I think I need the 5V then.

EDIT
Just removed the resistors, but nothing is happening. Except the value is set to 1 now.
And the value doesn't change when I bring metal nearby and the led in the NPN turn on.
So I gonna order the one you mentioned on Ali.

On that Ali page, I see a lot of options, but it is really the one directly from your link?
akamming
Posts: 337
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by akamming »

JeeGee wrote: Monday 23 December 2019 21:44
Forgive my stupidity, so no resistors at all and configure pull up in the settings.
And that pullup is build in the Pi, that ineternal 10k or something?

Gonna try that, but comared to yours, I think I need the 5V then.
I did not use any resistor, only connected the sensor as described in this article https://www.google.com/amp/s/ehoco.nl/w ... cript/amp/

And then use the plugin. In plugin config my settings are resistor type "pull up", interrupt mode "falling" and debounce time 350ms (and of course the correct pin number)
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

akamming wrote: Monday 23 December 2019 21:59
JeeGee wrote: Monday 23 December 2019 21:44
Forgive my stupidity, so no resistors at all and configure pull up in the settings.
And that pullup is build in the Pi, that ineternal 10k or something?

Gonna try that, but comared to yours, I think I need the 5V then.
I did not use any resistor, only connected the sensor as described in this article https://www.google.com/amp/s/ehoco.nl/w ... cript/amp/

And then use the plugin. In plugin config my settings are resistor type "pull up", interrupt mode "falling" and debounce time 350ms (and of course the correct pin number)
Then it must by my NPN, as I have also these settings.
thebartzman
Posts: 10
Joined: Friday 27 December 2019 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: The Netherlands
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by thebartzman »

Goodmorning,

To read out my watermeter I ordered the NPN sensor 'Inductieve nabijheidssensor LJ12A3-4-Z/BX ( 4 mm )' but it's still not deleverd yet.
But I have some doubs if this sensor will be compatble with my watermeter because my watermeter dos not use a metal plate on the flow wheel, but it look more like a kind of coil or something like a Print Circuit Board wire.

Does anybody know if the sensor above is compatible or which one I need to apply?
Image
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

Yesterday I received this PNP: https://nl.aliexpress.com/item/32826250 ... 4c4d4F0j02
And I can confirm it works! Installed it without any resistors.

But..... I miss some liters waters per day. Maybe I have to place it bit different on the watermeter.
In about 10 hours Domoticz liter count is 4 more then the real watermeter. I will leave it running the next days to see if it was yesterday, placing it etc.

So far, happy with the PNP and this plugin.

Question: Because the very first reaging the the current liter count, it is very very high for yesterday.
It could be deleted with SHIFT, click. But no matter what I try, the bad reading won't disappear. Why?

UPDATE: it seems to work when you remove it in the month, but not the day view, while it also asks for confirmation.
Martinvdm
Posts: 11
Joined: Saturday 29 August 2015 14:07
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Martinvdm »

I am trying to fix this in combination with an S0PCM http://www.smartmeterdashboard.nl/webshop reader.
It just count pulses connecting ground. As the proximity sensor is 12Vdc the s0pcm would not like that. How do i connect a reed switch or resistors to this? anybody a schema?
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

It is running for some days now and so far so good. But in the last 48 hours I see empty parts in the graphs.
Why is this? So far only during the night.

Any idea?
Capture1.png
Capture1.png (83.24 KiB) Viewed 2076 times
Martinvdm
Posts: 11
Joined: Saturday 29 August 2015 14:07
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Martinvdm »

JeeGee wrote: Tuesday 14 January 2020 20:00 It is running for some days now and so far so good. But in the last 48 hours I see empty parts in the graphs.
Why is this? So far only during the night.

Any idea?

Capture1.png
Do you use ESPEasy? i heard before that a reboot of the unit can reset it to 0. perhaps you can eliminate that the espeasy is not rebooting.
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

Martinvdm wrote: Tuesday 14 January 2020 20:34
JeeGee wrote: Tuesday 14 January 2020 20:00 It is running for some days now and so far so good. But in the last 48 hours I see empty parts in the graphs.
Why is this? So far only during the night.

Any idea?

Capture1.png
Do you use ESPEasy? i heard before that a reboot of the unit can reset it to 0. perhaps you can eliminate that the espeasy is not rebooting.
Uhm... guess not, as I don't know ESPEasy.
remko2000
Posts: 165
Joined: Thursday 28 December 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Broek op Langedijk
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by remko2000 »

I used the pythonscript from:
https://ehoco.nl/watermeter-uitlezen-in ... on-script/

if I place the pythonscript in my 'scipt' folder in domoticzfolder the script works fine but after some time domoticz crashes because of this script (mostly within 24 hours). It looks like something isn't correct in the script.

I tried to place the same pythoncode in domotics (settings, more options, events). If I do this I get an error in domoticz:

Code: Select all

2020-01-20 17:09:18.613 Error: EventSystem: Failed to execute python event script "Water"
2020-01-20 17:09:18.613 Error: EventSystem: File "<string>", line 61
2020-01-20 17:09:18.613 Error: EventSystem: print "JSON call = "+ str(url1)
2020-01-20 17:09:18.613 Error: EventSystem: ^
2020-01-20 17:09:18.613 Error: EventSystem: SyntaxError: invalid syntax
2020-01-20 17:09:18.810 Error: EventSystem: Failed to execute python event script "Water"
2020-01-20 17:09:18.810 Error: EventSystem: File "<string>", line 61
2020-01-20 17:09:18.810 Error: EventSystem: print "JSON call = "+ str(url1)
2020-01-20 17:09:18.810 Error: EventSystem: ^
2020-01-20 17:09:18.811 Error: EventSystem: SyntaxError: invalid syntax
If I comment out the printrules I get an other error:

Code: Select all

3 Error: EventSystem: Failed to execute python event script "Water"
2020-01-20 17:17:34.203 Error: EventSystem: Traceback (most recent call last):
2020-01-20 17:17:34.203 Error: EventSystem: File "<string>", line 2, in <module>
2020-01-20 17:17:34.203 Error: EventSystem: ImportError: No module named 'RPi'
If I do 'pip install RPi.GPIO' and installed this modules the error don't go away.

What can be the problem here?
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

My PNP with the plugin was running fine, but this week I had 3 times the issue that the measuring went crazy.
Examples: in one hour it said I used 400 liters, out of the blue and even one time 15.000 liters.
Tried to place the PNP a it different, but so far it didn't help.

Anyone else seeing this? And could be the cause?
fabstar81
Posts: 5
Joined: Saturday 27 April 2019 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by fabstar81 »

bbqkees wrote: Tuesday 06 February 2018 9:45
clubeddie wrote: Monday 05 February 2018 23: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.
hi, can you tell me how you got things configured in ESP8266? i have the sensor hooked up to the 3V pin, choose "Generic - Pulse counter" in ESP and told it to send it to the IDX of the RFX counter for water. But nothing happens. i'd like to know if i configured it correctly, or i have a faulty sensor.

it used to work on the GPIO pins of my RPI 3B+.
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by freijn »

Fab

the Sensor works better with higher voltage, like 12v DC.

!!!!!BUT !!!!! be carefull !!!

The output of the sensor will goto 12 volt as well. Putting that into an ESP will burn the input port.
You need a (simple) network to reduce the 12volt into max 3.3 volt again.

Also configure the at Rise count, if the watermeter stops directly under the sensor the ESP keeps counting. With the Rise it will
only a single puls.
Martinvdm
Posts: 11
Joined: Saturday 29 August 2015 14:07
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Martinvdm »

If you use a NPN sensor isn’t that data closes to ground? There is no voltage on that wires.
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by freijn »

I hear what you are trying to write, but then please, what is you definition on High and Low output in voltage ?
Martinvdm
Posts: 11
Joined: Saturday 29 August 2015 14:07
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Martinvdm »

freijn wrote: Friday 07 February 2020 19:12 I hear what you are trying to write, but then please, what is you definition on High and Low output in voltage ?
There are multiple versions of this sensor. I was just trying to explain that you can’t do any harm with the data wire. But off course do not connect 12v to your esp.
Rudi52
Posts: 4
Joined: Tuesday 13 November 2018 20:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Rudi52 »

I am using the plugin of akamming, and this is working perfect.
However my metering value is not correct, how can i change that?

I have a device 'Waterverbruik', but when i change the offset, nothing happens.
It stills counts the amount of water, but changing the offset does not change the metering value.
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

Any idea why I have a mismatch of some hunders of liters every week?

I tried to change the position of the PNP very often but that won't help anything.
It is not that it counts 505 instead of 500 per day, it just ads random about 100 liters in one hour and then for several hours it's ok.

Could it be, that when the iron is under the PNP (led is burning) that that is not working correctly?
Would adding resistors help? As I don't use anything at the moment.

A solution would be fine, as this is frustrating to correct it sometimes a week.
PvHeerebeek
Posts: 3
Joined: Friday 21 June 2019 21:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by PvHeerebeek »

When the NPN sensor ‘sits’ above the metal plate on the 1-liter pointer and the LED on the sensor is lit, how high can you lift the sensor before the LED goes out? If this is ‘very little’ you could have a sensor sensitivity problem.
If you open a water tap and let it flow, what does the LED show in relation to the turning pointer, is it a stable about 50%-ON/50%-OFF every full circle turn of the pointer or do you see flickers on the edges? This also shows a sensor sensitivity problem.
Have you tried feeding the sensor with a 9V battery i.o. 5V, making sure you use a resistor network on the output of the sensor to feed 3.3V switch signal to the GPIO pin. Increasing the supply voltage of this type of sensor increases it’s sensitivity.
Is the watermeter mounted in a vibration-free place and are meter and sensor connected well enough. When the metal plate of the pointer stops turning about halfway covering the detector, it is very important nothing moves as a small vibration could lead to the sensor switching on/of rapidly in line with the meter vibratioin.
I have powered my sensor via a small 5->12V Buck convertor fed from the PI 5V gpio pins with a resistor network to match 3.3V GPIO input voltage. I too have miscounts but it’s less then 5L a week which I relate to the pointer stopping turning on the edge. I am not interested in absolute accurate counter values but in water use during the day and that trend is showing well.

Miscounting is mostly related to fast status changes on the edges of sensor switch point. You could open up a big tap and see how fast your watermeter Counts. The logic should not be able to count faster. I am not a software guy, maybe there are status-hold times in the software that can be set to match the maximum meter speed? (Input status changes, then holds, then changes again, holds, so not switching on status change but un status)
JeeGee
Posts: 22
Joined: Sunday 25 August 2019 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by JeeGee »

Wow thanks for your long reply. I will do some more investigation with your suggestions.
I use a 5V PNP, without any resistors. Maybe I should change that too.

Will let you know.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest