ersiko
Posts: 5
Joined: Mon Feb 13, 2017 1:07 pm

Geekworm ups pi hat

Mon Feb 13, 2017 1:19 pm

Hi!

I bought a geekworm ups pi hat (http://www.banggood.com/Geekworm-UPS-HA ... 05260.html) and I can't find any good documentation about it. The most interesting page I found is http://www.raspberrypiwiki.com/index.ph ... _HAT_Board and it provides a compiled driver (raspiupshat.so) and and a python example to use it. It only can be imported on python2, not on python3. But although it can be imported in python2, it always report 100% of battery, no matter the status. I enabled I2C for it to work.

The battery works ok, it has 4 leds to show the status of the battery, but if I can't get the value from the OS, it won't serve its purpose of shutting down.

Questions:
Anybody knows about this hat? Can I get more information anywhere? For instance can I get the source for the compiled driver to compile it myself?

Thanks!

ersiko
Posts: 5
Joined: Mon Feb 13, 2017 1:07 pm

Re: Geekworm ups pi hat

Wed Feb 22, 2017 12:32 am

Well... as it was not working, I tried reading from the i2c protocol:

Code: Select all

pi@raspberrypi:~ $ i2cdump -y 1 0x76 w
     0,8  1,9  2,a  3,b  4,c  5,d  6,e  7,f
00: ffff ffff 0080 0080 0000 0000 0000 0000 
08: 1200 1200 ffff ffff 1c97 1c97 ffff ffff 
10: ffff ffff ffff ffff ff00 ffff 0000 0000 
18: ef96 efef ff01 ff01 ffff ffff ffff ffff 
(the rest are "ffff")

I don't know exactly how to interpret this numbers... Does anyone know a well-documented battery meter through i2c? Maybe I can use that info for this one...

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

Re: Geekworm ups pi hat

Wed Feb 22, 2017 5:08 am

I just recently found out about that UPS. I can only see two ICs on the board, and they appear to be part of the switching/charging circuit(s) (near inductors). Documentation is very sparse.

I'm not sure what you are talking to via I2C, it must be one of those two ICs. It may also be possible that it only reports low battery and not capacity. Can you tell us what the two ICs are?

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

ersiko
Posts: 5
Joined: Mon Feb 13, 2017 1:07 pm

Re: Geekworm ups pi hat

Wed Feb 22, 2017 11:33 pm

Hi

Thanks for your reply. Unfortunately I don't know enough stuff to answer it (I know my way around linux but I'm new to dealing with hardware...). How can I tell you what they are?

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

Re: Geekworm ups pi hat

Thu Feb 23, 2017 4:39 am

Tell us what the markings are on the two integrated circuits. I have a feeling they may be standard parts that are hooked up to the Pi's I2C lines. We might be able to look up datasheets for the parts that will tell us how to talk to them.

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

ersiko
Posts: 5
Joined: Mon Feb 13, 2017 1:07 pm

Re: Geekworm ups pi hat

Thu Feb 23, 2017 10:51 pm

I'm sorry, there's a lot of things on the board and I can't tell anything apart. I'm attaching a picture, I think it's sharp enough to read, but I can magnify any part of it.

Image
(from http://imgur.com/a/tSyX2)

Thanks again! And sorry, I'm trying to learn :)

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

Re: Geekworm ups pi hat

Fri Feb 24, 2017 1:20 am

They are the ICs marked U1 and U3, the flat 8 pin black parts. Unfortunately the markings have been obliterated, which is a bit strange for such a simple circuit. Although being in close proximity to the inductors (grey parts marked 2R2) tells me that they are DC-DC switching controllers or chargers. Can trace out the I2C lines and see where they go. I might just need to buy one and play with it.

I haven't heard of "Geekworm" before. I'm not sure if they are the original makers of the board, can't seem to find much info on it. It may well be a prototype that someone copied and produced a bunch of.

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

ersiko
Posts: 5
Joined: Mon Feb 13, 2017 1:07 pm

Re: Geekworm ups pi hat

Fri Feb 24, 2017 12:05 pm

The back part shows this:
Image (from http://imgur.com/a/Fm260)

If I'm not mistaken, I2C SDA goes to Q4, and I2C SCL and GPIO04 go to U2

The markings are indeed obliterated, and just those two... as if someone had scraped them on purpose... weird.

"Geekworm" has a few different items, so I thought it was a kind of established brand. But after buying this hat I realized they don't even have a webpage, they're just on raspberry wiki.

User avatar
CarlRJ
Posts: 598
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Geekworm ups pi hat

Tue Mar 07, 2017 8:18 pm

Intresting, I happened across a couple of "Raspberry Pi UPS" boards on Amazon, yesterday, that appear to be the exact same board, complete with the obliterated chip labels:

RICHEN Raspi UPS HAT Board for Raspberry Pi
Makerfocus Raspi UPS HAT Board for Raspberry Pi

squarles2007
Posts: 1
Joined: Mon Mar 20, 2017 8:52 pm

Re: Geekworm ups pi hat

Mon Mar 20, 2017 9:05 pm

I have the same board, after some digging I believe the lipo charge state IC is a max17043/17044. The datasheet lists its default i2c addres as 0x36, which is the same as the sample code on the wiki, additionally the code looks for voltage and capacity at the correct memory addresses for this IC.

https://datasheets.maximintegrated.com/ ... X17044.pdf

p.s. after some personal stupidity, I discovered the bread board looking vias on the bottom half of the board are tied to ground. Q1 blows when you tie 5 volts to ground, luckily its just a MMBT3904 transistor and mouser has fast shipping.

BounceMeister
Posts: 5
Joined: Wed Mar 22, 2017 10:24 am

Re: Geekworm ups pi hat

Wed Mar 22, 2017 10:32 am

I am very interested in any progress here. I have bought the same UPS board (from Aliexpress), but the LiPo bag is leaking. So i have to get a new battery for it. Chips are sanded as well. There is an image on banggood that shows some markings, but they are hard to read.

I am thinking of getting a protected 18650 Litium battery for it, looks safer to me than a LiPo bag battery. Especially when 24/7 in use on a location where i can't see it.

I was under the impression the provided libraries and software were a bit easier to implement. I want to use it on a Pi 2B running Raspbian and Domoticz. I hope someone figures it out and creates a tutorial for this promising piece of hardware.

Edit:
The Geekworm UPS board i have, also had some chips sanded. But i found a picture of it (at banggood) where i could see what U1 is. (Still can't see what U3 is).
Chip U1 is an "ETA 1096" which is a step up converter to convert the 3.7V to 5V. pdf here

Image can be found here.

Edit2:
GPIO Pin 4 (+) and 6 (-) provide the power.

sepie
Posts: 2
Joined: Tue Mar 28, 2017 5:12 pm

Re: Geekworm ups pi hat

Tue Mar 28, 2017 5:16 pm

I bought one on aliExpress and after some initial hurdles I have it up and running on Raspberry with OSMC. I use a script that ensures battery is charged to a minimum level each time and turns down when battery is below a certain level. So far it works well in the car (that is the use case). I am less happy about the small on/off switch on the board. I need to find a way how to make this bigger and easy accessible on outside of Cyntech case. Another thing what would have been nice is that you could program how it turns on. For me best would be always on when outside supply available.

BounceMeister
Posts: 5
Joined: Wed Mar 22, 2017 10:24 am

Re: Geekworm ups pi hat

Wed Mar 29, 2017 8:54 am

squarles2007 wrote:I have the same board, after some digging I believe the lipo charge state IC is a max17043/17044. The datasheet lists its default i2c addres as 0x36, which is the same as the sample code on the wiki, additionally the code looks for voltage and capacity at the correct memory addresses for this IC.

https://datasheets.maximintegrated.com/ ... X17044.pdf

.....
I have been reading through the datasheet and can't find the part about 0x36?
I did find adresses 6Ch (write)/6Dh (read) in the I2C part on page 11.
I would like to know if there is a way (through I2C) to find out if the power is supplied externally or by battery.
When on battery, the system should power off below a certain battery level (%), but when on external power, the system should remain "on" and charge the battery.

User avatar
rpdom
Posts: 22351
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Geekworm ups pi hat

Wed Mar 29, 2017 7:57 pm

BounceMeister wrote:I have been reading through the datasheet and can't find the part about 0x36?
I did find adresses 6Ch (write)/6Dh (read) in the I2C part on page 11.
The lowest address line on i2c is used for the Read/Write signal. The upper seven are used for the device address (0x00 to 0x7F). This means that you have to shift the address up (or down) a bit, depending on how your software uses the read/write line. 0x6C is 0x36 shifted up one bit.. 0x6D is the same address, just with bit 0 (Read) set.

BounceMeister
Posts: 5
Joined: Wed Mar 22, 2017 10:24 am

Re: Geekworm ups pi hat

Thu Mar 30, 2017 6:53 am

Thanks for the explanation! :)

bendan
Posts: 7
Joined: Fri Mar 29, 2013 5:29 pm

Re: Geekworm ups pi hat

Fri Mar 31, 2017 3:17 pm

Can anyone post the GPIO pins required by this board? I am trying to fit it into an acrylic case with a fan and need to run wires from the HAT GPIO pins to the RPi3 board GPIO via wires and plug the fan into the RPi3 board GPIO 5V and ground.
Thanks to anyone that can help.
Last edited by bendan on Fri Mar 31, 2017 3:28 pm, edited 1 time in total.

bendan
Posts: 7
Joined: Fri Mar 29, 2013 5:29 pm

Re: Geekworm ups pi hat

Fri Mar 31, 2017 3:27 pm

BounceMeister wrote:I was under the impression the provided libraries and software were a bit easier to implement. I want to use it on a Pi 2B running Raspbian and Domoticz. I hope someone figures it out and creates a tutorial for this promising piece of hardware.
GPIO Pin 4 (+) and 6 (-) provide the power.
I am trying to use it with an RPi 3.
I am just about the "NOOB ist" person around and would Really appreciate a tutorial including GPIO pin requirements and cade to use the features (and an explanation of said features)
Thanks to all who can help.

sepie
Posts: 2
Joined: Tue Mar 28, 2017 5:12 pm

Re: Geekworm ups pi hat

Mon Apr 03, 2017 3:32 pm

I was not able to find out whether there is an external supply. My way to solve is to check battery level continuously and when it goes down below 40% I turn it off. Simple Python script works.

What I also noticed is that when you apply after power down the external voltage you need to press the micro switch to turn it on. I use a Cyntech case and that means the switch is not accessible. I order a new bigger reset button and will connect that one the moment it is being delivered. Hopefully this makes it more practical.

Finally, I have the audio board on top of all and it seems that continues the drain the battery somehow. Need to figure out why that is. Any ideas?

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

Re: Geekworm ups pi hat

Wed Apr 05, 2017 7:56 pm

sepie wrote:I was not able to find out whether there is an external supply. My way to solve is to check battery level continuously and when it goes down below 40% I turn it off. Simple Python script works.

What I also noticed is that when you apply after power down the external voltage you need to press the micro switch to turn it on. I use a Cyntech case and that means the switch is not accessible. I order a new bigger reset button and will connect that one the moment it is being delivered. Hopefully this makes it more practical.

Finally, I have the audio board on top of all and it seems that continues the drain the battery somehow. Need to figure out why that is. Any ideas?
Having to hit a switch to reset the Pi and continuous drain of the battery might mean the UPS is not cutting power to the Pi. It might not be capable of this.. or you are not sending the proper commands to the UPS to power down. I don't have one of these, so I can't be of much more help.

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

Pyle
Posts: 4
Joined: Mon Apr 10, 2017 6:57 am

Re: Geekworm ups pi hat

Tue Apr 11, 2017 12:54 pm

I also bought this HAT.

After connecting the battery, there was no reaction. By chance, I found that the battery-cables plus and minus are interchanged. My chips are also sanded. U2 shows 7048 in the first, an unclear 3044(?) in the 2nd line.
Geekworm USB HAT - U2.jpg
U2 - Geekworm USB HAT
Geekworm USB HAT - U2.jpg (27.26 KiB) Viewed 30626 times
I testet the HAT on a Raspi 2 w/ connected LTE-Stick (Huawei E3276), in idle mode, receiving and sending SMS, and a WiFi-Stick. Capacity of the battery is 2500mAh and after disconnect line, the Raspi works for approx. 2 hours before reaching 20%. Perfect performance.

After reconnect the power, the HAT does'nt start to reload the battery but draining as long the battery is empty. Draining rate approx. 1% per 10 minutes.

If line dropped, the HAT has to be restarted by pressing the HUT's button S1 (pulls down R3 to ground). Inacceptable, the battery is totaly empty if there is no humen restart loading. "Automatic" loading restarts when the battery is total empty and line is available. After approx. 1.5 hours loading, the batterys capacity is on >90% (100%) and the loading stopps.

Maybe there is a way to restart the HAT by software and I2C. There are two modes who looks reasonable: "Sleep Mode" and "Power-On Reset", datasheet page 7.

Disconnect the HAT from line, wait for a while for discharging. After the forth HUT's LED switch off, reconnect the line. LED four should not blink:

1. Enable the MAX17043 "Sleep Mode", then disable the "Sleep Mode". Does this restart the charging?
2. Do a "Power-On Reset" by software. Does this restart the charging?

Can anyone test this two modes? I am not experienced enough to do this.

Short python-code to ask for voltage and capacity w/o using raspiupshat.so:

Code: Select all

# Geekworm UPS
# voltage and capacity
# 2017-03-17

import struct
import smbus 
import sys

# 0 = /dev/i2c-0 (port I2C0)
# 1 = /dev/i2c-1 (port I2C1)
bus     = smbus.SMBus ( 1 )

# MAX17043
address = 0x36

def readVoltage ( bus, address = address ):

	read    = bus.read_word_data ( address, 2 )
	swapped = struct.unpack ( "<H", struct.pack ( ">H", read ) )[0]
	voltage = swapped * 78.125 /1000000
	return voltage

def readCapacity ( bus, address = address ):

	read     = bus.read_word_data ( address, 4 )
	swapped  = struct.unpack ( "<H", struct.pack ( ">H", read ) )[0]
	capacity = swapped/256
	return capacity

print ( '%(volt).2fV (%(cap)i%%)' % { 'volt': readVoltage ( bus ), 'cap': readCapacity ( bus ) } );

madrian
Posts: 29
Joined: Tue Aug 28, 2012 6:48 pm

Re: Geekworm ups pi hat

Thu Apr 13, 2017 10:25 pm

I want to buy this small upc, but the "press switch after power outage" is unacceptable. We only lost battery charge, or pi does not start after restoring the power?

Fermars
Posts: 21
Joined: Wed Sep 17, 2014 2:35 pm
Location: Madrid, Spain

Re: Geekworm ups pi hat

Mon Apr 17, 2017 10:02 am

madrian wrote:I want to buy this small upc, but the "press switch after power outage" is unacceptable. We only lost battery charge, or pi does not start after restoring the power?
I already have this UPS from BG as well and after a few days testing, it does not worth the pain if you want to use your Pi as a small server allways working switched on, because as you mentioned once there is a power outage or even if you disconnect and reconnect power manually, the battery does not start charging up automatically, you have to power the Pi down, push the button to reset the UPS and then start again, otherwise the battery will run out shutting down the Raspi and the worst thing is that once the power is recovered it does not start up again.
Moreover, I have an external 2,5" harddisk and it is even worst, once the Pi initialize the HDD the UPS consider this consumption as a power outage and connect the battery and start discharging until it runs out.

So IMO is not an UPS as you expect, is an external battery to run the Pi for hours or saving from a suddenly power outage while you are working with it as a desktop computer (for instance).

Pyle
Posts: 4
Joined: Mon Apr 10, 2017 6:57 am

Chip: MAX17048

Tue Apr 18, 2017 7:48 am

On my HAT there is a MAX17048 used. A lot of interesting new features but currently no function to restart chip by uC after power loss found.

Geekworm
Posts: 28
Joined: Wed May 03, 2017 9:26 am
Location: China

Re: Geekworm ups pi hat

Wed May 03, 2017 9:35 am

Hello, we are the owner of this WIKI page.
http://www.raspberrypiwiki.com/index.ph ... _HAT_Board
Geekworm Official Store!
Contact: [email protected]
Know more Raspberry Pi Related Product Information: http://www.raspberrypiwiki.com/index.php/Product_Manual#Raspberry_Pi

User avatar
ukonline2000
Posts: 5
Joined: Wed May 16, 2012 6:16 am

Re: Geekworm ups pi hat

Wed May 03, 2017 10:11 am

Fermars wrote:
madrian wrote:I want to buy this small upc, but the "press switch after power outage" is unacceptable. We only lost battery charge, or pi does not start after restoring the power?
I already have this UPS from BG as well and after a few days testing, it does not worth the pain if you want to use your Pi as a small server allways working switched on, because as you mentioned once there is a power outage or even if you disconnect and reconnect power manually, the battery does not start charging up automatically, you have to power the Pi down, push the button to reset the UPS and then start again, otherwise the battery will run out shutting down the Raspi and the worst thing is that once the power is recovered it does not start up again.
Moreover, I have an external 2,5" harddisk and it is even worst, once the Pi initialize the HDD the UPS consider this consumption as a power outage and connect the battery and start discharging until it runs out.

So IMO is not an UPS as you expect, is an external battery to run the Pi for hours or saving from a suddenly power outage while you are working with it as a desktop computer (for instance).
If you want a raspberry pi to be able to start automatically when you have an external power supply or battery, rather than manually switch on power. I can recommend a method that has been tested. :D
You can use the USB TO 2 Mirco USB Cable, USB connect charger, one Micro USB connect RPI, another Micro USB connect UPS.
So as long as there is an external power supply or battery, raspberry pi can work properly. Unless the battery is low and the ext power is lost
689(OQ6P_6P24AKZG105MLC.gif
689(OQ6P_6P24AKZG105MLC.gif (55.3 KiB) Viewed 30095 times
Catch15F3(05-03-18-04-08).jpg
Catch15F3(05-03-18-04-08).jpg (32.44 KiB) Viewed 30095 times

Return to “HATs and other add-ons”