Currently, I have a high precision 24v, 4-20mA, 2 wire sensor connected via a voltage divider (actually I don't technically think it is a voltage divider - not sure what the technical term would be) to my Arduino Uno. It's working but the resolution from the Uno's analogue inputs isn't quite sufficient and there's a little more noise than expected.
Metal Film Fixed Resistor 250Ω ±0.1% 0.125W ±10ppm/°C (for "voltage divider" to convert 4-20mA = 1-5V)
5.1V Zener Diode 5% 500 mW (for analogue input protection)
Siemens 6EP3331-7SB00-0AX0 (24V supply)
Arduino UNO
I'm moving to use the Adafruit ADS1115 ADC to improve resolution and using 2 channels for differential to reduce noise sounds good BUT can't for the life of me work out - can I actually do this with a 24V sensor...? I've Googled for over an hour and failed to find good info... I'm failing to conceive the appropriate circuit so any help appreciated.
R1 is calculated for 5volt, which is wrong for both an Arduino Uno and an ADS1115.
R3/D1 are added for protection, but a zener does nothing more there than add noise and non-linearity.
I would use a ~200ohm resistor for R1.
That results in 0.02*200= 4volt@20mA, and is perfect for the PGA gain of 1x of the ADS1115.
Temp drift is important, but tolerance is irrelevant if you compensate (calibrate) in code.
For protection, I would remove the zener and use a common (1N4004) diode across R1,
to shortcircuit any negative input voltage.
And increase R3 to 10k, to protect the (10mA) protection diodes that the ADS1115 already has.
Leo..
I understand R1 is not optimum for the full 20mA range on the ads1115 but I thought the Uno adc full range was 5V? (The 250ohm being what I bought when testing the Uno built in adc). My electronics are basic so looking to learn.
Really appreciate the pointer on the Zener diode and noise - that was what seemed like a good idea from a stack exchange post I researched for reading current loops.
I assume trying to use the 2 channels for differential is not possible in this scenario?
arduinoexperiments:
I understand R1 is not optimum for the full 20mA range on the ads1115 but I thought the Uno adc full range was 5V? (The 250ohm being what I bought when testing the Uno built in adc).
It's not wise to use default Aref (5volt) for a 'current>voltage' sensor, because that would make results dependent on the potentially 'dirty' 5volt supply. Arduino's ratiometric A/D with default Aref should only be used for ratiometric sensors (pots, thermistors etc.).
The Uno also has a 1.1volt Aref. It would be possible to read a 4-20mA sensor with that, using a 51ohm sense resistor.
Still stuck with the 10-bit A/D, with in this case 61/20*1024= ~820 usable values/steps.
arduinoexperiments:
I assume trying to use the 2 channels for differential is not possible in this scenario?
The ADS1115 can measure voltage across the current sense resistor, but the two inputs for differential MUST be within the common mode range of the ADS. That would be hard without a reference point. Much easier/safer to measure single-ended (ground referred).
The ADS1115 has a voltage/absolute A/D (buildin/fixed reference), and a 5volt range on a 5volt supply.
You could use the 250ohm resistor and default PGA (2/3), but then you loose some resolution (5/6.144).
Leo..
That's been really helpful. To be sure I've understood correctly rather than rely on the, probably noisy, 5v I am running the external ADC on it is better to utilise its internal voltage references as they have some noise suppression?
If so does the ADS1115 have multiple voltage references (ie is there an optimum one to utilise?) - I read its spec sheet but couldn't see specific reference(s)...
Tomorrow I will remove the zener diode (order placed for some 1N4004) - is there anything else I can do to the circuit to remove noise (aiming for sample rate of close to the boards stated 860/sec so I can do software smoothing without over a 15ms delay of averaged reading).
What kind of 'noise' are we talking about.
Smoothing is lowpass filtering (high frequency noise removal).
What kind of 4-20mA sensor are you connecting to the ADS.
Leo..