normal switch without real function?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
thobastian
Normal user
Posts: 15
Joined: 21 Sep 2018, 11:05

normal switch without real function?

#1 Post by thobastian » 21 Sep 2018, 11:15

Hi,
I am new here in forum, but have general know how in arduino and esp easy.

I start a test project with nodemcu, espeasy v2.0 and a normal cable between gnd or V3.3 and D6.
I'll test the witch function of esp easy. It work like here:
If I connect the D6 on GND, I get a "0"
If I connect the D6 on V3.3, I get a "1"
If I disconnect the D6 , I get the last status from last test. But this is bad.
This isn't usable for a normal switch (like a wall mounted switch in a house)

How you solve this problem?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: normal switch without real function?

#2 Post by grovkillen » 21 Sep 2018, 12:50

Typing this on my phone, but, have you looked into switch settings? Internal pull up etc?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

reinhold
Normal user
Posts: 15
Joined: 19 Jun 2017, 22:52
Location: Vienna, Austria
Contact:

Re: normal switch without real function?

#3 Post by reinhold » 21 Sep 2018, 12:57

You need to add a pull-up or pull-down resistor, which ties the otherwise floating state of an unconnected pin to either HIGH or LOW. Of course, you can't distinguish between unconnected and switch open then.

thobastian
Normal user
Posts: 15
Joined: 21 Sep 2018, 11:05

Re: normal switch without real function?

#4 Post by thobastian » 22 Sep 2018, 23:39

In my settings, I switched to pull-up , but nothing happens.

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: normal switch without real function?

#5 Post by enesbcs » 23 Sep 2018, 15:33

thobastian wrote: 22 Sep 2018, 23:39 In my settings, I switched to pull-up , but nothing happens.
If you've created a Switch device in ESPEasy, to D6-GPIO12 with "Internal Pullup" then after submitting it, you can measure 3.3V at the D6 pin on its own (without cable connected), and value of 1. If not, than try D5 or D7. If you connect it to GND with a cable, than it will go to 0. Except if you configured this pin to OUTPUT at the Hardware settings, which would surprise me, or if it is a faulty module.

thobastian
Normal user
Posts: 15
Joined: 21 Sep 2018, 11:05

Re: normal switch without real function?

#6 Post by thobastian » 23 Sep 2018, 18:57

okay, this works good with 3-pin mounted switch, but what about 2-pin ?

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: normal switch without real function?

#7 Post by enesbcs » 23 Sep 2018, 19:19

thobastian wrote: 23 Sep 2018, 18:57 okay, this works good with 3-pin mounted switch, but what about 2-pin ?
I do not really understand what you mean about 3-pin.
I am using 2-pins. 1st is the GPIO and the 2nd pin is GND.

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests