Page 1 of 1

esp easy and PIR

Posted: Wednesday 25 October 2017 12:34
by Thomasdc
hellow,

Ive been testing around with a nodemcu
i flashed using windows the nodemcu with ESP_EASY

I want to use this device with a cheap PIR sensor

Normally the PIR sensor is 5V but using google i found out i can use it with 3V with this method:
Image

the problem i have now is that on my ESP easy switch (the PIR sensor) the value is alway '1' it never changes to '0'
i have no idea what i am doing wrong..

i go from the solderd wire on the pir too the 3V on de node mcu, the gound too the ground pin en the OUT pin on the pir is wired to GPIO-0

what i saw when i was trying to switch it using just a wire (so 3V to the gpio-0 pin) is that the state becomes '1' but when i release the wire.. the state keeps staying on '1' only once i connect the gpio-0 to ground it changes to value '0'

do i need to change my wiring between the pir and the nodemcu? i dont use resistors or anything for the moment..

i hope you guys can help me!
Thanks!

Re: esp easy and PIR

Posted: Wednesday 25 October 2017 12:41
by freijn
With your wire test you must fix it to a level.

So for a test, put the Gpio to +3v and the next test must be put the Gpio to GND.

Leaving the wire "floating" can give unpredictable results. Its like an antenna.

Then see if the above does give you 1 or 0 :-)

Re: esp easy and PIR

Posted: Wednesday 25 October 2017 12:45
by Thomasdc
freijn wrote: Wednesday 25 October 2017 12:41 With your wire test you must fix it to a level.

So for a test, put the Gpio to +3v and the next test must be put the Gpio to GND.

Leaving the wire "floating" can give unpredictable results. Its like an antenna.

Then see if the above does give you 1 or 0 :-)
I did this, i do need to connect it to the GND pin before it goes from '1' to '0'

Re: esp easy and PIR

Posted: Wednesday 25 October 2017 16:49
by freijn
indeed

you need to fix the input to a defined level.. do not allow it floating...

Re: esp easy and PIR

Posted: Wednesday 25 October 2017 18:02
by Thomasdc
How can i do that?

Re: esp easy and PIR

Posted: Thursday 26 October 2017 23:03
by freijn
2 things to test here.

Disconnect the Pir out wire from the ESP and use a voltage meter between the Out and GND.

See if the status changes from 0 to 1 and 1 to 0 again.

If noting happens , disconnect the PIR completely from the ESP and connect the Pir to 5 volt on the normal connection and test it again.

So... in short , does the Pir work on 3.3 volt (the hack) and/or on 5 volt on the normal connection ?

Re: esp easy and PIR

Posted: Friday 27 October 2017 13:25
by Thomasdc
i used a pull down resistor and now it seems to work fine!