Weird behavior AnalogRead() pin B524

Hi everyone,

I am new with particle devices, and I bought one B SoM B524, designed a board all around it and now I am testing it, all seems to work fine excepts for the analog pin A3 (D16) looking at the documentation it is an analog/digital pin without special functions, when I try to read the pin it always output 0.
I am using analog pin A0, A1, A2 successfully with the same copy of the circuit connected to A3, so I don’t think it is a bad board design fault
.
The weird behavior is:

A3 connected to GND, output 0;
A3 floating, output 0; while ALL the other output pins have a value around 150/300;
A3 connected to 3.3V, ouput 4095;
To me seems a sort of “digital response” of the pin.

The code used to test it is as simple as possible:


SYSTEM_THREAD(ENABLED);                         /* multi-threading */
SYSTEM_MODE(SEMI_AUTOMATIC);              /* auto-reconnect */

void loop() {

  for(int i = 14; i < 22; i ++) {
    Paint_DrawNum(0, 0, i, &Font24, BLACK, WHITE);
    Paint_DrawNum(0, 24, analogRead(i), &Font24, BLACK, WHITE);
    delay(1000);
    Paint_DrawString_EN(0, 24, "    ", &Font24, BLACK, WHITE);
  }
}

Paint_… are just functions to display on a connected LCD through SPI.

There something I can try, or I have to assume that the pin is faulty?

Thanks to all

Can you try an intermediate voltage (e.g. via a voltage divider)?
The readings of a floating pin are never anything to go by.

Yes! when I try to sample a voltage specified voltage pin A0, A1, A2 responds with a code of about 3900, while A3 with a code of 70, even if I use the same source

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