Continue to Site

Welcome to

Welcome to our site! 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.

Detect full-wave and half-wave with AVR

Not open for further replies.


Newbie level 5
Nov 24, 2012
Reaction score
Trophy points
Activity points
Hello ,

Is is possible to use AVR to detect Whether a wave is Full-wave or half-wave ?

my purpose is to rectify an AC Voltage . I have put a single diode for making Half-wave and have put a diode bridge for making Full-wave .
i have used an Opamp to Convert waves into a Square wave Signals (i thought it maybe helps) .

(sorry for my bad english)
Last edited:

I dont understand very much your requirements but there are several ways to discern between full wave or half wave rectification.
Probably the simplest is to measure the mean value. It will be half the value for the half wave compared to that of the full wave. That is if the amplitudes are the same. A simple integrator and a comparator will be enough. If the amplitude is not known then you will need to measure peak value too.
Other method could be measuring the period between peaks. The full wave will have twice the frequency (half the period). Or count the number of peaks in a fixed time. Since you already converted the signals into square waves, that is probably the way to go.
thank you ,

let me explain :

There is a input signal, this signal is Full-wave or half-wave (we don't know which one) , now i want to detect it, using an AVR Microcontroller .

yes, i have used a Capacitor to keep signal peak amplitude and i can measure it , but the problem is signal-frequency is unknown .
i have used AVR timer to count rising edges in 1 second . but still i don't know how to determine which kind of signal it is ?

If you can measure the peak value and the mean value then you can know if it is full wave or half wave. There is no need to know the frequency. Unless the circuits that you use (peak detector and integrator) behave different with the frequency.
see here:
there is a table with the values for AVR (average = mean value). Although I dont know why put that the AVR value of a sine is different than zero. The other values seem to be correct.
RMS can be used too but it is too complicated and not necessary.
Not open for further replies.

Part and Inventory Search

Welcome to