Help with Gemma and Micro-Lipo Charger for a wearable

Wearable electronics: boards, conductive materials, and projects from Adafruit!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
project_zero
 
Posts: 86
Joined: Tue Sep 10, 2013 11:22 pm

Help with Gemma and Micro-Lipo Charger for a wearable

Post by project_zero »

Hi there,

I am making a wearable crown for a friend and plan to put a strip of dotstar LEDs in it. The goal is to be able to plug the crown in and recharge it using a USB-C cable. I'm hoping to have charging integrated into the crown (and never have to unplug the battery, charge it, and plug it back in).

I am planning to use:

1. Micro Lipo Charger (product id 441)
2. Adafruit Gemma
3. 3.7 500mah battery
4. Dotstar LED strip, ~.75m (~20-30 pixels)

The problem is making sure all of these components can play together. I'm having a hard time figuring how to use the lipo charger, the gemma, and the battery all together. Gemma does not have a battery in, so you must use JST. But I want to have my battery plugged into the micro lipo charger. Can I plug my battery into my lipo charger, then solder a JST cable to Vbat and GND and use that to plug Gemma in? And then, for my dotstars, I will solder from D0, D1, Vout, and GND on Gemma to the Dotstar strip. I have made a rough diagram.

Image

Two questions:

1. Will this work? Does it appear correct?
2. Where would you recommend I put a switch? I am thinking on the Vbat line between the charger and gemma.

Thank you for your help.

User avatar
michaelmeissner
 
Posts: 1822
Joined: Wed Aug 29, 2012 12:40 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by michaelmeissner »

I've been down the road of portable projects and charging and I have done a number of different things, some that worked and some that don't.

There are 3 schools of thought with recharging batteries:

Use the USB connection on the microprocessor to charge the battery. This works best for microprocessors that have a built-in charger (or one that is easily attached). The classic case is the Feather system where all feather boards will charge the battery if you plug in the USB cable. But other possibilities include any of the QT PY boards with the charger BFF attached, or the ItsyBitsy with the Pro Trinket/ItsyBitsy lion/lipoly backpack soldered on.

I believe you should be able to use the QT PY BFF charger with the Gemma, connecting Dout on the Gemma to 5v on the BFF, and ground to ground.

My main issue with this method is when I'm doing a multiple day convention, I often want to take off the gadget and turn off the lights and charge it overnight (and not have it flash all night). Typically, when you use the USB to charge the battery, it powers the gear. If I'm using a Teensy, there is a special charger that fits under/over the Teensy, and with cutting a solder trace, the USB power goes to the charger, but depending on the switch, it will/will not power the Teensy.

Put a separate USB connection on the battery and connect the charger to that. This helps in that you can turn off the gadget, but still charge the battery overnight (either with a switch like the Gemma has, or by having a switch between the battery and microprocessor). There are some 3rd party chargers that do this. I've done this a few times, particularly with one of my goggle setups with the Gemma M0.

Remove the battery and charge it separately. I've come to hate the JST connector. I've had times where it is hard to remove the battery, and a few times, I've broken the cords in trying to get it out.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by adafruit_support_bill »

Your circuit should work as drawn.

User avatar
project_zero
 
Posts: 86
Joined: Tue Sep 10, 2013 11:22 pm

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by project_zero »

Thank you Michael and Bill! Michael, I did not notice until your comment that the Gemma has a switch on it. Thank you for pointing that out.

Bill, do I need an external switch in my circuit or is the switch on the Gemma adequate? Also, when I plug my wearable into USB-C to charge, will I need to turn off the Gemma first using its switch, or will it not matter whether the Gemma (and the LEDs) are on or off for charging?

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by adafruit_support_bill »

You can use the switch on the Gemma. With just the Gemma, it would not be necessary to turn it off while charging. But with 20-30 pixels attached, you may be drawing more current than the MicroLipo can supply, so you would still end up with a net discharge.

The Micro Lipo can charge at a maximum 500mA. 30 pixels can draw as much as 1800mA at full intensity white. (which is about twice the maximum safe discharge rate for the battery!)

Most practical applications would draw considerably less than that. I'd recommend a read through this guide for tips on efficient battery utilization.
https://learn.adafruit.com/sipping-power-with-neopixels

User avatar
project_zero
 
Posts: 86
Joined: Tue Sep 10, 2013 11:22 pm

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by project_zero »

Bill, it is funny that you shared this, and I just finished putting together a table to calculate how many hours of battery life I could eek out of these dotstars. I read that guide many years ago and it's always been a guide for me maximizing my light based projects. I am trying to hit 5 hours, which is tough with a 500mah battery. I also have your 1200 mah battery but of course its size profile makes it more tricky. A few things:

1. I have modified my design and am only using 17-18 pixels
2. These are replacing a former version which only used fairy lights, so I'm hoping I can go for very low dotstar brightness and still be doing better than the former design. I will likely push the brightness down to 10-20% in my code.
3. I will usually be shifting through red, green, blue, and fun patterns (snaking, etc) to limit how many pixels are on at one time.

I am hoping that, doing all this, 6ma per pixel is a reasonable guess (my minimum column) and that I can eek out 4.5 hours of battery life. Do you think this is too optimistic? If I'm pushing the bounds of optimism, I can see if it's possible to contain the 1200mah battery in my design.

Batteries, man! They're tough.
battery life orion.jpg
battery life orion.jpg (158.15 KiB) Viewed 252 times

User avatar
michaelmeissner
 
Posts: 1822
Joined: Wed Aug 29, 2012 12:40 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by michaelmeissner »

While it is useful as a rule of thumb for calculation, I tend to find that there are too many ifs, ands, and buts that you can't just plug things into a spreadsheet.

While the battery has a capacity printed on it, that is only a guideline. IIRC, as a battery ages, the capacity will go down. Similarly if it is used in high temps, the battery capacity will go down over time. Running the battery in colder weather will use more power. Depending on the gear, you might get less power due to voltage conversions. Some chargers likely will not top off batteries to get the most capacity. And if you are using non-Adafruit batteries, not all battery makers are honest about the capacity.

If your microprocessor can vary the speed and if you run the microprocessor at a slower rate, you likely will run a bit longer. Using different microprocessors can also affect the power usage.

Different neopixel colors use different amounts of power. So if your gizmo is displaying mostly blue, it might be a slightly different power usage than if you displayed mostly red, and if you are displaying white on a RGB neopixel, that will use even more power. As you run it, vary the power level for the colors and see if it is still visible, but the unit will run longer.

So while spreadsheets are useful for planning (and I use them), it helps to actually build the thing and see how much power is used. One thing is just to run the unit with your intended battery, and see how long it runs before the battery is depleted. Going to a higher level, there are various meters to tell you the power usage either at a given instant, or via a graph over time to show the usage.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by adafruit_support_bill »

The numbers are probably 'in the ballpark'. But you really need to test it out to (a) see if the color & intensity meet your needs and (b) see what the actual current draw is.

For best battery life, you will want to charge and discharge at or below the 'standard' rates listed in the battery datasheet. This avoids overheating the battery which causes it to degrade at a faster rate.

If 500mAh does not get you enough run-time, LiPo cells do come in many sizes. Once you know the actual current draw in use, you should be able to calculate the minimum size that gives you the necessary run-time.

User avatar
project_zero
 
Posts: 86
Joined: Tue Sep 10, 2013 11:22 pm

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by project_zero »

Thank you Bill, I will plan to do a test in the coming weeks using the gemma, my 500mah battery, and 18 dotstar pixels running approximate patterns in my approximate desired intensity. I will see how long until the system powers down.

For this particular project, I imagine 750-1000 would be a sweet spot, and I worry I may be pushing it with only 500mah. I would love if Adafruit had a lipo back in between 500 and 1200mah. I hope to maybe see that in the future.

How would you recommend I measure the current draw? Is there a recommended ammeter or adafruit product well suited for this purpose?

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by adafruit_support_bill »

If you don't already have a multimeter, I highly recommend getting one. They are indispensable tools for electronics projects of all kinds.
https://www.adafruit.com/?q=multimeter&sort=BestMatch

This guide shows how to measure current with a multimeter:
https://learn.adafruit.com/multimeters/current

User avatar
michaelmeissner
 
Posts: 1822
Joined: Wed Aug 29, 2012 12:40 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by michaelmeissner »

In general, I have't seen a perfect meter for this type of situation. I've seen a lot of meters that have features that measure part of what I want, but not the home run type of meter that does everything.

What I would like to see in the perfect meter for li-po battery projects:
  • Have direct female plug for lipo battery input and male plug for output, along with 5.5mm x 2.1mm, USB micro-B and USB C input/outputs. Some of the meters that I've seen don't have lipo support, but they do have the other formats, and you could wire up a lipo female plug to 5.5mm x 2.1mm plug, and vice versa.
  • Have a separate power input for the meter itself. This way it is more accurate, so that you are measuring the actual power of the project, and not have the meter itself consuming power. Also many of the meters that don't have a separate power input limit themselves to 5v and higher because the screen takes that much power. With separate power, you can also let the device run over night, and see when it ultimately quit.
  • Have support for graphing the results over time, instead of just showing you the current numbers.
  • In addition to graphing, have a bluetooth output to an Android phone, and have the app do the graphing. Having the app save the numbers in a CSV file would be nicer. But even if it doesn't do the save, at least having a screen capture can allow you to see the power over time.
  • Ditto for USB output in a form that I can read on a Linux Fedora system.
Here are 2 meters that come close:

User avatar
michaelmeissner
 
Posts: 1822
Joined: Wed Aug 29, 2012 12:40 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by michaelmeissner »

There is this battery monitor that you could incorporate into your sketch, or possibly run it on a second microprocessor and connect the grounds between the two: Or you can build your own meter with using a separate microprocessor to measure the input:

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by adafruit_support_bill »

. . . What I would like to see in the perfect meter for li-po battery projects:
While those are all nice to have features for measuring and monitoring power consumption of battery powered projects, a multimeter is a versatile, general purpose tool. It should be at or near the top of anyone's list of essential tools for electronics work.

https://www.adafruit.com/product/136
Image

User avatar
project_zero
 
Posts: 86
Joined: Tue Sep 10, 2013 11:22 pm

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by project_zero »

Amazing news. I set up my whole system on my benchtop like you recommended, Bill. And I put my multimeter in line to measure the current - in 14 years of hacking I realized I’d never actually used my multimeter to measure current.

Image

Image

I found that at ten percent brightness I was actually only pulling about 55ma. This was with 18 pixels and Gemma M0. This would give me 10 hours of battery life, meaning each pixel was actually only pulling about 3ma, better than I could have hoped for. I did a lot of experimentation and found that I could increase my brightness to setBrightness(50) before I reached about 80ma, which I set as my limit because I want 6 hours of battery life.

Of course there are caveats here. This was on a purple color. When I set my pixels to full white, I needed to drop down to a brightness of 20 to stay under 80ma (but it looked so bright on full white - our vision of brightness is definitely nonlinear too).

I set my strip to a shifting kaleidoscope and then a strand test run, to find that generally speaking, keeping my brightness at 50 or below had me comfortably at or below 80ma for 18px when running various patterns. If I decide to have a full white mode, drop it to 20.

Overall, excited that I can handily get away with the 500ma battery after all. I’ve definitely learned there’s no excuse for not measuring your current. And that the 60ma per pixel is a huge factor of safety - maybe if you’re blasting each pixel at full brightness on white - and that, very generally speaking, you can probably assume a tenth of this or less, if your brightness is below 75 or so.

Thank you.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Help with Gemma and Micro-Lipo Charger for a wearable

Post by adafruit_support_bill »

The 60mA per pixel is a generous 'worst-case' estimate. It assumes 20mA per channel at full brightness times 3 channels. In practice the actual value for full-intensity white is typically closer to the 55-58mA range per pixel. But if you are driving things to the max, you want to have a bit of a safety factor for your power supplies.

These numbers are also based on a 5v power supply. Powering with 3.7v, you can expect slightly less current draw.

"Purple" is 2 channels active. And at 10%, you would expect it to be a little less than 4mA per pixel at 5v. Since you are powering with 3.7v, 3v sounds reasonable.

But measuring is always a good idea. If your measurements are too far off from your expected value, there is a good chance that there is a problem somewhere. Either in your circuit or in your design assumptions.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wearables”