GPIO not always to 0

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

GPIO not always to 0

#1 Post by marktn » 15 Jun 2021, 20:31

Hi,

I have a keypad that has a relay NO. I have connected that to my ESP.
It always goes to state 1 but not always to 0
Is there a way when my gpio is 1, it always gets back to 0 after a few seconds.


Code: Select all

281831: EVENT: Clock#Time=Thu,00:56
283845: SW : GPIO=4 State=1 Output value=0
283855: EVENT: switch#State=0
284312: HTTP: GPIO,15,0
284316: GPIO : port#15: set to 0
287345: SW : GPIO=4 State=0 Output value=1
287350: EVENT: switch#State=1
287796: HTTP: GPIO,15,1
287800: GPIO : port#15: set to 1
292345: SW : GPIO=4 State=1 Output value=0
292350: EVENT: switch#State=0
292805: HTTP: GPIO,15,0
292810: GPIO : port#15: set to 0
297645: SW : GPIO=4 State=0 Output value=1
297650: EVENT: switch#State=1
298098: HTTP: GPIO,15,1
298101: GPIO : port#15: set to 1
302385: WD : Uptime 5 ConnectFailures 0 FreeMem 19368 WiFiStatus WL_CONNECTED ESPeasy internal wifi status: Conn. IP Init

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GPIO not always to 0

#2 Post by TD-er » 15 Jun 2021, 20:44

Can you draw how things are connected?
I don't think I really understand what you do here.

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: GPIO not always to 0

#3 Post by marktn » 15 Jun 2021, 21:15

I have a keypad, that gives a few seconds a signal to my esp.
The signal is given when the code or key is okay. It comes from a NO connection.

GPIO-4 to NO, Ground to COM. It is just a relay the keypad.
Attachments
firefox_2021-06-15_21-13-00.jpg
firefox_2021-06-15_21-13-00.jpg (90.47 KiB) Viewed 4076 times

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GPIO not always to 0

#4 Post by Ath » 15 Jun 2021, 21:28

Have you installed a pull-up resistor (~10k) between 3v3 and GPIO-4? This setup will most likely need one, as you (also) haven't enabled the internal pull-up (that's with 50 to 80k a tad high). A lower value stabilizes the signal better.
Also, setting a De-bounce time of around 100-300 msec will greatly stabilize the working of your rules.

Please also share your rules, related to this switch.
/Ton (PayPal.me)

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: GPIO not always to 0

#5 Post by marktn » 15 Jun 2021, 21:50

Ath wrote: 15 Jun 2021, 21:28 Have you installed a pull-up resistor (~10k) between 3v3 and GPIO-4? This setup will most likely need one, as you (also) haven't enabled the internal pull-up (that's with 50 to 80k a tad high). A lower value stabilizes the signal better.
Also, setting a De-bounce time of around 100-300 msec will greatly stabilize the working of your rules.

Please also share your rules, related to this switch.
Thanks! That solved the problem.Keep u the good work! :!:
I have no rules, the status will be send to domoticz to switch on/off my Alarm status.
At this time there is no resistor, but i will do that to be sure.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 30 guests