Using a single USB connection to provide power (external from arduino) and data from arduino to laptop

Hi,

I am trying to build a midi controller for the first time, and I am trying to use a single USB cable running from laptop to Arduino to provide power and data communication.
I am aware that powering a circuit through the Arduino is not best practice once its above a few test components, so I thought about splitting the power wires and data wires separately so that the power wires give me an 'external power source' and then power the arduino and circuit off of this, but then still have the data cables plugged into arduino at usb port for communication. Just wondering if this is possible, and if so is it sensible.

For context, I am planning on using around 15-20 rotary encoders (Ky-040), each with an LED as well, or maybe a single small display screen instead of the LEDs to indicate the state of the encoder.

Thankyou in advance the help :slight_smile:

Depends.
Which arduino?
How much current will the display use

Risky, just use a wall wart 5V PSU for the external power. Remember to tie all the grounds together.

In similar case I preferred to uncouple the board from the USB completely by using a radio-UART bridge modules like HC-12 or JDX-40 to communicate with PC

I never heard of HC-12 so I looked it up. It's what I know as LORA, in fact I was just range checking a couple units earlier today. The JDX-40 though comes up as some sort of Golf related thing. I just got a couple different USB isolators today, but how would you implement a HC-12 (a link will do)

If your Arduino is connected to USB, the current limit is determined by the PC and/or the fuse on the Arduino; it depends on the board that you use if the fuse is there.

If your Arduino is powered on Vin (e.g. 9V) the current is limited by the specifications of the voltage regulator; because that voltage regulator on the board does not have a heatsink it's very limited.

You need to be careful when powering a board with 5V on the 5V pin and at the same time powering it with 5V from the USB. You will need to hack a USB cable (or make another plan) to prevent problems like a damaged PC.

if you have separated the power lines of 5V from the power supply to Arduino and rotary encoders, it works fine, as data lines doesn't consume more power and comes from Arduino Safely.

Hi, @kbaz

To power your project with a separate power supply and still be able to program.

Take a USB lead and cut it open in the middle and cut the 5V wire.
This will leave gnd and the two data wires still connected.
This will let you connect and program your project with the project powered up independently.

Here is my USB isolation cable.
It is a USB extension cable that I cut in half, and rejoined gnd, D+ and D- in the box.
The terminals on the top are the two ends of the open 5V wire.
If I don't need power isolation I just plug a jumper between the two terminals.

Tom... :smiley: :+1: :coffee: :australia:

2 Likes