I recently had an interesting failure in a unit that I use to read 4-20mA signal coming from a pressure transducer. It's a submersible transducer that measures water level in a reservoir. I use a pro-mini with internal ref set to 1.1V, and I run the mA coming from the transducer through a 51 ohm resistor.
The unit worked fine, but at one stage the analog pin that U sed to read the signal just showed 0. No floating, just 0. It took me a while to find the fault, but it turns out that the transducer was broken and was not limiting the current to 20mA or below at all - it was just pumping whatever the power supply had available out into my arduino unit. I didn't measure the voltage, but this was clearly more than what the pro-mini could handle and I guess that pin popped.
Put in a new transducer with a new pro-mini and the system is running again.
Now my question is how I can safeguard this system so that this never happens again. Do I just put a resistor in-line coming from the transducer? Would this size depend on the size of the 24V power supply or is there a standard size I can use that will be a cure-all?
A largish resistor between analog input and sense diode should do the job. Note that this also increases the input impedance, so you better not go over 10k with that resistor.
At 24V at worst you get (24-5)/10000 = 1.9 mA flowing through the pin's clamping diode. That's probably still safe for long term, I normally try to keep it at <1 mA. No-one knows the specification of that clamping diode, really...
wvmarle:
A largish resistor between analog input and sense diode should do the job. Note that this also increases the input impedance, so you better not go over 10k with that resistor.
At 24V at worst you get (24-5)/10000 = 1.9 mA flowing through the pin's clamping diode. That's probably still safe for long term, I normally try to keep it at <1 mA. No-one knows the specification of that clamping diode, really...
There's no reason why you need to use an internal reference. You can change it back to the default and use a 165 ohm resistor (3.3/0.02= 165) and put a 3.3V zener diode across the input with the cathode connected to the input pin and the anode connected to ground.
The zener will make you lose any accuracy on the high end by starting to conduct at well under 3.3V.
It also requires you to keep Vcc very stable - any fluctuations there mess up the readings. This is the kind of readings the internal reference is for.
And possibly worst: that zener will NOT protect against OP's case. Unless the fault is detected before the zener burns and the 24V is after all directly on the pin...
Are you sure it outputs 24V ? Did you measure it with a meter ?
Changing the resistor value is not going to change the voltage. It is what it is. The resistor will only
change the current. If it's really 24V you need a voltage divider between the transducer and the
arduino. Normally a 4-20mA current loop is 5V, not 24. You need to measure it and tell us what
you read.
A series 24k resistor would keep the protection diode current at or below 1mA even if Arduino were unpowered and 24V applied to R1, R2 junction, a ceramic cap would bypass noise.
NOTE: the same thing could happen if there were a wiring fault between the junction of R1 & R2 and
24V -, the sensor would put out maximum voltage trying to drive 4mA through an open circuit.
Current-output sensors are often powered at 12V or 24V (typical for industrial sensors), and produce a CURRENT output - 4-20mA - where the voltage just follows whatever is needed for that current.
The higher supply voltage is needed as otherwise the sensor can not reliably produce a 20 mA output when loaded with a 250Ω sense resistor. The sensor's datasheet will normally give a minimum and maximum load resistance, and you can indeed place a second resistor in the loop without changing the signal, as long as the total remains below the maximum allowed.
That's the fun of current outputs. Very resilient.
raschemmel:
There's no reason why you need to use an internal reference.
Yes there is. A voltage (across the sense resistor) is best read with an A/D with stable reference.
Default Aref makes readout also dependent on the power supply of the MCU, and you don't want that.
raschemmel:
...and put a 3.3V zener diode across the input...
Bad too. Zeners already start conducting below the zener voltage.
That will affect the top end of the sensor readout.
Leo..