Glitch on pin 13. Is it broken?

I have a project that seems like it should be done. Basically, an arduino has a temperature sensor that makes an LED pulse gently above a certain temp.

I've installed this on two identical arduinos with identical wiring. One works.

The other one ignores temperature, starts to pulse on, quits, and then flashes pin 13.

What's really weird is: there's no reference to pin 13 anywhere in my code! I have an LED on 13 left over from testing purposes and it goes straight to the ground pin next door. Everything else goes to the main ground pin.

Why is pin 13 involved?

Okay that was weird. There was something wrong with the battery? When I use USB power or connect it to a fresh 9V, the problem stops.

blinking on pin 13 sounds like the bootloader running (and thinking that there is no sketch loaded.) Perhaps the sketch was not loaded reliably due to low battery voltages?