Power from GPIO

Post Reply
LordadmiralDrake
Posts: 82
Joined: Wed Mar 30, 2016 6:24 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Power from GPIO

Unread post by LordadmiralDrake » Sun Apr 10, 2016 8:55 pm

Is it possible to use the 5V and GND pins from the GPIO header to power the board?
According to the schematic, both the DC jack and the USB otg/power port are connected to P5V0, as well as the GPIO 5V pin, so it should work as long as correct voltage is supplied, right?

PeterRavnMikkelsen
Posts: 153
Joined: Sun Apr 14, 2013 10:34 pm
languages_spoken: English, Swedish, Danish
ODROIDs: U2, C2
Contact:

Re: Power from GPIO

Unread post by PeterRavnMikkelsen » Mon Apr 11, 2016 2:42 am

Good thing to ask about that. I'm sure Odroid will be able to answer that question. There could be an issue with the traces for the GPIO port +5V/ground only are dimensioned for 500mA, so if you try to run a 2A C2 from those, they would most certainly burn.

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

Re: Power from GPIO

Unread post by odroid » Mon Apr 11, 2016 10:10 am

It will work if your power supply has stable 5Volt output.
But it will bypass the over-voltage, over-current protection IC NCP372.

LordadmiralDrake
Posts: 82
Joined: Wed Mar 30, 2016 6:24 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by LordadmiralDrake » Mon Apr 11, 2016 5:50 pm

For the project I'm planning to use the Odroid for I need to make a daughterboard anyway, so I could put a protection IC there

LordadmiralDrake
Posts: 82
Joined: Wed Mar 30, 2016 6:24 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by LordadmiralDrake » Sun May 15, 2016 4:53 pm

Recently tested this out using a power supply board from my old DVD player, plus a breadboard and some cables for the connection and it worked like a charm.

infinity85
Posts: 329
Joined: Tue May 24, 2016 4:26 am
languages_spoken: english, german
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by infinity85 » Tue May 24, 2016 4:33 am

odroid wrote:It will work if your power supply has stable 5Volt output.
But it will bypass the over-voltage, over-current protection IC NCP372.
Hello,

also would like to try the 5V GPIO Pins for powering my Odroid C2 with an RemotePi Board from msldigital.com (RPi2 revision), which is originally designed for a Raspberry Pi 2 to power on the board with a IR Remote. The Remote Pi board has apparently a PolyFuse with 2A as over-current-protection. How many Aperes should it have for the C2? What is the C2 designed for in terms of over-corrent-protection?

If you provide the Information and if the board is going to work, then I'll submit the information to the developers from msl-digital and may be he will also offer a Odroid C2 edition of his board, which is really a nice gadget :)

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

Re: Power from GPIO

Unread post by odroid » Tue May 24, 2016 10:16 am

The C2 consumes 250mA with very light configuration.
If you attach a few heavy USB devices and a USB HDD and some other shield add-on boards, it can consumes around 2.2Amp with heavy computing load.

2.5~2.6Amp is the threshold level of the over-current protection.
Refer our schematics.
http://www.hardkernel.com/main/products ... &tab_idx=2

infinity85
Posts: 329
Joined: Tue May 24, 2016 4:26 am
languages_spoken: english, german
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by infinity85 » Tue May 24, 2016 11:52 pm

odroid wrote:The C2 consumes 250mA with very light configuration.
If you attach a few heavy USB devices and a USB HDD and some other shield add-on boards, it can consumes around 2.2Amp with heavy computing load.

2.5~2.6Amp is the threshold level of over-current protection.
Refer our schematics.
http://www.hardkernel.com/main/products ... &tab_idx=2
Thank you very much! This post was very helpful, so I will keep this in Mind. At least the RemotePi's polyfuse (2A) is less then your threshold (2.6A), so I can't break the Ordoid C2 due to over-current or so :). Right now my problem is, that the board does not fit because the c2's heatsink is interferring with the RemotePi Board. I ordered a stackable GPIO-Header as a extension for gaining space between board and odroid c2 heatsink.

infinity85
Posts: 329
Joined: Tue May 24, 2016 4:26 am
languages_spoken: english, german
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by infinity85 » Thu May 26, 2016 11:44 pm

odroid wrote:The C2 consumes 250mA with very light configuration.
If you attach a few heavy USB devices and a USB HDD and some other shield add-on boards, it can consumes around 2.2Amp with heavy computing load.

2.5~2.6Amp is the threshold level of the over-current protection.
Refer our schematics.
http://www.hardkernel.com/main/products ... &tab_idx=2
Hi there,
I have another question again regarding this topic..

As I mentioned I try to get this RemotePi Board working on the Odroid C2
Although it did not fit because of interferring parts with odroids heatsink I hooked it up and it is powering and starting my Odroid via IR and Pushbutton. The problem is now rather to get it shutdown safely to avoid SD-Card damage.

Therefore msldigital provides safe-shutdown scripts for the RemotePi board to communicate via GPIO Ports with the Odroids operating system (in my case LibreELEC, an OpenELEC kodi fork) and shutdown it safely with some GPIO commands.

The problem is, that those scripts are meant and fully working with the Raspberry Pi's but I spent the whole night yesterday (unsuccessfully) to get them work on my Odroid C2. It just does not work and unfortunately I don't know where to begin to understand what I need to change to adjust the scripts to the Odroid C2 GPIO system.

The script for a Raspberry Pi is like this:

Code: Select all

#!/bin/bash
# prevent restarting XBMC at shutdown. This is only used for OpenElec before V5
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
# this is the GPIO pin receiving the shut-down signal
GPIOpin1=14
# functions
add_omit_pids() {
omit_pids="$omit_pids -o $1" 
}
safe_shutdown () {
# for OpenElec before V5
touch "$LOCKDIR/$LOCKFILE"
# for OpenElec V5 and later
systemctl stop kodi
add_omit_pids $(pidof connmand)
add_omit_pids $(pidof dbus-daemon)
killall5 -15 $omit_pids
for seq in `seq 1 10` ; do
usleep 500000
clear > /dev/tty1
killall5 -18 $omit_pids || break
done
sync
umount -a >/dev/null 2>&1
poweroff -f
}

echo "$GPIOpin1" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
while true; do
  sleep 1
  power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
  if [ $power != 0 ]; then
    echo "out" > /sys/class/gpio/gpio$GPIOpin1/direction
    echo "1" > /sys/class/gpio/gpio$GPIOpin1/value
    sleep 3
    safe_shutdown
  fi
done
The comparison of the GPIO ports between Raspberry Pi 2 and the Odroid C2 and the msldigital RemotePi Board is as follows:

GPIO Comparison of RPi2 vs OdroidC2 vs RemotePiBoard

Image


I hope you can help me changing the script or give me a starting point :/

Tpimp
Posts: 355
Joined: Thu Jul 16, 2015 5:57 am
languages_spoken: english
ODROIDs: U3, C1+, XU4
Contact:

Re: Power from GPIO

Unread post by Tpimp » Fri May 27, 2016 7:23 am

"GPIOpin1" should be changed to a valid value fro the odroid-C2.

what pin you use depends on how you have it wired.

Looking at the script - the value to change it to will look like "gpio249" using the "label" value. From my understanding to use the pins 8/10 you might need to unload the Tx/Rx driver. I'm not sure.

infinity85
Posts: 329
Joined: Tue May 24, 2016 4:26 am
languages_spoken: english, german
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by infinity85 » Fri May 27, 2016 8:45 am

Tpimp wrote:"GPIOpin1" should be changed to a valid value fro the odroid-C2.

what pin you use depends on how you have it wired.

Looking at the script - the value to change it to will look like "gpio249" using the "label" value. From my understanding to use the pins 8/10 you might need to unload the Tx/Rx driver. I'm not sure.
Interesting. Why 249? Don't you think it should be pin8, which results in gpio113? I mean... looking at the script it says GPIOpin1=14 which is PIN8 on Raspberry PI2. So the RemotePi board is also connected to PIN8 on odroid C2 obviously. So I thought I had to change the script from GPIOpin1=14 to GPIOpin1=113. But it does not work :/. Or do I misunderstand there something?


EDIT:

Crazy! That did something indeed Tpimp!! I pinned from Pin8 to Pin7 and changed the script to 249 as you said (to avoid conflict with the Tx/Rx driver) and now the odroid shutdown after I pressed the assigned button on my Remote! Thank you! The only strange thing is still that the Remote Pi Board does not cut the power afterwards. On the Raspberry Pi I press the Shutdown button, OpenELEC shuts down and then after the Raspberry Pi is powered down (still consuming power, as indicated by the red led) the Remote Pi board cuts the power after a few seconds, as it knows thanks to the script that the Raspberry is powered down then. Now here the Odroid is powered down, the blue led is not blinking anymore but the RemotePi board does not get some kind of information through the GPIO which allows it to cut the power. So may be there is a wrong timeing somewhere in the script or so, which does not suit the Odroid but suits well for RPi?
Last edited by infinity85 on Fri May 27, 2016 9:06 am, edited 1 time in total.

Tpimp
Posts: 355
Joined: Thu Jul 16, 2015 5:57 am
languages_spoken: english
ODROIDs: U3, C1+, XU4
Contact:

Re: Power from GPIO

Unread post by Tpimp » Fri May 27, 2016 9:04 am

oh i didnt look at the script that closely.

Why doesn't it work? Have you tried exporting the gpio pin from commandline? I believe that pin 8 is already defined for UART - meaning the GPIO pin 8 is used for something other than gpio. To make it work as GPIO you will need to alter the configuration for UART 2. (Disable it). There are likely details on the odroid HW wiki.

infinity85
Posts: 329
Joined: Tue May 24, 2016 4:26 am
languages_spoken: english, german
ODROIDs: Odroid C2
Contact:

Re: Power from GPIO

Unread post by infinity85 » Fri May 27, 2016 9:08 am

Tpimp wrote:oh i didnt look at the script that closely.

Why doesn't it work? Have you tried exporting the gpio pin from commandline? I believe that pin 8 is already defined for UART - meaning the GPIO pin 8 is used for something other than gpio. To make it work as GPIO you will need to alter the configuration for UART 2. (Disable it). There are likely details on the odroid HW wiki.
Exactly :) You put this in my head, so I tried indeed the Pin7 with GPIO249 and it triggered the odroids shutdown successfully. Just the RemotePi Board somehow does not get a clue about the already powered off odroid :/

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest