0

I have a Naturewatch camera using a PiZero powered by a large battery pack. The pack will last several days as is, but I would like the camera to be running only during daylight, for obvious reasons, to extend the battery’s life. Does there exist a light sensitive switch I can place between the battery pack and Pi to boot the Pi at dawn and leave it running till a shutdown is run from a cron job at dusk.

  • You want the Pi to shut itself down, just killing the power can cause problems. You can search the internet for "light activated switch" there are a lot of varieties available. This could be a good DIY project. – Gil Dec 13 '23 at 21:05
  • Exactly as I said, the pi shuts down off a cron task running shutdown. A difficulty is in delatching the switch before shutdown without switching off the power till the pi has shutdown – Nicholas Walton Dec 13 '23 at 23:13

1 Answers1

1

You've left out much information that could help us help you with this. For example, "large battery pack" ... just how large is "large"? Have you got some "numbers" - volts & amp-hour capacity? Not trying to nit pick, but all questions similar to yours come down to math - simple math, but math nonetheless. To make any progress on this, you must think like an accountant, and "balance your debits and credits". In other words, you need an "Energy Budget". This is simply a set of calculations that show how much power you have (i.e. "large battery"), and how much you will be required to spend under the various operating conditions. We can help, but we cannot supply the basic facts!

Also, there are many ways to do this, and added information almost always helps. For example: does your PiZero have access to the Internet where it's located? Your idea for a light switch may (or may not) be feasible - have you done any research on that? What have you come up with?

If this were my project, I would consider operating the PiZero on a timer/RTC (if no Internet) so that I could control my energy "debits". I'd also have a way to restore power to the Pi in the morning (or whenever the subjects may be around).

In your comment above you indicate that you'd shut down the pi from a cron job. Yes - you can do that... but have you thought about how you'll get it to power up again? I can assure you it won't be from a cron job --- because after you've shut down, there are no more cron jobs!! But I am assuming you want this to happen automatically; maybe you don't need it to happen automatically, but these are the facts that would be useful to know.

I'd suggest that you work out some "numbers" to establish a first cut at an Energy Budget. Once you have some specifics, that is the time to ask questions here on SE. Generally, coming in with a "Pie in the Sky" thought for a project, and asking us to work out the details is not going to get you where you want to be.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • Please read the question. The purpose of a light activated switch is to turn the Pi on by allowing current to flow from the battery pack to the Pi once the light level reaches a preset level. The size of the battery is irrelevant so long as the pack last for more than twenty four hours, which it does. Not powering it during the night will extend its lifespan in the wild. I could just use a PiJuice power manager to power the Pi using its RTC except it’s expensive and would mean adding weight to the Pi which is not wished for. A simple photo resistor might appear suitable but it is not a switch – Nicholas Walton Dec 14 '23 at 17:17
  • … that latches on and can be toggled off when the Pi powers down at shutdown. At least to me it seems a simple need, but having already searched I have found nothing suitable that will sit between the battery and the Pi, switch on when the light level is reached and toggles off when the Pi turns off. SE would appear to be the best source to find if such a switch exists. – Nicholas Walton Dec 14 '23 at 17:24
  • 1
    @NicholasWalton: Sounds like you've got it covered then. – Seamus Dec 14 '23 at 21:31