Boarduino doesn't start up till 3-5th attempt

I have a boarduino running off a 9v alkaline battery with a hardware switch in the power lines. It's hooked up to a light-to-frequency convertor and a 2x16char LCD.

If I flip the power switch, the thing doesn't come on (or at least the LCD displays nothing). If have to flip it off and on a handful of times before it will come to life. I don't think it ever comes on the first time. After it's running, it's fine.

I have code that blinks the onboard LED 3 times on startup, and when I flip the hard switch, the LED blinks 3 times VERY faintly. If I hit the onboard reset button with the power still on, then the onboard LED will blink 3 times in a normal, bright fashion. But whenever I turn the board on by applying power, the LED blinks are very dim. It's almost as if there is voltage sag because the tiny PSU caps are still filling up. It's the only explanation I could think of.

Any chance that you have an oscilloscope so that you can watch the voltage on the incoming power? A digital one would be ideal so that you could trigger on the voltage as the board powers up.

  • There are two versions of the boarduino, and they have different power input requirements, which one are you using?

  • For the DC Boarduino the specs say it needs 7V on the DC input.
    Do you know if the 9V battery is providing at least 7V under load?

  • Have you tried powering up the boarduino without the light-to-freq converter and LCD connected? Maybe one of those is causing the voltage to drop?

  • Do you have a power supply that you could use to see if it's the battery or something with the boarduino?

  • I'm not sure about the Atmega328 that's on the boarduino but some microcontrollers have a register that tells you if the brownout detection kicked in on the previous power up. You might check the data sheet and see if the Atmega328 has anything like that.

Good luck.