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.

Real time Monitoring AC voltage with Atmel

Status
Not open for further replies.

gie_b_hsb

Junior Member level 2
Junior Member level 2
Joined
Oct 30, 2006
Messages
23
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,446
true value of ac voltage

Dear all,

please help me to make real time monitoring AC voltage with atmel microcontroller.....?

thank's for your all attention and cooperation.


rgrds,


gie
 

monitoring ac voltage

gie_b_hsb said:
please help me to make real time monitoring AC voltage with atmel microcontroller.....?
I apologize in advance for being a little caustic, but the term “monitoring” is good mostly for humanitarians. What it is that you want to measure and calculate?
 

ac voltage avr measure

sorry about "monitoring" term.
I mean, i want to measure ac voltage (include AC current) in AC line network so that i can see the ac voltage on big seven segment or similar. ...


thks....


rgdrs,



gie
 

lcd_out library

AVR OR PIC have adc for read voltage.

AVR'* Project name:
' adc on lcd
'* Author:
' MikroElektronika, September 2006.
'* Description:
' This program demonstrates how to use ADC library.
'* Test configuration:
' MCU: ATmega16
' Dev.Board: Easy AVR 3
' Oscillator: External, 8 MHz
' Ext. Modules:
' SW: mikroBasic for AVR 4.00
' * NOTES:
' connect potentiometer to MCU
'
program adc_on_lcd
dim data as word
text as string[7]
main:
Lcd_Init(PORTC, 4, 2, PORTA, LCD_HI_NIBBLE)
Lcd_Cmd(LCD_CURSOR_OFF)
Lcd_Out(1,1,"Analog Voltage:")
while true
' adc input PORTA.1
data=Adc_Read(1)
WordToStr(data, text)
Lcd_Out(2,5, text)
Delay_ms(10)
wend
end.

'========================

PIC
'(*
' * Project name:
' adconlcd2
' * Copyright:
' (c) mikroElektronika, 2005 - 2006
' * Revision History:
' 20050312:
' - initial release.
' * Description:
' This code demonstrates how to use library function ADC_read, and library
' procedures and functions for LCD display (4 bit interface)
' * Test configuration:
' MCU: PIC16F877A
' Dev.Board: EasyPIC4
' Oscillator: HS, 8.000 MHz
' Ext. Modules: None
' SW: mikroBasic v5.0 or higher
' * NOTES:
' - If you are using EasyPIC4, use provided jumper on top right to connect potentiometer to RA2
' *)
program AdcOnLcd2

dim ch as byte
CurrentValue, LastValue as word
Text as char[10]
qqqq, rrrr as float


sub procedure WordToStrWithZeros2(dim input_ as word, dim byref output as char[4])
dim len_, tmp as byte

len_ = 1
if input_ > 9 then
Inc(len_)
end if
if input_ > 99 then
Inc(len_)
end if
if input_ > 999 then
Inc(len_)
end if
output = "0000" ' right justified
dec(FSR)
while len_ > 0
tmp = (input_ mod 10) + 48
INDF = tmp
dec(FSR)
input_ = input_ div 10
dec(len_)
wend
end sub

main:
PORTB = 0 ' clear portb
INTCON = 0 ' disable all interrupts
OPTION_REG = $80
ADCON1 = $82 ' configure VDD as Vref, and analog channels
TRISA = $FF ' designate porta as input

Lcd_Init(PORTD) ' initialize (4-bit interface connection)
Lcd_Cmd( LCD_CURSOR_OFF) ' send command to LCD (cursor off)
Lcd_Cmd(LCD_CLEAR) ' send command to LCD (clear LCD)
Lcd_Out(1,1,"mikroElektronika") ' print string a on LCD, 1st row, 1st column
Lcd_Out(2,1,"LCD example") ' print string a on LCD, 2nd row, 1st column
Delay_ms(2000)
Lcd_Out(2, 1, "voltage:") ' print string a on LCD, 2nd row, 1st column
Lcd_Chr(2, 15, "V") ' Write "V" out of the loop, since it never changes

LastValue = 0 ' Inititalize LastValue

while true

CurrentValue = ADC_read(2) ' get ADC value from channel No.2

if CurrentValue <> LastValue then ' perform conversion only if they are different

rrrr = CurrentValue*(5000.0/1024.0)' 5 Volts over 1024 levels (10-bit conversion)

CurrentValue = rrrr ' This assignment will convert float to word

WordToStrWithZeros2(CurrentValue, Text) ' Convert word to string with zeros (right justified)

Text[4] = Text[3] ' This sequence will
Text[3] = Text[2] ' insert the "." character
Text[2] = Text[1] ' just after the first char in Text.
Text[1] = "."
Text[5] = 0 ' The string always ends with 0

Lcd_Out(2, 9, Text) ' Write formatted text

LastValue = CurrentValue' Equalize them so next time we do not write the same value
end if
wend
end.
 

atmel rms voltage

Thank's masud58 for your solution but i'm still confuse about this code, do you mind if you give your circuit and example circuit.....cos i'm not understand about MCU....
 

ac voltage monitor filter circuit

Use a transformer to step down the voltage lower than 5V AC. Make it DC using bridge rectifiers. Use a resistor and a capacitor in series as follows:

------^_^_^-------------------------
|
|
==
==
|
|
----------------------------------------

to make a filter circuit. use small value capacitor so that it can just filter the ripple and doesn't store much charge to give real time data.

Read the DC through a ADC pin
run the ADC on a loop and display the voltage after calibration
 

ac measure with avr adc

I guess you are not interested in the instantenous value of the AC voltage (or current). as the instantenous value changes by a freuency of 50Hz. so it is nonesense to show such value on a seven segment.
I guess that you are searching for "True RMS measurement". ok do the following steps:

1- use a voltage divider to reduce the AC voltage to 2.5 V (corresponding to 311V) and -2.5V (corresponding to -311V)

2- Use an instrumental amplifier (AD620 for example) to shift the measured voltage to
a value between 5V (corresponding to 311V) and 0 (corresponding to -311V)

3- Use ADC to measure the instantenous value

4- Intergrate and calculate the True RMS value

5- Send the measured value to Seven segment

if you need to measure the average value instead for True RMS you can use a rectifier and big capacitor before the voltage divider.

Regards
ahmed Salah
 

ac v meter with ad736

Dear ahmedsalah00

I think, i interesting with instantenous value of the AC voltage (or current) so that i can knowing power stability in my room....maybe you can give any circuit or web link to bulid this measurement......thk's for your solution n information....
 

analoge voltage on avr lcd

will you be happy seeing the seven segment flickering 50 times a second ?! True RMS is what you need.
 

capacitor measure atmel

i think you use ture RMS to DC converter for best results ... i used it and i got very good results the chip # AD736 :D
 

can atmel measure dc voltage

ashad: can you help-me? i've tried to use both ad736 and ad636, and also ad736, but i don´t get the results... can you post your circuit? thanx
 

ad736 ac voltage monitor

Dear Claw,

sorry for late reply.......... i was busy, i am sending of tested circuit perfectly working for ur help

7_1169452086.GIF


if u have futher query then feel free to ask
 
  • Like
Reactions: fwf and rcanr

    rcanr

    Points: 2
    Helpful Answer Positive Rating

    fwf

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top