Safely connecting a Microcontroller with a separate power supply to USB

Discussion in 'Embedded Systems and Microcontrollers' started by programmer6502, Apr 20, 2016.

  1. programmer6502

    Thread Starter Member

    Feb 1, 2014

    I'm working on a project with basically a home built breadboard Arduino using an Atmega328p. I've been powering the microcontroller from USB (using a FT232R USB serial breakout board) but am to the point now where I need more current than USB can offer. However, I still need to use the USB port to monitor results on a serial terminal coming from the microcontroller on my computer at the same time and occasionally reprogram.

    So when I power the microcontroller with a separate 5v power supply to gain higher current capacity, how do I go about simultaneously connecting it to USB without doing damage? Can the grounds be tied so that the separate 5v voltages are referenced the same?

    As of now without a separate supply, I'm using the connections VCC, GND, TX, RX, and DTR on my FT232R breakout board.

  2. MaxHeadRoom


    Jul 18, 2013
    Coupling the grounds should not be a problem, is there no way you can access 5v from one of the drive sockets that come direct from the P.C. Pwr. S?
    This will be the same source.
  3. programmer6502

    Thread Starter Member

    Feb 1, 2014
    I suppose I could, but it would be inconvenient. Plus I commonly use a laptop when prototyping. My microcontroller circuit will eventually make it's way into an RC vehicle, I'm just experimenting with some power hungry 2.4GHz modules first.

    And I'm sure it's not going to be last time I'll need more current when prototyping so I need to find a worth while method to solve the problem.
  4. OBW0549

    Distinguished Member

    Mar 2, 2015
    This is what I call a "non-problem."

    USB doesn't care if you connect its Vcc output to anything other than the FT232R; it's perfectly acceptable to leave Vcc unconnected while powering the rest of your device from a separate supply.

    Yes, tie the grounds together.
  5. nigelwright7557

    AAC Fanatic!

    May 10, 2008
    I designed a USB audio mixer and that had separate 5volt for the mixer.
    I just connected the grounds but not the 5 volt rails and it worked fine.
  6. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
  7. programmer6502

    Thread Starter Member

    Feb 1, 2014
    Thank you all for answering my question and the witnesses. And I assume the same also applies when using battery(s) as the separate power source? (Just checking)
  8. Picbuster

    Well-Known Member

    Dec 2, 2013
    Disconnect the mpu power from the ftdi chip.
    Feed the ftdi chip from 5V pc cable (USB power).
    Connect the mpu to 5V separate powersup
    This works and give you the advantage that the usb is always connected regardless the mpu state.
  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    It doesn't matter if your second supply is a wall wart or a battery or anything else. As long as you have the five volts to run your project just connect the common grounds together and you are good to go.
  10. odm4286

    Senior Member

    Sep 20, 2009
    Hopefully this will save you some you some trouble. Since you say your project requires more current than a USB port can supply I'm assuming you're drawing more than an amp. Keep in mind that if your power supply cannot handle that without a massive voltage drop you will see VERY strange behavior from your MCU. I swore my code was incorrect until I realized the 9v Alkaline battery I used dropped voltage so fast my PIC behaved erratically. If you go the battery route, try for a lithium battery their voltage with respect to current draw curve is much more forgiving.
  11. programmer6502

    Thread Starter Member

    Feb 1, 2014
    Sounds good. The battery it would be connected to is a NIMH 7.2v 3300MAh battery. So plenty of amperage and the battery is fed to an ESC with a built in regulator that drops it to 5V. I've actually run a microcontroller on it before with a filter cap and haven't had any issues at all.

    Well I think that about answers all my questions, I appreciate the help! Always nice to get some confirmations before attempting something that could potentially fry expensive equipment.
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    I am not a big fan of using a battery on a breadboard, reason being that "plenty of amperage" thing. If you happen to short something out they WILL melt wires and do other bad things.

    It is fine if you exert some extra care, and don't look supprised if your breadboard melts down to a slag heap.