Converting "MPR121 capacitive keyboard" sensor filter data into capacitance values? - Electrical Engineering Stack Exchange most recent 30 from electronics.stackexchange.com 2019-09-22T18:30:07Z https://electronics.stackexchange.com/feeds/question/430217 https://creativecommons.org/licenses/by-sa/4.0/rdf https://electronics.stackexchange.com/q/430217 0 Converting "MPR121 capacitive keyboard" sensor filter data into capacitance values? Çlirim Murati https://electronics.stackexchange.com/users/215730 2019-04-01T21:53:43Z 2019-04-02T13:27:25Z <p>The project that I'm working on, the MPR121 capacitive touch sensing keyboard connected with a 8051 microcontroller, my first intention when I started implementing the project was to measure the capacitance on the touched electrode, reading the datasheet I learned that I can get the capacitance value from the filter data later on I figured that the value I'm getting from filter data is reverse proportional with the capacitance</p> <p>Image below shows the relation between capacitance and the voltage</p> <p><a href="https://i.stack.imgur.com/eiLjP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eiLjP.png" alt="enter image description here"></a></p> <p>Image below shows the value range 0-1024 that we can get from the filter data and shows that the value is inverse proportional with the capacitance <a href="https://i.stack.imgur.com/9mDjr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9mDjr.png" alt="enter image description here"></a></p> <p>I've configured 0x5c and 0x5d register so that charge current I is 16 mikroA and the charge time T is 0.5 mikroS, I'm getting values of filter data in range from 0-600 does this mean that the capacitance is calculated as below..</p> <p>C=(I*T)/V=(16*0.5)/(0-1024) ?</p> <p>Thank you!</p> https://electronics.stackexchange.com/questions/430217/converting-mpr121-capacitive-keyboard-sensor-filter-data-into-capacitance-valu/430220#430220 0 Answer by Dirceu Rodrigues Jr for Converting "MPR121 capacitive keyboard" sensor filter data into capacitance values? Dirceu Rodrigues Jr https://electronics.stackexchange.com/users/22676 2019-04-01T22:33:47Z 2019-04-02T13:27:25Z <p>According with the MPR121 datasheet (from NXP), you forgot to include <span class="math-container">\$V_{dd}\$</span>:</p> <p><span class="math-container">$$C= \frac{I \times T}{ADC \space counts} \times \frac{1}{V_{dd}} \times 1024$$</span></p> <p>If <span class="math-container">\$I\$</span> and <span class="math-container">\$T\$</span> are given in <span class="math-container">\$\mu\$</span>A and <span class="math-container">\$\mu\$</span>s respectively, then <span class="math-container">\$C\$</span> is in <span class="math-container">\$p\$</span>F.</p> <p><strong>EDIT:</strong></p> <p>ADC counts available on following register:</p> <p><a href="https://i.stack.imgur.com/yZMUc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZMUc.png" alt="MPR121"></a></p> <p><strong>EDIT 2:</strong></p> <p>As the valid operating range of the electrode charging source is 0.7 V to (<span class="math-container">\$V_{dd}\$</span> - 0.7 V), the min and max ADC counts are given by:</p> <p><span class="math-container">$$ADC_{min}=\frac{0.7}{V_{dd}} \times 1024$$</span> <span class="math-container">$$ADC_{max}=\frac{V_{dd}-0.7}{V_{dd}} \times 1024$$</span></p> <p>with a fixed intermediate (mid) value of</p> <p><span class="math-container">$$ADC_{mid}= \frac{ADC_{max}+ADC_{min}}{2}= 512$$</span></p> <p>With <span class="math-container">\$V_{dd}=\$</span> 3.3 V (for example on MPR121 Adafruit breakout board), I think that:</p> <p><span class="math-container">$$\left\{\begin{matrix} ADC_{min} \approx 217.21 \\ ADC_{max} \approx 806.79 \end{matrix}\right.$$</span></p> <p>No conflit with the first formula I've presented in this answer.</p>