Reducing power consumption on Atmega328P-PU standalone

Hello,

I've got a new project planned that will rely on minimizing a standalone circuit's power consumption.

I want to build a device that switches off a light bulb using a relay after five minutes.

An elderly family member has a 1980s Mercedes, and the trunk light has no automatic power off after five minutes, like most modern cars. Our family member sometimes forgets to make sure the trunk is shut. And so the trunk light just stays on, and because they sometimes don't use the car for a week and it goes unnoticed when the car is in the garage, a 10-watt light bulb at 12 volts is enough to suck down the battery so that the car won't start.

This should be a piece of cake for an Atmega328P-PU standalone circuit, I am thinking the program sketch won't go much beyond

while (i<=300000) i= millis();


if (i>=300000) digitalWrite(trunkLight, LOW);

I want to make it so that the Atmega only has power when the trunk light switch is ON. When five minutes are up, you are going to have to shut and open the trunk lid again. Alternatively, maybe an idea would be to use a tilt switch, so you don't have to fully shut the lid. One of my old cars had this, and when the trunk light went out after five minutes, you only had to tilt the lid to a horizontal position for it to come back on.

Anyway, the device's design should be so that the trunk lid, with this device in place, can stay open for a week without the battery losing too much power. The 10-watt light bulb draws around 800 milliamps, and I am not sure how much a standard Atmega circuit would draw.

Could you give me some info on that, and also, what can be done to reduce such a circuit's power consumption, so that it can stay running for a week on that car battery without affecting its ability to start the engine?

Hi,
I think you would want to set it up so that when the trunk lid was opened and the power to the light was turned on, the Arduino would turn a relay ON to light the lamp. After the timeout, the relay would be turned off.

See the schematic on a typical relay board HERE:

Once the Arduino turns the relay off, there is no relay board current drawn, only the Arduino itself, which is very low, and could be less if you use Sleep ability. Nick Gammon has an excellent page on that HERE:

DISCLAIMER: Mentioned stuff from my own shop...

Maybe a variation of this, with "load" being the Arduino in parallel with the relay.
When Arduino is on an senses the trunk lid opening, it controls the relay coil, energizing relay from NO to NC contact. After 5 minutes, it de-energizes relay and powers itself down as well.

Hello again,

yes, I was going to put the relay in NO position when five minutes are up.

I like CrossRoads's approach as well... although I'm going to have to spend more time looking into it because I haven't really done much with interconnected transistors.

I find the sleep libraries intriguing... so basically, if I put the Atmega into SLEEP_MODE_PWR_DOWN at 0.36 mA, I could keep it running on that car battery (74 Ah battery... the car's got a diesel engine) for over 80,000 hours before there would be engine start problems... ;D

And then put the trunk light switch on one of the hardware interrupts for it to wake up again... and maybe, if I use a tilt switch, put that one on the other interrupt...

Or use the trunk opening to trip switch S1 and power up the Arduino, the Arduino then keeps the NPN on for the 5 minutes, after which it stops driving the NPN and allows the PNP (or a P-channel MOSFET) to turn off powering everything down except pullup resistor R1.

Naturally, it is good on this forum to keep the faith and promote an Arduino solution where possible. But if you are interested in a simple, practical solution, you could also look at a product such as this. OK. It is not so much fun to build, and you'll not learn much by installing it, but it could be an alternative in this specific case.
http://bluewireautomotive.com/products/interior-dome-light-delay-dimmer

30 second delay or so? I don't see any numbers. Sure would be easy tho.

The point of this project is to combine doing a family member a favor with the fun of designing an Arduino circuit... :wink: Everybody gets something out of it this way...

I've seen those delay circuit boxes at car electronics stores. I think they are really only meant to keep your interior light on for a little longer after you've shut the door. They probably won't give you a five-minute delay, and as I understand it, they do the opposite of what I want, in that they feed the interior dome light light bulbs for some time after their power supply is cut out... while I want to cut a light bulb's still existing power supply after five minutes.

What I've got planned seems like a pretty simple Atmega circuit to build, as far as circuits go... so I'd rather do a custom build - and be able to give it all the bells and whistles which I think it should have.

For example, it'd be nice to give it a tilt switch, and also a large(r) capacitor behind the relay, which will fade the light out gradually when the Arduino cuts the power. What kind of capacity would you suggest for a 10-watt light bulb at 12 volts to produce this effect?

carguy:
Hello,

I've got a new project planned that will rely on minimizing a standalone circuit's power consumption.

I want to build a device that switches off a light bulb using a relay after five minutes.

the simple way it to put in a mercury switch.
the next simple way is to put a button switch like on your refrigerator door..

alas, that is no fun.....

for the dimmer, just use a PWM signal with transistor or FET

anything more extravagant is not offering anything more than