Non-Contact Water/Liquid Level Sensor CQRSENYW001

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Non-Contact Water/Liquid Level Sensor CQRSENYW001

#1 Post by digital7799 » 03 Aug 2023, 14:39

Hi,
I purchased a Non-Contact Water/Liquid Level Sensor from Amazon and I'm trying to connect it to ESPEasy. Do you have any suggestions?
I tried using the Analog Input, but the input varies, and I do not understand why it changes randomly, sometimes from 3200 to 2650.
http://www.cqrobot.wiki/index.php/Non-C ... #Test_Case

Could you please provide some guidance on how to properly set up and calibrate the sensor?

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

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#2 Post by TD-er » 03 Aug 2023, 15:17

What kind of ESP are you using? ESP8266/ESP32?
If ESP32, which pin do you use?

digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#3 Post by digital7799 » 03 Aug 2023, 17:46

I am using eso8266
dont know which port to use. tried with Analog input

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#4 Post by frank » 03 Aug 2023, 17:56

When i look at the specs. Your sensors output is current (0-50 mA). The analoge inputs are made for xxx measurement. I think that the way forward is this:

https://www.letscontrolit.com/wiki/inde ... tle=INA219

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

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#5 Post by TD-er » 03 Aug 2023, 18:22

I don't think this 0...50 mA should be considered as an analog output.
It looks more like this sensor is just outputting a digital signal.
Not sure if it is a 'binary' state like "water present" or "no water present".
It could be that the output is more like a PWM signal.
But I have no idea what kind of signal it is, nor what frequency it should be.

Apparently there is a switch between 5V or 3V3 range and you should set it to 3V3.
But not all ESP8266 boards have the required resistors present to convert this into something less than 1V (the max. input voltage of the analog input on the ESP8266 chip)

So maybe you could connect the + of a simple AA battery to the analog pin and the - to GND and see what ESPEasy reads on the analog port.

If this is somewhere around half of the range (thus 1500-ish values), then you know you have the correct resistors present on your board.

If the sensor is outputting some PWM like signal, then you could add some capacitor over the signal to make it more like an analog signal.
For example start with a 100 nF capacitor and add it close to the analog port of the ESP between the A0 pin and GND.

If you're using a long cable to the sensor, you might also pick up quite a lot of noise which may affect the readings.

Anyway, just based on the description page of the sensor, I don't think it is outputting an analog value.

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#6 Post by Ath » 03 Aug 2023, 20:26

digital7799 wrote: 03 Aug 2023, 17:46 I am using eso8266
dont know which port to use. tried with Analog input
Looking at the Wiki page of the sensor it will output a low or high value on the OUT pin, depending on how it is calibrated. The calibration is sort-of described on that same page, but the translation seems to be done quite poorly :(
Basically you install it as desired, then adjust the sensitivity so it has a low value when no fluid is flowing, and high when the fluid is actually flowing.

An ESP8266 or ESP32 running ESPEasy will support the 3.3V level output (set the corresponding switch on the board to 3.3V, power applied to the board should still be 5V) using a Switch device. You'd better apply some De-bouncing time, and possibly a capacitor as suggested by TD-er, to filter out the noise.

NB: It is not a level sensor, but a flow-detection sensor. The name Level sensor implies some kind of level is measured, but that isn't the case, according to that description, just an on/off indication of fluid flowing or not.
/Ton (PayPal.me)

digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#7 Post by digital7799 » 04 Aug 2023, 07:49

that means i can use it for detection if there is water or not? So which device should i add in espeasy and which pin i should use?

digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#8 Post by digital7799 » 04 Aug 2023, 08:06

So i missed part that in Wiki they showed another sensor but what i purchased is this. Please take a look
CQRobot Ocean: Contact Water/Liquid Level Sensor Compatible with Raspberry Pi/Arduino. for Automatic Irrigation Systems, Aquariums, Plants, in The Garden, in Agriculture etc. https://a.co/d/3yYc24M

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#9 Post by Ath » 04 Aug 2023, 08:56

digital7799 wrote: 04 Aug 2023, 08:06 So i missed part that in Wiki they showed another sensor but what i purchased is this. Please take a look
CQRobot Ocean: Contact Water/Liquid Level Sensor Compatible with Raspberry Pi/Arduino. for Automatic Irrigation Systems, Aquariums, Plants, in The Garden, in Agriculture etc. https://a.co/d/3yYc24M
This sensor works nearly the same, except it probably doesn't need any calibration, but it mentions it has an open collector output, meaning that a pull-up resistor needs to be used. Good values here could be either 4k7 or 10k.
Any usable GPIO pin can be used, but some need some extra care or should be avoided, so have a look at this table
/Ton (PayPal.me)

digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#10 Post by digital7799 » 06 Aug 2023, 15:38

Great thanks for info, after connecting to pin which device should i choose from list of espeasy devices to see information from sensor?

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#11 Post by Ath » 06 Aug 2023, 17:17

digital7799 wrote: 06 Aug 2023, 15:38 Great thanks for info, after connecting to pin which device should i choose from list of espeasy devices to see information from sensor?
Ath wrote: 03 Aug 2023, 20:26 ...
An ESP8266 or ESP32 running ESPEasy will support the 3.3V level output (set the corresponding switch on the board to 3.3V, power applied to the board should still be 5V) using a Switch device. You'd better apply some De-bouncing time, and possibly a capacitor as suggested by TD-er, to filter out the noise.
...
/Ton (PayPal.me)

digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#12 Post by digital7799 » 06 Aug 2023, 19:06

so that means its not supposed to show distance of water tank? only 1/0?

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#13 Post by Ath » 06 Aug 2023, 21:00

digital7799 wrote: 06 Aug 2023, 19:06 so that means its not supposed to show distance of water tank? only 1/0?
The sensor you are trying to use only has the capability to show if water is actually flowing or not, for measuring a level you can use P013 HC-SR04, P110 VL53L0X, P113 VL53L1X or P134 AY02YYUV. This will require some calculation, as it will give you the distance from the sensor to the surface of the liquid, so the actual contents depends on the size of the barrel, but knowing the total height you can quite easily calculate a percentage from that (assuming the barrel is not round like a wine/whisky-barrel).
/Ton (PayPal.me)

digital7799
New user
Posts: 7
Joined: 03 Aug 2023, 14:31

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#14 Post by digital7799 » 07 Aug 2023, 12:57

oh, great thank you for advice. now i should think about how to protect them from moisture and corrosion without loosing measurement capabilites.

User avatar
Ath
Normal user
Posts: 3520
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non-Contact Water/Liquid Level Sensor CQRSENYW001

#15 Post by Ath » 08 Aug 2023, 10:52

digital7799 wrote: 07 Aug 2023, 12:57 oh, great thank you for advice. now i should think about how to protect them from moisture and corrosion without loosing measurement capabilites.
Best chances are when sourcing an A02YYUW, as that's available in watertight versions (searched on Aliexpress)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests