AnalogRead() seems broken on one pin

Hey everyone. I have a project where I am using multiple pots as input controller with analogRead(). This was working fine since over a year. Suddenly one pot stopped working and analogRead() was returning a steady value of 1022.
So I changed the hardware pot, but this didn't fixed it.
Now I got rid of all the hardware and tested the Teensy 4.0 I am using on its own with this very simple sketch:

Code:
void setup() {
  Serial.println("Test Sketch");


  pinMode(A0, INPUT_DISABLE);
  pinMode(A1, INPUT_DISABLE);
  pinMode(A2, INPUT_DISABLE);
  pinMode(A3, INPUT_DISABLE);
  pinMode(A5, INPUT_DISABLE);
  pinMode(A6, INPUT_DISABLE);
  pinMode(A7, INPUT_DISABLE);
  pinMode(A8, INPUT_DISABLE);
  pinMode(A9, INPUT_DISABLE);
  pinMode(A10, INPUT_DISABLE);
  pinMode(A11, INPUT_DISABLE);
  pinMode(A12, INPUT_DISABLE);
  pinMode(A13, INPUT_DISABLE);
}


void loop() {
  Serial.println(analogRead(A4));
}

No change if I connect the pin 18 to ground (or 3.3V) pin. The value is always 1022. I also tried without the "INPUT_DISABLE" code in the setup() function, this was just to be sure nothing is influencing the analogRead() call.
All the other (analog) pins seem to work as expected -> 0 if connected to GND and 1023 if connected to 3.3V.

What could cause this? Maybe a broken ADC? Did someone already experienced something like this this? And if the ADC is broken, what could caused this?


Best,
Rob
 
If we can see your circuit schematic and/or photo of your layout we may be able to help.
 
Sounds like the pad is fried for that pin. Does it work for digitalRead or digitalWrite ?
 
There is not really a schematic relevant, since the behaviour is the same with just a cable bridging pin 18 and ground. Without any further circuit or hardware.
Or do you mean regarding the question "what could caused a broken ADC"?
My device is a midi controller with just potentiometers on analog pins and some buttons on digital pins. Also I use 2 Pins with 8 WS2812 RGB-LEDs each. Serial Midi IO is used with the schematic provided from https://www.pjrc.com/teensy/td_libs_MIDI.html.
One analog pin is used to read an analog pulse for tempo sync and two digital outputs for standard leds. Everything is hard wired onto teensy pins except for the serial midi in and out port (optocoupler etc.), the two standard leds (resistor to protect the leds) and the sync pulse where I used some resistors to lower the input voltage.

The digital read does not work on this pin either... so something has to be broken on my teensy, right?
 
One analog pin is used to read an analog pulse for tempo sync and two digital outputs for standard leds. Everything is hard wired onto teensy pins except for the serial midi in and out port (optocoupler etc.), the two standard leds (resistor to protect the leds) and the sync pulse where I used some resistors to lower the input voltage.
This is w hat we need to see the circuit for. It's quite possible that the ADC has been damaged by input voltage.
 
Ok, so more then 3.3V on the pin could have caused this? Hm maybe there was a short somewhere... because the pin was only connected to the middle pin of the pot. And the pot itself was grounded and connected with the 3.3V pin. So I don't see where a damage have could come from?
Or is it possible that a high voltage was on another part/pin of the teensy and then the ADC on pin 18 burned through?
 
ESD? induced transient from nearby high voltage wiring? - can happen - its best to protect low bandwidth inputs with capacitors to ground as that will protect against such transients. For a pot input 100nF is going to do nicely.
 
ESD means "electrostatic discharge"?
Hm I have potentiometers on all the analog pins from 14 to 22. So nearby pins should have the same maximum voltage.
One difference could be the pin 23. This one I am using to read an analog pulse signal for tempo sync. I am reading the signal with analogRead() and test if it passes a certain threshold. Since my first try with the sync signal from a groovebox led to a peak reading of 1023, I lowered the input voltage with a voltage divider so that I still have enough headroom not to clip the input (max. reading then was around 900). Maybe I could do this in a more appropriate way? E.g. modular signals will maybe still clip the input since they are usually around 10V so far as I know?!

Thanks for the tip with the capacitor. So I would need a capacitor on the ground connection of every pot?
Perspectively I want to use the 74HC4051 multiplexer for my pot readings. Would I still need a cap for every pot or is a single cap on the ground connection of the IC enough? I found this thread where Paul suggests even no capacitor at all?!
So how likely is it to get a damage by ESD and is it always better to use caps to ground or just in certain cases?

Sorry, that's a lot of questions. I am more a DSP coder then an electronic inc, so I don't have any clue on such hardware stuff. But I really appreciate to learn and getting better here. So thanks for all your help and the advices so far! :)
 
Back
Top