esp easy and PIR

Everything about esp8266 and more.
Post Reply
Thomasdc
Posts: 242
Joined: Wednesday 11 March 2015 20:13
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

esp easy and PIR

Post by Thomasdc » Wednesday 25 October 2017 12:34

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!

freijn
Posts: 299
Joined: Friday 23 December 2016 17:40
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands Purmerend
Contact:

Re: esp easy and PIR

Post by freijn » 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 :-)

Thomasdc
Posts: 242
Joined: Wednesday 11 March 2015 20:13
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: esp easy and PIR

Post by Thomasdc » Wednesday 25 October 2017 12:45

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'

freijn
Posts: 299
Joined: Friday 23 December 2016 17:40
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands Purmerend
Contact:

Re: esp easy and PIR

Post by freijn » Wednesday 25 October 2017 16:49

indeed

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

Thomasdc
Posts: 242
Joined: Wednesday 11 March 2015 20:13
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: esp easy and PIR

Post by Thomasdc » Wednesday 25 October 2017 18:02

How can i do that?

freijn
Posts: 299
Joined: Friday 23 December 2016 17:40
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands Purmerend
Contact:

Re: esp easy and PIR

Post by freijn » Thursday 26 October 2017 23:03

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 ?

Thomasdc
Posts: 242
Joined: Wednesday 11 March 2015 20:13
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: esp easy and PIR

Post by Thomasdc » Friday 27 October 2017 13:25

i used a pull down resistor and now it seems to work fine!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests