[solved] Pro Micro pin output voltage difference between usb and batt

Hi,

I'm a hobbyist started last year.

I just build a small fun sound device that plays different christmas bells when detecting movement through a PIR.

It's a Pro Micro 5v with j1 closed (was open before, no difference to story below).

It's working great when powered by USB but not when using battery power.

I'm using a 3x AAA holder with a Pololu 5V step-up voltage regulator (U1V10F5). The Vout is connected to the VCC pin (thus not raw) on the Pro Micro. I'm outputting my sound to pin9.

When I check the voltage on pin9, on USB this is about 1,73v.
When disconnected from USB and turning on my batts, this pin gives 3,25v and rapidly declining when checking.

Also, if it helps, my speaker is working fine when on USB and 'screeching' (and tuning up the pitch) on battery power.

Does this make any sense to anyone...?

Thanks!

Regards,
Tri.

Solved it - user error (of course).

The issue was that I stupidly had the following code:

while (!Serial) {
  ; // wait for serial port to connect.
}

The fix:
Which of course hangs when there is no serial connection. Which is not there when on battery power. I've removed all serial code.
Another solution could be a timer which exits the loop after 5 or 10 seconds or so.

This little project is meant for one or two weeks 8x5 of working after which I can scrap it, so I don't require a very robust setup.

1 Like

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