User avatar
unusual.computers
Posts: 14
Joined: Wed Jul 12, 2017 1:13 pm
Contact: Website

arduino nano as smart power controller for pi zero

Thu Jul 20, 2017 6:16 pm

I am thinking about building a sort of power control unit for pi zero using a small arduino.
The idea is to use the nano to both measure the voltage in a battery and keep pi informed about the status and for a smart shutdown.
Pi would in turn have something running in the background that would ideally update status in the system tray, but certainly provide critical level warnings and there would be some sort of calibration app (to calibrate what is critical for a particular setup).
The communication would be via gpio serial and probably another pin for simple indication that raspberry is up/down.
Arduino would control the power via single mosfet and there would be a single button for rebooting/shutdown/wake up (depending on the state and length of the press). Likely arduino would have to run all the time (or at least I have not figured this part out yet), but could go into a very slow mode while pi is down so that battery drain is very minor.

Has anyone heard of a similar project? And if not, why not, it does seem quite obvious, so what am I missing?
Also, any advice on which mosfet would be suitable would be fantastic.
Thanks
-------------------------------------------------------------

unusualcomputerscollective.org

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

Re: arduino nano as smart power controller for pi zero

Fri Jul 21, 2017 7:22 am

Yes, you describe the basic building blocks of my UPS. See here:

http://www.allspectrum.com/mopower/

There is a schematic towards the end of the PDF user manual you can take a look at. It uses a low power microcontroller from Atmel, similar to the Arduino, which acts as a power supervisor for the Pi and is on all the time. There is a button for power control, similar to the way a regular computer power button works.

Mine uses the power control function of the switching regulator, but you can use a MOSFET to switch external power if that is what you want. I don't have a specific recommendation, but if you are going to do this.. remember that not all will work at the lower output voltages from your microcontroller. Some will only fully turn on at gate voltages of 10+, not suitable for 3.3v inputs. Read this.. https://arduinodiy.wordpress.com/2012/0 ... tl-levels/

The full fledged UPS was a lot more work then I had initially estimated. The firmware on the microcontroller alone is several thousand lines of code! I may do a smaller zero version if I get enough interest. You can homebrew one.. but depending on how feature rich you need it to be, it's going to take some work.

Regards,
-Moses
Last edited by mosespi on Fri Jul 21, 2017 8:32 am, edited 1 time in total.
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

User avatar
unusual.computers
Posts: 14
Joined: Wed Jul 12, 2017 1:13 pm
Contact: Website

Re: arduino nano as smart power controller for pi zero

Fri Jul 21, 2017 8:22 am

thanks very much, very good work and very useful indeed
-------------------------------------------------------------

unusualcomputerscollective.org

BudBennett
Posts: 89
Joined: Fri May 17, 2013 2:45 pm
Location: Westcliffe, Colorado, USA

Re: arduino nano as smart power controller for pi zero

Sat Jul 22, 2017 10:45 pm

The concept is obvious, the implementation is not. There are a lot of ways to do what you want and a simple Google search for Raspberry Pi UPS will yield a score of them. I have been having fun developing a set of UPS circuits for my own purposes. They are described on my Hackaday.io site:
https://hackaday.io/project/25116-singl ... spberry-pi
I can recommend a FET: AO3401. It is a sub-logic-level FET with a 30mΩ Ron, which should be low enough to power a Zero. You could also use an FDC6329, which includes an Nchannel driver, but will only tolerate 5.5V.

But the FET switch will be the least of your problems...

User avatar
Douglas6
Posts: 4736
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: arduino nano as smart power controller for pi zero

Sun Jul 23, 2017 12:18 am

This thread was very helpful to me when I attempted a very simple version of what you describe: https://www.raspberrypi.org/forums/view ... 25#p497325

User avatar
unusual.computers
Posts: 14
Joined: Wed Jul 12, 2017 1:13 pm
Contact: Website

Re: arduino nano as smart power controller for pi zero

Mon Jul 24, 2017 8:04 am

thanks very much guys, exactly the sort of info I was hoping for.
will post any progress I make here.
-------------------------------------------------------------

unusualcomputerscollective.org

Return to “Other projects”