Skip to content
All notebook entries
Debugging · · Entry #11

Trivial Debugging: The Loose Wire Saga

I spent two weeks thinking my MQ4 was broken. It wasn't. The ground wire to my breadboard had pulled half a millimeter loose. Half a millimeter cost me ten experiments.

The symptom

Starting Feb 4, every reading from the MQ4 was garbage. Numbers jumped around between 1 kΩ and 99 kΩ with no pattern. I assumed the sensor had died and ordered a replacement. New sensor: same garbage.

Two weeks of wrong guesses

  • “Maybe the ESP32 ADC is broken.” So I soldered up a backup ESP32. Same garbage.
  • “Maybe the USB cable is bad.” So I swapped to a known-good cable. Same garbage.
  • “Maybe my code is reading the wrong pin.” So I printed every pin to the LCD. Pin assignments were correct.
  • “Maybe the sensor needs to burn in for 24 hours.” So I preheated for 48 hours. Same garbage.
  • “Maybe my power supply is too noisy.” So I added a 100 µF capacitor across the rail. Same garbage.

By Feb 17, I had spent two weeks and ten ruined experiments on this. I was about to give up and re-design the whole power section.

The actual problem

I was about to call it a night and started cleaning up the workbench. I bumped the breadboard and the readings froze. Completely stable, perfect numbers for the first time in two weeks. I bumped it the other way and they went crazy again.

The black ground wire on the MQ4’s analog output side had pulled half a millimeter out of the breadboard hole. That intermittent contact was making the ADC see total noise. Push it back in firmly and everything worked.

What this taught me

  1. Loose connections look identical to broken hardware. When something is “intermittent,” check every single physical contact before you blame a chip.
  2. A bumped wire is the first hypothesis, not the last. I should have wiggle-tested every connection on day one.
  3. My V5 design uses screw terminals for power and ground. Breadboards are great for prototyping, but they fail silently. I’m not losing two weeks again.

Half a millimeter. Two weeks. Ten experiments.

  • Sri

- Sri

Related entries