odroid XU4 with android and JUICE4HALT UPS

Post Reply
maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

I recently bought an XU4 and a juice4halt ups for safe shutdown when power cuts off. I dont know how to take the signal from JUICE4HALT and make the XU4 shutdown. Can anyone help me?

User avatar
odroid
Site Admin
Posts: 37793
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1919 times
Been thanked: 1186 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by odroid »

We have no experience of using JUICE4HALT device. How did you connect it to the XU4?

BTW, does it have enough energy capacity to keep powering the RPi4?
As far as I know, ODROID-XU4 Octa-core processor consumes more power than RPi4 Quad-core processor.
But, that UPS hat seems to work with low power SBC like RPI2/RPI3/ODROID-C2 series only.

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

And did you remember that XU4 has 1.8V logic? It's not directly compatible with 3.3V logic that RasPi accessories use.
These users thanked the author mctom for the post:
odroid (Wed Jun 23, 2021 6:36 pm)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

100mA 53 sec. 141 sec.
200mA 33 sec. 87 sec.
IAV
(Raspberry Pi 3) 31 sec. 81 sec.
300mA 24 sec. 62 sec.
400mA 19 sec. 47 sec.
500mA 16 sec. 39 sec.
600mA 13 sec. 32 sec.
700mA 11 sec. 27 sec.
800mA 9 sec. 23 sec.
900mA 8 sec. 20 sec.
1000mA 7 sec. 18 sec


thats the time that can make systems operate only with that. I need enough power just to shut it down when power cuts off ( i think is enough). if i cant use it on 1.8v logic maybe i should use a transistor to bridge pin 12 with pin 1?

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

Keep in mind that i use android.... i dont know if its possible to shutdown just with a button click ( bridge with transistor)

User avatar
odroid
Site Admin
Posts: 37793
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1919 times
Been thanked: 1186 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by odroid »

On Android, as far as I remember, an event of power button might pop up a window to choose what to do.
Try pushing the power button on the XU4 board while Android system and your apps are running to see what happens.

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

I think none of us is familiar with this device, so if you share some documentation that could be examined to give you definitive answers, that'd be nice.
You never said which variant of J4H you're using and the makers have a few in offer.

If you connect 3.3V logic into GPIO pins of XU4, you may break it.
Indeed all logic signals must be translated. Reducing voltage may be achieved by a voltage divider if the signals aren't too fast. Increasing a voltage is trickier and needs at least one transistor.

It is definitely possible to have soft power off. In the worst case a tiny script may be implemented to check for GPIO pin status and act accordingly. I'm no Android expert, so I'll leave this to someone else.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

ok lets describe the project..... the whole idea is to use odroid xu4 with a 1280x480 screen with hdmi and touch with usb to run torque pro app for my car. But i need to start the android when i turn the key to acc mode and turn off the android when i turn key to off mode. I want to use juice4halt board so as the android shutdown normally so as not to damage it. I dont want to use battery because it wont be accesible after installation. Any ideas for auto shutdown? when the power cuts off? (i thing that android will start as sonn as the odroid board gets power right?) THANKS FOR YOUR QUICK RESPONSES!!

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

i use The 7V...28V model Ordering code: J4H-HV-TRM
this is it's datasheet with every information we need https://juice4halt.com/wp-content/uploa ... t20-HV.pdf
I USE THAT MODEL BECAUSE IT ALSO TRANSFORMS 12V (CAR) TO 5V (ODROID)

User avatar
odroid
Site Admin
Posts: 37793
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1919 times
Been thanked: 1186 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by odroid »

Carefully read @joerg's great posts first.
viewtopic.php?p=142427#p142427
viewtopic.php?p=226038#p226038
These users thanked the author odroid for the post:
joerg (Thu Jun 24, 2021 12:22 am)

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

Every one is using the C2 version...
So to sum up i can use the App GpioShutdownService for C2 / N2 / C4 / XU and sent to one pin ( i dont know which i guess i will find out in the app) 1.8v ?
i am a little bit confused...

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

The average output current of this thing is 1A. I don't think this is enough, as @odroid said before.

If I was trying to achieve the same thing, I'd just get a cheap 5V 5A step-down module and make it always supply XU4. In shutdown state XU4 consumes barely any power. On top of that I'd build a solution to issue a soft start and soft shutdown depending on some car's voltage that changes when you turn the engine on or off.

Your solution is flawed in a few ways. First of all, J4H is not compatible with XU4 at all and you'll spend too much time trying to make it work. Secondly, you assume the supercaps will always have enough time to fully charge up. IF you, for once, start the engine and remind you forgot something from your house, you'll turn it off and black-out the xu4. Probably not fatal, but that's what you're trying to avoid.
And finally, the current rating is inadequate, and keep in mind that in winter temperatures supercaps will perform even worse.
So, my advice is to return J4H if you can and rethink your strategy. :)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

so if i connect the odroid on battery 12v and have the acc mode of the car for on/off how would i set up this with the shutdown app?
how i will make it to shutdown when no power from acc is received?

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

Hm. Every time the voltage rises, a button push should be simulated, that's one thing. One could go fancy and use monostable multivibrator for that, but maybe such thing could be done with a FET transistor and a sprinkle of passive components.
Another thing is to provide a constant information about the "acc mode" to any GPIO pin - divided with a resistive divider, or with Zener-limited voltage, or inverted by a transistor.

Now, if the button press is simulated ("acc mode" is rising), XU4 will start.
When it's up and running, a bash script may check the GPIO every 5 seconds or so , and shut down the system when applicable.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

it will work like that? (attachment) Is there a script where when i sent power to a pin will start and when power to the same pin cuts off to shutdown?
Attachments
odroid diagram.png
odroid diagram.png (20.64 KiB) Viewed 297 times

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

That is a solid start, yes. :) Not quite correct, but impressive for a first try.

First of all, you can't supply XU4 directly from a car battery - this voltage is too high. You'll need a buck converter (often called step-down among hobbyists), that transforms voltages from >16V down to 5V, with minimum of 4A output. That'ss 20W minimum. This should sit between battery and your XU4.

cig 12V is a great idea to use as the signal to boot or shut down a computer. It actually may be a good idea to use N-MOSFET type transistor that tolerates Vgs voltage of +-20V. This is always specified in transistor datasheet.
And that transistor should probably short GPIO to GND. A pull-up resistor of around 2kOhm from the same GPIO to 1.8V won't hurt.

Now, in order to use that in the way you want, @odroid above linked a piece of software that can shut down your Odroid when the GPIO signal will get high or low.

If it comes to turn it on, you'll need to learn if there is a pin on Odroid XU4 that does that - no script can do it for you, because scripts don't run on a disabled computer.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

yes you are right i forgot the voltage regulator.... according to my research if you bridge pin #1 and #12 the odroid xu4 shuts down can anyone confirm this? Also the is a way to make android immediately shutdown without the confirmation box?

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

Would be easier to debunk your research if you showed some sources. ;)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »


User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

Well, I don't know where did you read it shuts down XU4, but the pin is called "PWRON". :)
Indeed this pin turns on XU4 and may be used to shut it down as well, here's some info how to achieve that: viewtopic.php?t=23036

But all this is for push buttons, how do you want to translate it into cig 12V changes?
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

Can i use "PWRON" to shutdown the XU4 WITHOUT any other input? (just with the button)
i will take the signal from the 12v cig and i ll use a relay (?) to simulate a button press by bridge pin1 and pin12

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

As per link I just gave you, yes, it can be done with Ubuntu. I don't know about Android, I'm not into that.
No, you won't find a magic pin combination that you can short and turn off XU4 safely, nor any other easy trick. Electronics ain't easy.
There must be a piece of software that triggers a safe shutdown, and you must somehow trigger it with logic signals on GPIO, capture these signals, and fire up a command that will do what you want.
It would be easy with Linux. Android is much harder to work with, because it is designed to NOT let users do what they want, and call it "safety".

Button press simulation using relay (make it transistor instead) is not the best idea. You may end up with a computer turning on and off in the exact opposite if it fails to capture the signal once. :)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

So if i use the shutdown app witch gpio should i bridge with pin 1? i am a little bit confused

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

If such "app" exists, I'm sure this is specified in its documentation. First, research possibilities to shutdown Android safely, then figure out the way to do it using GPIO.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

viewtopic.php?p=142427#p142427
i cant find any documentation but it works (at least i am reading in the forum that it works) but i cant understan how to use gpios for that

User avatar
mctom
Posts: 300
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 32 times
Been thanked: 25 times
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by mctom »

Well, scroll down a bit and you may find a schematic and config file for this service, for use in a car.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

maogns
Posts: 21
Joined: Wed Jun 23, 2021 4:27 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid XU4 with android and JUICE4HALT UPS

Post by maogns »

it's for the odroid c2...

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 2 guests