arduino / arduino/ArduinoCore-samd

Calibration method in CorrectADCResponse.ino seems inadequate

Open
#671 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
502
Forks
740
PR merge metrics
No merged PRs in 30d

Description

The calibration method and sketch [CorrectADCResponse.ino](https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino) did not do the job for me on a Seeeduino Xiao - so I started looking at how it works.

The problem with the method used is that it measures only the end points (0.0 and 3.3V) of the ADC input range, and those two measurements will often not be representative for a line through a number of points inside the range. It would be far better to have measurement points away from the range end points.

I realize that this is is the best that can be done with a simple two-point calibration, and that more elaborate methods must be used to get a better result.

I propose solving this by renaming this sketch something like "CorrectADCResponse_simple.ino", and then add a second sketch ("CorrectADCResponse_elaborate.ino" ?) with a more elaborate method - which could be implementing voltage dividers connected to multiple ADC inputs.

Resistors would have to be measured to take their production tolerance into account, and measured values inserted in the code.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading libraries/SAMD_AnalogCorrection/examples/CorrectADCResponse/CorrectADCResponse.ino and tracing its two-point calibration method. Define the scope of the proposed simple-sketch rename and the additional multi-point calibration sketch; the work is done when both sketches and the resistor-tolerance requirements are clearly implemented and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.