I've built a small knocking device with my Arduino that moves a servo a very small amount somewhere between about half and hour and a full hour at a random point. If the device ran for an entire day the servo would be in motion less than 30 seconds. To save power I only update the servo position when it needs to be moved. This is not an issue because a strong hold is not required for the application (it just knocks lightly on a surface). I thought this would give the 9v battery a long life but the device dies overnight. I am wondering how I can get a longer life off a 9v battery.
The device sleeps via the delay function almost all the time and when the servo is moving it moves (by design) for about half a second a very short distance. The servo is a HiTec HS-311. Even though I am not updating the servo position when not in use is it maybe possible that the servo is pulling a large amount of power anyways? I guess I could add a transistor to the power connectors of the servo but the device is very small and I am pressed for space as it is.
I would think that the Arduino idling like this would pull very little power. Thats why I can't figure out what is going on. Any ideas?
I thought this would give the 9v battery a long life but the device dies overnight. I am wondering how I can get a longer life off a 9v battery.
9V batteries are notorious for having a short life--you'd be better off looking at using multiple AA batteries. Get more details about 9V vs AA battery life, the battery chemistry will make a difference also.
The device sleeps via the delay function almost all the time...I would think that the Arduino idling like this would pull very little power.
It may not be as idle as you think--I'd suggest starting by looking at Arduino Sleep Code in the wiki.
I'm not sure how much people here have looked into long-running Arduino devices but the avrfreaks site might be useful. Other issues to consider include clock-speed and using a lower-voltage part (like the Lilypad?).
Thanks for all the helpful information. I'll look into changing the battery type and getting that sleep code to work.
P.S. So what are you knocking, and why?
I'm ummm.... errrrr... faking paranormal activity. Wanted to create a device that makes human sounding knock patterns at random intervals of time. Then hide said device really well in a place thought to be haunted hoping that the sound, combined with the fact people know they are alone, would scare them a bit. ;D