Input output interfacing

Afternoon,

I've been researching 4-20mA inputs and PMW to 0-10v analog outputting and i just wanted to run it by the fine people of this board first to check I've not made any silly mistakes.

Firstly, 4-20mA; A Temperature and Humidity sensor, four wires:
Temperature +
Temperature -
Humidity +
Humidity -

Simple 250 ohm precision resisters in series with the sensors between the ground and the 12v supply i'm using.

Output; 0-5 PWM to 0-10V analog:

Simple RC filter to smooth the PWM then using a Op-Amp with a gain of two to double the output voltage.

fPWM = 488Hz
Duty step = 0% -> 99.9%
PWM voltage = 0v -> 5v
R=51k
C=1uF

Transfer Function
G_((s))=20/(s+20)
Cut off frequency
Fc=3.12Hz
Final Vout value (without ripple)
G(inf) = 4.995v
Peak-to-Peak ripple voltage
Vpk-pk = 0.05v
Settling time
Tr = 0.117 sec

Which the voltage range operation of your sensor?
Few weeks ago I try read a 4-20mA (10-35V), so you need connect one power supply that supply 5V + (min volts) or 5V + 10V = 15V.
Now this is obvious to me, but I need 3 months to discover why my readings of sensor not correct, because I supply only 12V to sensor, now I use one 22V power supply.

Looks good - those resistors are in series with the sensors (ie they carry the same current, not share the same voltage).

Which op-amp are you considering - that circuit requires one that will handle input and output down to the 0V rail, note.

You might consider lowering the impedance of the feedback and filter network to around 10k, often this is the sweet spot
in terms of balancing various error and noise sources - high impedances can lead to more noise, greater risk of instability in the
feedback network and tighter restrictions on the input current and input-current-offset specs of the op-amp. Without knowing
the specs of the op-amp is hard to say more. The opamp will have to drive the output load (which you haven't said anything
about).

Veco:
Afternoon,

I've been researching 4-20mA inputs and PMW to 0-10v analog outputting and i just wanted to run it by the fine people of this board first to check I've not made any silly mistakes.

Firstly, 4-20mA; A Temperature and Humidity sensor, four wires:
Temperature +
Temperature -
Humidity +
Humidity -

Simple 250 ohm precision resisters in parallel with the sensors between the ground and the 12v supply i'm using.

Output; 0-5 PWM to 0-10V analog:

Simple RC filter to smooth the PWM then using a Op-Amp with a gain of two to double the output voltage.

fPWM = 488Hz
Duty step = 0% -> 99.9%
PWM voltage = 0v -> 5v
R=51k
C=1uF

Transfer Function
G_((s))=20/(s+20)
Cut off frequency
Fc=3.12Hz
Final Vout value (without ripple)
G(inf) = 4.995v
Peak-to-Peak ripple voltage
Vpk-pk = 0.05v
Settling time
Tr = 0.117 sec

The polarity symbols you have drawn for the round temp and RH are backwards.

And I suggest you change parallel to series in:

Simple 250 ohm precision resisters in parallel series with the sensors between the ground and the 12v supply i'm using.

Lefty

Here's the sensor i'm using:

It says it should be supplied 5-30v for the mA output. I could use 5V from the arduino i guess, but i figured i'd already broken out the 12v supply to terminal blocks so that would be a better option.

Good point about the resisters on the Op Amp, i should have plenty of 10k resisters around, i used 51k originally because i bought a reel of a 100 of them!

Here is the Op Amp i currently have:
http://docs-europe.electrocomponents.com/webdocs/0e32/0900766b80e32147.pdf

I hope that's ok!

Sorry yup, drew up that too quickly, you're quite right about the polarity and serial/parallel, i'll edit the original post in case others look at it.

Cheers for the feedback so far.

Nice, your sensor will work fine with 12V suppy, but connect the wire + to 12V and wire - to resistor, in your figure is invert..

retrolefty:
The polarity symbols you have drawn for the round temp and RH are backwards.

Ah, that's not actually true, since the sensor is drawn as a current-source, and the signs represent current
measurement direction, not voltage. Usually the signs aren't written as the arrow serves to indicate
polarity.

MarkT:

retrolefty:
The polarity symbols you have drawn for the round temp and RH are backwards.

Ah, that's not actually true, since the sensor is drawn as a current-source, and the signs represent current
measurement direction, not voltage. Usually the signs aren't written as the arrow serves to indicate
polarity.

I'm speaking from a real word situation where all such '2-wire 4-20ma transmitters' have just two terminals labeled + and -. The + must wire to the positive loop voltage source and the - must wire to the series 150 250 ohm resistor, which then wires to the negative loop voltage terminal.

Lefty

I've no idea what, if anything, is the symbol for a 4-20mA sensor. A current source makes sense in my head at least.

I guess if it was drawn correctly the + and - wouldn't actually be around it at all, the diagram only needs to show the 12V source and ground.

The documentation however only gives the electrical connections in terms of a + and - so it's good to have for reference.

In other news, 250ohm resisters ordered, I was shocked at how they start at £5 for such a tiny component. 0.1% tolerance and a specific use market do that i guess.

The +/- on a current source symbol are unusual (it is potentially confusing, pun intended!).

250 isn't a standard value, so fewer are sold, 0.1% is a rare requirement, so fewer are sold, price
is strongly inversely proportional to volume sold. Often an unusual value can be synthesised from
standard values in series or parallel, which can be cheaper. 270 0.1% in parallel with 3k3 1% would
give 250 at about 0.2% accuracy.

Good idea.

I'd like to get all (plus x3 of the op amp circuits) of this plus other bits like an RTC, SD card and screw terminal blocks on a custom PCB shield. I've yet ot lay it out but i think space may be at a premium.

Also some more interfaces (input 0-10v, 4-20mA output), for future use perhaps.
Ooh, maybe networking and SMS compatibility too.

I'm getting ahead of myself, get this working first... Do other stuff on other shields.

Veco:
I've no idea what, if anything, is the symbol for a 4-20mA sensor. A current source makes sense in my head at least.

I guess if it was drawn correctly the + and - wouldn't actually be around it at all, the diagram only needs to show the 12V source and ground.

The documentation however only gives the electrical connections in terms of a + and - so it's good to have for reference.

In other news, 250ohm resisters ordered, I was shocked at how they start at £5 for such a tiny component. 0.1% tolerance and a specific use market do that i guess.

Try E-bay
http://www.ebay.com/itm/Lot-of-5-Precision-Resistors-250-ohms-3W-0-1-/120652538650?pt=LH_DefaultDomain_2&hash=item1c1773a31a

In the refinery I worked at we used almost exclusively 4-20ma current loops for the field process control equiment. I often saw .05% or better tolerance on the 250 ohm 'sampling resistor'. But as the cost of industrial process control equipment was quite high the cost of this primary sampling resistor was of little consequence.

Lefty

Cheers, that's a good source for next time. Unfortunately i'm in the UK and i needed them urgently. I guess i should start looking for SMT now.

My project is to build a controller for temperature and humidity for a meat curing room capable of curing various different products. It's controlling a heater, cooler, humidifier and dehumidifier. (needs to go + and - of ambient).

Got all the code working with PID control (had many arguments with uni friends on the best control method!), which is fine for prototyping. Got the screen and a rudimentary menu system working with a rotary encoder w/push button.

I had an I/O interface board before, similar design to above, but the sensor supplier fitted a 4-20mA sensor and told me it was a 0-10v version... needless to say the 12v supply didn't go where it should have and i had one dead sensor and Arduino mega. I was not pleased.

Plenty to do still!
Data logging
Watchdog timer
SMS support
better menu
resume on loss of power
better system for creating, deleting and editing programs

I think i should get a fairly high precision output with the methods we've discussed, but I've been having a quick look at DAC's.

Is there such a component that'll take a serial input, convert it to analog with a 8 bit precision; is through hole type with 4 DAC's in the same chip, will output a range covering 0-10v and can source 40mA or so?

Probably not, but i could buya quad 8 bit serial DAC chips then put the output through an op-amp with a gain of one. Worth the effort?

Something like this perhaps?
http://uk.rs-online.com/web/p/general-purpose-dacs/7321512/
or