I live in an apartment were everyone has an individual doorbell on the front gate. When the button is pressed for my apartment, 21VAC rings a bell in my unit. I would like to have a micro-controller detect when this is happening.
My initial thought was to put a reed switch next to the bell, but it seems the reed switch is too sensitive and would get triggered when my bell was not on. My guess is that this is due to interference on the line from other apartment's doorbells, but I have not been able to verify this.
Now I'm thinking of using an AC relay, but I'm having some trouble finding one that would work with my voltages. I'm also looking into using an optoisolator, but know very little about them and am not sure of the pros/cons vs. a relay.
So my questing is, should I use an AC relay, an optoisolator, or something else? And for whatever solution, which part would be best?
Thanks.