Using Atmega 328 internal analog comparator

Hi, Guys

I want to make a zero crossing detector using arduino internal analog comparator.Is it possible to apply a sine wave of (say 1v amplitude frequency 50HZ from a step down transformer) with negative peak to its non-inverting terminal as normal comparator or should i use dc offset to sine wave for comparing.

Please Help.

Too vague. Please supply some drawings, preferably one for each alternative idea.

You can't drive a pin below ground without risking damage to the pin structure.

Consider using an optocoupler; there are numerous examples of ZCD circuits online.

aarg:
Too vague. . . .

Yes, but it is not much more vague that the description of the electrical characteristics of the ATMEGA328P's analog comparator in the data sheet.

Start by applying an appropriate offset to get the whole waveform in the positive domain. A 2.5V offset is a safe bet (nicely in the middle).

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.