Williwaw
Posts: 2
Joined: Tue Feb 27, 2018 6:46 am

How to turn on and off a raspberry pi every day for some minute?

Tue Feb 27, 2018 7:03 am

I need to make photographs of plants outside in the garden regularly. So my raspberry pi zero will be connected to a battery.
The pi should turn on every day once or twice at the same time. When the pi boots up it takes a photo then shuts down. So the powering should run maximum 5 minutes at once. That's more than enough. It would be ideal to run this cycle for several weeks, of course it depends on the battery.

For this I would like to use some 5v time delay switch but I don't have experience in it. I've found some on aliexpress but from the funny chinese decriptions I don't get exactly wich one is good for this task. (A bigger 12v relay is maybe consumes a lot power so I think that's not an option...)

Because I need several devices the timing device should be relatively cheap. (Some dollars maybe)

Could you help me on this?

https://www.aliexpress.com/item/DC-5-35 ... 269.94dRrc

https://www.aliexpress.com/item/Widely- ... 278.Ff3j6e

https://www.aliexpress.com/item/Trigger ... autifyAB=0

Thank you.

Endure1
Posts: 3
Joined: Tue Feb 27, 2018 6:13 pm

Re: How to turn on and off a raspberry pi every day for some minute?

Tue Feb 27, 2018 6:55 pm

I'm interested in finding a detailed solution on how to use those timer modules as well. If not, I was just going to use an electrical outlet timer like people use for their Christmas lights, but those are more expensive and bulky.

For ~$25 the Witty Pi 2 or Witty Pi Mini seems to do everything we're looking for and has nice instructions for use.
http://www.uugear.com/product/wittypi2/
http://www.uugear.com/product/wittypi-mini/

As somebody that is new to working with electronics/RPi it would be great to see a detailed explanation on how to use any 'timer module' to automatically (remotely) power on the RPi at given times of the day.

davef
Posts: 61
Joined: Wed Feb 20, 2013 8:39 pm
Location: Christchurch, NZ

Re: How to turn on and off a raspberry pi every day for some minute?

Tue Feb 27, 2018 11:30 pm

Had a quick look at your links. The last one is the only one that specifies a standby or self-consumption current. 20mA. That is probably going to hurt your battery lifetime.

An 8bit uP with power-down and power-save modes ie the ATmega88P/PV series to turn the PI on is going to be much easier on the batteries.

noteasy2
Posts: 9
Joined: Sat Jun 18, 2016 4:11 am

Re: How to turn on and off a raspberry pi every day for some minute?

Wed Feb 28, 2018 6:13 am

Why not using a 7x24 hrs programmable timer plug?

Williwaw
Posts: 2
Joined: Tue Feb 27, 2018 6:46 am

Re: How to turn on and off a raspberry pi every day for some minute?

Wed Feb 28, 2018 9:42 am

Yes, I've also found WittyPi, but I need a cheaper solution. :cry:
Unfortunatelly I don't have experience in programming Atmega controller.
A ready solution would be ideal for some dollars...

User avatar
DougieLawson
Posts: 36312
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How to turn on and off a raspberry pi every day for some minute?

Wed Feb 28, 2018 9:51 am

noteasy2 wrote:
Wed Feb 28, 2018 6:13 am
Why not using a 7x24 hrs programmable timer plug?
Because that just pulls the juice, it doesn't run an orderly shutdown. Doing that frequently will shoot the SDCard deader than Monty Python's parrot.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

PiGraham
Posts: 3665
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to turn on and off a raspberry pi every day for some minute?

Wed Feb 28, 2018 10:00 am

DougieLawson wrote:
Wed Feb 28, 2018 9:51 am
noteasy2 wrote:
Wed Feb 28, 2018 6:13 am
Why not using a 7x24 hrs programmable timer plug?
Because that just pulls the juice, it doesn't run an orderly shutdown. Doing that frequently will shoot the SDCard deader than Monty Python's parrot.
Something that just cuts power at a set time is OK if the Pi is set to power up, do something and shutdown all well before the timer cuts power.
There is a risk that something prevents the Pi from safe shutdown since the power is going off irrespective, but the risk is not large.

The downside is that the timer itself draws power, and the cheap plug-in units are no use for a battery powered system.
Thanks to the solar market similar devices exist for 12V DC

https://www.amazon.co.uk/Power-Programm ... KPRT4Z6PQV. At £3.90 it is surely the cheapest option.

mikerr
Posts: 2781
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: How to turn on and off a raspberry pi every day for some minute?

Wed Feb 28, 2018 11:57 am

How about:
Adafruit TPL5110 Low Power Timer Breakout
https://www.adafruit.com/product/3435 $4.95

Sleeps at ultra low 20uA (0.02mA) for 2 hours, but you could maybe use a larger resistor to increase that timing,
the MOSFET can drive up to 4A so more than enough for pi.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

PiGraham
Posts: 3665
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to turn on and off a raspberry pi every day for some minute?

Wed Feb 28, 2018 12:30 pm

mikerr wrote:
Wed Feb 28, 2018 11:57 am
How about:
Adafruit TPL5110 Low Power Timer Breakout
https://www.adafruit.com/product/3435 $4.95

Sleeps at ultra low 20uA (0.02mA) for 2 hours, but you could maybe use a larger resistor to increase that timing,
the MOSFET can drive up to 4A so more than enough for pi.
That could work.
The Adafruit TPL5110 Power Timer is a stand-alone breakout that will turn any electronics into low-power electronics! It will take care of turning your project on/off using a built in timer that can vary from once every 100ms up to once every two hours. Basically, the TPL will turn on periodically, adjustable by potentiometer or resistor, and turn on your project's power. It will then wait until a signal is received from the project to tell the TPL that it can safely turn off the power. If the TPL does not receive a signal by the set time-out, it will reset the device like a watchdog timer.
It doesn't do time of day and is limited to two hours but the Pi could use NTP, RTC or just count cycles to get to twice daily.

Endure1
Posts: 3
Joined: Tue Feb 27, 2018 6:13 pm

Re: How to turn on and off a raspberry pi every day for some minute?

Thu Mar 01, 2018 4:24 am

Assuming you already have a charged 12 V battery, the most straight forward path that I found is as follows.

First hook up a '12 V programmable timer' to your battery, such as this one
https://www.aliexpress.com/item/AC-220 ... utifyAB=0

The amazon version of this programmer (identical) has some interesting comments claiming 20-30 mA power consumption, which is on par with the last module you posted (the only one that included a power consumption). I wouldn't be surprised if it's power consumption is more than the ones you posted, however it's much more dynamic with 20 on-off time settings per day and is easier to use.
https://www.amazon.com/gp/product/B012F ... _qh_dp_hza

From there connect to a '12V to 5V 3A Step Down Voltage Regulator' such as:
https://www.aliexpress.com/item/1PCS-D ... utifyAB=0

You can find similar voltage regulators on amazon for ~$10 that ship in days instead of months. Just make sure you set the timer intervals so the raspberry Pi has enough time to fully shut down or you risk corrupting the micro SD card. If you do get one of those timing devices I'd be interested to hear how well they work.

Return to “Automation, sensing and robotics”