Comments on: ESP32/ESP8266 Analog Readings with MicroPython https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 19 Nov 2023 02:41:16 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Raimundas Juodvalkis https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-872827 Sun, 19 Nov 2023 02:41:16 +0000 https://randomnerdtutorials.com/?p=84186#comment-872827 In reply to Shaun Carter.

I abandoned esp32 and bought commercial plc from China. Day and night difference as plc has opto chip on ADC

]]>
By: Shaun Carter https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-872736 Sat, 18 Nov 2023 13:12:12 +0000 https://randomnerdtutorials.com/?p=84186#comment-872736 You need to ‘earth’ the pot casing to the 0 volt pin to get rid of the noise

]]>
By: azouz https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-839923 Sat, 10 Jun 2023 16:10:11 +0000 https://randomnerdtutorials.com/?p=84186#comment-839923 hi
the shell display of Thonny editor is showing random values i.e even the resistance has not been changed , the values keep changing according to the timer ..any advise plz

]]>
By: Alberto https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-792767 Tue, 18 Oct 2022 14:05:46 +0000 https://randomnerdtutorials.com/?p=84186#comment-792767 Hi,
I’m using the ESP-32 to mesure voltages in the order of uV (microvolts) so I have to use the intern amplifyer. Does anyone knows how to configure it?

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-576875 Tue, 23 Mar 2021 11:20:31 +0000 https://randomnerdtutorials.com/?p=84186#comment-576875 In reply to Marco Macrì.

Hi.
Double-check the connections of your circuit.
Regards,
Sara

]]>
By: Marco Macrì https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-575057 Sat, 20 Mar 2021 00:24:22 +0000 https://randomnerdtutorials.com/?p=84186#comment-575057 Hello, i have to say that the one above is a very well written tutorial and conteins a lot of useful concepts…
but i have a problem… when i run the code the first print is correct but then it always prints the max value of the potentiometer 4095… what should i do?

]]>
By: Raimis Juodvalkis https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-439801 Tue, 24 Mar 2020 12:44:07 +0000 https://randomnerdtutorials.com/?p=84186#comment-439801 In reply to Sara Santos.

What I realized, that board measure correct voltage, just wires needs to be shielded and grounded. Even voltmeter wires introduces a lot of noise. Input pin wire needs to be shielded and shield grounded.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-437512 Sun, 15 Mar 2020 16:35:18 +0000 https://randomnerdtutorials.com/?p=84186#comment-437512 In reply to Raimis Juodvalkis.

Hi.
Thanks for sharing that.
You can read more about the inaccuracy of the ESP32 ADC here: https://rntlab.com/question/the-adc-seems-terrible/
Regards,
Sara

]]>
By: Raimis Juodvalkis https://randomnerdtutorials.com/esp32-esp8266-analog-readings-micropython/#comment-437378 Sun, 15 Mar 2020 03:23:23 +0000 https://randomnerdtutorials.com/?p=84186#comment-437378 Measurements was not consistent till we made 20K runs and average.
Code:

from machine import Pin, ADC
from time import sleep

pot = ADC(Pin(34)) # use your pin number
pot.atten(ADC.ATTN_11DB) #Full range: 3.3v

myfloat = 0.0

number_of_runs = 20000
for x in range(number_of_runs):
pot_value = pot.read()

myfloat = myfloat + pot_value

if x == 20000:
break

myfloat = myfloat / 20000
print()
print(myfloat)

]]>