Shop OBEX P1 Docs P2 Docs Learn Events
Powering up the QuickStart — Parallax Forums

Powering up the QuickStart

Paul K.Paul K. Posts: 150
edited 2013-02-06 20:45 in Propeller 1
I'm a little confused on how applying power/programming thru the USB works.

If I have an external power source lets say 9V going to VIN. I know the on board regulator will bring that down to 3.3V. Do I need to disconnect my 9V source before I reprogram the board with a USB cable.

Can I leave the Quickstart connected to my USB and use an external source?

Paul
«1

Comments

  • LeonLeon Posts: 7,620
    edited 2011-08-21 14:30
    If you look at the schematic you will see a diode (D12) and MOSFET (Q2) isolating the 5V supply from the USB connector from Vin, so you should be OK powering it via Vin when programming. Parallax should mention it somewhere, though.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-21 14:35
    Yes you can, as long as Vin is greater than about 4.3V. If Vin is below about 4.3V, the USB bus and interface chip will attempt to drive Vin to that voltage. That can be a problem if you're using an exhausted battery for Vin. If you're using a 6V or higher battery, it's better to put a diode in series with the battery to prevent this.
  • Paul K.Paul K. Posts: 150
    edited 2011-08-21 15:18
    @Leon
    I saw that on the schematic and on specs they do talk about the USB enable. Just didnt understand how this worked.

    @Mike
    If the voltage dips down below 4.3V. What would happen? You said this could be a problem, how? I plan to use a 2S LiPo pack so the voltage would never get that low so I'm really not concerned just curious with out doing an experiment that could damage my only board.

    Thanks for reply guys.

    Paul
  • LeonLeon Posts: 7,620
    edited 2011-08-21 15:28
    The specification states a range of 4V to 9V, with a 5V nominal value. No damage should result with Vin over that range.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-21 16:38
    The 5V USB power gets passed through a couple of switch transistors and a diode to Vin. There's probably a little more than 4V available at Vin. If you connect an external power source to Vin that's greater than this, the diode blocks the power from USB and Vin provides the input to the 3.3V regulator. If the external power source is lower than this and USB power is available, the QuickStart board will attempt to "charge" the low power source. There's probably at least 100mA available for this, possibly as high as 500mA. I'd have to look at the datasheet for the FTDI chip used for the USB interface to see.
  • Kevin McCulloughKevin McCullough Posts: 62
    edited 2011-08-24 10:49
    The USB 5V supply can actually be up to around 5.25V and still be in spec (http://en.wikipedia.org/wiki/USB#Power). Then it goes through the MOSFET (almost no voltage drop), then through the Schottky diode (about 0.3V to 0.4V drop). So at the VIN node, it could still be nearly 5V. So if you are overriding the USB supply from and external source (into the VIN pin), that's fine as long as you know for sure that the external source will always be at least about 5.5V or higher (to provide a safety margin above the bare minimum 5V).

    If there is any possibility that the external source might fall below the minimum at any time, then you must use a diode in series with the external source into the VIN pin to protect against any back-flow. This would be the preferred method when powering the board from an external source, and is the safest.

    It's important to note that USB power supplies are very commonly not limited/protected. They typically will have an overload shutoff switch, but it's not something you want to rely on. And most of the time they are tolerant of much higher current draw than the 500mA typical "max". That is why it is very important to protect against back-flow current into your external source. The USB won't necessarily be limited to 500mA, and may very happily provide enough current (i.e. wattage) to damage components on the QuickStart or your external VIN supply.

    Also, the FTDI chip will not regulate USB power either. As far as the FTDI chip is concerned it's just a software request for so many "units" of power. If the computer or USB hub grants the request, then it will drive the pin low and turn on the MOSFET (Q2) which enables power to the rest of the board. But it's sort of an honor system on the part of the system designer that the amount of power drawn does not exceed the number of units requested. The USB hub can limit to exactly the much current, but often allows much more.
  • Kevin McCulloughKevin McCullough Posts: 62
    edited 2011-08-24 11:11
    Also, regarding the maximum input voltage for VIN. It is mainly a power-dissipation issue for the 3.3V linear regulator. So that depends on both the voltage dropped across the regulator AND the current drawn. The regulator uses the SOT223 package and should not dissipate more than about 1W at room temperature (~25 degC). The absolute max VIN listed on the AP1117 datasheet (http://www.diodes.com/datasheets/AP1117.pdf) is 18V, so with a margin of safety, maybe up to about 15V operating voltage.

    P(dissipated)=V(dropped across the regulator)*I(supplied to the rest of the circuit)

    So VIN can have a wide range, but care must be exercised to ensure that the maximum power dissipated at the given operating temperature is not exceeded.
  • LeonLeon Posts: 7,620
    edited 2011-08-24 11:26
    That should be added to the QS documentation.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-24 12:20
    Being a software type, is there best practice on how the diode should be put into the circuit (+ or - lead) and any suggested diode?

    component.diode := true; # add diode for protection :thumb:

    Okay, y'all can stop laughing now!!
  • David CarrierDavid Carrier Posts: 294
    edited 2011-08-24 13:28
    Connect the anode to your power source and the cathode to the Vin pin. The Vin pin connects to the input of the regulator, as does the USB power supply. Since power would be available from two different sources, each supply needs a diode in series to prevent the other supply from driving current into its output. The USB supply already includes a diode, so you only need to add one for your supply. Any diode that can take the current and voltage you are supplying will work, but a Schottky diode will be the most efficient.

    — David Carrier
    Parallax Inc.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-24 13:46
    Thanks, David!

    I'm good to go now, I do know how to tell my anode from a cathode!
  • Kevin McCulloughKevin McCullough Posts: 62
    edited 2011-08-25 01:02
    Also regarding the diode. Without getting into too much detail and math, you'll want to de-rate the diode for some margin of safety. Normally we would do power & temperature rise calculations and see exactly how much current the diode will be able to tolerate; however to avoid that, I would just suggest that something about twice your required capacity will most likely work for your project (since you're probably not operating much above room temperature). So if you plan on needing about 500mA, you will probably be just fine with a diode rated for at least 1A.

    Also, in this case, you can probably go with just about any diode that will tolerate your required current. Often we will choose a Shottky because they have a fairly low forward voltage drop (and remember the power dissipated equals the voltage drop times the current), so they tend to dissipate less power - therefore typically more efficient in general. In this particular case we are following the diode with a linear regulator (as opposed to a more efficient switcher); so I wouldn't worry much about the forward voltage drop of the diode (unless your very tight on the lower limit of minimum input voltage) because whatever power is not dissipated by the diode will ultimately end up being dissipated by the linear regulator. So essentially, whether it's a low forward voltage drop or a high forward voltage drop the efficiency will end up being the same.

    So basically... just choose a diode that is decently over-rated for current so you won't have to worry about power dissipation being a limiting factor. Essentially what David said: "Any diode that can take the current and voltage you are supplying will work" :-)
  • VonSzarvasVonSzarvas Posts: 3,451
    edited 2011-08-25 21:25
    Selecting a diode with high vf (high forward voltage drop) might actually be an advantage here. Perhaps something in the standard 1n400x range if you have it in the spares box.

    The diode will take some of the work off the linear reg. You could also consider 2 or more series diodes to further reduce the work of the linear reg if the vin is high and the reg is running hot.
  • EMHmark7EMHmark7 Posts: 93
    edited 2012-08-30 06:53
    Of course a close to universal necessity. 2 questions and 2 "tips" from a low-experience.

    1) How does it work while the QS is powered by both the USB and the 6V battery pack if both powers are equals, both diodes will open and power will be 5+6V?

    Real life example: The project is already On. I connect USB for programming and disconnect.

    2) I will use switch-mode power regulators (Dimension Engineering's DE-SWADJ (up to 1A, 10W) for my stepper motor that will be powered by another battery pack,
    and for my QS, the AnyVolt model (.5A adjustable from 2.6 to 14V).
    My question si if I really gain power autonomy (and less heat) from using such power regulator in the Vin, compared to just using the onboard regulator (of course I am asking to your gutfeeling, unless you really know).

    3) By the way, even if maybe I should start another thread for this, for making work my 4x20 parallax LCD with the QS, Parallax Support told me that I need to have a common ground (LCD and QS). It works now.

    4) My tip about batteries: I found - for those who do not know - that not only rechargeable batteries have lower voltage, but - and it is a possible limitation for me here in the canadian winter - they have a limited duty temperature range in the cold. I do not remember, but lets say from 32F and up.
    So, check this in your battery specsheets if necessary. That is why, sadly, I will stick to use-and-garbage ones.
  • cavelambcavelamb Posts: 720
    edited 2012-08-30 09:04
    Semantics, perhaps, but the proper terms help.

    Diodes do not "open" (like a valve) to pass current.
    They simply conduct in one direction but not the other.

    (Switches are said to open in order to "open" (break) the circuit.
    That's the opposite of close (short) to connect the circuit)


    The voltage on the common end of the connected diodes will be the
    higher of the two inputs - less the forward voltage drop of the diode.

    One of the stickier problems one will encounter with multiple power
    sources is that when connecting or disconnection the voltage may
    be adversely effected. Voltage spikes or dips can play havoc with
    logic systems.


    There are a lot of electronics self-study sites on the net.
    This is a good one.
    http://openbookproject.net//electricCircuits/DC/index.html
  • EMHmark7EMHmark7 Posts: 93
    edited 2012-08-30 15:00
    Thanks Cavelamb for the info.

    So if I understand what you are saying, all the time, either of the diodes will block?

    So, unless I get a suggestion, I would put a diode on both sides, rely on the onboard regulator and turn off the device when using USB connection.

    But for future reference or for who it may interest, I got a reply from Avago. They suggest me 2 devices: Their lowest power optocoupler (HCPL-4701)
    Minimum input can be driven with as low a current as 40uA.
    But they say: make sure that the pull-up resistor
    on the output is between 11 kohm to 16 kohm.

    http://components.arrow.com/part/detail/41658625S9024946N7786
    and a solid state relay, the ASSR-1411 (looks simple!)
    "The minimum recommended drive current for the ASSR-1411 is 3mA in the data sheet. However, if the output load is just low power, you may be able to make the ASSR-1411 work at 1mA drive current."

    But in both cases, I would need to investigate and I do not know any of the pullups in the camera.

    Maybe I'll it give a try in the future, but look nice for power consumption.
  • Albus DumbledoreAlbus Dumbledore Posts: 6
    edited 2013-01-05 20:06
    I bought my QuickStart about a year ago, used it with the basic LED/touch button demo. I remember powering it with a 9V battery connected to pins 40 and 39 and was able to power it without the USB cable attached and run the demo like this.

    Fast-forward a year later and I purchased the 2x16 Serial LCD Backlit with Speaker accessory. I couldn't get it to work. (The test mode worked but the sample spin file would not.)

    I replaced the LCD with a new one. It didn't seem to work any better at first, same result.

    I went back to basics and attempted to run one of the original LED/touch button demos and was successful. I tried the LCD demo again and was able to get it to run but only after changing the signal pin to anything but PIN 0, the sample spin file default.

    Aha, so my PIN 0 is fried, perhaps. At least I know that I can use the USB cable and power the LCD with the sample program.

    Now, I return to trying to power the QuickStart + LCD with the 9V battery. No luck. For some reason it's almost as if the (new) 9V battery can't power both devices. I review the specs for the LCD screen and it indicates 5V. Do I need to lower the voltage now in order to get the LCD to power correctly? Based upon your diode discussion earlier in this thread I'm guessing that this is the case.

    I've got pin 40 on the QuickStart going to a breadboard that also attaches to the 9V battery's positive pole and the LCD's center pin. I've got pin 39 of the QuickStart going to a breadboard that also attaches to the 9V battery's ground and the LCD's ground pin. Pin 2 on the QuickStart connects to the signal pin on the LCD via the breadboard.

    So if I do need to add a diode into the mix (to power this with a 9V battery) then where to I change things up? Thanks in advance.

    Ultimately, I bought all this so that I could create a tennis ball cannon. It is important to my project that it can run independently without being plugged into a computer just to get power via the USB.
  • EMHmark7EMHmark7 Posts: 93
    edited 2013-01-06 07:55
    You need to get a common ground between the LCD and MCU or the LCD will not work.
    So, link the 2 grounds together.
    Also, make shure you use in the software the pin that is in fact connected to the LCD.
    I use a voltage regelator that creates 5V for the LCD and for the VIN of Quickstart.
    I have put a diode between the regulator output and the VIN.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-01-06 09:05
    When using batteries, I normally use four AA NiMH. The combined voltage is pretty close to 5V and many 5V devices will run fine from the four AAs.

    9V are good for very low current devices. An LCD with a backlight will likely drain a 9V pretty quickly. You also shouldn't run 5V devices from 9V (as you have found). I'm betting the 9V powered LCD burned out pin 0 on your QuickStart.

    As EMHmark7 said, if you're going to use 9V you'll need a regulator to redece it to 5V. I recently purchased some of these regulators off ebay, they seem to work fine.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2013-01-06 09:30
    I've been thinking about building a little PCB with a 2.1mm barrel jack on one end, a 7805 and a USB female jack on the other end. (This would have come in handy last night at my shop)

    Those 500ma cell phone chargers just don't cut it when I want to power up a Quickstart with a bunch of stuff hooked to it easily.

    Anyone else want a couple of these?

    Jeff
  • LevLev Posts: 182
    edited 2013-01-06 10:24
    I've been thinking about building a little PCB with a 2.1mm barrel jack on one end, a 7805 and a USB female jack on the other end. (This would have come in handy last night at my shop)

    Those 500ma cell phone chargers just don't cut it when I want to power up a Quickstart with a bunch of stuff hooked to it easily.

    Anyone else want a couple of these?

    Jeff

    I'll take two Jeff. Thanks for offering this, and let me know how to pay you.
  • cavelambcavelamb Posts: 720
    edited 2013-01-06 21:01
    I've been thinking about building a little PCB with a 2.1mm barrel jack on one end, a 7805 and a USB female jack on the other end. (This would have come in handy last night at my shop)

    Those 500ma cell phone chargers just don't cut it when I want to power up a Quickstart with a bunch of stuff hooked to it easily.

    Anyone else want a couple of these?

    Jeff

    Great idea, but I've got it covered pretty well already.

    My wall wart(s) are from an old network modem and router.
    One +5 regulated (3 amps) and one +12 regulated (2 amps).
    They were a buck each.

    Look around the electronics bins in the second-hand stores.
  • AribaAriba Posts: 2,690
    edited 2013-01-07 01:34
    ...
    Those 500ma cell phone chargers just don't cut it when I want to power up a Quickstart with a bunch of stuff hooked to it easily.
    ...

    As a non native english speaking person, I wonder a bit about this phrase. Is it not a good thing if the charger not cut your QuickStart board when you power it up? :smile:

    Anyway, Phone/Pad chargers are not limited to 500mA. Most have 1A..2A current output. This is also labeled on these cheap ones from China, but they often don't really bring more than 200..500mA.

    Andy
  • cavelambcavelamb Posts: 720
    edited 2013-01-07 05:11
    Ariba wrote: »
    As a non native english speaking person, I wonder a bit about this phrase. Is it not a good thing if the charger not cut your QuickStart board when you power it up? :smile:

    Anyway, Phone/Pad chargers are not limited to 500mA. Most have 1A..2A current output. This is also labeled on these cheap ones from China, but they often don't really bring more than 200..500mA.

    Andy

    The phrase is most likely from "cut the mustard", or not up to the job...
    :)
  • Albus DumbledoreAlbus Dumbledore Posts: 6
    edited 2013-01-07 16:03
    EMHmark7 wrote: »
    You need to get a common ground between the LCD and MCU or the LCD will not work.
    So, link the 2 grounds together.
    Also, make shure you use in the software the pin that is in fact connected to the LCD.
    I use a voltage regelator that creates 5V for the LCD and for the VIN of Quickstart.
    I have put a diode between the regulator output and the VIN.
    As described above, I have a common ground (pin 39 of the QuickStart connected to the breadboard which is common to the ground pin of the LCD and the ground of the battery).

    When you say the diode is "between" the regulator output and the VIN, I am guessing that you're suggesting that the diode is "inline" on the VIN side.
  • Albus DumbledoreAlbus Dumbledore Posts: 6
    edited 2013-01-07 16:19
    Duane Degn wrote: »
    When using batteries, I normally use four AA NiMH. The combined voltage is pretty close to 5V and many 5V devices will run fine from the four AAs.

    9V are good for very low current devices. An LCD with a backlight will likely drain a 9V pretty quickly. You also shouldn't run 5V devices from 9V (as you have found). I'm betting the 9V powered LCD burned out pin 0 on your QuickStart.

    As EMHmark7 said, if you're going to use 9V you'll need a regulator to redece it to 5V. I recently purchased some of these regulators off ebay, they seem to work fine.
    I'm pretty sure the QuickStart originally had the PIN 0 problem. With the original work from when I bought it the last LED was always lit for the button demo. Since the device was new to me I didn't realize that this was a problem. It's entirely possible that the associated button is shorted for all I know. It was only while troubleshooting the LCD problem that I then had a eureka moment and tried a different signal pin.

    I used the 9V battery originally because the specifications indicated that the QuickStart would internally clip the voltage as necessary. I doubt if the LCD immediately drained the freshly-unwrapped battery that I tried during the troubleshooting phase.

    Personally, I'd imagine that two resistors in series could cheaply reduce the nine volts to five volts at a fraction of the cost of the voltage regulator. But if the 9V doesn't have enough current to drive what appears to be a simple LCD then I can't imagine the voltage regulator circuit fairing any better.

    That said, I'll try the 6V (4xAA) route and see if this is any better.
  • cavelambcavelamb Posts: 720
    edited 2013-01-07 19:40
    Alkaline 9 volt battery shows half an amp hour total.
    Fresh out of the wrapper.


    http://en.wikipedia.org/wiki/Nine-volt_battery
  • cavelambcavelamb Posts: 720
    edited 2013-01-08 15:52
    Thought I'd share some foolishness.

    Last night (LATE) playing around with my motor driver circuit I managed to have the battery and USB
    cable both on at the same time. Looks like it blew out the hub, cuz the hub don't work no mo.
    It was a cheapie, true, but I'm glad it was the hub and not the port in the computer!
  • Albus DumbledoreAlbus Dumbledore Posts: 6
    edited 2013-01-19 18:10
    I'm pretty sure the QuickStart originally had the PIN 0 problem. With the original work from when I bought it the last LED was always lit for the button demo. Since the device was new to me I didn't realize that this was a problem. It's entirely possible that the associated button is shorted for all I know. It was only while troubleshooting the LCD problem that I then had a eureka moment and tried a different signal pin.

    I used the 9V battery originally because the specifications indicated that the QuickStart would internally clip the voltage as necessary. I doubt if the LCD immediately drained the freshly-unwrapped battery that I tried during the troubleshooting phase.

    Personally, I'd imagine that two resistors in series could cheaply reduce the nine volts to five volts at a fraction of the cost of the voltage regulator. But if the 9V doesn't have enough current to drive what appears to be a simple LCD then I can't imagine the voltage regulator circuit fairing any better.

    That said, I'll try the 6V (4xAA) route and see if this is any better.
    Due to the fact that my local Radio Shack is only open weekdays (with hours that only cater to the retired and unemployed) it's actually taken me all this time to get to another city's Radio Shack. [/rant] Bought the 4xAA holder and it now works as expected pushing the sample program to the EEPROM and powering it using the pinouts described earlier (PIN 2 instead of PIN 1) by plugging in the 6V battery source.

    Thanks guys.
  • EMHmark7EMHmark7 Posts: 93
    edited 2013-01-20 07:31
    I do not know if it fits your case, but in case, I found that an IO connected to the LCD has its pin to high while not transmitting.
    Also, maybe you already know, the motor needs a diode protection against hihg current spikes it will do when its current is dropping, or when it is stopping.
Sign In or Register to comment.