Teensy 4.1 apparentl powered by 3V on pin 14 / A0

samygee

Member
Hu guys,
first post here so I hope I do everything correct! :)

What I am trying to do:
I'm working on a cool project (audio guestbook) utilizing teensy4.1 with an audio shield.
To power the arduino I use a 18650 battery shield that I "link" in to the USB cable that is pluggin in to the teensy.
To monitor the battery status I additionally connect the 3V bus from the battery shield with Pin 14 on the teensy, from which I read the Voltage with analogRead.
This works perfectly on several systems that I built.

Ground is connected to: Charger/PC via teensy's usb port, battery shield, teensy Gnd pin, some led's, some push buttons
5V goes like this: Host (charger/PC via cut open USB cable) -> battery shield input // battery shield 5V output -> switch -> back to cut open USB cable to teensy

What happens:

Somehow on one system the teensy seems to get powered by the cable leading to Pin 14!
When I unplug the USB cable from the teensy, the battery shield is still connected to Ground on the teensy and it's running!
I measure 3V at the teensy's 3V pin and 2.8V on the 5V pin.
And when I remove the cable from pin 14, the teensy has no power.

To me this is really weird, especially as this exact setup (I could not find any mistakes that are different then the other systems I built before) has been working fine on other systems!

Any ideas on what to check for or what might have gone wrong with this system? :)
 
Samygee:
A picture is worth a thousand words, a Schematic diagram of your entire circuit would be most helpful for us to help you.
Perhaps a snapshot of your setup would also be most helpful.

Regards,
Ed
 
I suspect you might be using one of these:-
Battery charger and holder.JPG
If you are a number of points come to mind;
(1) you cannot use the 3.3V output as an indication of battery condition. That voltage is generated by a buck/boost converter from the battery voltage.
(2) You should NEVER supply power (voltage) to a Teensy I/O pin when the Teensy is NOT powered. That is a sure way to damage the pin/Teensy which is what I suspect you have done.

If you want to detect battery state (voltage) you need to take a tap off the battery/battery terminals.
That voltage will range from 0v (dead flat and useless battery) and 4+ volts.
Now the maximum input to the Teensy I/O pins should NOT exceed 3.3V, so you will need a potential divider.
33k and 18k should produce a suitable divider: Battery V - 18k - 33k - Gnd.

The junction of the 18k - 33k resistors will go into the Teensy pin.
With those values the potential divider will consume between 63uA and 83uA.

We still have the problem of voltage going into the Teensy pin when the Teensy is NOT powered,
It may be that the 18k will limit the current going into the Teensy. I cannot guarantee that, Paul would be your better arbiter on that.

In order to ensure that there is limited voltage going into the Teensy pin you could have a diode going from the pin to the 5V supply.
If the 5V supply goes to 0V the diode will pull down the voltage going into the Teensy pin, limiting it to the voltage drop across the Diode.

I am sure there are others that are more qualified to answer this question than I. I am not a trained EE, just a self taught ee.

Teensy pin protection.png
 
What happens:[/B]
Somehow on one system the teensy seems to get powered by the cable leading to Pin 14!
When I unplug the USB cable from the teensy, the battery shield is still connected to Ground on the teensy and it's running!
I measure 3V at the teensy's 3V pin and 2.8V on the 5V pin.
And when I remove the cable from pin 14, the teensy has no power.

To me this is really weird

This is phantom-powering, happens in CMOS chips due to the ESD protection diodes, and can destroy a chip if you are unlucky - never have live signals connected to a powered-down chip (unless there are series resistors to limit the current to a mA or less, or other protection circuitry).

Search terms relevant are "phantom power CMOS" and "CMOS latchup".

If the current is high enough that pin's input protection circuitry can get fried. And sometimes high currents can put the entire chip into CMOS latchup which can fry the whole thing.
 
Hey guys, great replies all of you, thank you! :)

I am glad, you were able to understand my built and that I didn't have to draw a schematic diagram - I have never done this before with software :-D

I am using exactly this battery shield and found a supplier that advises to use the 3V bus as an indirect way to monitor the battery voltage, as the voltage drops at the 3V bus also, when the battery is exhausted.
It is working really well for me, I must say!
I am just having this phantom power (strong enough to power the teensy) on one of the 6 systems causing me problems.

So it seems, this situation is a bit above my knowledge but I am eager to learn.

->Is there a component/circuit that I can use to block the current from the pin whenever the teensy is not powered on purpose?
Can I use the 5V main current that powers the teensy with a component/circuit to enable the current to the pin? What would be the simples component/circuit to accomplish that?
 
I am using exactly this battery shield and found a supplier that advises to use the 3V bus as an indirect way to monitor the battery voltage, as the voltage drops at the 3V bus also, when the battery is exhausted.
Looking at the data sheet for the LDO used the minimum input voltage to the 3.3V regulator varies dependant upon current load. This minimum input voltage can be anything between 3.375vV and 3.980V, so the 3.3V output may start reducing when the battery voltage is down to 3.98V. At that voltage the battery still has a lot of power available. The usual cut off voltage used is reconned to be between 3.2V and 3V. Lion batteries MUST not be taken less than 3V. If they are they may/will never recover.

->Is there a component/circuit that I can use to block the current from the pin whenever the teensy is not powered on purpose?
Can I use the 5V main current that powers the teensy with a component/circuit to enable the current to the pin? What would be the simples component/circuit to accomplish that?
The circuit I showed will protect the Teensy input pin. If the 5V supply is removed the input will be pulled down to the voltage at the 5V input pin. If NO 5V then 0V (less the Diode forward voltage).
 
I don't know why but the voltage divider did not work as expected. Even between two 10kOhm resistors I could measure the full voltage provided by the battery.

So I ended up just putting a single 10 kOhm resistor between the battery plus and the teensy pin I use to measure the voltage (3v bus still).
That works perfectly so far. Prevents any phantom powering from happening but I can measure the voltage reliably on the teensy.

Thanks for your help everyone! :)
 
I ended up using an other battery module that has a higher charging current.
This module has no 3V bus so I am trying to measure the voltage directly at the battery as you suggested.

With a voltage divider consisting of 2x 10k resistors I measure half the voltage at the junction.
But with the teensy attached, the voltage somehow increases to 3.3V

Is it because I did not include the diode to teensy's 5V pin yet?
 
I ended up using an other battery module that has a higher charging current.
This module has no 3V bus so I am trying to measure the voltage directly at the battery as you suggested.

With a voltage divider consisting of 2x 10k resistors I measure half the voltage at the junction.
But with the teensy attached, the voltage somehow increases to 3.3V

Is it because I did not include the diode to teensy's 5V pin yet?

Please give a photo of your wiring and your current code.
 
Guys, I think I figured it out!

Pin A0 aka Pin 14 was apparently used by the audio shield as S/PDIF-out as well.
So I tried pin A2 and configured it as INPUT_PULLDOWN and that gives me the desired result! :)
It shows close to 0V if nothing is attached. And when I attach the cable from the voltage divider it gives me the correct voltage.
 
Back
Top