Author Topic: Raspberry Pi Power Switch Circuit  (Read 3813 times)

0 Members and 1 Guest are viewing this topic.

Offline QuatrerwinTopic starter

  • Supporter
  • ****
  • Posts: 22
  • Country: us
Raspberry Pi Power Switch Circuit
« on: March 16, 2017, 05:08:00 am »
I've been designing a power switch circuit for the Raspberry Pi Zero. It uses an Adafruit Powerboost 1000C along with a DPDT switch.

Once the Raspberry Pi is off, I would like to disable the Powerboost (pulling the enable pin down to ground). I have a circuit that should work using diode logic, but I would like something more power efficient.

The thought behind it is that the Powerboost will remain disabled until either the VS and LBO are high (3.0V - 5.2V) or the 3.3V or a GPIO pin on the Raspberry Pi are high (3.3V). I've found a couple CMOS logic chips that can do an AND-OR with those voltages, but I don't know how to control the P-Channel JFET with the output from that. I'm not even really sure where to start. Would anyone have any advice for the circuit to help make it more feasible/power efficient?

Here is the circuit I've been creating (Note that only one side of the DPDT switch is shown. The other side just signals to the Raspberry Pi to shut down):



Powerboost pins:
  • BAT - this is the battery input, connected directly to the JST connector. For most Lithium batteries, this will range from 3.0V when near-dead to 4.2V when fully-charged. Higher voltages will let you draw more current and in general, are more efficient. Try to keep the wires going to this pin nice and short - 3" or less is best!
  • VS - this is the load shared output from the battery charger. When there is 5V coming in from the micro-B USB power plug, this pin will have approx 5V on it (less a little due to the internal resistance of the charger chip's MOSFET). When there's no USB charging, the Vs pin will be the same voltage as the BAT pin.
  • GND - this is the power ground. This boost converter is not 'isolated' - the ground input is the same as the ground output
  • 5V - this is the boosted output. When the board is running, the voltage will be 5.2V approximately. It may dip down to 5V as the current draw starts to go up (over 500mA). When the board is disabled, this output is 'floating' but you should still try not to apply a voltage to it while the board is disabled. There's a blue LED connected to this pin which will let you know when there's power output
  • EN - this is the 'enable' pin. By default it is pulled 'high' to VS. To turn off the booster, connect this pin to ground. The switch can be as small as you like, it is just a signal. Contrast this to an inline power switch which would have to be able to handle up to 2A of current! When the chip is disabled the output is completely disconnected from the input.
  • LBO - this is the Low Battery Output. By default it is pulled high to BAT but when the charger detects a low voltage (under 3.2V) the pin will drop down to 0V. You can use this to signal when its time to shut down or alert the user that the battery is low. There is also a red LED connected to this pin
« Last Edit: March 16, 2017, 05:39:23 am by Quatrerwin »
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Raspberry Pi Power Switch Circuit
« Reply #1 on: March 16, 2017, 01:03:37 pm »
Basic PChan needs a + gate V to turn it off.




So select a FET with a Vth that meets your logic level out of the CMOS gate. If you
need inversion translate your AND-OR to NAND-NOR logic and or use the inversion
in the NAND-NOR to invert any signals to meet the logic requirements. But you have
to raise the gate to Vth + Vs. Without seeing the rest of the power domain schematic
I cannot tell whats driving use of the PFET.

Worst case you can always use a charge pump to get extra gate drive, or a diode
multiplier off CMOS grunge oscillator circuit.

http://electricalengrz.blogspot.com/2013/05/aoi-logic-to-nand-or-nor-logic.html

http://stackoverflow.com/questions/9845684/how-to-convert-a-boolean-expression-from-and-and-or-to-only-nand


One alternative is use of a low end UP, like a PSOC 4000 series part,
use it to do the sequencing and logic, then a more simplified interface
to actual power routing components should be achievable. Sleep mode
would enable power conservation as well. Like a 4013, << 50 cents.
Has internal reference and comparator.

Regards, Dana.
« Last Edit: March 16, 2017, 02:05:04 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: Quatrerwin

Offline QuatrerwinTopic starter

  • Supporter
  • ****
  • Posts: 22
  • Country: us
Re: Raspberry Pi Power Switch Circuit
« Reply #2 on: March 16, 2017, 03:06:48 pm »
That was pretty much the complete circuit. There were a couple of transistors to bring up some of the voltage levels to make the FETs work (Unfortunately I don't have them in the notes I can find). The toggle switch is a modified DPST switch where it has 4 pins (2 pins connected when in the off position and a different pair of pins connected when in the on position). I could replace it with a DPDT switch if necessary. The other pins connect a GPIO pin on the Raspberry Pi to ground when the switch is in the off position, pulling the GPIO pin low. As for the Powerboost, Adafruit has a schematic here: https://learn.adafruit.com/adafruit-powerboost-1000c-load-share-usb-charge-boost/downloads

The logic gate was stumping me because it has a negative current when the condition is true. I needed a positive voltage to turn on the P-Channel JFET. The source of the P-Channel JFET is normally at 3V - 3.7V (the same as the BAT pin on the powerboost) when the Powerboost is enabled.
« Last Edit: March 16, 2017, 04:02:56 pm by Quatrerwin »
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Raspberry Pi Power Switch Circuit
« Reply #3 on: March 16, 2017, 10:15:25 pm »
You have a classic high side switching problem, that is in general
done with a boostrap/boost circuit, or possibly depletion mode
mosfet with its gate puled up to drive voltage, and an open drain
or collector drive to ground connection to gate.

Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline QuatrerwinTopic starter

  • Supporter
  • ****
  • Posts: 22
  • Country: us
Re: Raspberry Pi Power Switch Circuit
« Reply #4 on: March 16, 2017, 11:00:09 pm »
That's quite a bit to look up! I'll look into those and see what I can come up with. In the meantime, I'm not particularly attached to the circuit if there's a better way to do it. Really the requirements are as follows:

  • If the switch is moved to the "on" position, enable the Powerboost (this is done by disconnecting the EN and GND pins on the Powerboost).
  • If the switch is in the "on" position, but the LBO pin is pulled down to 0V disable the Powerboost (unless the Raspberry Pi is on).
  • If the Raspberry Pi is on, do not disable the Powerboost.
  • If the switch is moved to the "off" position, signal the Raspberry Pi to shut down, but do not disable the Powerboost.
  • If the switch is in the "off" position and the Raspberry Pi is off, disable the Powerboost (connect the EN and GND pins on the Powerboost).

The Raspberry Pi seems to operate its GPIO pins at 3.3 V for high and around 0 V for low. The Powerboost outputs at USB voltage (5 V) or battery voltage (3.0 V - 3.7 V) for high and around 0 V for low.

This is my first attempt at really designing a circuit from scratch (I'm a software developer who is starting to get into electronics design. I had a fairly basic circuits course as part of my physics major in college).
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3508
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Raspberry Pi Power Switch Circuit
« Reply #5 on: March 17, 2017, 12:16:47 am »
I think that there is a driver in the Pi kernel, selectable through the device tree overlay, that can hold a GPIO pin in some known state when the kernel is up, and release it after all other parts of the kernel is down.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf