I'm trying to read from an analog sensor (a capacitive soil moisture sensor). I'm using a ESP12E, not a development board, so the ADC pin can only take 1V max. Since my sensor can output up to 3V, I need a voltage divider to not fry my board.
Here is my wiring:
https://imgur.com/4NYRfzt
Could you please confirm the wiring is ok?
I then use this code to read from the sensor:
Code: Select all
from machine import Pin, ADC
from time import sleep
pot = ADC(0)
while True:
pot_value = pot.read()
print(pot_value)
sleep(1)
The sensor works with a ESP32 devkit board, so the problem doesn't come fro m the sensor (the devkit board has a voltage divider, so I didn't need to make one myself).