Go Down

Topic: 4-20 mA pressure transducer convert signal to 1-5 volts circuit diagram help (Read 2986 times) previous topic - next topic

knightridar

Ok got it.
I won't be able to try anything using the 100Ω resistor until I get the ADS1115 modules in the mail.

PGA setting with a full scale of +/- 2.048 volts → 

16 bit ADC → 216 = 65,536 → ±2.048V → +2.048V (32,768) →

2.048V/32,768 = .0625mV / bit = .0000625V / bit →

For 0-20 mA → 32,768 steps
For 4-20 mA → 16/20 * 32,768 steps = 26,214.4 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 32,768 = 6553.6 steps (starting point of readings)
→.0000625V / bit * 6553.6 = .4096V  (voltage read out at 4 mA)
→.0000625V / bit * 32768 = 2.048V  (voltage read out at 20 mA)

I managed to get the FC-33 signal conditioner I mentioned below used from eBay.
I'm hoping it's in working condition.... ::) Just got it in the mail.

With both options, I will be using a laptop screen to view serial monitor results from Arduino IDE.

Setup 1:
1. Use 100Ω resistor in series with the current loop
2. Send analog input to ADS1115 (powered via arduino 5v/gnd wires)
3. Results sent via I²C to Arduino

Setup 2:
1. Use FC-33 signal conditioner to convert 4-20 mA signal to 0-5 volts
2. Send results from signal conditioner into analog input of Arduino

Quote
The 20% comes from the ±10% accuracy of 1.1volt Aref (not factory calibrated).
Meaning YOU have to calibrate (to 0%).
With the signal conditioner, I won't/can't use 1.1v Aref? Correct?
I would still have to calibrate for 0-5 volts due to Arduino being plugged in via USB port?

Quote
The resulting pressure value of that circuit could depend on supply voltage of the Arduino.
If you power the Arduino with regulated 7-9volt on the DC socket, it might be stable.
But if you power the Arduino via USB, pressure value might fluctuate.
So I'm confused a bit...

I want to view results from the serial monitor so I must have the arduino plugged in via USB port.
My 5 volt value will fluctuate???

What if I got a converter and powered the Arduino via the 24V dc power supply and
still had it plugged into the USB port? Will I still get fluctuating 5 volts?
7-26V input to 5.0V output converter, with output ripple of 30mV
Is this output ripple sufficient for good results and is it relevant to the fluctuating voltage?

outsider

Have you tried the sensor with the Arduino ADC? Remind me again, which Arduino?

knightridar

I have tried the Arduino ADC on the UNO R3, but I was using this to convert the current to a voltage:

Current To Voltage Module 0/4-20mA To 0-3.3V 5V 10V Voltage Transmitter

It gave me no luck the potentiometers maxed out at a range of ~2.7V.
the pressure transducer ratings were the same or fluctuating.
I was applying water pressure within the ranges of 0-50 psi (0-344.738 kPa)

I'm going to try it with the signal generator first and see what kind of readings I get first.
FC-33 Signal Generator Manual

Then when I get the ADS1115 in the mail I will use that.

knightridar

Well it looks like the used signal generator I got on eBay doesn't work. It was worth a try.  :(


Here is some info I found on Arduino ADC
Precise voltage measurements with the Arduino
Quote
These specifications tell us the Arduino is capable of measuring voltages to an accuracy
of  ± 2 LSB  - so the maximum error is 2 bits (4 decimal) in 10 bits (1024 decimal)
So the worst case accuracy of the converter is 4 / 1024 or 1 part in 256  i.e. 0.25%.
Quote
The Arduino has its own voltage references - but they are not very precise
The chip - depending on type -  is provided with SOME of the following reference voltages
DEFAULT: the default analog reference of 5 volts (on 5V Arduino boards) or 3.3 volts (on 3.3V Arduino boards)
INTERNAL: a built-in reference, equal to 1.1 volts on the ATmega168 or ATmega328 and 2.56 volts on the ATmega8 (not available on the Arduino Mega)
INTERNAL1V1: Vint1 - a built-in 1.1V reference (Arduino Mega only)
INTERNAL2V56: Vint2 -  a built-in 2.56V reference (Arduino Mega only)
EXTERNAL: the voltage applied to the AREF pin (0 to 5V only).
(3)

However the accuracy of these "reference" voltages is very limited. For example
DEFAULT: depends on your computer power supply
(4: 7.3.2)  USB2  Vbus = 4.4V - 5.25V     
(2: 31.8)  Vint 1 = 1.10V  actually 1.00 -- 1.20V
(2: 31.8)  Vint 2 = 2.56V  actually 2.40 -- 2.80V

The accuracy of the reference against which the voltage is measured - using any of the above references -  is at best only 5.25 - 5.0/5.0 * 100 = 5%  - much worse than the 0.25%. the ADC provides.  Clearly if we wish to measure voltages to the accuracy provided by the Arduino the on-chip references are not good enough. The diagram below shows these errors as compared to a 4.096v reference described below.
Making accurate readings on the Arduino for analog input voltage

*********************************************************************************

Quick recap...

Using 100 Ω resistor,
V = IR
2.048V = I *100 Ω → .02048A = 20.48 mA
V = .004A * 100 Ω = .4V

16 bit ADC → 216 = 65,536 → ±2.048V → +2.048V (32,768) →
2.048V/32,768 = .0625mV / bit = .0000625V / bit
For 0-20 mA → 32,768 steps
For 4-20 mA → 16/20 * 32,768 steps = 26,214.4 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 32,768 = 6553.6 steps (starting point of readings)
→.0000625V / bit * 6553.6 = .4096V  (voltage read out at 4 mA)
→.0000625V / bit * 32768 = 2.048V  (voltage read out at 20 mA)

689.476 kPA (100  psi) max. pressure spec. of transducer →689.476kPa / 2.048 = 336.658203125 kPa/V
→  336.658203125 kPa/V  * .0000625V/bit = 0.0210411376953125 kPa/bit
→ 0.0210411376953125 kPa / 689.476 kPA = 0.000030517578125
0.00305 % of pressure transducer rating (theoretical resolution)

************************************************************************************

Using 250 Ω resistor,
V = IR
5V = I *250 Ω = .020A = 20 mA
V = .004A * 250 Ω = 1V

10 bit ADC → 210 = 1,024 → 0-5V→ +5V (1,024) →
5V/1,024 = 4.88mV / bit = 0.0048828125V / bit
For 0-20 mA → 1,024 steps
For 4-20 mA → 16/20 * 1,024 steps = 819.2 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 1,024 = 204.8 steps (starting point of readings)
→0.0048828125V / bit * 204.8 = 1V (voltage read out at 4 mA)
→0.0048828125V / bit * 1,024 = 5V(voltage read out at 20 mA)

689.476 kPA (100  psi) max. pressure spec. of transducer →689.476kPa / 5 = 137.8952 kPa/V
→  137.8952 kPa/V  * 0.0048828125V / bit = .67331640625 kPa/bit
→ .67331640625 kPa / 689.476 kPA = .0009765625
0.09765625 % of pressure transducer rating

************************************************************************************

Using 51 Ω resistor,
V = IR
1.02V = I *51 Ω → .020A = 20 mA
V = .004A * 51 Ω = .204V

With Aref 1.1

10 bit ADC → 210 = 1,024 → 0-1.1V→ +1.1V (1,024) →
1.1V/1,024 = 001.07421875mV / bit = .00107421875V / bit
For 0-20 mA → 1,024 steps
For 4-20 mA → 16/20 * 1,024 steps = 819.2 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 1,024 = 204.8 steps (starting point of readings)
→.00107421875V / bit * 204.8 = .22V (voltage read out at 4 mA)
→.00107421875V / bit * 1,024 = 1.1V(voltage read out at 20 mA)

689.476 kPA (100  psi) max. pressure spec. of transducer →689.476kPa / 5 = 137.8952 kPa/V
→  137.8952 kPa/V  * .00107421875V / bit = 0.148129609375 kPa/bit
→ 0.148129609375 kPa / 689.476 kPA = 0.00021484375
.021484375 % of pressure transducer rating

Wawa

Why are you calculating in volt. Are you making a voltmeter?
I thought you were making a pressure sensor.

Makes more sense to directly calculate the available bits/steps to pressure.
And, since humans think in the decimal system, you have to incorporate that in your calculations.
Every added digit requires a 10x better setup.

Take a 100psi sensor as example.
With the ~820 steps available from a Arduino, the limit is 'almost' 0.1psi. For 0.1psi you need 1001 steps.
Oversampling might just get you to one decimal place.
It will make no difference if you use default Aref or 1.1volt Aref.
1.1volt Aref is just more stable, given that the sensor is a ratiometric type (4-20mA).

With the ~26000 steps of an ADS1115, you can have a 0.01psi readout.
Not a 0.001 readout, because that would require 10001 steps.

If the readout is in different units (bar, kPa), you might be able to make better use of those ~26000 steps.


"0.0048828125V/bit" is a bit silly if you know that the 5volt supply can vary a few percent in seconds.
"About 4.8mV" is more realistic.

V = .004A * 250 Ω = .1V ? I get 1volt.
204.8 steps // there are no 0.8 steps.
Leo..

knightridar

Thanks.

I was putting in the voltage calculations as a point of reference for others if they have similar problems.
In the beginning I was trying to use my multimeter to read voltage from the Vout portion of the initial module I was using below..

4-20 mA to Voltage conversion module

to confirm if the voltage reading/pressure on my serial monitor matched that of the conversion module.
The device didn't work out so well. The pressure regulator I was using allowed me to see what pressure was being applied to the sensor and the pressure readings on the serial monitor were not correct either. I believe the module is broken.

Correcting the .1V error ... typo... Thanks.

Wouldn't the voltage readings be useful if we were to measure them from the analog input port?
i.e. to use them for offsetting or calibration purposes?

outsider


knightridar

I don't have those resistors.
I'm ordering these though:

For:

2.408V
100 Ohms resistor, +/-.01% tolerance

5V
250 Ohms resistor, +/-.01% tolerance

Aref 1.1V
51 Ohms resistor +/-1% tolerance

Sorry your schematic was a bit confusing for me. I'm getting more comfortable with them over time.
If my interpretation is correct then the 220Ω and 27kΩ resistors in parallel would be connected across the positive and negative leads on the terminal block?

I chose to go with the 250Ω  or 100Ω setup in series and then use a 10 kΩ resistor for voltage protection going into the Arduino or ADS115. I added a 1N4001 diode (didn't have 1N4007 available on me) for reverse polarity protection.

Here is a mockup picture of my setup (I still have to get the actual resistors):
It's based on the schematic I found on the Arduino forums in my first post of this thread.


outsider

The diode is NOT for reverse polarity, remove it. Don't hook up to Arduino yet, do some voltage checks first. Turn on the 24V and put your voltmeter across the 250 Ω resistor, what voltage?

outsider

#24
Jan 16, 2019, 03:24 am Last Edit: Jan 16, 2019, 03:45 am by outsider Reason: Corrected drawing
The diode is NOT for reverse polarity, remove it. Don't hook up to Arduino yet, do some voltage checks first. Turn on the 24V and put your voltmeter across the 250 Ω resistor, what voltage?
WAIT, WAIT! you have the 100 Ω R across a short circuit.

knightridar

Thanks for catching that  :o ...updated picture



Just out of curiosity how did you get the 27kΩ number for the resistor going into the Arduino analog input?

Fyi....
I was using the diode due to Wawa's response in post no. 2. about reverse polarity protection.
I know your suggestion was for measuring current.

Quote
Keep the rest of the (protection) parts the same, but add a diode (1N4004) across the sense resistor (anode to ground) for added polarity reversal protection.
Leo..

Wawa

That setup won't work witout connecting supply ground (big arrow) to Arduino ground.
Leo..

knightridar

Okay I added the ground wire.
I had the same problem last time with a l298 h-bridge driver connected to the arduino.



I'm still trying to figure out why 27kΩ  resistor is being used for going into analog input.
Does it have to do with voltage dividers?

Wawa

The 27k resistor is there for the safety of the analogue pin.
It limits fault current into the pin to <1mA, in case you make a wiring mistake (24volt on the pin).
Can be replaced for 22k or even 10k, and the pin will probably still survive that abuse.
Can even be omited (shorted), but then you will blow up the pin if you do something wrong.

Because the internal impedance of the pin is extremely high, that resistor has little or no effect on the measurements.
Leo..

knightridar

I see thanks.
Will the tolerance of the resistor affect the voltage readings
or I can be free to use a lower tolerance resistor?

I found  this:
27 kΩ +/-.1 % tolerance resistor

Hopefully I understood the math properly (i.e. incorrect wiring supplies 24V dc power to analog in)
24V/27kΩ= .00088 A = .88 mA
in my case (actual voltage)
24.3V/27kΩ= .9 mA

I thought the current limit of every Arduino Uno IO pin is 40 mA?
24V/.04A= 600 ohms
Wouldn't any resistor above 600 ohms be sufficient?
I know I wouldn't want to be right at the limit.

Is this not good enough?
24V/10kΩ= 2.4 mA

Go Up