0

Trinket and NEOPixel power consumption
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket and NEOPixel power consumption

by pkclsoft on Thu May 06, 2021 7:00 am

I’ve been trying to build a small motion sensing light for a dark nook in my house. Originally, I started off with a simple Motion sensor PIR similar to PIR Motion Sensor, and just wiring the digital out to a simple LED. That worked, for several weeks happily, but it just wasn’t bright enough.

I had a heap of spare NEOPixels from a cosplay I built last year so I thought I could get more light by putting a Gemma between the PIR and some NEOPixels. The idea was for the Gemma to sense the PIR signal go high, and use that to trigger a fadein-wait-fadeout of the NEOPixels.

I got the prototype working with a Gemma v2, but that board didn’t fit physically in the enclosure so I looked around and settled on a 5V Trinket as it seems to have the same chip and capabilities, but is physically smaller.

The Trinket does seem to behave a little differently, but I did get it working. Once the Trinket based prototype was working via breadboard and wire spaghetti, I soldered it all together.

And to my joy, it worked perfectly… for about 2 days. After that, the lights came on, and just stayed on, and the colour (which should have been white) had changed to a warm yellow.

Power cycling it showed that there was no longer enough power in the batteries to let the Trinket do its thing.

Here is a rough diagram of what I’ve set up:

sensorlight.png
sensorlight.png (128.5 KiB) Viewed 210 times


So what I’m wondering is whether I’m just asking too much of those 3 AAA batteries. I’ve kept all the wires as short as I can, and everything has been soldered. I don’t know whether I should have found a way to tell the neo pixels to turn off when they fade out. I use the .show() function and just set the colour to 0x000000 to turn them off, but does that stop them drawing power?

Is there a better power source that would last a lot longer (given that the enclosure only just fits the 3AAA batteries now)? I can’t afford to burn through 3 AAA batteries every 2 days.

Worst case, I might have to abandon the NEO Pixels and replace them with some other superbright white LEDs, but I’m not sure if that will save me power.

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by dastels on Thu May 06, 2021 12:02 pm

How many NeoPixels?
A white NeoPixel will take ~60mA each. Multiply that by the number of pixels and it adds up quickly.

BTW, setting them to 0x000000 is how to turn them off, so you're good there.

I've never used AAAs to power a NeoPixel project but I suspect that is your problem. Will a big LiPo fit? You can use the LiPo backpack https://www.adafruit.com/product/2124 to easily add a recharging-in-place capability.

Switching to white LEDs will mean 1 unt per LED, but super bright ones are going to need more current per unit, so it might be a wash... depends on the specs of the LEDs.

Dave

dastels
 
Posts: 6498
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket and NEOPixel power consumption

by pkclsoft on Thu May 06, 2021 4:53 pm

Hi Dave,

Thanks for your reply. There are only the 4 pixels.

So that backpack provides the protective circuitry to make using a LiPo safe? I think, yes, I can probably get a LiPo that will fit. They're much thinner than a 3pack of AAA batteries I think. I'll look at the options for that today.

Regards

Peter

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by dastels on Thu May 06, 2021 5:52 pm

It's not a matter of making them safe, per se. It's more about adding a charger: The LiPo will recharge (ok, safely) when USB is connected (just power is needed so a charge/power USB cable will work. Do note:
Ideally, this backpack is for use with the 3.3V Pro Trinkets & ItsyBitsy, so that the battery voltage (3.7V-4.2V) will get regulated down to 3.3V on the board. However, many times, you can run a 5V microcontroller + accessories off of the ~4V from the LiPoly battery with no problem. (Technically its overclocking but we've never seen that affect the microcontroller itself, AVRs are happy to overclock without complaint).


4 pixels will run fine off 3.3v, so using a 3.3v Trinket or a Trinket M0 will work fine.

Also, not the warning on the Trinket page:
Deprecation Warning: The Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Trinket so that people can maintain some older projects, we no longer recommend it.


Dave

dastels
 
Posts: 6498
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket and NEOPixel power consumption

by pkclsoft on Thu May 06, 2021 6:54 pm

That deprecation warning is not something I've seen before, but if I understand it, it makes sense.

I use a fairly new Mac for my work, and I find that with the Gemma V2 I have to use an old USB hub to do the programming. For the Trinket I thought I would have to do the same thing, but it turns out that a simple USBC to USB adapter is more reliable for doing the upload.

That said, I went for the Trinket mainly for the physical dimensions because the enclosure is 7.cm square, so when I have the PIR taking 2.4x3.3cm and the AAA battery pack taking 3.8x5.1cm it didn't leave enough room for much else. I think, if I get the backpack for the Trinket and replace the AAA with a LiPo I'll have more space anyway.

I'd gone for the 5V Trinket because I thought I needed closer to 5V for the pixels. Drat.

Thanks for your help though. I'll look into getting the backpack and a LiPo. This little motion sensing light is getting pricey. It's a shame those off-the-shelf units in the lighting stores don't work very well, but then I guess this is why. You get what you pay for.

Peter

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by pkclsoft on Thu May 06, 2021 7:33 pm

So, if the 4 pixels are drawing ~240mA each time the unit is triggered, for about a minute, and the Trinket is drawing ~50mA (or is it 150?) constantly (that green dot is on 100% of the time), and then the PIR...

Hmm. I've just noted re: the PIR:

Runs on 5V-12V power (if you need to run it off of 3V you can do that by bypassing the regulator, but that means doing a bit of soldering). Digital signal output is 3.3V high/low.


So that reinforces the need for the 5V, though perhaps I can look at that bypass as an option. Still unsure about how much it draws though. So if I round up, and say 90% of the time, the thing is drawing 100..200mA, but then when the lights come on, it's drawing around 500mA for a minute then I start to get some numbers.

I've looked over your uber guide on batteries, but I still get confused about how much to expect from a battery. Energizer sure don't make it easy to find their specs for their AAA batteries. And when I do find them, they're not written for me.

Choosing to get the backpack is the easy bit; choosing a battery with enough capacity to not have to charge it too often is doing my head in. I'll keep hunting for more info. Thanks.

Peter

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by horchnl on Thu May 06, 2021 7:52 pm

Hi,
I have question about power, I know very very little about this really cool stuff. So bear with me please. Can you someway hook up a plug to the neopixels/microboard? Like just have the metal plugs that connect to an outlet? Remove the wire...Of course you would have to have capicitors/resistors built in? Is this possible and do you know where I could find more information on doing this?

Thank you in advance,
Nicole

horchnl
 
Posts: 2
Joined: Mon Feb 22, 2021 10:21 pm

Re: Trinket and NEOPixel power consumption

by horchnl on Thu May 06, 2021 9:58 pm

I want to add an example to my previous post. The example would be like a nightlight.

horchnl
 
Posts: 2
Joined: Mon Feb 22, 2021 10:21 pm

Re: Trinket and NEOPixel power consumption

by dastels on Thu May 06, 2021 10:58 pm

horchnl: please start a new thread for your question. Hi-jacking threads just leads to confusion.

Dave

dastels
 
Posts: 6498
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket and NEOPixel power consumption

by dastels on Thu May 06, 2021 10:59 pm

pkclsoft: I tend to get the biggest one (in terms of mAh) that will fit physically.

Dave

dastels
 
Posts: 6498
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket and NEOPixel power consumption

by pkclsoft on Fri May 07, 2021 12:36 am

Thanks. Settling on the 1200mAh unit. I could possibly fit the 2000mAh but it might be a squeeze.

One thing I note about the backpack is that the 3rd pin on it appears to line up with the PB4 (#4) pin on the Trinket when I thought it would need to connect to the USB pin.

I see now (and I didn't twig earlier) that the backpack is for a "Trinket Pro", not the older "Trinket" I have. So it's not going to mount as easily.

If I mount it on the back of my Trinket, but only use the BAT and G pins direct through, and run a wire from the 5V of the backpack to the USB on the Trinket, is that correct?

Here are the two PINOUT images with how I think it needs to be wired up.

trinket backpack.png
trinket backpack.png (320.93 KiB) Viewed 176 times


Thats of course assuming that the backpack will work with the older Trinket in the first place.

Peter

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by dastels on Fri May 07, 2021 9:21 am

Yes, it won't mount directly on the Trinket. It will with the Pro Trinket or ItsyBitsy boards. It will work find but you'll need to wire it up, at least partially.

Dave

dastels
 
Posts: 6498
Joined: Tue Oct 20, 2015 3:22 pm

Re: Trinket and NEOPixel power consumption

by pkclsoft on Fri May 07, 2021 9:27 am

Thanks. That gives me the confidence to move forward then.

Peter

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by pkclsoft on Thu May 13, 2021 8:36 am

I'm pleased to report that so far, all is looking good. One day down after the initial charge of the battery. I'm really pleased with how easy it was to wire up the backpack. Great job.

pkclsoft
 
Posts: 12
Joined: Thu May 06, 2021 6:36 am

Re: Trinket and NEOPixel power consumption

by dastels on Thu May 13, 2021 8:51 am

Glad to hear it!

Dave

dastels
 
Posts: 6498
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.