[Debug] Button being triggered when pulling from the power source?

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)

This is my first project with an ESP32/Arduino, so don't assume I know anything.

Using code Tags </> attach your sketch.

May be a bit hard with all the files. But I can try.

The issue isn't with the code, that's for sure. It works fine as long as I'm stationary.

According to your schematic, there is nothing connected to U3 WEMOS and you have 3.3V shorted to ground

I've updated the schematic. I broke it when I switched over boards for my physical prototype.

Are you using the bike frame as a ground return path?

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?

Yes, in general a lower value PULL-UP will make the button inputs less impervious to noise. Try 3.3K

I would also put a 10uF capacitor on the wemos 5V input.

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.