Shop OBEX P1 Docs P2 Docs Learn Events
Power from USB — Parallax Forums

Power from USB

mynet43mynet43 Posts: 644
edited 2010-02-13 03:29 in Propeller 1
I have a small Propeller board that I'd like to power from the USB port.

I'm currently using a 7.4V Li Ion battery thru a 5V regulator into a 3.3V LM1117DT-3.3 regulator.

I'd like to eliminate the battery and the 5V regulator and use the 5V from the USB port to power the whole circuit.

The chips on the board are:
P8X32A-Q44 - Propeller
FT232RL - USB to serial interface
AT24C512 - eeprom for Prop
MCP3208 - 8 port ADC chip
LM324D - op amp

The MCP3208 and LM324D both use 5V.

Can someone please point me to a schematic showing how to power the prop from USB?

Also, can I continue to use the 3.3V regulator I have, or do I need another one?

I can supply the schematic if needed.

Thanks for the help.

Jim

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-02-12 03:08
    USB has 4 connections, Ground, +5V, +data, -data. I think the gnd and +5V are the outside connections but am not sure. That info is available on the internet. The 5V chips can use the 5V from the USB directly, and the current 3.3V regulator can use the 5V as the input voltage to supply the 3.3V for the 3.3V chips.

    All of this is doable as long as the current draw does not exceed the maximum the USB port can supply.
  • mynet43mynet43 Posts: 644
    edited 2010-02-12 03:19
    Kwinn,

    Thanks for the feedback. That's about what I thought.

    I guess the easiest way to try it on my board would be to remove the 5V regulator and run the 5V from the USB port to the 5V line used by the 3.3V regulator and the other chips.

    Do you know how accurate the 5V is from the USB?

    Sounds like it's worth a try. If anyone else has any suggestions, let me know.

    Thanks,

    Jim
  • mynet43mynet43 Posts: 644
    edited 2010-02-12 14:41
    Quick update.

    I tried removing the 5V reg from the circuit and running the 5V from the USB to the 5V supply.

    Surprise, it seems to work fine with the chips I listed. It's also lighting 3 LED's. It's been running for over an hour.

    I measured 4.87V from the USB, so that's pretty good.

    I'm not sure how much margin I've got. Does anyone know for sure how much the USB will source? I've read from 100ma to 500ma.

    I haven't tried connecting peripherals to the board, but they are basically inputs to the ADC chip, so I don't think they'll affect the power usage.

    Thanks for the help.

    Jim
  • hover1hover1 Posts: 1,929
    edited 2010-02-12 15:02
    Current maxes out at 500ma from what I have read. I'm sure it depends on the manufacturer. I normally use a USB Hub between my project and my computer, as you don't know if your project will blow your USB port. I would rather throw a $6.00 hub in the garbage, than buying a new mother board for my laptop.

    my .02

    Jim
    mynet43 said...
    Quick update.

    I tried removing the 5V reg from the circuit and running the 5V from the USB to the 5V supply.

    Surprise, it seems to work fine with the chips I listed. It's also lighting 3 LED's. It's been running for over an hour.

    I measured 4.87V from the USB, so that's pretty good.

    I'm not sure how much margin I've got. Does anyone know for sure how much the USB will source? I've read from 100ma to 500ma.

    I haven't tried connecting peripherals to the board, but they are basically inputs to the ADC chip, so I don't think they'll affect the power usage.

    Thanks for the help.

    Jim
  • mynet43mynet43 Posts: 644
    edited 2010-02-12 15:29
    Thanks for the answer.

    If it's 500ma, then I've got lots of extra power.

    Jim
  • hover1hover1 Posts: 1,929
    edited 2010-02-12 16:20
    After reading the USB 2.0 spec, (April 27,2000), a USB external hub will only supply 1 unit (100 ma) per port. The hub itself uses 1 unit, and each port supplies 1 unit for a total of the 5 unit maximum (500 ma).
    So you should be able to get 500ma direct from a computer USB port, but only 100ma from an external hub port.
    Jim
    mynet43 said...
    Thanks for the answer.

    If it's 500ma, then I've got lots of extra power.

    Jim
  • RaymanRayman Posts: 14,877
    edited 2010-02-12 19:36
    It's a bit dangerous to use USB power that way... Also, your computer may complain if you attempt to draw more that 100 mA without first letting your FTDI chip negotiate with the computer. The FTDI documentation shows some better ways to draw USB power...

    But, on the other hand, you should be fine, if you're careful...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • hover1hover1 Posts: 1,929
    edited 2010-02-12 19:50
    Ray, are you responding to the OP, or my post about the hub?

    My take on the spec is that the external USB device is allowed 100ma until it negotiates for the full 500ma. That's why I use an external hub. I let it set everything up. Downside is I only have 100ma per port on the Hub.

    Jim
    Rayman said...
    It's a bit dangerous to use USB power that way... Also, your computer may complain if you attempt to draw more that 100 mA without first letting your FTDI chip negotiate with the computer. The FTDI documentation shows some better ways to draw USB power...

    But, on the other hand, you should be fine, if you're careful...

  • RaymanRayman Posts: 14,877
    edited 2010-02-12 20:29
    Sorry, the OP (original post?)...

    BTW: I'm pretty sure I'm drawing ~400 mA from my hub with the PSB connected and backlight on full power. But, I have a hub with a power supply. Maybe that 100 mA you refer to is an unpowered hub...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • hover1hover1 Posts: 1,929
    edited 2010-02-12 20:50
    Correct...I'm running an unpowered hub. Good to know a powered hub is giving at least 400ma. That has potential.
    Thanks, Jim
    Rayman said...

    Maybe that 100 mA you refer to is an unpowered hub...

  • mynet43mynet43 Posts: 644
    edited 2010-02-13 00:19
    FYI, I've been using an unpowered 4-port hub. It ran OK for several hours before I stopped it.

    Right now I'm not sure what to think. The 3 LED's I'm lighting probably take about 60ma, so I figure I have to be using well over 100ma.

    Anyone with some more info on this would be really appreciated. If this works, I can save about $20 for the battery and another $20 for the charger. I'm building 15 of these to start, so that adds up.

    Thanks for the help!

    Jim
  • hover1hover1 Posts: 1,929
    edited 2010-02-13 00:38
    Jim, As Ray said, he is running about 400ma from a Powered USB Hub.

    Just checking ebay, a Powered Hub could be had for $$4.00 to $11.00. I'd buy the $11.00 one. [noparse]:)[/noparse]

    Jim
  • mynet43mynet43 Posts: 644
    edited 2010-02-13 01:28
    The idea is to power the whole thing by just plugging it into a USB port.

    It will be used by plugging it directly into a USB port on a battery powered laptop or netbook.

    A powered hub wouldn't make sense here.

    If it works under these conditions, then I'll go with it.

    I need to be confident that there's enough power to keep it going.

    I just plugged it into a little ASUS Netbook, compiled a program to eeprom and it's running fine using only USB power.

    It seems like someone was saying I could get 500ma directly from a port.

    Any confirmation would really help.

    Jim
  • hover1hover1 Posts: 1,929
    edited 2010-02-13 01:46
    Jim,

    I am no expert on USB power. I was just sharing what I found. Judging on the PDF that I put up, if the FT232RL - USB to serial interface that you use, can succesfully negotiate , them 500ma will be avalaible. I think you can go with that.

    I just try to put something between my projects and my $3,500 laptop.

    Best Regards,
    Jim
  • mynet43mynet43 Posts: 644
    edited 2010-02-13 01:52
    Thanks!

    It sure seems to be working fine, so I think you're right.

    I may try adding a little more load to it, like a couple more LED's, just to see if it keeps working.

    If it still works, I may take a deep breath and go for it.

    Jim
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-02-13 02:12
    mynet43,

    Take a look at the schematic for the MoBoStamp-pe (in the back of the manual). This includes a soft-start circuit along with some necessary buffering between the FT232R and the Prop.

    -Phil
  • mynet43mynet43 Posts: 644
    edited 2010-02-13 03:19
    Phil,

    Thanks for the good references. There was an excellent article from Maxim in the links.

    Since mine seems to be working so well, I may measure the current to see what's happening.

    Right now it seems very solid. I'll try it on a few other computers.

    Jim
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2010-02-13 03:27
    USB Power

    The USB 1.x and 2.0 specifications provide a 5 V supply on a single wire from which connected USB devices may draw power. The specification provides for no more than 5.25 V and no less than 4.75 V (5 V±5%) between the positive and negative bus power lines. For USB 2.0 the voltage supplied by low-powered hub ports is 4.4 V to 5.25 V.[noparse][[/noparse]29]

    A unit load is defined as 100 mA in USB 2.0, and was raised to 150 mA in USB 3.0.

    A maximum of 5 unit loads (500 mA) can be drawn from a port in USB 2.0, which was raised to 6 (900 mA) in USB 3.0. There are two types of devices: low-power and high-power. Low-power devices draw at most 1 unit load, with minimum operating voltage of 4.4 V in USB 2.0, and 4 V in USB 3.0. High-power devices draw the maximum number of unit loads supported by the standard. All devices default as low-power but the device's software may request high-power as long as the power is available on the providing bus.[noparse][[/noparse]30]

    A bus-powered hub is initialized at 1 unit load and transitions to maximum unit loads after hub configuration is obtained. Any device connected to the hub will draw 1 unit load regardless of the current draw of devices connected to other ports of the hub (i.e one device connected on a four-port hub will only draw 1 unit load despite the fact that all unit loads are being supplied to the hub).[noparse][[/noparse]30]

    A self-powered hub will supply maximum supported unit loads to any device connected to it. A battery-powered hub may supply maximum unit loads to ports. In addition, the VBUS will supply 1 unit load upstream for communication if parts of the Hub are powered down.[noparse][[/noparse]30]

    In Battery Charging Specification[noparse][[/noparse]31], new powering modes are added to the USB specification. A host or hub Charging Downstream Port can supply a maximum of 1.5 A when communicating at low-speed or full-speed, a maximum of 900 mA when communicating at high-speed, and as much current as the connector will safely handle when no communication is taking place; USB 2.0 standard-A connectors are rated at 1500 mA by default. A Dedicated Charging Port can supply a maximum of 1.8 A of current at 5.25 V. A portable device can draw up to 1.8 A from a Dedicated Charging Port. The Dedicated Charging Port shorts the D+ and D- pins with a resistance of at most 200Ω. The short disables data transfer, but allows devices to detect the Dedicated Charging Port and allows very simple, high current chargers to be manufactured. The increased current (faster, 9W charging) will occur once both the host/hub and devices support the new charging specification.


    ===============================================================================================================================================

    USB 3.0

    The bus power spec has been increased so that a unit load is 150 mA (+50% over minimum using USB 2.0).

    An unconfigured device can still draw only 1 unit load, but a configured device can draw up to 6 unit loads
    (900 mA, an 80% increase over USB 2.0 at a registered maximum of 500 mA).

    Minimum device operating voltage is dropped from 4.4 V to 4 V.

    Source: en.wikipedia.org/wiki/Universal_Serial_Bus

    Post Edited (Bob Lawrence (VE1RLL)) : 2/13/2010 3:33:59 AM GMT
  • mynet43mynet43 Posts: 644
    edited 2010-02-13 03:29
    OK, I just measured the current with a DVM.

    The 5V coming out of the USB port measures roughly 50ma.

    This seems pretty low with all these chips.

    Does it make sense? If so, I'm in really good shape.

    Thanks for the help.

    Jim
Sign In or Register to comment.