The purpose of this project is to provide a 4-20 mA output from a PWM signal generated by a microcontroller. One of the more interesting applications of this circuit would be to replace or to realize a smart sensor with Arduino.
Arduino Uno, or systems based on the ATmega328 chip has no a true analog output. The easiest way is to use one of the PWM outputs and filter the signal with a passive RC filter to obtain an analog signal proportional to the duration of the pulses. This expedient creates a considerable noise due to the frequency of the PWM itself. To eliminate the noise I used a second order active low-pass filter, Sallen-key type. The frequency of the Arduino PWM (with 16 MHz clock) on pin 9 is about 490 Hz, so I used a very low cutoff frequency (11 Hz) but with a bandwidth sufficient for the majority of industrial controls.By connecting the filter directly to the PWM output is obtained a signal which varies from 0 to 5 V which would give an output current of 0 to 20 mA. The pulses duration is programmed with a word of 8 bits, losing 1/5 of the full scale. To improve the current resolution from 20/255 to 16/255, I modified the minimum amplitude of pulses from 0 to 1 volts, giving at the output a 4 to 20mA current.
Elektor Magazine is al 65 jaar een van de toonaangevende informatiebronnen op het gebied van elektronica voor ingenieurs, ontwerpers, start-ups en bedrijven. Ons magazine wordt ondersteund door een actieve community van elektronica-ingenieurs – van studenten tot professionals – die gepassioneerd zijn over het ontwerpen en delen van innovatieve ideeën.
Voor hen publiceren we jaarlijks honderden items in verschillende formats, zoals artikelen, video’s, webinars en andere leervormen. Onze missie is om kennis op elke mogelijke manier te delen en lezers te inspireren met de nieuwste ontwikkelingen binnen de elektrotechnische sector.
Bedankt voor uw beoordeling!
Voeg hieronder eventueel commentaar toe!
Bedankt voor uw beoordeling!
Reactie bij uw beoordeling plaatsen? Log hieronder in. Geen behoefte aan? Sluit dan gewoon dit venster.
Discussie (0 opmerking(en))