Water flow sensor YF-S201C

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Water flow sensor YF-S201C

#1 Post by olleman » 17 Jun 2018, 17:18

Hello!

I'm wondering wether this sensor could be used with the pulse logic plugin i n EspEasy? My concern is that it will output roughly 450 pulses/litre of water and I'll have flows of up tp 10 litres/min. Will the hardware be able to coop with all these pulses?

https://www.aliexpress.com/item/Free-sh ... 3b59SZFNZE

Btw, the application is to monitor water usage in the water tank in my boat, thus giving me a good read on what's left in the tank.

Regards, Olle

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Water flow sensor YF-S201C

#2 Post by grovkillen » 17 Jun 2018, 18:02

Shouldn't be a problem I think, but is that value even reasonable? I mean 450 pulses per liter is 2.2mL per pulse.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#3 Post by olleman » 17 Jun 2018, 22:46

Thanks for your quick reply. The specification says:
Flow Pulse: F(Hz)=(5.0*Q)±3% Q=L/Min

So, at 6 L/Min 30 pulses each second, right?

Does espeasy send each pulse to domoticz or does it buffer it somehow and send it like once every second or whatever? Seems like a lot to send 30 pulses each second but what do I know:)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Water flow sensor YF-S201C

#4 Post by grovkillen » 17 Jun 2018, 23:07

Yes it's a counter thus only publish on given interval.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#5 Post by olleman » 18 Jun 2018, 08:23

Cool , thanks!

Does anybody know of a way to measure the volume in a tank, preferably with Domoticz? The ideal case would be to be able to set the tank level to a certain volume eg. 100l and with the flow sensor withdraw volume from it. When I refill the water tank I would also need to "reset" or "fill" the tank again.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Water flow sensor YF-S201C

#6 Post by Wiki » 15 Jul 2018, 16:02

Hi,
I am thinking of a quite similar project, water level in freshwater tank in my caravan. I have already ordered this one https://www.aliexpress.com/item/GY521-G ... 4c4dQ4NTx1 to get the level of the water.

Due to lack of time I didn't got far with the project right now. But at random I had found this project http://www.ispindel.de/docs/README_en.html in the past. So it may be possible to get accurate readings of the water level using a float in the tank by measuring the angle and calculating the remainig volume.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Water flow sensor YF-S201C

#7 Post by Shardan » 16 Jul 2018, 20:28

As the flow sensors are cheap nowadays how's about using two of them?
One for fillup ond one for draining?

Just an idea i got while reading the post.
Regards
Shardan

waspie
Normal user
Posts: 127
Joined: 09 Feb 2017, 19:35

Re: Water flow sensor YF-S201C

#8 Post by waspie » 17 Jul 2018, 16:21

As an alternative idea:

I'm using a pulse counter in one application but I didn't want so much data flowing so often to openhab over mqtt.

I used a trinket to do the detection (or you could use it to do the math) and then turn a digital pin on/off when it met a given threshold. I then picked up this high/low with espeasy as a switch and sent that over mqtt instead.

Say, use the trinket to count pulses and every time they add up to a liter ( or 2, or 5?) it could switch a leg on and off. Then espeasy would send that 1/2/5 liters has been used. That way your traffic is much less and less likely to get lost.

I don't know if this would be applicable for situation but maybe?

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Water flow sensor YF-S201C

#9 Post by Drum » 05 Aug 2018, 22:30

something like this might work
https://www.adafruit.com/product/464

If there is a chance of an overflow (pump on too long) I suggest a tried and true analog automatic shut off float switch.

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#10 Post by olleman » 09 Aug 2018, 15:38

Thanks for all your input. I have actually made a prototype with domotitcz and dZvents script to make something that might just work. The link to the code is here: https://www.domoticz.com/forum/viewtopi ... 70#p184370 last post.

In the meantime I finally got my flow sensor delivered but I can't get it going. I'm getting nothing. I'm using a Wemos d1 and connect VCC to 5V, GND-GND and SIGNAL to D6 and I have also tried D7. I use pulse counter in ESPEasy but I haven't recorded one single pulse, it's "dead". I'm not good with electronics but I've tried a pull-up of 10K between VCC and SIGNAL and that didn't change anything. Any ideas how to connect this or how I can investigate if the sensor somehow was broken on delivery?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Water flow sensor YF-S201C

#11 Post by TD-er » 09 Aug 2018, 22:13

What is the output voltage of that sensor?
The ESP only can handle 3.3V. Some say it should be 5V-tolerant, but I am not so sure about that.

Do you have some kind of schematics of the sensor?
Does it pull a signal to GND to send a '0', or should you use a pull-down resistor and does it output 5V when it tries to send a '1' and is it floating when '0' ? (then you need 2 resistors to make the signal max. 3.3V)

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#12 Post by olleman » 10 Aug 2018, 08:33

Seems like it sends 5V. I distinctly remember that the wemos d1 can handle 5V input, I think that the popular ultrasonic sensors sends 5V and I have used these without any additional resistors in the past.

Also tried with a NodeMcu yesterday with the same result.

Here's a technical datasheet but I can't really make anything out of it. Perhaps somebody else can?

https://www.google.se/url?sa=t&source=w ... mKZV_b9fJq

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#13 Post by olleman » 10 Aug 2018, 12:24

Tried bridging with a jumper cable and pull up - same thing! BUT when configures as a switch input it gives med "0" or "1" as expected. I have tried every configuration I can think of in the pulse logic counter. Am I missing something fundamental?

Also tried the sensor with ha LED and it gives pulses as it should.

EDIT: hmm pulse counter needed to be one of the first 1-4 tasks, working now :)

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#14 Post by olleman » 10 Aug 2018, 19:32

So, back to my project. I have tried today with water with different flows and at 5l/min and above it seems to be accurate but tat 1-3 l/min it's highly inaccurate which is a shame since it's rated for 1-30 l/min. Having bad values at this range wont work since this range is quite often used in my boat where I wanted to use this project. I'm gonna need something with better precision but I'm not sure where to find it.

Another way would of course be to use some kind of level measuring of the tank itself that's been suggested in the thread but I like this approach. If someone has experience with flow sensors that work well at 1-10 litres/min please direct me to these sensors :)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Water flow sensor YF-S201C

#15 Post by grovkillen » 10 Aug 2018, 20:15

I have used this flow sensor for quite some time and even a flow of 10mL/second (0.6L per minute) is counted accurately. The sensor is used in many coffee machines and I would say that the cups used are 0.2L at most and that one is filled accurately within 30 seconds. So they are really good (and cheap).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#16 Post by olleman » 11 Aug 2018, 08:45

Thanks! Do you know anything how they perform upwards 10l/min even though they are rated to MAX 6l/min? I will occasionally have MAX flow in the boat which would mean about 10l/min.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Water flow sensor YF-S201C

#17 Post by TD-er » 11 Aug 2018, 13:14

olleman wrote: 11 Aug 2018, 08:45 Thanks! Do you know anything how they perform upwards 10l/min even though they are rated to MAX 6l/min? I will occasionally have MAX flow in the boat which would mean about 10l/min.
I can imagine the water pressure may also be an issue with these flow sensor with 10 liter/min.

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#18 Post by olleman » 11 Aug 2018, 15:39

This one seems interesting, seems to be very similar to the one grovkillen recommended but with threaded connections and supposedly a MAX flow of 10l instead of 6.

https://de.aliexpress.com/item/Hall-Sen ... 78327.html

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: Water flow sensor YF-S201C

#19 Post by olleman » 11 Aug 2018, 15:46

On another note, I'm having problem making a rule that needs to contain a formula within the SendToHTTP command. Is it possible to do this?
Look at the last portion of below rule, I need to multiply the value by 6 (to get flow/min) but ESPEasy won't accept this formatting. Do I need to remind everyone that scripting and coding isn't my strong suit :)? Having two tasks with the same flowmeter doesn't work since one of them always stops working...

on Flow#Liter>0 do
SendToHTTP 10.3.141.50,8080,/json.htm?type=command&param=udevice&idx=21&nvalue=0&svalue=[Flow#Liter*6]
endon

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Water flow sensor YF-S201C

#20 Post by grovkillen » 12 Aug 2018, 09:40

olleman wrote: 11 Aug 2018, 08:45 Thanks! Do you know anything how they perform upwards 10l/min even though they are rated to MAX 6l/min? I will occasionally have MAX flow in the boat which would mean about 10l/min.
I would think it'll work okay for short periods of time with a max flow of 10L/min. I haven't tested it myself but I guess it's easy to test with an air pressure hose and blow it into the sensor.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests