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.
jnmulder
Posts: 4
Joined: Thursday 15 March 2018 22:34
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by jnmulder » Wednesday 04 April 2018 21:25

Thanx for youre repsponse.
instead I changed my script
Every 0.5 sec, I read out the level of the GPIO in an infinit loop.
When it has changed to on I add the counter with 1 and set a variable to on
next reading gpio = on and variable = on nothing happenes
next readin gpio = off variable = changed to off

so far (over 1 week now) not 1 liter deviation :-)


philchillbill wrote:
Wednesday 21 March 2018 9:23
jnmulder wrote:Thanx for youre response.

The cable is about 1, m long and not shielded.
There are some electrical devices nearby so youre suggestion could be right. What is the best way to shield the cable? Shield the complete kabel from sensor until Rpi?

Yep, and make sure the shield is grounded. You basically want something like a coax cable where an earthed shield surrounds the core. For a 1m length, just wrapping some tin foil like used for baking might do the trick and be quick to try.


Sent from my iPhone using Tapatalk

User avatar
philchillbill
Posts: 166
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 24 April 2018 8:01

jnmulder wrote:Thanx for youre repsponse.
instead I changed my script
Every 0.5 sec, I read out the level of the GPIO in an infinit loop.
When it has changed to on I add the counter with 1 and set a variable to on
next reading gpio = on and variable = on nothing happenes
next readin gpio = off variable = changed to off

so far (over 1 week now) not 1 liter deviation :-)
Maybe you should post a code-snippet here to help others who have problems with signal bounce.



Sent from my iPhone using Tapatalk
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.

Joep123
Posts: 15
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Joep123 » Sunday 06 May 2018 11:35

Hobbybob wrote:
Friday 25 August 2017 18:55
Today my sensor came in (the one with the yellow cap on the end), and it worked really well when I held a screwdriver next to it, but it looks like the plastic cap on top of the half-moon disc is too thick. It doesn't respond to that in any way... I've tried it with 5V and GND from the Pi (signal-cable not attached of course), and also with a 12V-adapter connected to it.

Any ideas if I can do something about this, or do I have to find a completely other way to register the water-usage? I'd rather not start damaging the water-meter since that belongs to the water-company.
I have the same situation. Did you find a solution for the plastic cap?
I used some sand paper and now the led is only on at a small piece of the water meter. If the metal part turns the led goes off.

Hobbybob
Posts: 117
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 06 May 2018 12:19

Joep123 wrote:
Sunday 06 May 2018 11:35
I have the same situation. Did you find a solution for the plastic cap?
No, I did not. I switched to another system that uses light (IR) to check when the haf-moon disc is rotating. It is a tcrt5000 I am using now.

Joep123
Posts: 15
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by Joep123 » Tuesday 08 May 2018 21:24

@pvangorp

Time by time I get this error:

Code: Select all

2018-05-08 21:13:26.537 Error: EventSystem: in Watermeter: [string "commandArray = {}
..."]:18: attempt to perform arithmetic on global 'sWaterUsage' (a nil value)
2018-05-08 21:13:33.693 Error: EventSystem: in Watermeter: [string "commandArray = {}
..."]:18: attempt to perform arithmetic on global 'sWaterUsage' (a nil value)
2018-05-08 21:13:33.890 Error: EventSystem: in Watermeter: [string "commandArray = {}
..."]:18: attempt to perform arithmetic on global 'sWaterUsage' (a nil value)
2018-05-08 21:13:33.909 Error: EventSystem: in Watermeter: [string "commandArray = {}
..."]:18: attempt to perform arithmetic on global 'sWaterUsage' (a nil value)
As soon as I put a number > 0 into the user variable everything is fine for some time.
Do you have a solution for this issue?

SorzZy
Posts: 3
Joined: Sunday 07 June 2015 9:39
Target OS: Raspberry Pi
Domoticz version: Beta
Location: netherlands (the hague)
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by SorzZy » Sunday 20 May 2018 8:55

Same problem here!

2018-05-20 08:47:02.910 Error: EventSystem: in lua-water: [string "commandArray = {}
..."]:18: attempt to perform arithmetic on global 'sWaterUsage' (a nil value)

u01pei
Posts: 47
Joined: Sunday 04 January 2015 17:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by u01pei » Sunday 20 May 2018 10:27

Hobbybob wrote:
Sunday 06 May 2018 12:19
Joep123 wrote:
Sunday 06 May 2018 11:35
I have the same situation. Did you find a solution for the plastic cap?
No, I did not. I switched to another system that uses light (IR) to check when the haf-moon disc is rotating. It is a tcrt5000 I am using now.
I have the same sensor and had the same issue. The plastic cap is just a little to thick, so I used a sharp knife to cut it of. I wrecked one switch first, as I removed the entire orange cap, but that made the resin 9holding the sensor element) come loose, making it very fragile and causing a wire to break.
So on the second switch I only removed the lower side of the cap (so a only a cilinder remains around the sensor). The orange material is about 0,5 mm thick, so if you cut about 0,5 from the bottom edge you will remove only a disk of orange material and the cilinder remains attached.

Hobbybob
Posts: 117
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 20 May 2018 11:09

u01pei wrote:
Sunday 20 May 2018 10:27
I have the same sensor and had the same issue. The plastic cap is just a little to thick, so I used a sharp knife to cut it of. I wrecked one switch first, as I removed the entire orange cap, but that made the resin 9holding the sensor element) come loose, making it very fragile and causing a wire to break.
So on the second switch I only removed the lower side of the cap (so a only a cilinder remains around the sensor). The orange material is about 0,5 mm thick, so if you cut about 0,5 from the bottom edge you will remove only a disk of orange material and the cilinder remains attached.
After I had the IR-sensor in place I read about this. I belief that was someone who used sanding-paper to make it thinner. Perhaps I'll switch to this method sometime. My current setup does count water sometimes when nothing is being used. The half-moon disc is then exactly on the edge of where it is measured... Then again: this problem also occurs with the induction-sensors.

User avatar
sincze
Posts: 910
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi
Domoticz version: 3.8875
Location: Netherlands
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by sincze » Tuesday 12 June 2018 12:33

After several years of having a TCRT-5000 as a watermeter I decided to check out the NPN as well.
NPN Meter.jpeg
NPN Meter.jpeg (109.91 KiB) Viewed 106 times
.
TCRT is connected to the Raspberry pi. The NPN is attached to a WEMOS to create a wireless solution.

In the image you can see the test setup.
Not a lot of room over the watermeter wheel, but just sufficient to have both meters up and running.
Using Pass2php since 2016-12
LAN: RFLink, P1-Port, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266, Xiaomi Gateway
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

jagroeneveld
Posts: 4
Joined: Tuesday 29 May 2018 9:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Watermeter lezen met raspberry en Inductieve NPN sensor

Post by jagroeneveld » Tuesday 19 June 2018 17:36

In order to see if the results are successfully logged to Domoticz, I added the following lines
#err1 = response1.read()
#print "response = " + str(err1)

just after
#Voor debug => print voorbeeld van de JSON aanroep en/of de counter
#print "JSON call = "+ str(url1)
#print "Watermeter Counter = " + str(Counter)

I needed to do so because I use authorization in Domoticz

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests