View Full Version : 4 -20mA Analogue input help
andybarrett1
- 25th April 2020, 21:10
Hiya
Just a quick one ....need to interface a 4-20mA signal to a pic
I know I can do it with probably a 250R resistor and Opamp LM358
Wonder if anyone done anything similar
Or any pointers / pitfalls
Thank you for reading
Andy
MOUNTAIN747
- 25th April 2020, 21:38
Andy, a 250 precision Res is what I always used in the field for years. Just check the voltage across the res with the pic. I would think it depends on the accuracy you need.
wayne
Ioannis
- 26th April 2020, 13:37
I'd recommend 0.1% or best and also an input protection for overvoltage on the PIC side. If for any reason the ground side of the resistor is disconnected, it is certain that the PIC will be destroyed.
Ioannis
sayzer
- 2nd May 2020, 19:47
If you will use 10-bit ADC to read the voltage on 250R resistor, why would you need an opamp?250R will give you 5V at 20mA max.and, 1V at 4mA lowest.Your ADC reading will be from 205 to 1023.And remember, most 4-10ma sensors provide lower than 4mA and higher then 20mA; Mostly, 2mA to 25mA is the field.So you may want to keep your voltage range between 0.5V and 4.5V. I would not go for 5V at max mA. You should make it 4.5V at 20mA. So if it goes higher than 20mA you still have room to detect it.
Ioannis
- 2nd May 2020, 20:50
In case the ground return is somehow opened, won't this destroy the pic?
Ioannis
sayzer
- 3rd May 2020, 10:29
In case the ground return is somehow opened, won't this destroy the pic?
Ioannis
Yes, I think so; Most likely it will burn the i/O circuity of the pin.
If not, you get reset.
And, most of the time, people tend to connect sensors without powering-off the reader device. So there is high possibility that what you said is indeed a highly possible scenario.
CuriousOne
- 3rd May 2020, 16:09
Accidentally delivered 12VDC to GPIO.5 of 12F683. Port is now dead, but other ports and IC itself work properly.
Ioannis
- 3rd May 2020, 16:25
But I do not see an input protection circuitry. Only the 250Ω resistor.
I think better to use a 240Ω resistor, then a series resistor with diodes to Vdd and ground for the least protection.
Better use these:
1. A ferrite ring (say Murata BLM21, 1K@100MHz) in the input wire. Then a small capacitor of 47-100pf to ground. This will give a protection to very short transient input voltages.
2. Then 1K in series and 100pf to ground for a strong low pass filter so a 500V pulse will give a 5V/ns slew rate on the 100pf.
3. Two LND150 with a common resistor of 1K will give a two way current limit of 10mA so the diodes mentioned above can handle the excess current to power supply.
Ioannis
andybarrett1
- 5th May 2020, 14:33
Hi All
Thank you... Thank you ......
I am more confused than ever now.....But all good advice.... I was thinking I was keeping it simple with my 250R and Op-Amp
But lots of good advise here......like the 0-5v to 4.5v Idea.... Never thought :-)
Precision resistor is good ... But again liking the 240R plus Series 10R with diodes
Just swamped...... Thank you Again all
Processing the help
Andy
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.