ESP8266 Thing analogPin/analogRead

All things pertaining to wireless and RF links

Moderator: phalanx

Post Reply
hsadeghilam
Posts: 5
Joined: Thu Jul 19, 2018 5:05 pm

ESP8266 Thing analogPin/analogRead

Post by hsadeghilam » Fri Jul 20, 2018 10:34 am

Which pins on ESP8266 can be used as analogPin to do analogRead? I connected wires with 20 mA current to pins 4 and 0 and my board became very hot!

paulvha
Posts: 272
Joined: Sat Nov 11, 2017 2:39 am

Re: ESP8266 Thing analogPin/analogRead

Post by paulvha » Fri Jul 20, 2018 12:10 pm

You do NOT provide current, you provide voltage. On an ESP8266 thing that should be max 1V on the A0/ADC. The current is based on the voltage divided by the internal + external resistance.

hsadeghilam
Posts: 5
Joined: Thu Jul 19, 2018 5:05 pm

Re: ESP8266 Thing analogPin/analogRead

Post by hsadeghilam » Fri Jul 20, 2018 12:41 pm

So one wire goes to ADC and the other one to GND? How I can find the value of internal+external resistance? When I measure the voltage of my wires its about 25 V. How can I reduced it to 1 V?

paulvha
Posts: 272
Joined: Sat Nov 11, 2017 2:39 am

Re: ESP8266 Thing analogPin/analogRead

Post by paulvha » Fri Jul 20, 2018 2:40 pm

Indeed input to the ADC and the other to GND. If we you have max 25V make a voltage divider: take 2 resistors serial: 1K (connect to GND, ADC and resistor 2), the other resistor2 :24K connected the 1K, ADC and the power source (25V). That way the maximum voltage is 1V to the ADC.

hsadeghilam
Posts: 5
Joined: Thu Jul 19, 2018 5:05 pm

Re: ESP8266 Thing analogPin/analogRead

Post by hsadeghilam » Fri Jul 20, 2018 2:52 pm

I just tried it and surprisingly I figured out my sensor spits out a variable current (at a constant voltage), so reading voltage does not work for me. Any suggestion on how I can read current?

n1ist
Support Volunteer
Posts: 1032
Joined: Wed Mar 22, 2006 11:02 am

Re: ESP8266 Thing analogPin/analogRead

Post by n1ist » Fri Jul 20, 2018 4:34 pm

Pass the current through a resistor and measure the voltage across it
/mike

hsadeghilam
Posts: 5
Joined: Thu Jul 19, 2018 5:05 pm

Re: ESP8266 Thing analogPin/analogRead

Post by hsadeghilam » Mon Jul 23, 2018 9:00 am

Thanks! It worked fine :)

Post Reply