Skip to main content
deleted 79 characters in body; edited title
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

ESP32 ADC <-> WIFI IssueWiFi issue

I'm using the ESP32's ADC1 (not ADC2, which conflicts with Wi-FiWiFi functionality) to capture some analog data received @IO36at IO36 (an ADC1 port). As soon as I uncomment the WiFi.mode(WIFI_AP_STA) line (even when the WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source As soon as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of the ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- I tried adc1_get_raw, which made no difference.
4- I tried this code on another ESP32 module, it also showed a huge difference in adc1 readings before and after uncommentinguncomment the WiFi.mode(WIFI_AP_STA).
5- Using root APIs such as esp_wifi_init & esp_wifi_set_mode &line esp_wifi_start instead of Arduino wrappers like(even when the WiFi.modebegin() didn't help.line is still commented out), analog readings go crazy!

NEW CLUE: Apparently the issue is with the Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue. Some side notes:

  1. The hardware that processes the input signal to make it suitable for the ESP32 analog input uses the same power source as the ESP32 module.
  2. A 100 μF SMD capacitor is connected to the source line of the ESP32 module just beside it to lessen the impact of its power consumption ripples on other devices.
  3. I tried adc1_get_raw, which made no difference.
  4. I tried this code on another ESP32 module; it also showed a huge difference in ADC1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
  5. Using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of Arduino wrappers like WiFi.mode didn't help.

New clue: Apparently the issue is with the WiFi Access Point mode (i.e. WIFI_AP), because setting Wi-Fi to Station mode (i.e. WIFI_STA) doesn't cause this issue.

In general anything related to WIFI functionWiFi causes the ADC to get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after the WIFIWiFi initialization command, even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance   

enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA); 
  // uncommenting this line analogread goes crazy!, even while the following line is still commented...
  out
  //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }

ESP32 ADC <-> WIFI Issue

I'm using the ESP32's ADC1 (not ADC2, which conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment the WiFi.mode(WIFI_AP_STA) line (even when the WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of the ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- I tried adc1_get_raw, which made no difference.
4- I tried this code on another ESP32 module, it also showed a huge difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
5- Using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of Arduino wrappers like WiFi.mode didn't help.

NEW CLUE: Apparently the issue is with the Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.

In general anything related to WIFI function causes ADC to get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after the WIFI initialization command, even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance  enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }

ESP32 ADC <-> WiFi issue

I'm using the ESP32's ADC1 (not ADC2, which conflicts with WiFi functionality) to capture some analog data received at IO36 (an ADC1 port).

As soon as I uncomment the WiFi.mode(WIFI_AP_STA) line (even when the WiFi.begin() line is still commented out), analog readings go crazy!

Some side notes:

  1. The hardware that processes the input signal to make it suitable for the ESP32 analog input uses the same power source as the ESP32 module.
  2. A 100 μF SMD capacitor is connected to the source line of the ESP32 module just beside it to lessen the impact of its power consumption ripples on other devices.
  3. I tried adc1_get_raw, which made no difference.
  4. I tried this code on another ESP32 module; it also showed a huge difference in ADC1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
  5. Using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of Arduino wrappers like WiFi.mode didn't help.

New clue: Apparently the issue is with the WiFi Access Point mode (i.e. WIFI_AP), because setting Wi-Fi to Station mode (i.e. WIFI_STA) doesn't cause this issue.

In general anything related to WiFi causes the ADC to get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after the WiFi initialization command, even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance 

enter image description here

#include <WiFi.h>
float R = 0;
    
void setup() {
  Serial.begin(500000);
  // WiFi.mode(WIFI_AP_STA); 
  // uncommenting this line analogread goes crazy, even while the following line is still commented out
  // WiFi.begin();
  analogSetAttenuation(ADC_0db);
}
    
void loop() {
  R = analogRead(36);    
  Serial.println(R/12.21);
}
Bumped by Community user
added 44 characters in body
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 18

I'm Using ESP32using the ESP32's ADC1 (not ADC2 that, which conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment the WiFi.mode(WIFI_AP_STA) line (even when the WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of the ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- TriedI tried adc1_get_raw, which made no difference.
4- TriedI tried this code on another ESP32 module, it also showed a huge difference difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
5- usingUsing root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of arduinoArduino wrappers like WiFi.mode didn't help.

NEW CLUE: Apparently the issue is with the Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.
In

In general anything related to WIFI function causes ADC to get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after the WIFI initialization command, even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }

I'm Using ESP32 ADC1 (not ADC2 that conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment WiFi.mode(WIFI_AP_STA) line (even when WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- Tried adc1_get_raw which made no difference.
4- Tried this code on another ESP32 module, it also showed huge difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
5- using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of arduino wrappers like WiFi.mode didn't help.

NEW CLUE: Apparently issue is with Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.
In general anything related to WIFI function causes ADC get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after WIFI initialization command even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }

I'm using the ESP32's ADC1 (not ADC2, which conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment the WiFi.mode(WIFI_AP_STA) line (even when the WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of the ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- I tried adc1_get_raw, which made no difference.
4- I tried this code on another ESP32 module, it also showed a huge difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
5- Using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of Arduino wrappers like WiFi.mode didn't help.

NEW CLUE: Apparently the issue is with the Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.

In general anything related to WIFI function causes ADC to get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after the WIFI initialization command, even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }
Bumped by Community user
Bumped by Community user
added 153 characters in body
Source Link

I'm Using ESP32 ADC1 (not ADC2 that conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment WiFi.mode(WIFI_AP_STA) line (even when WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- Tried adc1_get_raw which made no difference.
4- Tried this code on another ESP32 module, it also showed huge difference difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
5- using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of arduino wrappers like WiFi.mode didn't help.

NEW CLUE: Apparently issue is with Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.
In general anything related to WIFI function causes ADC get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after WIFI initialization command even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }

I'm Using ESP32 ADC1 (not ADC2 that conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment WiFi.mode(WIFI_AP_STA) line (even when WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- Tried adc1_get_raw which made no difference.
4- Tried this code on another ESP32 module, it also showed huge difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA)

NEW CLUE: Apparently issue is with Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.
In general anything related to WIFI function causes ADC get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after WIFI initialization command even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }

I'm Using ESP32 ADC1 (not ADC2 that conflicts with Wi-Fi functionality) to capture some analog data received @IO36 (an ADC1 port). As soon as I uncomment WiFi.mode(WIFI_AP_STA) line (even when WiFi.begin() line is still commented out), analog readings go crazy!

SOME SIDE NOTES:
1- The hardware that processes input signal to make it suitable for ESP32 analog input uses the same power source as the ESP32 module.
2- A 100uF SMD capacitor is connected to the source line of ESP32 module just beside it to lessen impact of its power consumption ripples on other devices.
3- Tried adc1_get_raw which made no difference.
4- Tried this code on another ESP32 module, it also showed huge difference in adc1 readings before and after uncommenting WiFi.mode(WIFI_AP_STA).
5- using root APIs such as esp_wifi_init & esp_wifi_set_mode & esp_wifi_start instead of arduino wrappers like WiFi.mode didn't help.

NEW CLUE: Apparently issue is with Wi-Fi ACCESSPOINT mode (i.e. WIFI_AP), because setting Wi-Fi to STATION mode (i.e. WIFI_STA) doesn't cause this issue.
In general anything related to WIFI function causes ADC get unstable. No matter which ESP32 board you use, you could simply serial plot any ADC1 channel before and after WIFI initialization command even with floating ADC1 pins you can see the difference.

Signal goes crazy even though there is a 100uF cap at ESP32 Power entrance enter image description here

    #include <WiFi.h>
    float R = 0;
    
    void setup() {
        Serial.begin(500000);
    //    WiFi.mode(WIFI_AP_STA);  // uncommenting this line analogread goes crazy! even while following line is still commented...
    //    WiFi.begin();
        analogSetAttenuation(ADC_0db);
    }
    
    void loop() {
        R = analogRead(36);    
        Serial.println(R/12.21);
    }
added 263 characters in body
Source Link
Loading
added 22 characters in body
Source Link
Loading
added 22 characters in body
Source Link
Loading
deleted 614 characters in body
Source Link
Loading
added 41 characters in body
Source Link
Loading
added 29 characters in body
Source Link
Loading
Source Link
Loading