1
\$\begingroup\$

My current project utilises a Raspberry PI (3B+ or 4B) to communicate and control an external peripheral device.

The Raspberry PI also has a UPS (PiJuice) attached, including a Li-Ion battery (and therefore ~3.7v).

Background

This peripheral device, was not designed or made by me, and is current limited in the device's circuitry preventing the device to be wholly powered via the USB cable. It was never designed to be used the way I am using it. It is instead, meant to be powered via a stand alone power source (AA batteries). USB was only meant to program the device, then be disconnected.

The device which requires ~4.2v-5v and pulling around 40mA to correctly operate within tolerances, contains a microcontroller (3.3V) and microSD card. When the voltage drops (AA batteries), other components on the device stop working, due to their own (less forgiving) tolerances. As mentioned above, when the device is connected solely via USB, the same component circuitry also stops working, as it doesn't receive sufficient power.

The device has my custom firmware, enabling access to the microSD filesystem via a MSD protocol.
The PI gpio is used to control the device's CLK, RST and another interrupt pin, externally signalled via jumpers, which switch the device between its normal mode, to MSD mode.

So in summary, the PI is connected to the device via both GPIO pins and a USB cable to access the USB MSD and interact with the USB HID, when the mode permits.

Side Note 1: Until I've come up with a working solution, I added a simple arduino style 5v relay, to disconnect the AA battery when not in use and conserve power, but this needs to go also.
Side Note 2 The device is highly sensitive to noise, as it records ultrasonic audio. The PI USB has been found to introduce noise in the ultrasonic recordings, so I added python code on the PI to control the USB hub power, which disconnects the USB power when the device is recording (not in MSD mode). This removes much of the the noise in recordings.

So far all this works, but it isn't nearly pretty or a long term workable solution.

Problem

I'm trying to remove the need for the additional power source for the peripheral device, as it causes big headaches when the AA batteries go flat. I have a battery right there, already in the PiJuice.

Connecting the 5V pin on the Pi to the VCC of the peripheral device causes the PI to turn off every time, whenever the USB port is also connected.

I can successfully power the device (no AA batteries), via the 5V pin on the PI whenever the USB is not connected.

Any suggestions how to power my peripheral device, and get rid of those pesky AA batteries?

tl-dr

Generally, when a peripheral device needs supplementary power and a USB connection as well, how should a PI connect to it?

\$\endgroup\$
2
  • \$\begingroup\$ How much amp can your UPS provide at 5V? Drawing an extra 40mA shouldn't be a problem that the PI goes down. \$\endgroup\$
    – Swedgin
    Commented Mar 23, 2020 at 8:59
  • \$\begingroup\$ Want to thank @Swedgin for your reply. I haven't forgotten this question, but am forced to sidetrack before coming back and confirm your replies. \$\endgroup\$ Commented Apr 1, 2020 at 0:28

2 Answers 2

1
\$\begingroup\$

Since RPi schematics are not released, this is a vague guess but might be worth a try.

It is possible (I'd even say likely) that the power delivered to the USB ports is coming from a power switch, sort of isolating the 5V pin of the RPi and the Bus voltage on the USB port. Personally I don't know if and how backpowering (see official documentation here) is possible in this case, but what I am proposing won't harm your devices in either case.

What I think is happening: Power is delivered from the 5V side to the output side of the power switch.

Simple fix: Add a diode to prevent current flow from your device to the USB cable (coming from the 5V pin).

\$\endgroup\$
1
  • \$\begingroup\$ Cheers @flashingx for your assistance. I'll post a follow up as soon as I've had a moment to verify your suggestion. Am forced to park this while i'm tackling another problem. \$\endgroup\$ Commented Apr 1, 2020 at 0:30
0
\$\begingroup\$

There could be a variety of things stopping direct 5V powering, but if the device operates fine with batteries, I'd suggest you get a small isolated DC-DC converter such as this one DC-DC Converter, 5V dc/ 200mA Output which you power from the RPi 5V (via USB cable if that suits).

Then use a LDO adjustable linear regulator on the output to give you the 4.5V which I'm assuming your device needs (3xAA cells). If noise is still an issue, and if current draw is stable, then you could use a two stage RC filter-voltage dropper to get to 4.5V whilst filtering out switcher noise.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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