I have been playing with my AtMega256 and have found a weird behaviour that could be used for zero-detection.
I am using a USB charger for powering Arduino.
When I read an analog input I am getting a nice sine wave at 50Hz.
However, this only happens under certain conditions:
- ALL analog inputs must be not connected, or connected to air (antenna?).
- Any other analog inputs must not be read while performing the detection.
- If the sampling is done too fast it soon degrades the signal (it goes towards zero). Sampling at 1ms the signal is quite robust.
I was wondering if this could be used for a software-only solution to zero-crossing detection.
What do you think? Are you able to replicate what I am seeing?