Po Ting
Well-known member
Questions about Teensy 4.1, MOSFETs, and ON/OFF Button for Battery-Powered LED Project
Hello community,
I have a few questions regarding using MOSFETs and the ON/OFF button with Teensy 4.1.
Previously, I built a battery-powered addressable LED strip project as a Persistence Of Vision (POV) performance device for flow arts.
It was built using a Teensy 3.6 back in 2018:
https://forum.pjrc.com/index.php?threads/posted-venti-pov-v2-0-80hd.53088/
That setup used the Snooze library and a very minimal hardware design (diagram below). By pulling pin D14 low, it achieved a hibernate current of ~100 µA. Probably due to imperfect hand soldering, but still good enough for a lithium battery project.
There were 160 APA102 LEDs in the setup, drawing around ~200 mA when the N-channel MOSFET gate was pulled high and the LEDs were all set to "off."
-----------------------
Now I’m upgrading my setup to use Teensy 4.1, but I’ve run into some issues:
1. Managing hibernation with MOSFETs
The Snooze library doesn’t provide the same support on T4.1, and in ON/OFF mode the controller doesn’t hold GPIO states like the T3.6/LC did.
I tried a modified setup, but with the ON/OFF pin shutting down the board, I still measured ~6 mA of leakage. From some solder/de-solder testing, it seems the leakage comes from the LED strip’s high voltage flowing back through the SPI pins.
I also tried a P-channel MOSFET configuration, but that introduced another leakage path, since the pull-up resistor allowed current to flow through the Teensy.
I don’t have much experience with these power arrangements, so I’d appreciate any references or shared experience from others who’ve solved similar problems.
2. Sharing a switch between GPIO and ON/OFF
I’d like to connect a single switch to both a GPIO pin and the ON/OFF pin, so that:
However, in practice it only works once and doesn’t wake up again properly. Debouncing also seems to be an issue.
Has anyone successfully implemented this kind of dual-use button with T4.1?
3. Controlling ON/OFF via GPIO in software
If I connect the ON/OFF pin to a GPIO somehow, is it possible to simulate a button press in software (pulling the pin low) to power off the Teensy?
4. Other approaches
If there are alternative hardware methods or recommended practices for power management and hibernation on Teensy 4.1, I’d be very grateful to hear them.
Thanks in advance for any insights or advice!
Hello community,
I have a few questions regarding using MOSFETs and the ON/OFF button with Teensy 4.1.
Previously, I built a battery-powered addressable LED strip project as a Persistence Of Vision (POV) performance device for flow arts.
It was built using a Teensy 3.6 back in 2018:
https://forum.pjrc.com/index.php?threads/posted-venti-pov-v2-0-80hd.53088/
That setup used the Snooze library and a very minimal hardware design (diagram below). By pulling pin D14 low, it achieved a hibernate current of ~100 µA. Probably due to imperfect hand soldering, but still good enough for a lithium battery project.
There were 160 APA102 LEDs in the setup, drawing around ~200 mA when the N-channel MOSFET gate was pulled high and the LEDs were all set to "off."
-----------------------
Upgrading to Teensy 4.1
Now I’m upgrading my setup to use Teensy 4.1, but I’ve run into some issues:
1. Managing hibernation with MOSFETs
The Snooze library doesn’t provide the same support on T4.1, and in ON/OFF mode the controller doesn’t hold GPIO states like the T3.6/LC did.
I tried a modified setup, but with the ON/OFF pin shutting down the board, I still measured ~6 mA of leakage. From some solder/de-solder testing, it seems the leakage comes from the LED strip’s high voltage flowing back through the SPI pins.
I also tried a P-channel MOSFET configuration, but that introduced another leakage path, since the pull-up resistor allowed current to flow through the Teensy.
I don’t have much experience with these power arrangements, so I’d appreciate any references or shared experience from others who’ve solved similar problems.
2. Sharing a switch between GPIO and ON/OFF
I’d like to connect a single switch to both a GPIO pin and the ON/OFF pin, so that:
- A short click can be detected as user input.
- A long press would power off (hibernate).
- A short press again would wake the device.
However, in practice it only works once and doesn’t wake up again properly. Debouncing also seems to be an issue.
Has anyone successfully implemented this kind of dual-use button with T4.1?
3. Controlling ON/OFF via GPIO in software
If I connect the ON/OFF pin to a GPIO somehow, is it possible to simulate a button press in software (pulling the pin low) to power off the Teensy?
4. Other approaches
If there are alternative hardware methods or recommended practices for power management and hibernation on Teensy 4.1, I’d be very grateful to hear them.
Thanks in advance for any insights or advice!