Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling Pullup resistor for GPIO #2525

Closed
nhorvath opened this issue Apr 22, 2018 · 7 comments
Closed

Disabling Pullup resistor for GPIO #2525

nhorvath opened this issue Apr 22, 2018 · 7 comments
Labels
enhancement Type - Enhancement that will be worked on

Comments

@nhorvath
Copy link

I have a PIR sensor that doesn't like the internal pullup on GPIO02 on my Sonoff T1 UK 3CH version. When the PIR goes "off" it is showing about 1.2V and 3.2V when on. The 1.2V is enough voltage for the pin to occasionally consider the input high. I tried adding a pulldown resistor which helped reduce the frequency but it would still happen occasionally.

My solution was to make a code change to switch GPIO02 to INPUT (floating) rather than INPUT_PULLUP. What do you think about adding a user configurable way to do this?

  for (byte i = 0; i < MAX_SWITCHES; i++) {
    if (pin[GPIO_SWT1 +i] < 99) {
      pinMode(pin[GPIO_SWT1 +i], (16 == pin[GPIO_SWT1 +i]) ? INPUT_PULLDOWN_16 : ((2 == pin[GPIO_SWT1 +i]) ? INPUT : INPUT_PULLUP));
      lastwallswitch[i] = digitalRead(pin[GPIO_SWT1 +i]);  // set global now so doesn't change the saved power state on first switch check
    }
  }
@stale
Copy link

stale bot commented Jun 6, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Jun 6, 2018
@ascillato
Copy link
Contributor

Hi,

For all your PIR sensors happened this, or for any in particular?

@stale stale bot removed the stale Action - Issue left behind - Used by the BOT to call for attention label Jun 6, 2018
@nhorvath
Copy link
Author

nhorvath commented Jun 6, 2018

It happens with all my AM312 based sensors.

@ascillato2 ascillato2 added the enhancement Type - Enhancement that will be worked on label Jun 6, 2018
@abmantis
Copy link

I'm adding a new device that also needs the GPIO_SWT1 to have no pullup.

arendst added a commit that referenced this issue Aug 23, 2018
6.1.1.9
 * Allow user override of define MAX_RULE_TIMERS (#3561)
 * Allow user override of define MAX_RULE_VARS
 * Add GPIO options ButtonXn, SwitchXn and CounterXn to select INPUT mode instead of INPUT_PULLUP (#2525)
 * Fix OtaMagic when file path contains a dash (-) (#3563)
@ascillato2
Copy link
Collaborator

Implemented. Closing issue. Please, ask to reopen if needed. Thanks.

@nhorvath
Copy link
Author

@ascillato2 can you point me to the documentation on how to use the new config?

@ascillato
Copy link
Contributor

Yes,

https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_changelog.ino

Now, with last develompent version, you have in the webmenu in the module configuration new options from the dropdown selection.

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
6.1.1.9
 * Allow user override of define MAX_RULE_TIMERS (arendst#3561)
 * Allow user override of define MAX_RULE_VARS
 * Add GPIO options ButtonXn, SwitchXn and CounterXn to select INPUT mode instead of INPUT_PULLUP (arendst#2525)
 * Fix OtaMagic when file path contains a dash (-) (arendst#3563)
@ascillato ascillato mentioned this issue Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on
Projects
None yet
Development

No branches or pull requests

4 participants