• Уважаемые посетители сайта esp8266.ru!
    Мы отказались от размещения рекламы на страницах форума для большего комфорта пользователей.
    Вы можете оказать посильную поддержку администрации форума. Данные средства пойдут на оплату услуг облачных провайдеров для сайта esp8266.ru
  • Система автоматизации с открытым исходным кодом на базе esp8266/esp32 микроконтроллеров и приложения IoT Manager. Наша группа в Telegram

ESP32, не нулевые значения на аналоговом входе

sashadeg

New member
Здравствуйте. Имеется 2 esp32 c алиэкспресса.
2022-08-02_15-42-19.png2022-08-02_15-42-07.png
Так как имел дело только с ардуинами и esp8266, решил проверить работу аналоговых входов таким скетчем в среде ArduinoIDE:
C++:
const int potPin36 = 36;
const int potPin39 = 39;
const int potPin34 = 34;
const int potPin35 = 35;
const int potPin32 = 32;
const int potPin33 = 33;
const int potPin25 = 25;
const int potPin26 = 26;
const int potPin27 = 27;
const int potPin14 = 14;
const int potPin12 = 12;
const int potPin13 = 13;
int potValue36 = 0;
int potValue39 = 0;
int potValue34 = 0;
int potValue35 = 0;
int potValue32 = 0;
int potValue33 = 0;
int potValue25 = 0;
int potValue26 = 0;
int potValue27 = 0;
int potValue14 = 0;
int potValue12 = 0;
int potValue13 = 0;

void setup() {
  Serial.begin(115200);
  delay(1000);
}

void loop() {
  potValue36 = analogRead(potPin36);
  potValue39 = analogRead(potPin39);
  potValue34 = analogRead(potPin34);
  potValue35 = analogRead(potPin35);
  potValue32 = analogRead(potPin32);
  potValue33 = analogRead(potPin33);
  potValue25 = analogRead(potPin25);
  potValue26 = analogRead(potPin26);
  potValue27 = analogRead(potPin27);
  potValue14 = analogRead(potPin14);
  potValue12 = analogRead(potPin12);
  potValue13 = analogRead(potPin13);
  Serial.print("36 = ");
  Serial.println(potValue36);
  Serial.print("39 = ");
  Serial.println(potValue39);
  Serial.print("34 = ");
  Serial.println(potValue34);
  Serial.print("35 = ");
  Serial.println(potValue35);
  Serial.print("32 = ");
  Serial.println(potValue32);
  Serial.print("33 = ");
  Serial.println(potValue33);
  Serial.print("25 = ");
  Serial.println(potValue25);
  Serial.print("26 = ");
  Serial.println(potValue26);
  Serial.print("27 = ");
  Serial.println(potValue27);
  Serial.print("14 = ");
  Serial.println(potValue14);
  Serial.print("12 = ");
  Serial.println(potValue12);
  Serial.print("13 = ");
  Serial.println(potValue13);
  Serial.println("  ");
  delay(1000);
}
Когда пины висят в воздухе, монитор порта выдает такие значения:
36 = 0
39 = 0
34 = 0
35 = 109
32 = 398
33 = 174
25 = 4095
26 = 4095
27 = 4095
14 = 4095
12 = 4095
13 = 4095

Проблема заключается в том, что на первой espшке (та что с type-c) при подаче GND на входы 25, 26, 27, 14, 12, 13 в мониторе порта вместо нулевого значения, показатели прыгают от 10 до 60 едениц. На остальных входах все хорошо: подаешь 3.3 - получаешь 4095, соеденяешь с GND - получаешь 0. На другой esp32 таких проблемм нет.
Из-за чего такое может быть и можно ли как то решить эту проблемму?
 
Сверху Снизу