My plan is to use my phone (Google Pixel) as a screen for a raspberry pi, and I'm worried that my power supply isn't sufficient. Is there a way to prohibit the Pixel from charging while still maintaining data flow? I haven't done much electrical work and I don't know if phones are equipped with this option, let alone if it's even possible. My power source is, if memory serves me, 3000 mWh, capable of 5 volt 2 amp (I can verify later if that turns out to be important).


Upon some deeper searching, (not sure how I missed it to begin with), I found some posts suggesting commands such as echo 0 > /sys/class/power_supply/batterycharging_enabled/charging_enabled. My updated question is, then does this actually work? How does it work?

  • When the kernel detects power supply, it just enables the charging_enabled, so that the device gets charged (and the opposite for disconnection of power supply). As a root user, you can manually disable it. That's how it works. What more do you expect? :) – Gokul NC Aug 19 '17 at 9:07
  • I'm looking for the same thing but for a different phone. – user186920 Aug 19 '17 at 10:54
  • @GokulNC It depends. It's possible that there is a charging circuit that always charges the battery and then it informs the kernel and the kernel sets that flag to inform applications. – user186920 Aug 19 '17 at 10:55
  • @MarkYisri The kernel can control the charging circuit too.. It's just a matter of what registers are set in the power IC. As an exercise, try disabling that flag when your device is being charged and leave it for an hour, and then enable it again. Do you think the battery level indicator of your device would show a higher value? Nope.. – Gokul NC Aug 19 '17 at 12:35
  • @MarkYisri that's exactly what I was wondering, I wasn't sure whether the charging circuit was capable of being controlled – Sllew Aug 19 '17 at 14:08

Considering usb C can send power in both directions, I'm assuming you can set the phone to power an external device using in phone settings, and this way you would avoid it pulling power from your source.

A side note though : 2A is quite a number, unless you're running rpi hot or powering something else my educated guess is that it should be enough for both.

  • I would tend to agree, except I think the Pixel is capable of charging at 3 amps. Moreover, with just 3000 mWh I'm hoping to make the battery last as long as possible. Even if it could handle it, I'd prefer not to. That's an interesting point you make, thanks! – Sllew Aug 20 '17 at 1:47
  • @Silew My 2013 tablet will not charge unless I give it at least 2A. – user186920 Aug 22 '17 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.