Powering through USB without battery attached

(This may have been mentioned somewhere in the documentation)

If you try and use the board from the sample iOS app, without the battery attached (running off the USB port), the LED only works for about 2 seconds and most other functionality doesn't work. I spent about 20 minutes figuring this out. Is this intentional?




  • 1. The LED uses more current than the USB port can provide which can cause the board to "crash" or what ever. If you attach the battery it works fine.
    2. The slow update of the Labels (UI) happens because the call-back-block is not executed on the main thread. If you update the UI on the main thread it changes immediately. The board it self only needs about 0.05s to respond.
  • I've tried using both the USB socket out of my computer and also the Apple 10W iPad charger. I'm very surprised that the LED is drawing that much current!

    It's a very bad idea to update UI not on the main thread, why didn't they just do the following:

    dispatch_async(dispatch_get_main_queue(), ^{});

    You can run the UI updating code in the parenthesis and it runs on the main thread, regardless of where this line is run. 

  • You were correct about the call back being called in a background thread. I've updated the sample code and it is now much more responsive.

    In general it is bad practice and slightly irresponsible to run a callback not on the main thread, and there appears to be no reason not to.
  • Here is a link to the amended DeviceDetailViewController.m  file which runs all UI changes on the main thread using GCD. As said before, the real changes should be to run the callback on the main thread, but for now this should do.


  • edited September 2014
    Yea. When I first ran the sample code I was really disappointed because I thought that it did not work or the board needs way to long to respond. But it actually responds really quickly and I think there is some cool stuff possible.

    [edit] Well, I don't know but maybe the Metawear itself somehow limits the current it draws from the USB-Port in order to not harm it. I'm pretty sure that the LED needs way less than 10W. ;)
  • @tobynextdoor:  For what it's worth I suspect the problem is not with the USB port current draw, as last time I checked USB ports are supposed to allow 500mA @ 5V before limiting the current.  I believe it has more to do with the heat dissipation of the low-dropout (LDO) linear voltage regulator, since unlike a switching regulator any voltage difference between the 5V input and 3.3V regulator output will be dissipated as heat.  Let's assume the LEDs are powered from 3.3V and each color consumes 20mA.  That's 60mA total.  Since the input voltage is 5V and the output is 3.3V we have 1.7V that will have to be dissipated as heat.  (5V - 3.3V) * (.020A * 3) = .1W (or 100mW).

    That's a fair amount of heat to get rid of on such a tiny board, so I imagine it runs for a little bit before the regulator automatically shuts itself down to avoid heat damage.  Kind of annoying, but not the end of the world.  Perhaps in later versions they can either use a switch-mode PSU or at least add a tiny heatsink/ground plane around the regulator.
  • Hey guys,

    We can't power the ultra bright RGB LED off of the USB power alone because the battery recharging circuit can't handle rapidly changing loads such as a 60mA LED switching on and off. If you put a large capacitor on the USB input line then it will work just fine and handle the 60mA instant demand.

  • Thanks for the explanation.

    I can't think of a device being shipped without some kind of battery attached so this should be no problem.
This discussion has been closed.