Pages: [1]   Go Down
Author Topic: 4-20 mA Output  (Read 2040 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
I'am looking for a solution to convert the PWM output to a 4 to 20 mA signal
Anyone done this before ?

Grz
Logged

Offline Offline
God Member
*****
Karma: 4
Posts: 813
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A suitable low-pass filter would be simplest. The 4-to-20mA part can be implicit if you know the input impedance.

If you know the frequency of the PWM, then design a low-pass LC filter with a "3dB" corner frequency of 1/100th of that. This will give you 80 dB of rejection of the higher frequencies, which is enough for a 12 bit ADC input. For example, for 20 kHz PWM, a corner frequency of 200 Hz will give you 5 ms response time. If you want to use a smaller inductor, or faster response, raising the filter frequency is an option, but you'll get more ripple.

If the PWM is already low frequency, like the 490 Hz that comes out of the Arduino, then you're in more trouble. You'd probably want something that times the interval, and latches the output level until the next cycle.
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12113
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Corner frequency of 200Hz is more like response time of 800us - there's a factor of 2 pi...

An RC filter at 1/100 the frequency is 40dB rejection, not 80dB
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
God Member
*****
Karma: 4
Posts: 813
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Agreed that an RC filter, with 6 dB/octave slope, is 40 dB at 1/100th the frequency.
That's why I suggested an LC filter, which has higher slope :-)
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually converting the PWM to a 0-5vdc analog voltage is probably the easy part. Converting the voltage to a 4-20ma is a little more complex. You will need to know something about the device that is to receive the signal, what impedenace it is providing and if it will provide the loop voltage or not. I think National Semi (or maybe it was Signetics?) use to make a DC voltage to 4-20ma converter IC back when sometime, not cheap as I recall. Otherwise get your op-amp application circuits manuals out and get to work.


Lefty

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lefty,

I was think that direction,  combining the two attach examples
will do the trick, and still tinking about mis use a 78xx in to a const current driver.
Gone build up the breadboard.

thx


* circuito.png (21.12 KB, 1257x619 - viewed 182 times.)

* 4-20mA source 02.png (4.1 KB, 462x253 - viewed 169 times.)
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lefty,

I was think that direction,  combining the two attach examples
will do the trick, and still tinking about mis use a 78xx in to a const current driver.
Gone build up the breadboard.

thx

That should work out, however your specific 'load' my require a grounded 'load resistor', which that second design doesn't appear to support? Also I would suggest you consider adding a little 'fudge factor' of a little more gain then needed and an adjustable offset control. Industrial E-to-I converters almost always included two trimmer pots to fine tune the 'zero' (offset) and 'span' (gain), to allow for fine calibrating the whole system.

Lefty

« Last Edit: February 24, 2012, 03:32:46 am by retrolefty » Logged

Pages: [1]   Go Up
Jump to: