How to "case grounding" my sensor?

Hello,
Me again :slight_smile: ...
Today, my question is about "grounding" my sensor.
I'm using this piezometer sensor from Autosen: Pressure transmitter submersible 10m H2O/ 1bar - AF904
At the bottom of the web page, it says to connect pin no2 to CASE (case grounding).
I'm using it for 2-3 years now and I was naively connecting it to the negative side of the battery. Is it bad? At least, I thought it was not but it seems after a few months, there's a some difference between measured and real values (about 1%) which is not the case at the beginning.
These sensors can handle with 10-30 V as input.
I understand that I should connect pin no2 to the ground. Literally push in a metal in the soil and connect it to pin no2. Is it correct? That's what an ingeneer from Autosen told me after I exposed him my problem. If so, what's the purpose of doing this? I understand why using ground in a house but I don't understand why it would help me? Do you think it can help to stabilize the signal overtime?
Thanks in advance for your time and help.
Regards,
Laurent

Edit: Actually, I think I'm wrong with the term "case grounding". Can you please help me how I should connect pin 2? Should I connect it to anode and/or ground? I'm a bit lost :sweat_smile:

The device you linked to uses a 20ma current loop for data. I assume you are using it that way. I also assume you are using shielded cable to connect to the sensor. The cable shield should be connected to the case, pin 2. Then the Arduino end of the shield should be connected to the Arduino system common ground.

Additional: Further reading shows the cable comes with the sensor, so it seems it is not shielded. But, in any case, the pin 2 wire needs to go to the Arduino ground, which may also be the negative of the power supply. Seems all is well with your project.

This is normal for most things in life, and this is why calibration is needed.

So you think I should recalibrate each of them once every ~6 months or so? Oh well...

I don't think you can calibrate the sensors, but in the code. You somehow found out about this 1%, so you have another way to measure pressure. If it's trusted, you calculate the new error value, and use that in your code.

How many devices? Do they all have similar errors and all in the same direction? Time to show a schematic of one of the installations, including the power sources. What Arduino are you using and how are you measuring the 4-20ma current?

Yes.

It is shielded until the last 3 cm.

Each GND on my circuit (sensor, ESP32, temp. sensor...) is connected to the anode of the battery. I just wanted to know if it was correct to you. It seems to be according to what you're saying.

What is called "Case", is it the case in which I put the PCB plates? That's what I'm using...

The case is defined in the sensor documentation as the stainless steel case of the pressure sensor.

So using plastic boxes as I showed you in the picture in post #7 is not a good thing. I should use stainless steel cases and connect pin 2 to it? Anode should also be connected to pin 2?

Please pay attention! The sensor manufacturer could care less what you do to use their sensor. Their document ONLY refers to their product. What you want to use for YOUR case has no bearing on the sensor document.

If you will show a schematic of your project, perhaps more help could be given. Do you realize the anode is the positive terminal. A cathode is a negative terminal.

I realized after I wrote it. I was going to edit my post. Too late.

I'm a bit scared of sharing all my work as this work belongs to my small company's brother.
My circuit is closed and uses a battery, so from what I read, connecting pin 2 to the cathode of the battery should be fine? Sorry if I can't show everything but I thought it was a general question about Case Grounding for sensors in ESP32 circuits powered with batteries.

The white lead(2) is connected internally to the case of your transducer. That's the case that the instruction manual refers to. You should connect it to the negative terminal of your power supply(battery).
Your transducer can't be recalibrated but you can use a correction factor in your code if you think it needs it. For €300 it should never need anything. If you are using it for measuring liquid depth as it was intended, check to see if there is any debris covering the sensor end. Make sure the vent tube that exits the end with the wires is not obstructed.

No need to be sorry. But case grounding is only necessary for personal safety. The usual battery operation is already safe. What is important, as EmilyJane points out is the end of the sensor tube MUST be open to the atmosphere. Of equal importance is how you go about measuring the voltage created by the sensor 4-20ma circuit. If you are comparing it's voltage to a battery voltage that is decreasing as it discharges, then there is a problem!

Good point. Which Arduino, and code.
Sensors like this one deserve a good (absolute) external A/D, like a (genuine) ADS1115.
The default ratiometric A/D of an Uno or crappy A/D of an ESP is not good enough.
I doubt grounding is an issue, unless the sensor is faulty (water ingress).
Leo..

That's what I'm doing at the beginning.

Agree. They are never clean, especially in these conditions, after a few months. But you're right I should go on the site and clean it regularly.

It is the case. No worries about this point

It was one of my concerns indeed. This is how I get the values (I checked at different depth and it is pretty exact) :

const int analogPin_piezo = 4;       // GPIO04                                         *
float valResist  = 164.3;            // EXACT VALUE OF RESISTANCE R7                   *
float deltaValue = 0.58;             // DELTA PIEZO MEASURED IN AIR                    *
...
valPiez = 0;
for (int i=0 ; i < 10 ; i++) {
   valPiez += analogRead(analogPin_piezo);
   delay(20);
}
valPiezAvg = valPiez/10.0;
float valmA = ((valPiezAvg*3.3/4096.0)*1000)/valResist;
piezoCor = (valmA-4.0)*10/16 + deltaValue;


I hope this method is correct. Let me know.
Thanks to all of you

Which 3.3volt-logic 12-bit Arduino.
Leo..

I'm using GPIO4 on the ESP32 to read the signal of the sensor, and a boost converter that momentally (using the transistor 2N3906) convert the 5V to 12V. I'm also using the TPL5110 to wake up my circuit every 2 hours.

Two concerns here.

  1. The crappy A/D of the ESP32.
  2. noise/ripple on the 12volt supply.
    Leo..

Can that be "corrected"/improved by using capacitors? Actually, I had that problem of repeatability at the beginning but it is much less important now after I've added capacitors in my circuit. Only variations of 1-2 cm between measurements which is acceptable to me. Do you see a solution to your concerns Leo?

A boost converter with a 2N3906 sounds DIY.
??
Theoretical resolution with a 12-bit A/D is 10m / (4096 * 4/5(4-20mA)) = ~0.3cm
Leo..