Spurious Zero-Crossing Signal and more Spurious Arduino Interrupts

Discussion in 'General Electronics Chat' started by mhoyt, Oct 3, 2015.

  1. mhoyt

    Thread Starter New Member

    Oct 3, 2015
    I've got an interesting problem and I'm hoping somebody here can help with it. I'm building a light dimming circuit with an H11AA1 chip. Things are sort of working but when I look at things with a logic analyzer, I'm seeing some strange things that I'd really love to understand.

    Strange 1) The signal from the H11A11 seems to have some spurious noise right around where the signal is raised and when it falls.

    Strange 2) The output signal from H11A11 is attached to an arduino interrupt (rising edge). I'm tracing the execution of the ISR with a GPIO (high upon entry and low upon exit). I'm seeing the ISR trigger with the additional noise near the rising of the zero cross signal but then I'm also seeing additional triggers that I can't explain as well as what I have to assume are missed edges as well.

    Hopefully some pictures will help. Channel 00 is monitoring the direct output of the H11AA1. Channel 01 is the execution of my ISR associated with that signal.

    This trace shows the rising and falling of one zero cross detection. There's some interesting noise at both the rising and falling events. The two runs of my ISR near 0.55ms I can attribute to the noise on Zero Cross but I can't explain why I see an extra run of the ISR near 1.0ms.

    Here's a zoom of the left side:

    More zoomed:

    Zoom of the right side of the trace:

    To my untrained eye, it seems as if my H11AA1 is giving me more edges than I want and my Arduino is both tossing in an extra interrupt that I can't account for potentially missing another.
    • Does anyone have any experience with the H11AA1 and if this is typical behavior or does this suggest my part is flaky or I have it connected incorrectly?
    • Any thoughts on why I'm seeing that third ISR occur and then none that I can associate with the apparent spurious edge near 0.95ms?
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    I'd guess your ISR trigger pin could be picking up interference at the 0.95mS point? What sort of lights are you dimming (fluorescents generate interference)?
    Are all other sources of interrupt (e.g. from other interrupt-on-change pins) disabled while your ISR runs?
  3. mhoyt

    Thread Starter New Member

    Oct 3, 2015
    Its just a single incandescent lamp.

    I'm not consciously disabling interrupts while in the ISR. I'll give that a shot to see if it cleans things up but that signal from the H11aa1 sure looks strange to me.
  4. gootee

    Senior Member

    Apr 24, 2007
    Maybe it's something basic, like insufficient decoupling caps on the power pins, or not close-enough to the pins.
  5. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    A logic analyzer is a great tool for some jobs, but not this job. It is a very narrowly-focused diagnostic tool, not a general purpose test instrument and certainly not suited for analog noise issues. And if an incandescent light dimmer is anything, it is an analog noise generator. With oscilloscope shots we can determine if the optocoupler is being triggered incorrectly, if the problem is occurring at turn on or turn off, etc. Note that getting scope shots of a live AC circuit is dangerous, requires very careful attention to grounding, is dangerous, can damage equipment in the blink of an eye, and is dangerous.

    JWHassler likes this.