Skip to content

Espressif ADC is not accurate, has a deadzone and differs per cpu #8754

Open
@bill88t

Description

@bill88t

CircuitPython version

It's exactly the same on 8.x and 9.x so it's not related to idf5

Code/REPL

import analogio, board, time; iadc = analogio.AnalogIn(board.any_adc_pin)
while True:
    print(iadc.value)
    time.sleep(0.1)

Behavior

Connect any potentiometer. First pin to 3v3, middle pin to the adc pin of the board, and the third pin to GND.

As we spin it around it should change it value.
The maximum should be 65535 and the minimum 0.
With a breadboard and jumper wires the values will of course not be exactly accurate, but they should be close.

However with S2 we can see the value fluctuates between 556 and 51157.
With S3 it goes from 0 to 61543.

Meanwhile with rp2040 the value can go from 0 to 65535 just fine.

I tested with 2 esp32-s2 boards, one s3 board, two rp2040 boards and 2 different style linear potentiometers.

Additional information

Also it should be noted that there is an amazingly big deadzone it stays at 51157 on s2 (about 20% of my slider).
On s3 it's smaller, but can still be felt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions