Connect professional pressure level transmitter to ESP8266

Hey guys,
I need to connect a professional pressure level transmitter (like this one: Pressure transmitter submersible 10m H2O/ 1bar - AF904) to a microcontroller. I always worked with the ESP8266 but the max output is 5V and the operating voltage for this piezometer (and for all the professional I found) is between 10V and 30V. In term, I'm sending data to a server and display the results online. I'm doing this for other sensors but I need to use these kind of sensors now.
I'm not a professional and I would really appreciate to have advice please. Should I switch to another controller? Do you know another water level transmitter that could work with lower voltage? Is there a way to connect them?
Thank you so much in advance for your time

The sensor takes a 10 - 30V supply and outputs a value on a 4 - 20mA interface.

I dont know if you are planning on using a bare esp8266 or eg a NODEMCU.
However you will power that seperately from the sensor, but with a common ground.

So lets suppose you will use a nodeMCU board.

There is a single ADC - the 8266 measures 0-1V and this is scaled on the NodeMCU board to read 0 - 3.3V
So you need to connect the current output from the sensor to the Node via a current to voltage converter (AKA a resistor)
A 150 ohm resistor will give 3V at 20mA and 0.6V at 4mA

For accurate results you will need to calibrate the ADC as desribed on my pages here


1 Like

Ok, I got it now. Thank you so much John for your detailed answer! Yes, it's a NodeMCU. I will read carefully everything.

A 'professional 4-20mA sensor' and the crappy A/D of an ESP8266 are a poor match.
Better put an ADS1115 in between (with 100 ohm sense resistor and a PGA of two).
Don't forget to add the pin-protection parts to the sense resistor.

1 Like

Good advice Leo, thanks. Sorry for the stupid question but what do you mean by the pin-protection parts? I've used ADS1115 in the past but not expert. Should I put the resistor the same way John did and connect the ADS to the analog?
Thanks a lot

However the spec for the device quoted gives a resolution of 0.1% which matches the Node!
I'd agree its likely the ADS1115 will give better results - but you could test without one.

@ponpon777 the point of a 4 - 20mA interface is it CAN generate high voltages. (within the limits of the supply)

so you could usefully add a series resistor in the connection to the analog input - just in case eg the sense resistor is o/c.

@johnerrington @Wawa
Sorry to come back to this topic after this long silence. I was busy with other stuff. I read more on that and I understand things better. However, I have one last question: in the arduino sketch, I will read the analog value and transfer the result via ftp to a server. In order to do that, I need my NodeMCU to be powered (3.3 or 5V), right? So basically, should I add a power converter to power the NodeMCU as shown in blue on my crappy picture below?

A NodeMCU needs 5volt power. USB power (a 5volt cellphone charger) is an easy option.
A 12>5volt buck converter on the 5volt pin is also ok.

250 ohm is wrong. That's for 5volt-logic Arduinos.
The NodeMCU has a 3.3volt processor, so that resistor should be about 160 ohm.

True for the resistor, sorry, I was reading other tutos with other arduinos.

For the ESP, I was thinking to power it using a buck converter rather than a cellphone charger. I might change my mind later but I just wanted to know if I placed it correctly on the picture.


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