Problem with GPIO2 and GPIO4 wemos D1 ESP32

Hello,
I’m trying to read from GPIO2 and GPIO4 (analog pins) in a wemos D1 ESP32 board and doesn’t work. In other analog pins like GPIO35 no problem. In the sketch I have defined virtual pins. Any help please?

That’s because they belong to ADC2, which can’t be used at the same time as WiFi…

You could use IO32 and 33 instead, or switch to a regular ESP32 board that breaks-out more of the ADC1 pins.

Pete.

1 Like

Thanks Pete, now I understand why doen’t work. GPIO 32 33 are occupied by a SD card. GPIO 38, 39 are SDA and SCL, can I use as analog inputs?

I don’t understand the question.

Pete.

I meant if GPIO 38, 39 are analog inputs. In my board are printed as SCL and SDA

I have no idea, I’m not familiar with your board.

It looks like the diagram you posted is screwed-up though, as the bottom two analog pins seem to have IO38 and IO39 printed next to them, but the diagram shows IO38 as being GPIO36

image

It also shows SCL and SDA in the top right hand corner labelled as GPIO22 and 21…

image

so this makes no sense to me…

Maybe time to google alternative images for your board, or use a regular ESP32 Dev board instead.

Pete.

Hi Pete,
The board I use is almost the same that the picture I sent. Is a board named ESP32 steammakers. Next to analog pins I have SCL and SCA. I would know if these pins are analogic too. I would try.

It is a board manufactured by keyestudio and sold in Olot, Spain

Only 38 Pins on D1 Mini ESP32
32 adc1
33 adc1
38 doesn’t exist
39 adc1