Gauge ADC ESP32

Hello,
I can not find Gauge ADC with ESP32 project.
Can you help me, please?
Thank you.

1 Like

Can you give us more info ?

Are you looking for the analog port for ESP32 ? In that case it is not supported and you need to implement it in your code.

I was using esp8266 with adc0 (quite simple and very usefull), and I was thinking that with esp32 I could use more ADC.
Sorry with that.
Do you think it could be implemented in the future?

You can use it, you just need to redirect your analog info to a virtual pin. You can use all the ports

If you need some help with this il be glad to provide it. In fact i got the info about the analog pins from this forum about a month ago :stuck_out_tongue:

It is not that it is not working, rather just no direct pin support in the App as there are many variants of ESP32 Dev boards, and it is still in teething stages (at Espressif’s end), so only Virtual Pin support is available in Blynk.

First you need to determine your Analog pins GPIO number, then you simply use the same code analogRead() as you would on almost any Arduino or ESP8266.

This is on a Wemos Lolin32 Dev Board wherein A0 = GPIO 36 (Also labeled VP)

NOTE: The ESP32 is capable of 12 bit resolution (range 0-4095).

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";

const int analogPin = 36;  // Analog input pin 0 (GPIO 36)
int sensorValue = 0;  // Value read from the ADC

BlynkTimer timer;

void setup() {
  Serial.begin(9600); // Initialize serial monitor output at 9600 bps:
  Blynk.begin(auth, ssid, pass);  // Connect to Blynk Cloud
  timer.setInterval(250L, AnalogPinRead);  // Run sensor scan 4 times a second
}

void AnalogPinRead() {
  sensorValue = analogRead(analogPin);  // Read the analog in value:
  Serial.print("sensor = ");  // Print the results...
  Serial.println(sensorValue);  // ...to the serial monitor:
  Blynk.virtualWrite(V0, sensorValue);  // Send the results to Gauge Widget
}

void loop() {
  Blynk.run();
  timer.run();
}
3 Likes

Fine indeed.
1000 thank you