- 2. Use CVD_SAMPLES_PER_SCAN to increase the amount of oversampling.
All applications will want to oversample at least 8 times to ensure random noise cannot significantly affect the sensor's reading.
Most applications oversample between 30-50 times.
The diminishing returns on sensitivity when increasing this value occur at an exponential rate. This means there is only a small difference at 70 and 80 samples, while there is a very large difference between 10 and 20 samples.
- 3. Change CVD_SCALING to 1 to eliminate resolution loss.
When the acquisition module has oversampled CVD_SAMPLES_PER_SCAN number of times, the final sum must be moved from a 24-bit array to a 16-bit array. The reading value cannot be allowed to exceed the 16-bit limit of 65535. To prevent this from occuring, the framework will use CVD_SCALING to determine what to divide the accumulation register by. This results in a slight loss in resolution. If this is a concern for your application, setting CVD_SCALING value to 1 will eliminate this step.
It is your responsibility to ensure the CVD's reading cannot exceed 65535.
- 4. Check that the average is not becoming corrupted.
If your average is updating too quickly, you may be losing some sensitivity because the average is no longer equal to the sensor's unpressed value. To check this, uncomment CVD_DEBUG_OUTPUT_AVG in the configuration file and view the average in real time with the reading.
If the average is updating too quickly, you can slow it down by increasing the value of AVG_UPDATE and AVG_RATE.
If the average is becoming corrupted due to fast tapping on the sensor, use the NEGATIVE_CAPACITANCE configuration option to adjust how the average behaves when the reading has fallen below the average. For fast-tapping systems, setting this value to 1 is recommended. Using the '2' value for this option is only recommended for systems that are not going to have any noise spikes.
- 5. Decrease the amount of parasitic capacitance affecting the sensor and its trace.
The amount of parasitic capacitance on the sensor will directly impact its maximum level of sensitivity. Eliminate ground planes near your sensor and make sure its trace path is not running near any high-current or digital lines. This is particularly important for proximity sensors and normal touch sensors with long traces.