HC-SR501 ( motion sensor )on nodeMCU, is my sensor broken ? #5854
Unanswered
espruino-discuss
asked this question in
ESP8266
Replies: 1 comment
-
Posted at 2017-09-09 by @MaBecker HC-SR501 datasheet describes output as "TTL output: 3.3V, 0V" so try a D pin like NodeMCU.D1 Posted at 2017-09-09 by Antoine Hi MaBe, Thanks for the heads-up :) I'm gonna try this. Posted at 2017-09-10 by Antoine Issue resolved :) I tried a digital pin without any success :( I tried an other HC-SR501 and it worked. So my sensor was definitely broken. here the code that's working : setWatch(function() {
console.log("Movement detected at : ", Math.floor(Date.now() / 1000) );
}, NodeMCU.D6, {repeat:true, edge:"rising"}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-09-09 by Antoine
Hi everyone, I'm trying to read a HC-SR501 with my nodeMCU but I struggle a bit :(
Wiring :
VCC to vin (5V)
OUT to A0
GDN to GDN
I tried :
Never got any detection
I tried
I swapped the sensor for a water level sensor and
console.log( analogRead(NodeMCU.A0) );
and the water level is detected normally.Did I miss something ?
Thank you a lot for your help :)
Beta Was this translation helpful? Give feedback.
All reactions