Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to generate 4-20ma signal from the AVR microcontroller port pin ?

Status
Not open for further replies.

madhub63

Junior Member level 1
Joined
Jan 12, 2008
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,370
Hi,
I want to generate 4-20ma signal from the microcontroller port pin using avr microcontroller. I know that by connecting a dac (serial) and converting that voltage to current is possible but i want to know any other method available.

Thank U
 

how pwm 4-20ma is generated

Take a look at this example:


Although it uses PICAXE as "the brain", the principle of the operation remains the same for all other microcontrollers, including AVR:
PWM generated at one output pin and analog input as feedback ..

Regards,
IanP
 

    madhub63

    Points: 2
    Helpful Answer Positive Rating
pwm 4-20ma

Thank u for ur replay but i dont have much points to download ur file.

Bye
 

generating 4-20ma

Hi!
If you donot want to use the DAC then you can use the PWM of the PIC to generate differnet voltages across an RC (Resistor+capacitor)network. Simply vary the duty cycle of the PWM signal to generate different voltages and thus different currents.

Best Regards.
 

    madhub63

    Points: 2
    Helpful Answer Positive Rating
generating 4-20ma output with pic

Actually i am using the atmel avr microcontroller.It has 4 channels of pwm is it possible to use that one to generate voltages . But i want that votage has to be there untill or unless i changed the value loaded to the dac register is it possible to that job using pwm.Is itpossible to send u that circuit of generating voltage from pwm pin.
Thank U
 

pwm microcontroller 4-20ma

Hi,
Yes, so long as you keep the duty cycle value in the PWM register the same., it will continue to output. For 4 to 20 ma, you vary the PWM duty cycle value from 20% to 100%. Take the average of the output waveform and convert it proprtionately to current.
Regards,
Laktronics
 

    madhub63

    Points: 2
    Helpful Answer Positive Rating
pwm-4/20ma

Hi!
Yes you can do that as alreday suggested by laktronics. I used the PWM of the AVR to generate DTMF signals which is very difficult as compared to generating 4-20mA so you can use the PWM for your generating 4 -20mA.
Regards.
 

    madhub63

    Points: 2
    Helpful Answer Positive Rating
avr 4-20ma

Hello friends,
I know that the avg o/p from the pwm is dc but how to cope up with the timing constraints.
 

how to generate 4to20ma signal from pwm signal

Hi!
Check out this application note. It will solve your problem.
Regards.
 

    madhub63

    Points: 2
    Helpful Answer Positive Rating
generare 4 - 20 ma

Thank u for ur valuable replay .I have one more doubt regarding the PWM of avr microcontroller .Whether pwm uses the available timers(3) to generate the voltages or it will work independently from the timers? In atmega 8535 it is shown that it has 4 channel of pwm but the timers available in that controller is only 3 how is possible to program the four channels of pwm? I am asking this question because i want to use 3 dacs for my application but i am already using 3 timers for the other applications.
 

Re: generating 4-20ma

Hi!
Well that question is a bit tricky but so far what i have understood is that you can use the timer interrupt as a normal timer interrupt while still using the timer for generating PWM but only in the phase correct PWM mode. Since in this mode the timer is never reset but continously counts from 0----255-----0 i.e first it upcounts to 255 and then down counts to 0 and timer interrupt is generated when it reaches 0. This has been explained in detail on page 78 of the mega8535 datasheet.

Regards.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top