Using ESP8266 to read pressure sensor with 4-20mA output?

Hello,

I am trying to use an ESP8266 to read the output of a pressure sensor. The pressure sensor is powered through an 8V power supply, and outputs a signal 4-20mA. To read this on the ADC pin, I am reading that the pin can only handle 0-1V. Does this mean that I have to get that 4-20mA signal converted to 0-1V? or can the pin handle 3.3V OR is there an entire different way to look at this issue?

If the pin handle 1v , then you need a resistor that will convert the 20mA to 1volt. 470R is probably the nearest .
Have the one side of the resistor connected to the 8266 0v line.

You need to check whether your board is the 1v or 3.3v version - apparently you can get both

I see what you mean. After further research it seems as though the board I have is the 0-3.3V. So that would mean I need to get 20mA to 3.3V. In doing this, that accounts for the whole range of 4-20mA being converted to 0-3.3V, right?

20mA, 3.3v gives you 165ohms, 150 is the nearest so ...

4mA gives .004 150 = 0.6 volts
20mA gives .02
150 = 3volts

20mA gives you 0.020.02150 =0.06 watts , so a 1/4w 150 ohm resistor will do it .

The max. voltage should equal the reference voltage of the ADC, which can be less than Vcc.

hammy:
If the pin handle 1v , then you need a resistor that will convert the 20mA to 1volt. 470R is probably the nearest .
Have the one side of the resistor connected to the 8266 0v line.

I knew one of your calculations was wrong as you would need a higher resistance value for the higher voltage.

You meant 47 Ohms. :grinning:

Well spotted Paul.... sorry about that

Better check which esp8266 you have.
The ADC will burn out over 1 volt.

The wemos mini and other modules have a voltage divider built in.

dave-in-nj:
Better check which esp8266 you have.
The ADC will burn out over 1 volt.

The wemos mini and other modules have a voltage divider built in.

If I am not mistaken, not all of them have an ADC that will burn out over 1V. Some are 3.3V depending on which board.

dave-in-nj:
The ADC will burn out over 1 volt.

Where did you get that information.

With common Arduinos (Uno etc.) you can still apply 5volt VCC to the analogue pin, even if you have set Aref to 1.1volt.
I expect you can do the same (3.3volt/VCC) to an ESP pin.
Leo..

The AVR controllers have been elected for the Arduino project for their electrical robustness. Other controller families may not be so tolerant.

Yes, but the suggestion that the microcontroller will not tolerate an input that is still within its supply voltage range is rather absurd. It may not read in a meaningful way, but it should not cause damage.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.