Categories
Project Ideas Raspberry Pi

Portable PI – Power Supply and Power Switch

Finally nearing the end of completing the power supply and soft latching power switch. The components have changed slightly but the principle design is the same. The components include two li-ion batteries connected in parallel with protection circuit, soft latching switch, Adafruit Powerboost 1000 with charging circuit (Product #2465) , and a Teensy 3.1. Along with the hardware components, there are two software pieces with one residing on the Teensy and the other running in the background of the Raspberry Pi.

The design utilizes a soft latching power switch has three functions. It powers the device on from an off state, signals the Teensy that the user has pressed the power button to request a shutdown, and power off. One of the main requirements besides those mentioned above is that the soft latching power switch must not draw current or very little current when in the off state. This is necessary as we do not want the batteries to be drained when the device is in the off state.

These requirements were met with a modified version of the soft latching power circuit described in my earlier post. The circuit was modified for a couple of reasons. First of all, the circuit needed to be able to operate from 3 to 4.5 VDC rather than at 5 VDC. Another reason the circuit needed to be modified is that the output was floating when off so the enable signal to the powerboost circuit would cause the power to cycle back on after a few seconds.

There are two pieces of software working together which allows the Raspberry Pi to safely shutdown when the user presses the power button. The Teensy has software which monitors the power button to see if it is pressed and monitors the USB power from the Raspberry Pi. If the user presses the power button, the Teensy changes the state of a pin on the Raspberry Pi. The Raspberry Pi has a program running in the background which checks if the logic level on the pin has changed. If the logic level changes, the script will issue a shutdown command.

The next thing was to determine the best way to know when the shutdown was complete.

Categories
Project Ideas Raspberry Pi

Soft Latching Power Switch

The Raspberry Pi ON/OFF Power Controller that I looked at from Mosaic Industries, Inc. does a good job at 5 VDC but I need the circuit to be able to switch LiPo batteries which have a voltage range of between 2.7 and 4.35 VDC between discharged and fully charged. I looked for dual MOSFET devices which could operate in this range and found the following.

Both of these devices function at these lower voltages however I have been having some oscillation issues with these. When the button is held down to turn off the load, which is a LED, the output is switched off but it turns back on after a few seconds. I have not been able to investigate why this is happening. I suspect that I miswired something but I need to take some time to check.

The International Rectifier device seems to behave a bit better so it may be the one I use but I will need to investigate what the issue is and resolve that before I can move on. I can’t wait to wrap this project up.

If you have an idea as to what my problem may be, please leave a comment to let me know.

UPDATE – 16 May 2015

I determined the reason for the odd behavior was that the N-Channel MOSFET’s gate was floating. I was able to fix this by using a pull-down resistor of 100KΩ. Looking at the schematic, I connected the resistor between Pin 7 and ground. This pulls the gate to ground through the 330KΩ and 1KΩ resistors.