Currently I'm having trouble with my lighting/indication system for my escooter. The indication buttons are somehow both randomly triggering when I start pushing my scooter. (AceButton does this less when I increase the debounce to say 100).
ESP32 Power Source: 60v -> 12V Step Down -> 5V Step Down -> ESP32-S2
Button Mode: INPUT_PULLUP (45k ohm internal)
I've debugged all the wires, plugs and tried shaking everything.
I'm wondering if pulling the throttle could be responsible for interfering with the pin's INPUT_PULLUP which senses a button press? And if so, could I please get some advice on remeding this.
If anyone's interested, here's a schematic: (excludes 12v step down)
No, it's all on a double sided perf board. 5v & gnd is routed directly to the 5v step down from the board. Very direct 60v battery <-> 12V Step Down <-> 5V Step Down <-> ESP32-S2
The frame of the scooter doesn't conduct anything.
I can't really stick a multimeter inside while riding, so I'm at a bit of a loss. Perhaps a pull down resistor or a different value pull up resistor would do?
Thank you. The lower pullup seems to align with my research, however I wasn't sure how low.
This leads me to my next quesion, I'm familar with INPUT_PULLUP. But if I were to use my own resistor, would I leave it wired from the IO port to ground and put the resistor inbetween? And would the pin mode just be INPUT?
I'll try the capacitor if this doesn't work. It does add two complications, mostly because of the small size of my board. It's only about 2cm x 2cm, soldered with mostly SMD and through board header ports.
--
I just implemented something to ignore any key releases within 100ms, it seems to have solved the issue. However this doesn't seem like the best solution and it has a chance to cancel out genuine key presses.
The pullup goes between 5V and the input pin.
To be correct you should change the mode to just INPUT.
You can find small 10uF surface mount ceramic capacitors