My wish list for a future teensy - A lipo charger with battery disconnect

niteris

Member
First off I want to say that I'm an avid teensy user and I love these little chips.

I've been using the lilypad recently because it has an integrated Lipo charger. However they forgot to add a low power disconnect and the device will just drain the lipo until it's dead. I don't know why this isn't a solved problem.

My wish list for a teensy is a low power version with a battery disconnect in a small form factor. It could ideally charge through the existing USB port. Using the snooze library would result in ~1u doze power usage.

To get around this I have to glue on a secondary lipo charger and fly wire it to make it work. Or else use disposable batteries (NIMH destroys itself if it's discharged to 0 in series).

Am I the only one that fantasizes that someone will could make this one day?
 
I have wanted batteries in so many different ways, that it would be hard to have a 1 size fits all configuration.

If you aren't aware of it, a forum member (or previous forum member) designed a charger that is made to solder on to the bottom or top of a Teensy and provide charging:
  • https://www.tindie.com/products/onehorse/stbc08-high-current-lipo-battery-charger/
  • You need to cut the solder pad between VIN and VUSB. The switch on the front controls whether the Teensy gets powered. If the USB has power, it will charge the battery if needed, even if the power switch to the Teensy is cut. Usually this is what I want, since I often make cosplay units, and I can charge the battery overnight without having the unit running all of the time.
  • You can choose via solder pads whether you want to charge the batteries at 300mA, 500mA, or 800mA. Smaller batteries need smaller charge current, while bigger batteries won't be fully charged over night with a small current.
  • The JST plug is not connected by default. You have to solder it into place. In practice, I have to be real careful in attaching and removing the battery, as I have ripped the JST plug off of the unit.
  • If you have the Teensy in a stacked setup, it can be hard to fit in the charger.

If you are using the Teensy 4.0 or 3.2, you can use the Adafruit Teensy feather adapter, which include a charger, and it uses A7 with a voltage divider to allow you to crudely measure how battery capacity is left. You can also use the Teensy 4.1/3.5/3.6, if you use stacking headers, or mount the Teensy underneath the feather adapter.

Adafruit also has two other chargers that aren't made directly for Teensy, but you can use them with the appropriate wiring:

Seeed makes a combination battery charger and voltage booster. You plug a USB C cable into the USB socket, and it recharges the battery. You use a standard USB A to micro-B cable to provide power to the Teensy. This is nice for times when you want 5 volts. However, because it is boosting the power, you do get less runtime.

I also like the little chargers I get from ebay. They are the right size for gluing to the back of the bigger batteries. I often will also solder in a switch so I can turn off the battery. I keep meaning to attach these to more batteries. Then I can charge the battery with the USB plug on the battery, and I don't have to worry about getting power from the Teensy.

Over the years, some issues that I've seen with built-in charging:
  • As I mentioned earlier, you have to balance how much current is used to charge the batteries based on the batteries you intend to use. Most units are fixed, and a lot are on the low side (100mA or 200mA). That is great if you want to use 500mAh batteries or smaller, but I often times start at 1,200mAh batteries.
  • Not every place wires batteries the same way. I tend to use the Adafruit standard for wiring, but several batteries I've ordered from Amazon have the ground and power wires switched ports. I have to cut the battery cable and re-solder in a more standard connector.
  • I've come to hate the JST connector. I find it hard to remove (but hey, it is less likely to come out, like DuPort jumper wires might). If I've attached a JST plug by soldering, the force of removing and attaching the battery can over time yank the socket out of the board. Sometimes I just switch to use DuPont stacking headers (using scotch tape to keep things connected). I've also thought about using audio cables or 5.5mm x 2.1mm cables for connecting the battery.
  • I've had to rewire batteries every so often, as the solder connecting the wires comes out. A big reason is sooner or later, the battery will fall out the board and be hanging by the cable.
  • If you use something like a AA/AAA battery holder with 3-5 batteries, you have to make sure this never gets connected to a circuit that tries to recharge the battery.
 
Hm, I am not sure, if Paul should start adding peripheral features to the Teensy that are completely unrelated to the CPU and its environment. You need a Lipo Charger, another one needs a little piezo speaker, someone wants a step motor driver and the next a little microphone. Why isn't there a 6N138 on every RX Pin, so that we could directly connect de-coupled midi (a feature I have on over 90% of my Teensy Projects, but I assume the majority wont need). Why do we have to add an audio shield to the teensy, when Paul could add the codec chip to the Teensy itself? Why isn't there a LCD driver directly on the board, so we could use displays without them in our projects? Wouldn't it be awesome if there were at least 4 high quality DACs on the board? I cannot remember the last time I did a Teensy-Project without the need of multiplexing IO. It would make my projects a ton more easy, if there were a few multiplexers directly on the Teensy. But wait, how should Paul know what multiplexers I need, and what if the next person would rather use a shift register instead? What do I do, if Paul adds a Battery charger for 1S with a charge rating of 100mA, but I need 12V in my project somewhere, go with 3S Battery, maybe even quite big, and 1S charging with 100mA wouldn't help at all? Or maybe still 1S but the 100mA charging that might be perfectly for your project, is way to low for mine?

You see where I am going to: I am sure nearly every single person would like to have different peripheral on the teensy. So the simplest solution is to focus on what is directly related to the CPU and its directly related components (like memory, IO like USB etc), keep the costs as low as possible for the board, and let the maker decide what additional stuff is needed and choose what specification it should have.

For me personally, I would rather love to see more IO available, bring back USB Device Connection etc. than "wasting" space on the board for features a lot of projects won't need but everybody has to pay for. And while it is somewhat awesome, that there is USB, SD etc. on board already, when it comes to designing my PCB and start integrating the Teensy into my project, I feel that having all this on the board puts a lot of limitations into the design (It is hard to make USB and SD Card available in projects that are bigger than the length of the board without extension cables). I would sometimes love to have more available juice on the 3.3V line, but as Teensy is designed to manage the power regulation and prefers to not get powered on the 3.3V pins, it is not really possible to use an external one.
If I could name a wish: I would love to have a teensy, where as much as possible IO is available as headers, because adding connections to those solder-pads is awful in a project. Like, 5.0 in small, 5.1 in big, 5.x in big, but without all the additional stuff, rather add a second row of pins :p

For Battery management, if you dont already know:

Teensy already comes with everything you need to add an external battery with charging to your project. On the bottom of the board, where the USB Connector is, are 2 rectangle pads with a small connection between them. By cutting it, you disconnect VBUS from VIN. That way, USB-Power doesn't connect automatically to the voltage regulator on the Teensy. Now connected the VBUS Pin to the IN-Pad of the charging/bms-board of your choice, connect the VIN Pin to the OUT-Pad of the board (make sure you have one that delivers 5V) and connect the Battery of choice to the Battery Pads of that board.
And the awesome part of that is: YOU can device what batteries you choose, how much power is used for charging, maybe even use your own circuitry on a custom PCB for that project.
 
Teensy already comes with everything you need to add an external battery with charging to your project. On the bottom of the board, where the USB Connector is, are 2 rectangle pads with a small connection between them. By cutting it, you disconnect VBUS from VIN. That way, USB-Power doesn't connect automatically to the voltage regulator on the Teensy. Now connected the VBUS Pin to the IN-Pad of the charging/bms-board of your choice, connect the VIN Pin to the OUT-Pad of the board (make sure you have one that delivers 5V) and connect the Battery of choice to the Battery Pads of that board.
And the awesome part of that is: YOU can device what batteries you choose, how much power is used for charging, maybe even use your own circuitry on a custom PCB for that project.
That is assuming you want to do the necessary soldering and such. Using the feather system from Adafruit, I can just go to the drawer and pick out a random battery, and attach it to the feather without having to do any soldering. That is convenience. I often times reuse Teensies and batteries, moving them from one project to another (I generally have the Teensy either with male header pins or stacking headers, and I move to a new prototype board or just breadboard). There it becomes useful to have batteries with standard connectors and having the battery port on microprocessor.
 
That is assuming you want to do the necessary soldering and such. Using the feather system from Adafruit, I can just go to the drawer and pick out a random battery, and attach it to the feather without having to do any soldering. That is convenience. I often times reuse Teensies and batteries, moving them from one project to another (I generally have the Teensy either with male header pins or stacking headers, and I move to a new prototype board or just breadboard). There it becomes useful to have batteries with standard connectors and having the battery port on microprocessor.
I get that. I would be extremely useful for me (who has not soldered a single Teensy onto something yet because I do the same) to have at least 2 or three octocoplers and multiplexers on the controller because I use them on nearly every project. And it is totally not convenient to add an Audioboard to most of them, so it is extremely useful to put the audio codec chip on the board too. :)

I have the feeling, you are not getting my point: what is useful for you (or for me) is not useful for everyone. I for example have not a single Teensy connected to a battery currently. So why pay money for charging, connectors etc?
There are no sensors, buttons, encoders, potentiometers, displays etc on the Teensy, so for most projects you have to do some kind of soldering/PCB design anyways, or at least some breadboard work.
 
@MichaelMeissner (joined 2012) has lots of exp making it work with needed addons ... see list in p#2 - and noted Feather system p#4. The @OneHorse LiPo addon (open of p#2) was new with the T_3.1 it seems.

PJRC's Teensy is small and cost effective without stuff that doesn't break that, while maximizing the MCU's hardware with dense PCB with underside pads and even extending as needed: T_3.5,3.6,4.1.

Especially in these days of hard-to-get parts - i.e. T_4.1 with No Eth when that chip went unstocked, and PCB redesign for essential parts. Adding anything non-essential could stop production.
 
I get that. I would be extremely useful for me (who has not soldered a single Teensy onto something yet because I do the same) to have at least 2 or three octocoplers and multiplexers on the controller because I use them on nearly every project. And it is totally not convenient to add an Audioboard to most of them, so it is extremely useful to put the audio codec chip on the board too. :)

I have the feeling, you are not getting my point: what is useful for you (or for me) is not useful for everyone. I for example have not a single Teensy connected to a battery currently. So why pay money for charging, connectors etc?
There are no sensors, buttons, encoders, potentiometers, displays etc on the Teensy, so for most projects you have to do some kind of soldering/PCB design anyways, or at least some breadboard work.

Sure, everybody has different needs, but it is always a balance. If the machine is so stripped down, then new people won't consider using it. I suspect in general, the cost of adding charging and such is fairly small. But the OP was asking a question about battery usage, so I was answering them/him/her what my experience in battery powering Teensys.

As I said, I tend to use prototype boards that I plug the Teensy into. If something changes, I can always wire up a new prototype board (or use a breadboard for short term use). Or if I burn out a Teensy, i can swap to use a new one fairly simply. I also go further in that I often swap displays, so I have a standard wiring for SPI devices, and then I make a display specific cable that plugs into the standard output. My latest design brings out the 2 SPI ports, 2 I2C ports, 2 I2S ports, 4 pins that are level shifted for WS2812B/APA102 LEDs/PWM, and 4 serial ports.

However in terms of usage, I wish in the original design, the VUSB pin, program pin, VBAT pins, and ON/OFF (or DAC) pins had been part of the standard pins brought out to the edges rather than being inside or rear pins. But that is a trade off, in that 4 pins would need to be eliminated from the standard pins.
 
There are common features and there there are niche features. Power is a common feature that everyone using portable electronics must address. Conflating this with niche features like a driver motor or piezo speaker that the vast majority of users don't use, muddies the water.

Wearable electronics makers need a solution for small power usage scenarios. Truly large power usage scenarios already have a solution: simply connect it to one of those 5v USB batteries with its own power logic to protect the battery. I've done this several times for musical instruments used on stage. The power reservoir is so huge that I don't even bother to reduce the MCU power usage or use a power mofset on the addressable leds strips (helps in preventing auto-shut off too). Additionally, those big projects are typically custom one-offs and I'm totally okay with the additional work required to get these working properly. With wearables, I want to make them in batches. So the category here is not supporting large batteries, it's supporting the small ones.

Wearable electronics can also design around power constraints. I can reduce the LED count or brightness. EL wire I can shut off the power. With those new tiny string LEDS in the Adafruit nOODz, I can reduce the PWM or add a resistor. All of these projects though all have the same problem: power. Power power power power. It's a problem I face over and over again. I can't even solve it by using NIMH batteries either since those will get wrecked too when in series. The lilypad would address this issue IF it had included a battery disconnect feature. But it doesn't. And it will just wreck the lipo as it constantly drains the battery to 0v if the user forgets to shut it off after use. Yet despite this fatal flaw of wrecking the battery, the Lilypad remains a very popular micro.

Wearables also don't need to support a bunch of charging speeds. 100mA is perfectly sufficient. Large batteries don't take that much larger to charge due to chemistry specifics. You could replace a 120mA lipo pack with a 240mA lipo back and the charge time difference wouldn't be +100%, it would be more like +50%.

So I totally disagree with the analysis that if Teensy were to address this, then this would result in feature creep. Everyone in the wearables space has the exact same problem and no good solution. One micro that solves this would really fix the wearable space - yet no one is doing this. It could even run on the 328p or 32u since the computation power necessary for wearables is pretty small. I really liked the Teensy LC because of the doze library but it seems this micro might not come back in stock until 2024.
 
There are common features and there there are niche features. Power is a common feature that everyone using portable electronics must address. Conflating this with niche features like a driver motor or piezo speaker that the vast majority of users don't use, muddies the water.

Yikes, well, one person's common is the next person's niche. I see a good number of posts about low-power applicatipons, but far more that are not, including lots of motor control, audio, etc. Perhaps there could be a survey, but I don't have the impression that portability, let alone wearability, is a common aspect of Teensy applications. Aren't there platforms out there that are more targeted at low power, even more so than Teensy LC?
 
Aren't there platforms out there that are more targeted at low power, even more so than Teensy LC?

There are NO Arduino solutions that charge a LIPO and have a battery disconnect during the depleted battery state. The Lilypad USB is the closest thing but the lack of undervoltage battery disconnect will result in a wrecked battery unless the user remembers to shut off the power every time they stop using the device. Lilypad is about 8mA with the bare board so the user has about 12 hours to shut off the device or the battery is going to go into the danger zone. Even if the MCU shuts down via a low-power library the FTDI USB -> Serial will still consume 4mA, according to forum posts that I haven't verified.
 
I have wanted batteries in so many different ways, that it would be hard to have a 1 size fits all configuration.

If you aren't aware of it, a forum member (or previous forum member) designed a charger that is made to solder on to the bottom or top of a Teensy and provide charging:
  • https://www.tindie.com/products/onehorse/stbc08-high-current-lipo-battery-charger/
  • You need to cut the solder pad between VIN and VUSB. The switch on the front controls whether the Teensy gets powered. If the USB has power, it will charge the battery if needed, even if the power switch to the Teensy is cut. Usually this is what I want, since I often make cosplay units, and I can charge the battery overnight without having the unit running all of the time.
  • You can choose via solder pads whether you want to charge the batteries at 300mA, 500mA, or 800mA. Smaller batteries need smaller charge current, while bigger batteries won't be fully charged over night with a small current.
  • The JST plug is not connected by default. You have to solder it into place. In practice, I have to be real careful in attaching and removing the battery, as I have ripped the JST plug off of the unit.
  • If you have the Teensy in a stacked setup, it can be hard to fit in the charger.

If you are using the Teensy 4.0 or 3.2, you can use the Adafruit Teensy feather adapter, which include a charger, and it uses A7 with a voltage divider to allow you to crudely measure how battery capacity is left. You can also use the Teensy 4.1/3.5/3.6, if you use stacking headers, or mount the Teensy underneath the feather adapter.

Adafruit also has two other chargers that aren't made directly for Teensy, but you can use them with the appropriate wiring:

Seeed makes a combination battery charger and voltage booster. You plug a USB C cable into the USB socket, and it recharges the battery. You use a standard USB A to micro-B cable to provide power to the Teensy. This is nice for times when you want 5 volts. However, because it is boosting the power, you do get less runtime.

I also like the little chargers I get from ebay. They are the right size for gluing to the back of the bigger batteries. I often will also solder in a switch so I can turn off the battery. I keep meaning to attach these to more batteries. Then I can charge the battery with the USB plug on the battery, and I don't have to worry about getting power from the Teensy.

Over the years, some issues that I've seen with built-in charging:
  • As I mentioned earlier, you have to balance how much current is used to charge the batteries based on the batteries you intend to use. Most units are fixed, and a lot are on the low side (100mA or 200mA). That is great if you want to use 500mAh batteries or smaller, but I often times start at 1,200mAh batteries.
  • Not every place wires batteries the same way. I tend to use the Adafruit standard for wiring, but several batteries I've ordered from Amazon have the ground and power wires switched ports. I have to cut the battery cable and re-solder in a more standard connector.
  • I've come to hate the JST connector. I find it hard to remove (but hey, it is less likely to come out, like DuPort jumper wires might). If I've attached a JST plug by soldering, the force of removing and attaching the battery can over time yank the socket out of the board. Sometimes I just switch to use DuPont stacking headers (using scotch tape to keep things connected). I've also thought about using audio cables or 5.5mm x 2.1mm cables for connecting the battery.
  • I've had to rewire batteries every so often, as the solder connecting the wires comes out. A big reason is sooner or later, the battery will fall out the board and be hanging by the cable.
  • If you use something like a AA/AAA battery holder with 3-5 batteries, you have to make sure this never gets connected to a circuit that tries to recharge the battery.

Thanks for the links. I investigated every single one and there is no mention of a battery disconnect for the low power state. My guess is that this is because they don't exist, which has been my experience. Most of the chargers on ebay/amazon suffer the same problem. But I just got some in today that advertise this so I hope they work, but each one requires I do re-work to bring the charging rate down from 1A to 100mA.
 
Last edited:
Thanks for the links. I investigated every single one and there is no mention of a battery disconnect for the low power state. My guess is that this is because they don't exist, which has been my experience. Most of the chargers on ebay/amazon suffer the same problem. But I just got some in today that advertise this so I hope they work, but each one requires I do re-work to bring the charging rate down from 1A to 100mA.

Seems properly monitoring the voltage from the battery and shutting down is the option.
 
Here is an article on adding charging for batteries. It's an interesting and enlightening read.

Yup, this is great. What's surprising to me is that the chargers want to bring the battery to the limit of 4.2 volts. I've gone down this rabbit hole and determined that 3.9 or 4.1 volts would be sufficient. The safety profile is better, the cycle length is better, and I don't see how a charger could continue to pump current into a battery if the voltages are equal. I can imagine that it's possible for a charger to pump charge into a battery at 4.2 volts if a side reaction is happening and the battery wants to float back down to say 4.1. But maybe someone smarter than me can tell me I'm wrong.

On a side note, I've been talking with people on Reddit about this problem and someone who seems to know what they are talking about says that a lot of battery protection circuits are cutting off the battery at 2.75-2.85 volts. YIKES! They said that even 3.1v is too low unless the battery is going to be immediately charged and recommended the battery cut-off be 3.3v if the battery will be stored in that depleted state for at most, weeks at a time.

https://www.reddit.com/r/arduino/comments/134u73k/comment/jijk3hl/?utm_source=share&utm_medium=web2x&context=3
 
They said that even 3.1v is too low unless the battery is going to be immediately charged and recommended the battery cut-off be 3.3v if the battery will be stored in that depleted state for at most, weeks at a time.
On the system I am designing (...for a long time now!!) I was intending to use battery power until the on-load voltage had dropped to 3.2V, then go into Snooze mode having warned the central control that the battery needed charging.
 
If you were boosting the lipo battery, pololu as a series of step-up/step-down boosters that either have a fixed 3v minimum input, or you can adjust the minimum voltage with a potentiometer. I bought a few of the regulators with a fixed 3v input a few years ago, but with the global parts shortages the price has gone up:

 
If you are using the Teensy 4.0 or 3.2, you can use the Adafruit Teensy feather adapter, which include a charger, and it uses A7 with a voltage divider to allow you to crudely measure how battery capacity is left. You can also use the Teensy 4.1/3.5/3.6, if you use stacking headers, or mount the Teensy underneath the feather adapter.

Hi there,

I'm working on the audio guestbook from https://www.youtube.com/watch?v=dI6ielrP1SE&t=684s and I would like to have it battery powered. I'm using the Teensy 4.0, which accepts 3.6V to 5.5V on Vin. I'm leaning towards using the Adafruit Feather adapter you mentioned since it seems like I can get everything else I need from Adafruit and save on shipping. I've noticed they also have this 5V booster/charger https://www.adafruit.com/product/1944 and I'm wondering if it is fine to stick with the 3.7V or if there are any reasons/functions to make sure I supply 5V to Vin.

Thank you.
 
Hi there,

I'm working on the audio guestbook from https://www.youtube.com/watch?v=dI6ielrP1SE&t=684s and I would like to have it battery powered. I'm using the Teensy 4.0, which accepts 3.6V to 5.5V on Vin. I'm leaning towards using the Adafruit Feather adapter you mentioned since it seems like I can get everything else I need from Adafruit and save on shipping. I've noticed they also have this 5V booster/charger https://www.adafruit.com/product/1944 and I'm wondering if it is fine to stick with the 3.7V or if there are any reasons/functions to make sure I supply 5V to Vin.

If you boost a lipo battery to 5v, you will lose power in doing the boosting, so your ultimate run time might be less.

Thank you.

It really depends on what else you are hooking up, and whether they need 5v power. For example some devices (servos, older displays, older neopixels) really, really want 5v power. For audio devices where you are powering the speaker from VIN, you should be able to get louder volume with 5v as compared to 3.7-4.2 volts you get from lipo batteries. But sometimes 5v is problematical (with older neopixels if you powered them with 5v, they could not properly read the data signal unless you boost the signal.

While I have read lots of posts about it, I have not looked in detail was the audio guestbook needs.

In my projects I go all over the place in terms of batteries. A lot of times I will use lipo batteries (sometimes with a charger built-in, sometimes not), but I have come to hate the JST plug and the way the power wires are just soldered to the battery, since I have pulled off JST sockets, and had the wires come off of the battery. At other times, I use a USB power bank to power the gizmo. A few times, I have wired in an 18650 battery (similar power to lipo, but it tends to hold more power). A few other times, I use a 4 AA cell holder. So I can't really say what you should use.
 
It really depends on what else you are hooking up, and whether they need 5v power. For example some devices (servos, older displays, older neopixels) really, really want 5v power. For audio devices where you are powering the speaker from VIN, you should be able to get louder volume with 5v as compared to 3.7-4.2 volts you get from lipo batteries. But sometimes 5v is problematical (with older neopixels if you powered them with 5v, they could not properly read the data signal unless you boost the signal.

While I have read lots of posts about it, I have not looked in detail was the audio guestbook needs.

In my projects I go all over the place in terms of batteries. A lot of times I will use lipo batteries (sometimes with a charger built-in, sometimes not), but I have come to hate the JST plug and the way the power wires are just soldered to the battery, since I have pulled off JST sockets, and had the wires come off of the battery. At other times, I use a USB power bank to power the gizmo. A few times, I have wired in an 18650 battery (similar power to lipo, but it tends to hold more power). A few other times, I use a 4 AA cell holder. So I can't really say what you should use.

Thanks a lot. It does seem like the whole battery situation is less than straightforward but I have a decent starting point.
 
LiFePO4 cells are 3.2V with a pretty flat discharge curve, much easier to work with I think, and significantly safer than LiPo
 
Back
Top