So I've been building a tiny handheld thing inside an old mint tin, just an Arduino clone, a small screen, a couple of buttons and a piezo buzzer for beeps. It mostly works but every time I press one of the buttons the screen fills with random blocks for a second and then sorts itself out. Sometimes the buzzer does a wierd half beep at the same time. I figured it was my wiring at first so I redid all the connections and made the wires shorter, but it still does it. It's not loose because I can press the button a hundred times and it glitches every single time, very consistent. My only other guess is the ground wires. Everything shares one ground pin on the board and maybe that's the problem? Someone at my school said something about buttons needing thier own path back to ground but I didn't really follow what he meant. I'm using the internal pullups in the code so I'm not sure if that changes anything. Has anyone hit this before with a cramped build like this? It's annoying more than anything since the program keeps running fine underneath, the display just freaks out for a moment.
Why does my little LCD screen glitch out whenever I press a button?
Nov 03, 2026
Last reply: 1 day ago
5 Replies
First reply
Ran into this exact thing in a cramped handheld build of mine and it turned out to be noise from the button line getting into the display wires, not the ground pin itself. What gave it away was what you described: the glitch happens on every single press, perfectly consistent…
Read the full replyRan into this exact thing in a cramped handheld build of mine and it turned out to be noise from the button line getting into the display wires, not the ground pin itself. What gave it away was what you described: the glitch happens on every single press, perfectly consistent, and the program keeps running underneath. A loose wire or bad connection doesn't behave that predictably, so don't blame your soldering.
Here's what's going on. When you press the button, that wire acts like a tiny antenna for a split second, and in a tin that size your button wire is probably running right alongside or crossing over the wires going to the screen. The spike momentarily garbles the data heading to the display, so you get the block garbage until it redraws. The buzzer doing a weird half beep at the same time is the same story, the piezo picks up the spike too. Internal pullups are fine, keep using them, that's not your problem. What actually helps is putting a small cap, something like a 100nF, from the button pin to ground on the board side. That soaks up the spike before it goes anywhere. Doing the same across the buzzer terminals helps too. Also try rerouting so the button and buzzer wires don't run bundled together with the display wires, even if it makes the wiring uglier. If they have to cross, cross at right angles rather than running parallel. Your school friend had a point, just not quite the way you heard it. It's not that each button needs its own ground pin, it's that you don't want everything sharing one long skinny ground wire where all the currents flow through the same path. If your clone board has a wider ground rail, use that, and keep the ground runs short. One quick test if you want to confirm it: unplug the buzzer entirely and press the button a bunch of times. If the screen stops freaking out, the buzzer was amplifying the whole mess and you can focus your fixes there.
I had a similar headache with a power-intensive build a while back. Since everyone is pointing at the signal noise, you might want to check your power rail itself. Even if the code runs fine, if the voltage dips for a millisecond when the screen tries to redraw, that could cause the garbage data display. Have you looked at the gauge on your power supply? It's not just about the current, but the quality of the power coming in. Sometimes swapping a cheap USB cable for a beefier one makes all the difference in stability.
I wonder if we should consider the possibility of switch bounce exacerbating the observed symptoms, because mechanical buttons do not always provide a clean digital signal upon physical depression. Even if the noise coupling is minimal, the contact may chatter for a brief period before stabilizing, which could cause the processor to interpret a single press as multiple rapid events. Integrating a small RC filter across the button leads physically, or implementing a sufficient debounce delay within the sketch itself, ought to ensure only one definitive state change registers before the display driver is activated.
I had a buddy build a tiny gadget like this years back, and the glitch always seemed to appear when it first powered up, even if the code ran fine later. It wasn't noise or a bad wire, but the timing of the display's initial handshake with the processor. You might want to try adding a tiny delay right at the start of the loop or the setup to let the screen settle before you try to push the first frame. Sometimes the chip just needs a moment to wake up before it can handle the data stream properly.
Update: tried separating the button wires from the display ones like the first reply suggested, and the constant glitch is mostly gone. But every so often one press still gives a double beep or a flicker. Someone mentioned button chatter causing a messy signal, so does sorting that in code ussually fix it, or do I need to change the wiring too?
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required