Hi, ESP newby here.
I bought a ESP12S based development board (link). Unfortunately I cannot find much information about the board, but I did find the datasheet of the ESP-12S module itself. It is supposed to have 9 IO pins, which (by luck) matches my needs. I would like to attach 4 push-buttons and 3 relays right now and add one (or more) I2C sensor(s) later. However that also means I need to use GPIO16 as an relay output, but I’m having trouble getting it to work. I managed to get the four push-buttons and 2 relays to function properly. The last relay which I would to control via GPIO16 is giving troubles. If I understood correctly, GPIO16 differs from the other GPIOs since it has an internal pull-down instead of an internal pull-up and that it is used to wake from deep sleep. I’m not planning to use any deep-sleep, so that should not be an issue. I conducted a small series of experiments, but the results do not make sense to me: (first line of the table is for reference only):
pull | Inverted | Code | Behav without relay | Behav with relay |
---|---|---|---|---|
none | No | - platform: gpio pin: number: GPIO15 name: Two |
Boots normal off: 0.3mV on: 3.24V |
Short relay on/off flash during boot off: 0.4mV - 0.0mA on: 3.19V - 2.0mA |
none | No | - platform: gpio pin: number: GPIO16 inverted: False name: Three |
Relay on during boot - then reboot loop 0.3mV - unstable |
Relay on during boot - then reboot loop 0.3mV - unstable |
none | Yes | - platform: gpio pin: number: GPIO16 inverted: True name: Three |
Boots normal off: 0.3mV - unstable on: 0.3mV - Goes into reboot loop |
Relay on during boot off: 0.3mV - unstable on: 0.3mv - Goes onto reboot loop |
INPUT_PULLDOWN16 | No | - platform: gpio pin: number: GPIO16 mode: INPUT_PULLDOWN_16 inverted: FALSE name: Three |
Boots normal off: 0.3mV - unstable on: 0.3mV - unstable |
Relay on during boot - then reboot loop 0.3mV - unstable |
INPUT_PULLDOWN16 | Yes | - platform: gpio pin: number: GPIO16 mode: INPUT_PULLDOWN_16 inverted: True name: Three |
Boots normal off: 0.3mV - unstable on: 0.3mV - unstable |
Relay on during boot - then reboot loop 0.3mV - unstable |
INPUT_PULLUP | No | - platform: gpio pin: number: GPIO16 mode: INPUT_PULLUP inverted: False name: Three |
Boots normal off: 0.3mV - unstable on: 0.3mV - unstable |
Relay on during boot - then reboot loop 0.3mV - unstable |
INPUT_PULLUP | Yes | - platform: gpio pin: number: GPIO16 mode: INPUT_PULLUP inverted: True name: Three |
Boots normal off: 0.3mV - unstable on: 0.3mV - unstable |
Relay on during boot - then reboot loop 0.3mV - unstable |
Anybody any idea what is going on here and how to get GPIO16 working as a switch? Should I use a hardware pull-up or pull-down? What should be the value?
I could also connect a scope, but since I do not own one myself it’s a bit harder to do so.
I could also just get another board with more GPIO pins, but I still what like to understand what is going on here.