Powering Teensy 4.0 using a rechargeable 3.6V NiMH battery.

cheeft

Member
I am using a 3.6V, 80mAh NiMH battery to power my teensy 4.0. How can I connect this to the board in a way which allows for charging through the USB port? I would also like to include functionality allowing the microcontroller to read the amount of charge left in the battery so that an LED can indicate when the battery is running low.

Does anyone have any ideas for this?
 
Teensy 4.0 consume about 100mA@600MHz, your battery will be empty in less than 1 hour.
Is this battery able to output 100mA ????
3.6V seems low to connect to Vin
 
Hi Angelo,

I have tried connecting the battery and it powers the microcontroller fine, without overheating. Low battery life does not concern me.

Do you know how I would enable charging through the USB port and reading the remaining charge left during discharge?
 
You could always buy one of these. Cut the link on the underside of the Teensy (see pic below).
Feed the USB 5V side voltage to the input of the UPS (Uninterruptible power supply) card and the 5V output from the UPS card to the other side.
Connect up your battery, and common all the earths (you will probably find the the i/p and o/p earths on the UPS card are already common) and off you go.
The USB input will go to the UPS, and the output of the UPS will power the Teensy. Easy Teensy....sorry couldn't not do that!!!
 
I am using a 3.6V, 80mAh NiMH battery to power my teensy 4.0. How can I connect this to the board in a way which allows for charging through the USB port? I would also like to include functionality allowing the microcontroller to read the amount of charge left in the battery so that an LED can indicate when the battery is running low.

Does anyone have any ideas for this?

There are some possible approaches discussed in <this> thread.

Hope that helps . . .

Mark J Culross
KD5RXT
 
If you want something that is made to be soldered to a Teensy consider this. You will have to cut the solder connection underneath the Teensy that connects VIN and VUSB:
Alternatively if you what to use a second USB port for charging the battery consider these products:
The adafruit board hooks up a 3.7 lipo battery and provides JST output that can be hooked to VIN/GROUND. The Seeed product takes the battery and produces 5v that can be plugged into the Teensy's USB port. Both of these can charge batteries faster. But you likely want to use batteries with at least 1,200mAh capacity.

<edit>
And the thread that kd5rxt-mark posted also contains my recommendation for the Adafruit featherwing adapter, which works best for Teensy 4.0 due to the size (Teensy 4.1 needs to be mounted taller or underneath the board). If you want to use the featherwing adapter for featherwings, there are some addition caveats I can point you to.
 
There are nice LiFePO4 cells (3.3V, upto 1000mAH in CR123A size for instance). Perfect for powering 3.3V logic as they only charge up to about 3.6V and have a pretty flat discharge curve as well as 1000's of charge cycles.
 
If you want something that is made to be soldered to a Teensy consider this. You will have to cut the solder connection underneath the Teensy that connects VIN and VUSB:
Alternatively if you what to use a second USB port for charging the battery consider these products:
The adafruit board hooks up a 3.7 lipo battery and provides JST output that can be hooked to VIN/GROUND. The Seeed product takes the battery and produces 5v that can be plugged into the Teensy's USB port. Both of these can charge batteries faster. But you likely want to use batteries with at least 1,200mAh capacity.

<edit>
And the thread that kd5rxt-mark posted also contains my recommendation for the Adafruit featherwing adapter, which works best for Teensy 4.0 due to the size (Teensy 4.1 needs to be mounted taller or underneath the board). If you want to use the featherwing adapter for featherwings, there are some addition caveats I can point you to.
Thanks, however I am using a NiMH battery as linked in the original post - I am relatively new to electronics so I am not sure if this makes a difference. Just to clarify, is there no way of doing this without making additional purchases?

Charging through the USB port is ideal, but not essential. The only essential aspect is that the battery and other components will be contained in sealed housing for the drumsticks and the charging mechanism must be able to connect to the battery externally. If this requires one or two small wires to protrude from the drumsticks that would be fine (although ideally the physical contacts would be flush with the housing).
 
Thanks, however I am using a NiMH battery as linked in the original post - I am relatively new to electronics so I am not sure if this makes a difference. Just to clarify, is there no way of doing this without making additional purchases?

Charging through the USB port is ideal, but not essential. The only essential aspect is that the battery and other components will be contained in sealed housing for the drumsticks and the charging mechanism must be able to connect to the battery externally. If this requires one or two small wires to protrude from the drumsticks that would be fine (although ideally the physical contacts would be flush with the housing).
I didn't notice it was a NIMH battery, the various chargers I mentioned only work for lipo batteries.

You need some sort of charger for the battery that works with NIMH batteries. If you don't have a charger laying about you would need to buy an appropriate charger. Given the battery's capacity is 80mAh, I would imagine your runtime with a Teensy won't be that long. You can try to run the Teensy at a slower clock rate, but ultimately the Teensy 4.x does need more power compared to other microprocessors.
 
I didn't notice it was a NIMH battery, the various chargers I mentioned only work for lipo batteries.

You need some sort of charger for the battery that works with NIMH batteries. If you don't have a charger laying about you would need to buy an appropriate charger. Given the battery's capacity is 80mAh, I would imagine your runtime with a Teensy won't be that long. You can try to run the Teensy at a slower clock rate, but ultimately the Teensy 4.x does need more power compared to other microprocessors.
I am considering getting a lipo battery to work with this charging module. I am not sure which battery to purchase though, do you have any suggestions?
 
BTW NiMH cells are about 1.3V, so that pack will be 3.9V nominal. The old NiCd cells that NiMH replaced were 1.2V, and everyone seems to have pretended that NiMH are the same, which isn't the case. So the pack should fare OK connected to Vin I reckon.
 
I am considering getting a lipo battery to work with this charging module. I am not sure which battery to purchase though, do you have any suggestions?
IIRC, since those chargers charge at 1A, I think you want a battery with at least 1,000mAh of capacity (but it would be helpful to find a FAQ that goes in the details). When I'm making costume props, often times an issue is will the battery fit in the space. One thought would be to get 16650 batteries and a single cell 16650 holder. You can dispense with the holder if you are willing to solder the wires straight to the battery (which I'm not). These are lipo batteries in a round form. One place other than electronics stores to look for them is vape shops.

Note, it can be hard to order batteries via mail order, since there are various restrictions on mailing batteries. For example, I live in the USA, but my normal mailing address is a US post office box. However, I can't have batteries sent there, so I have to use the street address, and risk the package being lost or mis-delivered. I don't know how people in Alaska, Hawaii, or Puerto Rico get batteries, since within the USA, batteries tend to be required to be ground shipping only.
 
No, don't use one of those, it uses a TP4056 chip. It's charging cycle get's confused if you are taking current out at the same time as you are charging the battery.

The one I showed you is a proper UPS (uninterruptible power supply) which uses an ETA9640 chip. The data sheet is here.
18650 cells are available with capacities of 2Ah and up to 3.5-4Ah. You could use your hand all day without having to re-charge it.
Again I would suggest you use one of these (with an 18650, or similar). It's so easy to connect to the Teensy, it takes care of charging your battery and providing 5V for the Teensy.
 
Below is a suitable connection diagram. Don't forget to cut the USB power supply tabs where shown by the PJRC Teensy 4 card.
z.png
 
Perfect, I have ordered some of those modules. I have heard that lithium cells are more dangerous than NiMH, will they definitely be suitable for a build that will likely take lots of impacts?
 
I would have thought that the battery would have been robust enough.
It is a steel tube after all.
If you are concerned you could use something like this.
I think they are primarily intended for stopping inadvertent shorts.
You could put the battery in a larger diameter tube with some foam between the battery and the outside of the case, but personally I would not bother.
Just make sure that the battery CANNOT be shorted and use a good quality battery.
I buy from these people. They seem to know a lot about batteries.
If you buy on a Friday (FogStar Friday) you can get a 20% discount.
 
I would have thought that the battery would have been robust enough.
It is a steel tube after all.
If you are concerned you could use something like this.
Though as the ad notes, that particular case will not hold 18650's with the button top. The button top prevents the battery from being over-charged or depleted. If you are using 18650's in a larger enclosure that provides the protection, you don't need it for the original battery. But in general for using them in projects, I tend to prefer to always use batteries with protection.
 
Yes, but if you use a charge control module as was suggested overcharging is not a problem. You do however have to ensure that discharge current is not too high, but again the module takes care of that. It also takes care of discharging to a too low voltage, cutting of the output at something like 3V.
 
Okay, great. I have purchased a few of these batteries as well as a few UPS charging modules. Does anyone know how I could send information to the teensy 4.0 telling it how much charge is remaining in the battery? I have got a 3-state LED which I would like to change colour depending on how much charge is left.

Thanks again for everyone's help so far.
 
You can read the battery voltage. Here also, the voltage on the analog pins should not be above 3.3V.
And as Li-ion batteries can go up to about 4.2 volts at full charge, you will need a resistor based voltage divider.

Angelo
 
Back
Top