Digistump Forums

The Digispark => Digispark Pro Support => Topic started by: MichaelMeissner on August 09, 2014, 06:48:33 pm

Title: Digispark Pro VIN vs. VCC
Post by: MichaelMeissner on August 09, 2014, 06:48:33 pm
I don't think I asked this before.  Sorry if I did.

I like to use Adafruit neopixels (ws2812b based LEDs) that are fairly picky about voltage (3.5-5.3v).  I blew out one of my Digisparks, when I attached the VCC line to power two 16 LED neopixel rings (I was powering it via USB).  Now, I keep the voltage low (typically ~ 75mA) by limiting the power on each led to 30 (sum of red + blue + green power levels).  Evidently it was too much for the Spark.  Other micro-processors that I use, have had a big enough regulator, that small amounts of lights are possible from the 5v pin (or 3.3v if the processor is 3.3v and I'm powering it from a li-poly battery).

Assuming I'm powering the Digispark Pro via a USB port (i.e. a phone charger battery), would I be able to plug into the VCC line?  If not, if I'm powering it via USB, does VIN get 5v in this case?  I assume that since the Pro has a 500 mA LDO regulator, it would be safe to use VCC if I'm putting 6-16v to VIN, but it isn't clear about the case when it is being powered by USB.

On the Uno, the 5v pin by-passes the regulator, so you get as much current as the USB connection provides.  On the Teensy 3.x, there is a 500mA regulator between VUSB and VIN, which is ok for my use (but the 3.3v signals need to be level converted if you use 5v power).  On the Pololu A-star LV, the step-up/step-down regulator can provide up to 1A of 5v power.  On the Gemma, VOUT gives you the direct power before the regulator, and the 3.3v pin gives you 150mA of regulated power.  On the Trinket, you have a pin that gives you the USB power directly, and you can draw up to 150mA directly.

I know when you power hundreds of lights you need to pay more attention to power issues.  But for just a few lights for a wearable costume, having to have 2 power sources, is a drag.
Title: Re: Digispark Pro VIN vs. VCC
Post by: gogol on August 11, 2014, 05:48:54 am
Hello Michael,

seems that you are mixing up different things.
Quote
Now, I keep the voltage low (typically ~ 75mA)
First voltage is measured in VOLT [V] and current in AMPERE [A].
Next, when we speak about the current you can draw from different 5V sources:
A plain USB 2.0 port delivers 100mA and can deliver up to 500 mA, when allowed by the host controller, which needs USB protocol interaction to do so. 

No microcontroller can deliver more current, than the uplink USB can deliver. I don't know any microcontroller, where there is an  regulator between USB +5V and the +5V line of the board, as that makes no sense.

However each board has some kind of protection between USB +5V and +5V:  The Digispark has a simple diode, which makes sure, that current can only flow from USB to the board, but never reverse for those situations, where the spark is connected to Vin as an additional source.
The UNO for example uses an  MOSFET transistor, which disconnects the line from USB in thise situations. I addition there is a resettable fuse in the USB line.

The Digispark PRO has now in addition to the Diode an resettable fuse. That fuse makes the board hopefully a little bit more stable, as the diode was very sensitive to shorts.  I assume, that this was the culprit in your cases as well.

In the teensy there is also only a 500mA fuse between +5V USB and the board: https://www.pjrc.com/teensy/schematic.html

The pololu has as well no regulator in between: http://www.pololu.com/docs/0J61/all#3.2  there is the similar MOSFET as switch, like in the UNO.

There is no reliable way, to get more than 500mA out of USB, in many cases it is less.   There are many tricks out, like Y-cables and other stuff, which is all against the USB standards and rises the risk of damaging the USB host device.

10 WS2812B are in most cases no problem with a good USB port,  with higher numbers you need to use external power.
Title: Re: Digispark Pro VIN vs. VCC
Post by: MichaelMeissner on August 11, 2014, 07:39:50 am
Fair enough, I tend to see the world through a software lens, and I'm sometimes hazy on the electrical details.

I realize you can't get assume you can get more than 5v power at 100 mA or so from USB.  What I'm trying to do is realize how to hook things up so I can use a single power supply and drive both microprocessor and a small number ws2812's (32 in my case).  Yeah, I should have in the description put in 5v whenever I was talking about mA.  In any case, I limit the power of the ws2812's so I can power 32 leds at 5v with 70-80 mA of power, which allows me to use USB to power the setup without additional batteries.

On the Teensy I can hook up a li-po battery to vin/ground, and connect the leds to 3.3v power, and things will work.  Or I can hook up 5v power either through the USB or through vin/ground and use a level shifter to get the data communication to 5v.

On the Gemma, I hook up a li-po battery to the JST connector, and connect the rings power to the Vbat pin.

On the Uno, I need to use a USB cable to provide 5v power from a phone charger battery, and I hook the rings power line to the 5v circuit.  Or I use 7.5 - 9v power via the 5.5mm connector, and still use the 5v pin.

I'm trying to understand how I would connect up a Digispark Pro.  If I use USB power, I presumably could use the VIN pin to power the ws2812 leds.  But if I'm powering the chip via the VIN pin, and it is more than 5v, can I use the VCC pin to power the neopixels?  Most of the time, I will be using the li-po shield, but one of my planned setups uses 9v for other things, and I would want to hook up the Digispark Pro to the 9v.

As I said, with the original Digispark, it blew the fuse when I tried this setup, and I wanted to make sure I could set up the Digispark Pro with a single battery (preferably a USB phone charger battery).  If I can't do it simply, I likely will use the Digispark Pro less, and use other processors more.
Title: Re: Digispark Pro VIN vs. VCC
Post by: gogol on August 12, 2014, 05:01:59 am
Quote
I realize you can't get assume you can get more than 5v power at 100 mA or so from USB.
That is the defined minimum, you can always expect. In most cases you can expect more, however 500mA is that value, you should not exceed, as that could break host devices with insufficient protection.
That is the reason, that most controller boards have some protection on board, protecting the USB host from pulling to much current.

If you need more current for your peripherals, you should go for an external power supply. That can be a USB phone charge battery (make sure, that the chosen one has no current limitation as well), a power supply or whats-o-ever.
Connect that to +5V of the board and to the peripheral, and you are all set!

The problem is, that you need to create a own connection cable, which will feed the +5V pin and not the +5V USB.  As long, as you are feeding power through the USB socket, you have the restrictions through the USB protection devices in your power supply.
In that case the maximum current is limited through your power-source alone.

Once you are connecting a higher voltage source than 5V to Vin,  you are again limited to the current of the on-board voltage regulator.

Hope that this helps.
Title: Re: Digispark Pro VIN vs. VCC
Post by: MichaelMeissner on August 12, 2014, 06:38:23 am
That doesn't really answer the question.  I know for higher amps, I need to do special cables, chargers, etc.  However, I am intentionally limiting the power I'm drawing to be 5v and 75mA, so I shouldn't need special cables, etc.

The question is can I pull 5v and 75mA out of the 5v pin without causing the Digispark Pro to self destruct without using special wiring, etc.?  Given the two common wiring setups (5v via USB, more than 5v via VIN pin), what is the recommended method of wiring in both situations to get 5v and 75mA of power.
Title: Re: Digispark Pro VIN vs. VCC
Post by: gogol on August 12, 2014, 11:52:52 pm
Hmm, looks like, than I don't understand the question.
From my point of view the answer is clear:  If you can always expect 5V 100mA from any USB host, the question for +5V 75mA should be covered, as: 75mA < 100mA.

Title: Re: Digispark Pro VIN vs. VCC
Post by: DeuxVis on August 13, 2014, 03:00:52 am
I've been powering 3 or 4 (can't remember exactly) of those RGB leds, plus the digispark sending'em instructions, from a laptop usb port. They were spitting out full white brightness for some time (minutes), which is around 60 mA each led from my measurements.

So I'd assume you are vastly safe if you only draw 75mA.


As an alternative you could use a "usb battery" like this one (http://www.amazon.com/gp/product/B0084Y47SK) (but feel free to look for different models, there are many).
It would decouple your circuit from the laptop, make it portable while still using only the digispark usb port for power.
I've run a dozen of WS2812 - displaying a demo moving rainbow pattern - and a digispark from this kind of battery for more than an hour and nothing went hot.
Title: Re: Digispark Pro VIN vs. VCC
Post by: MichaelMeissner on August 13, 2014, 05:33:41 am
Gogol: boiled down, the question is can I assume I can draw 75 mA from the 5.5v pin (assuming I have appropriate power to the Digispark Pro).  Since I blew out a Digispark in the same setup, I thought I would ask to be sure I could do it with the Digispark Pro without risking letting the magic smoke go.  When I posted the question, I hadn't dug deep enough in the KS posting to notice it has a 500 mA LDO to regulate voltage, I would actually hope I can draw out up to 400 mA if I have a power supply that delivers an appropriate amount of current.

DeuxVis: I have several batteries that provide USB level output like the one you mentioned, plus li-poly batteries, multi-voltage batteries that provide a USB output plus regulated voltage up to 12 volts, 9v non-rechargeable batteries, and AA battery packs up to 8 cells.  Which I use depends on various other circumstances.

For example, I have one setup where I have a squirrel finger puppet that is dressed like an artist, and her canvas is a small lcd that is fed from a security camera, and the camera/lcd prefer 9-12v over 5v, so there I would prefer to power the micro-processor with 9v, so I have a single battery supplying both parts.

On the other hand, for smaller costume pieces like my steampunk goggles or bow-tie, I tend to prefer li-poly batteries because the batteries are so small compared to an AA battery pack or USB cell phone charger.  I'll have to see whether the li-po shield adds too much bulk to be usable for a small piece.

While I can wire up a digispark programming tool (http://digistump.com/products/42 (http://digistump.com/products/42)) or similar to have additional lines for raw power, I would prefer to keep things as simple as possible (more components means more things can break, and in a costume the more separate components there are, the more likely one is going to become separated by the end of the day due to vibration).

As I said, I do have batteries that provide 2 power levels, but those tend to be big and heavy.  I tend to prefer having one battery, since it is simpler to replace the battery, while if I have multiple batteries, you have to determine which battery has become drained to replace, and with multiple batteries, it means you need to carry spares for each battery.

In terms of the 5v batteries meant for charging cell phones, I have several of these, but the newer ones seem too smart, in that they will automatically cut off if the 'cell phone' (i.e. micro-processor) is not drawing enough energy (or it doesn't identify itself as a phone).  I've seen circuits like this that fools these type of batteries by using a spike of power every so often to fool the battery to stay on (but not enough that it drains the battery faster): http://www.dorkbotpdx.org/blog/paul/battery_pack_load (http://www.dorkbotpdx.org/blog/paul/battery_pack_load)
Title: Re: Digispark Pro VIN vs. VCC
Post by: gogol on August 14, 2014, 01:20:51 am
@Michael:  The original digispark is capable driving 500mA without problems, when the USB host can provide it. I had several setups, where I used it just plugged in to a USB-battery.  However I killed the protection diode in 4 sparks, all in setups, where I was sure, that low currents where connected.  I assume, that this happened through    inadvertent shorts during setup.
The PRO has a polyfuse in row to the diode, and I tested that working OK by shortening the 5V behind.   However I have currently only the one beta device, and see still problems with the USB-voltage, as described here: http://digistump.com/board/index.php/topic,1455.0.html

Erik should be able to tell more about his tests and maximum values, he designed the PRO for.
Title: Re: Digispark Pro VIN vs. VCC
Post by: MichaelMeissner on August 14, 2014, 04:44:17 am
@Michael:  The original digispark is capable driving 500mA without problems, when the USB host can provide it. I had several setups, where I used it just plugged in to a USB-battery.  However I killed the protection diode in 4 sparks, all in setups, where I was sure, that low currents where connected.  I assume, that this happened through    inadvertent shorts during setup.
Thanks.  That is disheartening news.  Oh well, I'll hope for the best.
Title: Re: Digispark Pro VIN vs. VCC
Post by: dougal on August 14, 2014, 06:40:59 am
Instead of worrying about powering other stuff through the Digispark Pro, why don't you just feed power directly from the battery (assuming you're using a 5V battery, or close-enough)? Or, if you want to use other voltage levels, you could always get a tiny little buck/boost board (https://www.tindie.com/products/BBTech/tps61200-power-step-up-converter-booster-v1/?pt=directsearch) to bypass the DPro's power circuitry, and still power the controller and the NeoPixels from one battery.
Title: Re: Digispark Pro VIN vs. VCC
Post by: MichaelMeissner on August 14, 2014, 08:18:56 am
I've been resisting doing it, because it makes the controller package bigger, since I can't just plug in a battery directly to the controller and connect wires, etc.  Like this picture of my steampunk goggles using a Gemma and a li-poly battery:
(http://www.the-meissners.org/2013-small-albums/2013-electronics/small/2013-12-30-02-12-005-steampunk.jpg)

I likely make a little power platform: