How do you get a 5V output from a phone?

Thread Starter

-live wire-

Joined Dec 22, 2017
959
I have seen some people with fans that you plug into your phone. So it must be possible to get power from a phone. I might want to have some phone powered microcontroller stuff. So how do you get power from an iPhone, and how much can you get? I have measured the voltage between the red and black wires of the USB cable when only plugged into the phone, and I only saw about .1V.
 

Thread Starter

-live wire-

Joined Dec 22, 2017
959
Also, are there apps that allow you to measure the current when charging and discharging the battery? I have not seen any such apps.
 
Phones with USB OTG function enables your phone to act as a USB host. That's why you can even transfer charge from a phone to another.

EDIT:

In order to use your phone as a host, the guest has also to support USB OTG.
 
Last edited:
Someone correct me if I'm wrong, but this is what I think:

For example, take a look at this device:



It allows you to use your iphone to host those devices (cameras,keyboards, etc), so your iphone must supply power to them. According to the USB OTG specification:



Some STM32 nucleo boards actually support USB OTG.
 

Thread Starter

-live wire-

Joined Dec 22, 2017
959
Someone correct me if I'm wrong, but this is what I think:

For example, take a look at this device:



It allows you to use your iphone to host those devices (cameras,keyboards, etc), so your iphone must supply power to them. According to the USB OTG specification:



Some STM32 nucleo boards actually support USB OTG.
But what do you have to do to tell it to host the USB?
 
But what do you have to do to tell it to host the USB?
Iphone will automatically host devices such a keyboards, mouse, etc. In general, the device where you connect the USB OTG cable, will automatically host.

Keep in mind that OTG is relatively new technology. Most of the phones are slaves. They do not provide power on the USB VCC pin. But nowadays, many of them have USB OTG capability. They can provide power over the usb pins, like a host. Back to the microcontroller, I don't think you can use your phone to power it if it doesn't support OTG. Take a look at some STM32 nucleos which support this function.
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
Phones with USB OTG function enables your phone to act as a USB host. That's why you can even transfer charge from a phone to another.

EDIT:

In order to use your phone as a host, the guest has also to support USB OTG.
If you connect the external device and your phone supports OTG, the device will power up (This is on android). They are trying to sell this function, otherwise it is just an enabled or disabled part in the software and a few resistors in the OTG cable to activate it.

There are apps which measure the current (I do not know how accurate they are).

Bottom line: It is better to use a battery bank and power whatever you want, including your phone.
 

Thread Starter

-live wire-

Joined Dec 22, 2017
959
Do you just need to send a certain analog or digital signal to get 5V from your phone then?If so, how complex is it, and does Apple keep it a secret?

I am talking about for an iPhone, not android or another phone. Sorry if I wasn’t clear enough.
 
Last edited by a moderator:
Do you just need to send a certain analog or digital signal to get 5V from your phone then?If so, how complex is it, and does Apple keep it a secret?

I am talking about for an iPhone, not android or another phone. Sorry if I wasn’t clear enough.
Honestly, seems like Iphone keep it a secret. I really don't know. For non-iphones, an USB OTG cable looks like this

 

be80be

Joined Jul 5, 2008
2,072
A iphone 6 will do OTG there is nothing special but the cable My kids have fan's for there phones it just plugs in like the charging cable there maybe a resistor on the data line like they do to charge I can have a look at the fan and tell you for sure how it works it is cheap but looks easy to take apart and see if there is a resistor in the mix.
 
A iphone 6 will do OTG there is nothing special but the cable My kids have fan's for there phones it just plugs in like the charging cable there maybe a resistor on the data line like they do to charge I can have a look at the fan and tell you for sure how it works it is cheap but looks easy to take apart and see if there is a resistor in the mix.
That's what I thought. Taking a look at a OTG device connected to the Iphone will give a hint about the special connection that makes OTG available.

As shown above, for Android only two lines need to be shorted to enable OTG. Something similar should happen with Iphone.
 

be80be

Joined Jul 5, 2008
2,072
Id say it's the same this lets the iphone get power and I would think it's the same maybe a value change But maybe not

Screenshot from 2018-08-28 16-42-43.png
 
Last edited:
The venerable phone company doesn't want you messing with their lines or their equipment in general. That's why they keep the phones technical information hidden from you! Attempting to steal power from the phone company will land you in prison!

Cheers, DPW [ Everything has limitations...and I hate limitations.]
May have been stated but he mean a cellphone, not a landline.
 

be80be

Joined Jul 5, 2008
2,072
I was wondering about that .
It maybe set the power line at 2.5 volts to charge and the left side below that I didn't have time to See but when I get off work today I'll get the fan from my kids and see how the resistors are set in it.
Pin 8 on the phone sets it to to provide Power but how that works out to the 4 usb 4 pins I only seen the charging. I'm wondering if pin 8 is set low or lower then 5 volts I'll know when I take the fan apart
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
It should be like this: the battery is connected to 2 loads, the phone and the output from the USB. The inside software or hardware, has to switch the USB from charging mode to discharging mode, which can be done in various ways. But once switched, the electricity will flow from the battery to the USB, instead of the USB to the battery. A resistor can be put on the data lines (middle of the USB) to detect the mode needed.
 
Top