Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espurna and XKC-Y25-NPN non-contact liquid level sensor #2604

Open
analistamarcioprado opened this issue Mar 9, 2024 · 2 comments
Open

Espurna and XKC-Y25-NPN non-contact liquid level sensor #2604

analistamarcioprado opened this issue Mar 9, 2024 · 2 comments
Labels

Comments

@analistamarcioprado
Copy link

Device

NodeMCU

Version

No response

Question

Good morning community.

I'm trying to use the Espuna with NodeMCU Lolin v3 and an XKC-Y25-NPN non-contact liquid level sensor.

I compiled Espurna with 1 INPUT type digital sensor (D1) and connected the sensor to pin D1.

However, strange behavior is occurring.

Espurna only detects the liquid once. It goes from state 0 to 1 and does not return to state 0, even if you are not detecting liquid.

The Espurna only returns to state 0 if you physically disconnect the sensor and connect it again.

Please, can anyone help me?

Thank you very much in advance.

@mcspr
Copy link
Collaborator

mcspr commented Apr 10, 2024

I would guess there is no pull-up or down for the input?

https://github.com/xoseperez/espurna/wiki/Sensors#generic-digital-sensor does mention internal pull-up, but it might not work as expected on all boards (as I do remember that Wemos and Nodemcu include their own internal pull-ups on some of the pins)

@mcspr
Copy link
Collaborator

mcspr commented Apr 14, 2024

Another thing to note is read & report, and the time it takes for 1.0 to change into 0.0

By default, readings happen every 6s. Reporting - every 10 successful readings. When values are read, raw value (either 1.0 or 0.0 in case of digital sensor) are passed into a filter. And, by default, this filter is 'max'.

get digitalFilter0
> digitalFilter0 => max (default)

Meaning, if it registers 1.0 at least once during read & report cycle - read and reported value become 1.0 until the next one (i.e. now + 60seconds)

Setting it to 'last' instead would show real read values and report the latest read value during the read & report cycle.

set digitalFilter0 last
reset

(reboots the device)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants