Battery drain when LED's are off

I built a simple project with my son. It's sort of a nightlight where four led's are connected to the Arduino via a breadboard and there's a button attached to it. He pushes the button and the lights go on and again and the lights go off. I figured the LED didn't use much power so it could be run off of a 9 volt battery for a good amount of time.

We connected a 9 volt battery to the power connector. It worked great as his first stand-alone device. He didn't use it yet, but overnight the battery drained, even though the button wasn't pressed and the LED's weren't on. Any ideas why? I noticed there's a little light lit on the board even when the button isn't pressed. Could that tiny light be draining the battery?

You do have current limit resistor in the LED path, yes? 220-270 ohm or so?

Regulator is knocking 9V down to 5V all the time.
Power LED is on.
Board draws ~15mA when running a simple loop for regulator, atmega328, USB/Serial adapter, power on LED.

9V batteries only have something like 300mAH of capacity.
300/15 = 20 hrs tops.

I'd suggest a 7.5V wallwart for power.
Example: Switching DC Wall Power Adapter 7.5V / 1A - dipmicro electronics

bobmcinnis:
I noticed there's a little light lit on the board even when the button isn't pressed. Could that tiny light be draining the battery?

That ... and all those black square things on the board.

Arduinos draw power constantly, even when they're not doing anything.

Thanks guys,

Yeah, I have resistors but didn't realize the power drain was so significant. I guess most of the projects I'm seeing are plugged into the wall or have an on/off switch, huh? Thanks again!

Cool dad to work with your son on projects. I recommend using this for further learning. The first go round works, but has some problems.

The 9V does not have much capacity and the project uses power even when on. Brain storm on how to improve that.

Since going to a simple resistor, switch, and battery would sort of be going backwards how about figuring a way to do the same thing with component or more simple logic chip. What you have is a flip flop circuit.

Sounds like what you want is this:

Thanks! I was looking for what to do next with my son. This is perfect. Thanks so much!

There are ways to put the Arduino microcontroller into sleep mode, but most Arduino boards also have a usb->serial chip which uses 15mA too. For low power standby you need a standalone board without the USB->serial chip, and to use one of the libraries that allows putting the microcontroller into low-power sleep modes.

bobmcinnis:
I built a simple project with my son. It's sort of a nightlight where four led's are connected to the Arduino via a breadboard and there's a button attached to it. He pushes the button and the lights go on and again and the lights go off. I figured the LED didn't use much power so it could be run off of a 9 volt battery for a good amount of time.

We connected a 9 volt battery to the power connector. It worked great as his first stand-alone device. He didn't use it yet, but overnight the battery drained, even though the button wasn't pressed and the LED's weren't on. Any ideas why? I noticed there's a little light lit on the board even when the button isn't pressed. Could that tiny light be draining the battery?

Having prototyped the system on an Arduino, I would build a minimal atmega328p design on a piece of stripboard, and program it to be in sleep mode most of the time. If you want to stick with the 9V battery as the power supply, use a micropower regulator to provide the 5V supply, such as the MCP1702-5002E.