UPS3 with Pi3

Moderators: mdrjr, odroid

UPS3 with Pi3

Unread postby hblanken » Thu Dec 22, 2016 7:38 pm

I am quite new to GPIO and different voltages for breakout boards. I have a UPS3 running with Odroid C2 and think it would be an ideal solution also for my Pi3.
http://odroid.com/dokuwiki/doku.php?id=en:odroid-ups3

Could the board be mounted onto a RaspPi3 and work in the same way to provide power for a couple of hours to the Pi?
I know Hardkernel is a separate company, however I would appreciate the community's point of view.

I use the Pi3 for getting video through an HDMI-in shield and the CSI connection at 1080p, something Odroid C2 unfortunately cannot provide. :(

So I need several Pi3 and several Odroids, I like both systems.

So any help to help me get the UPS3 running on Pi would be appreciated. Do I need to watch out for anything, or can I just mount it onto the Pi much the same way it works with my C2. What do I need to change/watch out for? Thanks!
hblanken
 
Posts: 6
Joined: Thu Dec 22, 2016 7:32 pm
languages_spoken: english
ODROIDs: C2

Re: UPS3 with Pi3

Unread postby odroid » Fri Dec 23, 2016 9:28 am

You need to check the initial state of Pin#15 or Pin#26 on RPi3 40pin GPIO header.
It must be "High" state in the booting process to enable the UPS3 output power by default.
http://odroid.com/dokuwiki/doku.php?id= ... -c1_c1_c21
User avatar
odroid
Site Admin
 
Posts: 23642
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: UPS3 with Pi3

Unread postby hblanken » Thu Dec 29, 2016 2:49 pm

Thank you.
I have now assembled it onto my Pi3 and it works.

The GPIO 26 is high and receives power at bootup.

I want to write a safe shutdown script, however the pin values give me trouble.

I have now checked GPIO.IN channels 11 and 13 from my Pi.
GPIO.setup(11,GPIO.IN)
GPIO.setup(13,GPIO.IN)

I only get
>>> GPIO.input(11)
0
>>> GPIO.input(13)
1

This happens for all the various scenarios - if I connect AC power only, if I connect AC power and battery, if I only connect charged battery. I always get 11 == 0 and 13 == 1.

Why is this happening?
How can I check if battery power drops below 3.7v to then shutdown the Pi?
Thanks for any help.
hblanken
 
Posts: 6
Joined: Thu Dec 22, 2016 7:32 pm
languages_spoken: english
ODROIDs: C2

Re: UPS3 with Pi3

Unread postby odroid » Thu Dec 29, 2016 3:59 pm

Do you have a DMM to measure the voltage of AC_OK & BATTERY_OK signals in the schematics?
http://odroid.com/dokuwiki/lib/exe/fetc ... rev0.1.pdf
User avatar
odroid
Site Admin
 
Posts: 23642
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: UPS3 with Pi3

Unread postby hblanken » Sun Jan 01, 2017 4:14 pm

Hi there - I tested with a DMM.

Here are the results:

Tests
a) OFF, with battery connected to board
=> 13 = 3.3V, 11 = 0

b) OFF, with power cord and battery connected to board (blue led on):
==> 13= 3.3V, 11= 0.3V

c) ON, with battery only
==> 13 =3.3V, 11 = 0

d) ON, with power cord and battery (blue led is on)
==>13 = 3.3V, 11=0

What does this tell me? What is happening with pin 11?
How could I code a safe shutdown script with these readings?

Thanks a lot for help.
hblanken
 
Posts: 6
Joined: Thu Dec 22, 2016 7:32 pm
languages_spoken: english
ODROIDs: C2

Re: UPS3 with Pi3

Unread postby odroid » Mon Jan 02, 2017 12:10 pm

If the Pin 11/13 are output mode on RPi3 40 header, you can't read the UPS status.
I think the pin-numbers in GPIO.setup API could have a different pin numbering.
User avatar
odroid
Site Admin
 
Posts: 23642
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: UPS3 with Pi3

Unread postby hblanken » Mon Jan 02, 2017 1:09 pm

Hi there - I am not sure I understand your reply.

The Odroid C2 11 and 13 pin are at the same location as the Pi3. Take a look at Pi3 Board: http://www.raspberrypi-spy.co.uk/2012/0 ... -and-pins/
Take a look at C2: http://www.hardkernel.com/main/products ... &tab_idx=2

Or am I missing something?
Thanks
hblanken
 
Posts: 6
Joined: Thu Dec 22, 2016 7:32 pm
languages_spoken: english
ODROIDs: C2

Re: UPS3 with Pi3

Unread postby odroid » Mon Jan 02, 2017 2:19 pm

Exported GPIO number and Wiring number must be different.
For example, Pin#11 is Export_GPIO#247 and Wiring number is GPIO#0 on ODROID-C2.
http://odroid.com/dokuwiki/doku.php?id= ... connectors
User avatar
odroid
Site Admin
 
Posts: 23642
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: UPS3 with Pi3

Unread postby hblanken » Mon Jan 02, 2017 5:18 pm

Now I am completely lost.

GPIO, Export GPIO, Wiring number!? I have no idea how I can ever write a script to read the voltage on the correct pins.

My intent was to use more of these UPS3 on my odroids and PI3s with CSI2 1080p cameras.

But if I am not able to safely shut down the SD card when the battery is low, then this does not seem to be a good solution :(

Can't be that hard to find the correct pin for checking battery voltage, right?

What are we doing wrong in our thinking?
hblanken
 
Posts: 6
Joined: Thu Dec 22, 2016 7:32 pm
languages_spoken: english
ODROIDs: C2

Re: UPS3 with Pi3

Unread postby odroid » Mon Jan 02, 2017 5:55 pm

Since I don't have any RPI, it is not easy to help you.

According to your link (http://www.raspberrypi-spy.co.uk/2012/0 ... -and-pins/),
Pin#11 is GPIO17 and Pin#13 is GPIO27 on RPi3.
It is the main reason why your script code doesn't work.

Image
User avatar
odroid
Site Admin
 
Posts: 23642
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: UPS3 with Pi3

Unread postby hblanken » Mon Jan 02, 2017 8:08 pm

Thank you for your support even without having a Pi3.

I think that PIN 13, wiringpi pin 2 is the pin which lets the power flow into the Pi. It is always high, even if the board is switched off.

When I switch the board on, with the battery connected, then physical pin 1, 17 are high (which is correct as those are the 3.3v pins) AND pin 13 is high as well.

I have not written any script yet - I would like to write a script, however, I first need to identity that the BATT_OK and AC_OK pins have voltage. At the moment only physical pin 13, wiringpi pin 2, has 3.3v, I cannot identify the BATT_OK pin - both pins right next to 13 according to the UPS3 schematics should provide high voltage when turned on, but they are both on 0 when measuring with DMM, why?

According to Odroid specification the pins are exactly the same for Odroid C2 and Pi3, except for 3 pins.

And here is the matching schema for Pi3 and wiringpi pin is 0 and 2 - like on odroid.
http://raspberrypihobbyist.blogspot.com ... agram.html

Do I need to set the AC and BATT pin somehow to enable a voltage measure?

I want to identify the right pin to know that the battery is still strong enough, before triggering a safe shut down
hblanken
 
Posts: 6
Joined: Thu Dec 22, 2016 7:32 pm
languages_spoken: english
ODROIDs: C2

Re: UPS3 with Pi3

Unread postby odroid » Tue Jan 03, 2017 9:39 am

If the RPI pins are output mode by default, the voltage will not change.
So you need to set the pin as input mode first.

Or remove the UPS3 from RPI and check the voltage of two pins with DMM.
User avatar
odroid
Site Admin
 
Posts: 23642
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to UPS

Who is online

Users browsing this forum: No registered users and 1 guest