Is one of my pin dead ?

I'm trying to test my board pins, because of some I2C errors I've been having, and I think I found a potential cause :
I'm using an Arduino Pro Micro 3.3v, and I'm testing pin 2 and 3, the one for using the I2C.
Pin 2 seems to be working, it display seemingly correct results.
Pin 3, on the other hand, seems to be bugged : it doesn't seem to send anything, because the analogRead of Pin 9 doesn't change in correlation with whether it's connected to it or not. Could I have found the issue ? Or is it just something simple that I'm missing ?

Here's the code I'm using :

void setup() {
  pinMode(3, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(9, INPUT);
  Serial.begin(9600);
}


void loop() {
  digitalWrite(3, HIGH);
  Serial.println(analogRead(9));
  delay(200);
  digitalWrite(3, LOW);
  Serial.println(analogRead(9));
  delay(200);
}
1 Like

Are you looping A9 to D3? Schematic please and/or nice clear pics. Hand schematic is best please.

image
I'm connecting 3 to 9, yeah

I see the prob! you're connecting pin 6 to pin E! LOL
Have you tested all the other pins, is this the only one? If yes, is there anythingbelse wired in? If no, sounds like a fail. Got another unit yo test with? Does it behave same or different?

Serial.println( digitalRead(9) );

I was thinking that a resistor and led between pin and GND could test one IO at a time while the code blinked them all. Set the GND end and move the other, resistor end from pin to pin watching for blinks. If you would do them all at once, get resistors that limit the total to 200mA, max source/sink current for most AVR-duinos (MCU chip limit) so 1K - 2.2K resistor makes a nice indicator led.

You could just stick a jumper in the pinhole and
set OUTPUT LOW and wait 1 milli
set INPUT
read the pin and print it
set OUTPUT HIGH and wait 1 milli
set INPUT
read the pin and print it

If you fill the wire with charge and make the pin INPUT, it does not ground the wire. When an INPUT is not being read it is electrically neutral, called the Z-state as opposed to OFF, ON, and PULLUP states, electrically Zero.

The OUTPUT HIGH 5V charge mainly stays in the wire. AVR docs tell that each digitalRead() eats 1 microAmp of charge. Count the number of reads it takes in a fast loop before the charge drops below 1.1V and reads LOW. In the presence of oscillating field(s) it may never read low, you can detect EM noise and learn about unterminated inputs!

Yup, tested all other ones, they all respond normally, exept for Pin 3... Could it be that because it's the SCL pin it behave differently ? Or is it just ded ?

If you connect a LED with series resistor on 3, does the blink sketch work with pin 3 ?

I tried it with Pin 2, 3 and 4 but without a resistor, and it works on 2 and 4, but not 3.
What would the resistor accomplish there ? I'm not very good with electronic just yet, would it make a difference ?

The resistor is used to limit the LED current to a safe level that the GPIO output pin can handle.

It does appear your pin 3 has been damaged.

In the future, keep out currents to a safe level, a good rule is no more that 20mA.

Hi, @Jaeth
Did you look at post #5?

Pin 9 is not an analog input pin but just a digital pin I believe.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Heya !
I'm following this pinout :

So I believe Pin 9 is an analog, and I've tried digitalRead and analogRead anyway x)

Do you know how it could have been damaged ? I only used it with an I2C accelerometer, which shouldn't require resistors...

A GPIO pin can go faulty in a number of ways:

  • manufacturing issues.
  • user abusing the pin.
  • static discharge to the pin.
  • faulty load circuit.

Have you check the out put voltage after uploading program

Hi,
Put a potentiometer on pin 9 and analog read the pin as you adjust it.

Have you tested it as a digital input and a digital output?

Tom.. :smiley: :+1: :coffee: :australia:

The resistor would slow the current from the pin through the led if you have the led turmed the right way so it lights the led without oversupplying current which damages the pin and the led and can kill either quickly.

On an Uno R3 you can replace the chip with a bootloaded chip that you can learn to do to new blank chips that ran a bit over $2 ea in 2019. I have bigger roll-your-own Duino chips (when I make my own, haven't smoked one yet, says GFS) they have 16K RAM, 2 serial and 32 robust AVR IO pins.

Did you learn basic physics in school? It helps with electronics.

Most accelerometers are 3.3V only, but the Pro Micro is 5V.

You need a logic level converter to make that connection. Otherwise you can destroy one of both of the connected devices, and that may explain what happened in this case.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.