Detecting battery charge levels from Pixelblaze?

Let’s just say I had really really (silly) large current requirements for a wearable and I wanted to power it off “raw” (no BMS) remote control car LiFePO4 batteries. Two 3S packs. Are enough analog pins exposed on the Pixelblaze to plug six cells into? What if I want to use the sensor expansion board also? Is there a voltage reference on the ESP? Can I get “low level” enough inside the Pixelblaze environment to do things like this?

Or would it be best to offload this to another microcontroller? I’m having a difficult time finding a breakout board that can handle this for me.

I’ve powered some wearables off moderate-sized hardpacks (5Ah). I decided to use a BMS-type solution (well, just an annoyingly loud balance port buzzer).

There are 5 ADC pins available on recent hardware (Pixelblaze v3.6 Standard) and 5 more available via the sensor expansion board. If you’re looking to monitor individual cell voltage, you’ll need a voltage divider on each to not go over the 3.3V max for each ADC pin. You may wish to calibrate it once and derive a curve, as I’ve read the ADCs on ESPs are nonlinear near the extremes.

Then there are additional GPIO pins that you could use to trigger a hard disconnect via a N.O. (fail-safe) relay. Maybe you’d use a temporary pushbutton to bootstrap the relay closed for startup… There may be a smarter way to latch this in on and off states.

I think one significant downside to this approach, and the main reason I’d go with an external micro, is that you’d need to copy-pasta the battery monitoring code into every pattern you want to use.

I’m curious what you are planning! How do you intend to use them? With a 3S pack, I’m guessing you are doing 12V LEDs? Most work fine to around 9V. Otherwise you’ll need buck converters for the LEDs. You’ll need one for the PB either way.

If you are using buck converters keep in mind they will continue to drain the battery unless there’s a BMS of some kind to cut off the power under a voltage threshold. Even with everything “off,” it could be enough to over discharge things if left for some time.

You could dedicate a micro for this, then you’d be reinventing a BMS :laughing: If you just need undervoltage protection, maybe you don’t need a full blown BMS, and could get something with just the protection features since you’d be charging them externally.

Maybe something like this would work?

https://www.aliexpress.us/item/3256803152979471.html

If you want a low voltage indication in Pixelblaze, like to dim or flash a warning or something, I think monitoring the full 3S output would be sufficient. To do that you’d only need 1 analog input, or 2 if you are using the packs independently. You’ll want a voltage divider to drop the voltage down to the 0-3.3V range. Looks like a 3S would be max 10.95V. I’d drop it by 1/4th for easy math and some headroom.

The ESP32 in Pixelblaze is run at 3.3V, as long as there’s sufficient voltage to power it, so any ADC reading will be (roughly) on that scale. As @jeff mentions the ESP32 ADC isn’t the best, but should be fine for a low voltage indicator assuming you can tune the threshold as needed.

Here’s a graph for example:

esp32_ADClinearity

source

The ADC on the sensor board is much better, if you already have one I’d use that, but I wouldn’t get one just for the extra accuracy.

1 Like

The rough shape of it is something on the order of 1600 “pearl” pixels split across 8 strings, to fill a whole expansion board’s outputs. I’ll buck the ~12V down to 5V with a couple of Murata OKL2-T/20-W12 DC-DC converters (if I can find the bastards, they’re not in stock anywhere.) That’s a total of 160W plus losses, so I need batteries that can supply a lot of current. I know I’m not going to run it at any more than a tenth of that unless I’m showing off to one of you guys but If It’s Worth Engineering, It’s Worth Over-Engineering :stuck_out_tongue_winking_eye:.

I don’t really need a BMS because I’ll have a separate balance charger, but I want to make sure I don’t damage the batteries. I asked r/batteries but they don’t seem to think anything sub-BMS exists, aside from the low-voltage buzzers you use on an RC plane but that’s no good to me in front of Mayan Warrior. That thing you linked might be OK but they’re large and tricky to mount.

I want to give myself the option of using LiPo or LiFePO4 (less explodey) because Burning Man and you never know what’ll be available. So that suggests doing it in software.

I also want to use the sensor board because it looks cool—when it’s connected, how many pins do I have free on the Pixelblaze? You’re probably right that I only need to monitor the whole pack voltage and not individual cells if they’re going to be balanced externally every charge. So that’s two pins on the sensor board if I want an accurate reading; but that means I need to mount the sensor board inside the power control box which will be stashed in a pocket in the inside back of the jacket. Not a big deal but it means I miss out on the built-in mic, light sensor and the best of the gyro. And I need to run wires for the brightness pot and various other controls to another box I can hold in my hand—I assume that works fine?

I really wish there was a convenient “belt” based battery system for wearables. I always struggle to place a pack that’s both big enough, but not too big to make everything bulky. A belt with pouches that you can add or remove capacity to would be so amazing that then has multiple output points to do power injection on a wearable…

My jacket was custom made for me and has pockets all around the inside in which I house the batteries and electronics. It also has two flaps with Velcro closures running around the bottom hem, through which I run ground straps that I use as flexible “bus bars”. I bolt spade terminals to it to connect the strips.

A bandolier of 18650s would work, too :joy:.

2 Likes

I just find that batteries in jackets add weird weight to it in places I probably don’t want it. It then doesn’t flow like fabric should :frowning:

Yeah that’s fair, but I find for this particular piece it’s already got a kilo or two of LED strings/strips in it so the batteries don’t make much difference.

A deconstructed fanny pack might be a good jumping off point? Add in support for insertable packs.

Oh, maybe? I just have never tried to make my own battery packs and have no idea where I’d start with that. I’m sure it’s doable, but I just started learning 3d modeling and printing, this kind of learning will have to wait.