1

I need to be able to power on and off Rpi using battery using timer-mechanism, Some say to use plug timer, but I'm not sure if it will work with battery because it might end up that plug timers use plug power to power on/off and the inner battery is only for the clock. Is there any efficient way to make a timer for RBpi that would, for example, power Rpi every day for some period of time?

I know its not very Rpi specific question, but I think it could be very helpful for others too.

3
  • Digital timers might work. The one I have will work fine without mains connected, but after about a week the screen is getting quite dim (low battery). The only somewhat easy way I can think of the the Art Controller Kit (shop.evilmadscientist.com/productsmenu/tinykitlist/580)
    – Gerben
    Aug 2, 2013 at 12:54
  • Be sure you don't just cut the power. You may be okay the first few times, but ultimately you will end up with a corrupt file system. Look into a GPIO shutdown system, or if you know how long the PI needs to be up, or it is only doing a single task, set it up to shutdown (issue the shutdown command in your script) after that task is complete, then kill the power at some point after that.
    – Butters
    Aug 2, 2013 at 14:11
  • If you have a rev2 Pi, then you got an unpopulated connector called P6, which is a hard reset button. Shutdown the Pi with your favorite method, and then you can restart it just by shortening the 2 pins.
    – M Noit
    Aug 2, 2013 at 15:09

2 Answers 2

1

I gave your question some thought, but the answer I give you assumes you need to turn off your Raspberry Pi to conserve batter power. If that is not the case, there is always the software answer: just shut the services down (put it on some init level that shuts everything down, you can even make a specific init level for that and not use init 0 or init 1 or init 6), except for cron, which you would need to set the system into that state and then to reboot it (or if you are skilled enough and have the time and courage - to switch init back to level 2 or 3). That would solve your question, if power saving was not the main issue behind it.

Considering the need to save energy, I think it might be possible with a custom firmware, and maybe an external RTC, to build an energy-saving solution without external circuitry. But I don't think that would be the case, very complicated, time consuming and error-prone.

But the ready answer I have to power saving would be to have an external circuitry of some kind perform the hard reset as M Noit commented in your question, using the P6 connector.

Considering that solution, then the easiest way would be not having to print some circuit or keep some unreliable bredboard connected, you could use the ATmega microcontroller on the Gertboard to perform the hard-reset for you. That reset circuit is described in the D9 sector of the first page of the raspberry pi v.2 schematics. As per that schematics, a simple GND signal on P6-1 should do the trick. I know of no way to determine if the input current on the ATmega output pin is enough to drive that circuitry connected to the D15-RUN pin on the BCM2807 (no datasheet available!) but if not, the Gertboard has buffer circuits and open collectors that will do the trick for sure. Just put the ATmega pin into a high Z or input state when not signaling DOWN to take it out of the circuit. Worst case would be having to use the perforated section of the Gertboard for a relay to just connect the two pins of P6, as the design of the Raspberry Pi intended its use.

The ATmega itself has no RTC, but you can connect one to it, or just calculate the amount of time it will take for the next powerup when powering the Raspberry Pi down, and send it at power-down time to the ATmega.

This answer has some pointing to hardware building and solution. I have run no tests, and I have not implemented anything I just described. So use it at your own risk, knowing that it can brick your ATmega and/or your Raspberry Pi.

0

It is possible to do with an Arduino-type microcontroller. You would need to hook up the serial rx/tx through a logic level converter. Also hook up p6-1 (the square pad on the 2-pin connector near the micro usb connector) to an Arduino pin. To shut off, serial out at 115200 baud: sudo halt . To turn on again (at least 30sec after shutdown), drive p6-1 low and then leave floating.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.