AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

3
8/10/2019 AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD http://slidepdf.com/reader/full/ac-voltmeter-frequency-meter-using-arduino-uno-board 1/3 TO MAKE A DIGITAL FREQUENCY METER AND AC VOLTMETER USING ARDUINO UNO BOARD (RANGE 0-200HZ APPROX.) Presently I'm working on ubuntu 14.04, running proteus under virtualbox windows xp. This is the iruit diagram made in proteus. The omponents used are listed on the le!t side o! the image. "ow lets move to the main portion o! the ode, that is how to program the arduino board to !untion as a #ero ross detetor and measure !re$ueny. %e will use a sinusoidal input signal with &0# !re$ueny or you an hoose anything aording to your wish. (irst o! all, the loop)* heks i! analog input value is #ero, i! it is #ero, it starts a milliseond timer whih ounts milliseonds until the next #ero enountered i.e. hal! time period. +o !re$ueny 1-T h#. /ultiply by 1000 to get !re$ueny in #. 23 )one should be easy with basi oding using 5627I" I23 hek httparduino.

Transcript of AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

Page 1: AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

8/10/2019 AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

http://slidepdf.com/reader/full/ac-voltmeter-frequency-meter-using-arduino-uno-board 1/3

TO MAKE A DIGITAL FREQUENCY METER AND AC VOLTMETER USING ARDUINO

UNO BOARD (RANGE 0-200HZ APPROX.)

Presently I'm working on ubuntu 14.04, running proteus under virtualbox windows xp.This is the iruit diagram made in proteus. The omponents used are listed on the le!t side o! the

image.

"ow lets move to the main portion o! the ode, that is how to program the arduino board to !untion

as a #ero ross detetor and measure !re$ueny. %e will use a sinusoidal input signal with &0#!re$ueny or you an hoose anything aording to your wish.

(irst o! all, the loop)* heks i! analog input value is #ero, i! it is #ero, it starts a milliseond timer

whih ounts milliseonds until the next #ero enountered i.e. hal! time period. +o !re$ueny 1-T

h#. /ultiply by 1000 to get !re$ueny in #.

23 )one should be easy with basi oding using 5627I" I23 hek httparduino.

Page 2: AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

8/10/2019 AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

http://slidepdf.com/reader/full/ac-voltmeter-frequency-meter-using-arduino-uno-board 2/3

examples*

8 by +5/ 56596T: 3;3T6I5; 3"<I"336I"< %.9.7.T. .I.3./.

7"I=.6;; 1&>01&110?@

link !b.omsohamhakrabortyA 8

BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

8 by +5/ 56596T: 3;3T6I5; 3"<I"336I"< %.9.7.T.link !b.omsohamhakrabortyA 8

Cinlude D;i$uidrystal.hE;i$uidrystal ld)1-, 11, >, 4 , @, -*F

int analogInput G 0F

!loat vout G 0.0F!loat vin G 0.0F

!loat 61 G 100000.0F resistane o! 61 )100* Bsee textH

!loat 6- G 10000.0F resistane o! 6- )10* B see textH!loat value G 0,nvalueG0F

int pG0,ountG0,mG1,$G0F

void setup)*

 pin/ode)analogInput, I"P7T*F

 ld.begin)1&, -*F  ld.print)JP565/3T36+J*F

K

void t)* timer in milliseonds

  delay)1*F

  pLLFK

void loop)*

  ountGG0F

while)ountGG0*;P 5;7;5T3+ (63M73": 

  value G analog6ead)analogInput*FpG0F  i!)valueDG0.001* #ero ross detetion 

t)*F  value G analog6ead)analogInput*F

  while)valueE0.001*

 

value G analog6ead)analogInput*F  i!)valueDG0.001* alulates !re$ueny

  ountG1000)-8p*F breakF  K

  else

Page 3: AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

8/10/2019 AC VOLTMETER & FREQUENCY METER USING ARDUINO UNO BOARD

http://slidepdf.com/reader/full/ac-voltmeter-frequency-meter-using-arduino-uno-board 3/3