-->
Page 1 of 1

read 2 potentiometers

PostPosted: Mon Jan 18, 2021 5:19 pm
by froussel
The esp8266 has only one analog input pin.
I would like to measure each value successively.
I saw a schema but I can't find it anymore. There were 2 mosfets (N or P) ordered by 2 IO
Can you explain to me please?

Re: read 2 potentiometers

PostPosted: Tue Jan 19, 2021 12:00 pm
by eriksl
I don't think you want to be using de internal ADC. It's very noisy and imprecise and hard to read out persistenly.

The best option is to connect an external ADC using e.g. I2C, but SPI or even I2S is possible.

If you want to try it with the internal ADC, the simplest way is to use an analog multiplexer, for example a CD4066.

Re: read 2 potentiometers

PostPosted: Tue Jan 19, 2021 1:48 pm
by froussel

Re: read 2 potentiometers

PostPosted: Wed Jan 20, 2021 2:49 am
by davydnorris
That's how I would have suggested you do it, although I wouldn't have added the diodes in my initial idea. This will work well though.