<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Using two ADC pins influences analog input voltage readings]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">up until now, I have only used P13 as an analog input pin and everything worked as expected. But today, I also started using P16 and noticed that both pins now report values that are too high. For example, on P16 I read a voltage of 2.85 instead of 2.5 as measured with my multimeter. If I only use one adc pin, I read the expected voltage. Does anyone has an explanation for this?</p>
<p dir="auto">For both pins, I use ADC.ATTN_11DB.</p>
]]></description><link>https://forum.pycom.io/topic/3663/using-two-adc-pins-influences-analog-input-voltage-readings</link><generator>RSS for Node</generator><lastBuildDate>Sat, 17 Oct 2026 12:06:18 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/3663.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Aug 2018 22:02:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Tue, 21 Aug 2018 22:02:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">up until now, I have only used P13 as an analog input pin and everything worked as expected. But today, I also started using P16 and noticed that both pins now report values that are too high. For example, on P16 I read a voltage of 2.85 instead of 2.5 as measured with my multimeter. If I only use one adc pin, I read the expected voltage. Does anyone has an explanation for this?</p>
<p dir="auto">For both pins, I use ADC.ATTN_11DB.</p>
]]></description><link>https://forum.pycom.io/post/21711</link><guid isPermaLink="true">https://forum.pycom.io/post/21711</guid><dc:creator><![CDATA[MoeweX]]></dc:creator><pubDate>Tue, 21 Aug 2018 22:02:12 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Wed, 22 Aug 2018 07:14:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2990">@moewex</a> GND offset? Are you sure, that the input ciruits have a proper low impedance connection to GND?</p>
]]></description><link>https://forum.pycom.io/post/21712</link><guid isPermaLink="true">https://forum.pycom.io/post/21712</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Wed, 22 Aug 2018 07:14:22 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Wed, 22 Aug 2018 18:51:59 GMT]]></title><description><![CDATA[<p dir="auto">Hi, thx for the response <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a>! I double checked, but I only have one power source and am also pretty sure that this is not the reason.</p>
<p dir="auto">Furthermore, I did additional testing and somehow the values are now also off if only one adc is measuring as well. I am pretty sure this has not been the case before, but now every value is always slightly too high. Is it possible that I messed up the internal calibration or so?</p>
<p dir="auto">I measured four different values (with both my voltmeter and and wipy). These are the results (voltmeter --- wipy --- factor the wipy is to high):</p>
<p dir="auto">2.69 --- 3.161 --- 1.175<br />
2.31 --- 2.642 --- 1.144<br />
1.62 --- 1.791 --- 1.106<br />
1.44 --- 1.581 --- 1.098</p>
<p dir="auto">As the value differences are not constant, I cannot just calculate &quot;the real&quot; values, or does anyone see a pattern?</p>
]]></description><link>https://forum.pycom.io/post/21716</link><guid isPermaLink="true">https://forum.pycom.io/post/21716</guid><dc:creator><![CDATA[MoeweX]]></dc:creator><pubDate>Wed, 22 Aug 2018 18:51:59 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Wed, 22 Aug 2018 19:02:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2990">@moewex</a> No, i do not see a pattern except that the ratio is increasing with the voltage, like a non-linear effect. The ESP32 ADC is known for bad linearity. Did you use adc_voltage() or adc_value() for reading the ADC. It may be interesting to try adc_value().<br />
And you should use a low impedance input (&lt; 10 kOhm).</p>
]]></description><link>https://forum.pycom.io/post/21718</link><guid isPermaLink="true">https://forum.pycom.io/post/21718</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Wed, 22 Aug 2018 19:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Thu, 23 Aug 2018 07:01:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a> . For the measurements, I did adc_value() as I essentially just execute the <a href="https://docs.pycom.io/firmwareapi/pycom/machine/adc" target="_blank" rel="noopener noreferrer nofollow">quick usage example</a>.</p>
<p dir="auto">I am measuring the analog output of a <a href="https://www.dfrobot.com/wiki/index.php/Capacitive_Soil_Moisture_Sensor_SKU:SEN0193" target="_blank" rel="noopener noreferrer nofollow">soil moisture sensor</a>, so the impedance should not be a problem here, right?</p>
<p dir="auto">But I tried to also measure the voltage of voltage divider with two 100kOhm resistors, is this problematic?</p>
]]></description><link>https://forum.pycom.io/post/21724</link><guid isPermaLink="true">https://forum.pycom.io/post/21724</guid><dc:creator><![CDATA[MoeweX]]></dc:creator><pubDate>Thu, 23 Aug 2018 07:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Thu, 23 Aug 2018 07:30:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2990">@moewex</a> So you translated than the values in the range 0..4095 yourself into a voltage? Then you should test the real range in advance. These devices do NOT have it's full range at 3.3V. See also here: <a href="https://www.esp32.com/viewtopic.php?f=19&amp;t=2881&amp;sid=ed97d32cb10488d58c6d4947d68cb59f&amp;start=10" target="_blank" rel="noopener noreferrer nofollow">https://www.esp32.com/viewtopic.php?f=19&amp;t=2881&amp;sid=ed97d32cb10488d58c6d4947d68cb59f&amp;start=10</a><br />
The best linearity is at 6dB attenuation.<br />
The impedance affects mostly the noise. I typically put  a small capacitor at the input, like 1 .. 10 nF, which also lowers the impedance.<br />
Edit: I should add that the ADC of the ESP32 is lousy. The effective resolution you get is about 9 bit. Everything else is noise. If you need precise values, use an external ADC, like from Analog Devices.</p>
]]></description><link>https://forum.pycom.io/post/21725</link><guid isPermaLink="true">https://forum.pycom.io/post/21725</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Thu, 23 Aug 2018 07:30:44 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Thu, 23 Aug 2018 11:45:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a> The moisture sensor output is somewhere between 1V and 2.5V (roughly), so I had not to translate it (where does the 4095 come from anyhow?) :).</p>
<p dir="auto">The link you provided is helpful, thank you! So it seems to be an ESP32 problem (which is good to know). By adding a capacitor to the input (connected between input pin and ground, right?), I should be able to reduce the noise and maybe improve the accuracy, don't I? But I guess the best solution is to add more voltage dividers so that I can use a lower attenuation... . Maybe it would be worthwhile adding such a note to the documentation</p>
]]></description><link>https://forum.pycom.io/post/21730</link><guid isPermaLink="true">https://forum.pycom.io/post/21730</guid><dc:creator><![CDATA[MoeweX]]></dc:creator><pubDate>Thu, 23 Aug 2018 11:45:51 GMT</pubDate></item><item><title><![CDATA[Reply to Using two ADC pins influences analog input voltage readings on Thu, 23 Aug 2018 12:14:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2990">@moewex</a> The 4095 is the highest value of the 12 bit ADC. So you could try to call apin.value() instead of just apin, which seems to return the voltage value, which has to be calibrated beforehand. The noise and fluctuation will always be large. So you have to add some kind of lowpass or averaging. For the moisture application with ist slow change, using a digital lowpass filter/averaging is surely appicable. And you do not have to care for absolute precision, just consistency.</p>
]]></description><link>https://forum.pycom.io/post/21731</link><guid isPermaLink="true">https://forum.pycom.io/post/21731</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Thu, 23 Aug 2018 12:14:07 GMT</pubDate></item></channel></rss>