ESP-WROM-02 Read from TOUT ADC

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
EsPmIcRoY
Posts: 2
Joined: Wed May 15, 2019 9:16 am

ESP-WROM-02 Read from TOUT ADC

Post by EsPmIcRoY » Wed May 15, 2019 9:52 am

Hi,

I have a ESP-WROM-02 and I would read a ADC signal.

On the datasheat I read that it is possible only read from the TOUT pin!
I found an example in C language that use "system_adc_read" function.

On micropython for read from an ADC input I use "machine.ADC(<IO>)" but in this case I don't know the name (or number) for the TOUT pin.

Does anyone know how I can do it?

Thank you

Online
User avatar
jimmo
Posts: 85
Joined: Tue Aug 08, 2017 1:57 am

Re: ESP-WROM-02 Read from TOUT ADC

Post by jimmo » Wed May 15, 2019 10:19 am

Hi,

machine.ADC takes a channel number, not a pin. On ESP8266, channel 0 is the ADC pin, channel 1 is VDD33.

https://docs.micropython.org/en/latest/ ... l/adc.html

EsPmIcRoY
Posts: 2
Joined: Wed May 15, 2019 9:16 am

Re: ESP-WROM-02 Read from TOUT ADC

Post by EsPmIcRoY » Thu May 16, 2019 9:49 am

Hi jimmo,

I tried with ADC(0) and work fine!

I just have to be careful because this input only accepts values ranging from 0v to 1v!

Thank you

Online
User avatar
jimmo
Posts: 85
Joined: Tue Aug 08, 2017 1:57 am

Re: ESP-WROM-02 Read from TOUT ADC

Post by jimmo » Thu May 16, 2019 10:07 am

Yup. As the doc says though, a pair of resistors (in a voltage divider) will let you use anything you want.

Post Reply