Skip to content

Modifying the GeeekPi UPS

jbaumann edited this page Oct 19, 2020 · 7 revisions

The GeeekPi UPS

I forgot to take a picture of the unmounted UPS, so I used one from the website. But here is another picture of the modified and fully mounted UPS with a Raspberry Pi 3B+.

Some of its hardware features are:

  • Mounted from the bottom, contacts are made using Pogo Pins (everything needed for mounting, screws etc. are part of the package)
  • It accepts up to two 186 50 Li-Ion batteries
  • It has a real-time clock
  • The system is specified for a maximum current of 4A (I haven’t tested that)
  • It offers two USB-A and one USB-C ports as output for charging other devices
  • It has one Micro-USB port for connecting primary power (no USB-C)
  • It provides a Coulomb meter to measure voltage and current. This is the secondary power going to the RPi, and as such can give insight into the current load of the RPi. But it doesn’t provide any information about the battery voltage or current.

There is no way to turn the UPS off or on from the RPi, the only way is the blue button that when pressed for a short time turns the UPS on and when pressed for a long time turns the UPS off (I had to implement additional functionality to reflect that).

As often as I turned the power supply on and off, I was never able to let the RPi show that it measured any undervoltage. This is an excellent result (I’m quite harsh) and lets me trust this UPS to a large degree. I will, later on, provide oscilloscope measurements, but that is for another day.

The Modification

The modification is simple and minimal. It contains of two cables soldered to the UPS, one for the switch (aka button) and one for the battery power used to power the ATTiny.

Adding the Switch Cable

Cut an orange Dupont cable to length and solder it to the pin shown in the following picture.

It is on the left side nearer to the PCB. You can also measure the pins against GND and it should be the only one not connected to GND. As a test you can connect the UPS after you soldered the cable and connect the cable to GND. If the state of the UPS changes then you got the right connection.

Adding the Power Cable

Add a bit of solder to the plus side of the battery holder. Cut a red Dupont cable to length and solder it to this.

Reset Configuration for the GeeekPi UPS

For the modified GeeekPi we need to „press“ the switch for more than 50ms to turn the UPS on and for 4s to turn it off again. Depending on whether you used the jumper on the ATTiny Daemon PCB to connect the ATTiny to the RPi’s 5V power you can additionally let the system check the voltage (this is highly recommended). The config file entries for this are:

Option Name Default Comment
ups configuration 1|3 This value configures how the ATTiny daemon tries to reset the system:
Bit 0 = 1: Reset by „pressing“ a switch twice (pulling the line down for the reset pulse lenght turns the switch once)
Bit 1 = 0: Do not check external voltage (external voltage is not connected to RPi Vcc)
Bit 1 = 1: Check external voltage: (external voltage is connected to RPi Vcc)
Recommended for GeeekPi is the value 3 (including connecting the EXT_V pin to the RPi Vcc via the jumper)
pulse length on 200 This is the length of the pulse used to turn the UPS on
pulse length off 4000 This is the length of the pulse used to turn the UPS off
switch recovery delay 1000 This is the time in ms to wait before „pressing“ the switch again (needed since we are in switch mode)