How do I use this water sensor?

Hi,

I got a water sensor called XKC-Y25-NPN. It came with no data sheet, no instructions, nothing (!).
I know it comes in different flavours, "NPN" being one of them. This is the link:

https://www.aliexpress.com/item/1005005740444504.html

This is the list of variations:

This is the only bit of documentation I got:

How do I plug this into my Arduino?
I am a little worried because Dr Robot sells the same sensor, but with an attached board which seems to be doing some magic:

And makes it work as a digital one (on/off).

I am confused. Help?

Don't buy such things.

It looks like there is an on/off funtion in that sensor. Use a digital input declared as INPUT_PULLUP in setup.

That is exactly how the link says it works. If you supply the device with 5 volts you will get a 5 volt signal. Try it and see. You don't need an Arduino to test it. Use a LED with a 220 Ohm resistor in series with one leg and connect between ground and the signal connections.

Power supply filtering, connector and a button.

What s "power supply filtering"?

OK but... so what's the "M" pin for?

The capacitors C1, C2 and C3 on the DFRobot interface board.

Capture

OK but... so what's the "M" pin for?

Mode setting. Take a look at the documentation linked in post #4.

There seems to be several UTUBE videos of the device. This is one, there are others.

So... why do they provide such a filter? As in, what's the difference between hooking it up straight to a digital pin, and through this filtering circuit?

This is a very basic circuit principle that is covered in the first semester of a university level class on analog circuit design, any textbook on the topic, and many introductory web pages. If you are interested in this hobby, it would be a great idea to take some time and study the material.

Sorry for asking basic questions. I will study more and come to the forums with more advanced questions.

I apologise, I misunderstood the use of this forum.

Thanks,

Merc.

But really, back to my question... normally, we need a sensor, we get a sensor, we use a sensor. The CFRobot guys have gone out of their way to put a power supply filter on the sensor.

Is such a filtering circuit something that any sensor should have/use? Or is that just a way for DFRobot to add value to the sensor they sell?

Ask the DFRobot people why they added those parts. It is possible that they discovered problems and are attempting to fix design errors in the sensor module.

Hi, @mercmobily

As DF have no control over what their sensor is connected to or powered by, they include these extra components to ensure the protection of their device and predictability of its output.

Nothing sneaky, just plain common practice in analog circuit design to ensure stability.

Tom... :smiley: :+1: :coffee: :australia:
PS. Unfortunately we do not live in a perfect theoretical world.

Should It be ok for me to run this sensor without the extra circuit?

Or, would it make sense to put such a filter anyway? And if so, are there already made ones out there? (I am especially asking since I don't think DFRobot will sell just that bit)

Finally somebody in this thread mentioned that I really should know about this stuff and study it. I tried looking it up but I get all sorts of "filtering" articles. Tom, do you have a good textbook I could use to get to know the basics?

Hi, @mercmobily
Trying it without the filtering should be okay.

See what happens.

Tom... :smiley: :+1: :coffee: :australia:

Love your spirit Tom :smiley:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.