What the smallest relay with 240vac a coil that you know? or is there a solid state way of switching that is small keeping in mind the 5v is monitored by a MCU and so needs to be a constant ON / OFF switch
Something utilizing an opto-isolator. However, by the time you add the high-voltage capacitor, diode, current limiting resistor on the input side, it will not be very small...
What the smallest relay with 240vac a coil that you know? or is there a solid state way of switching that is small keeping in mind the 5v is monitored by a MCU and so needs to be a constant ON / OFF switch
Here is about the simplest opto-coupler circuit that won't burn up or kill you... and doesn't use huge capacitors. C2 can be a small disc ceramic.
It detects the turn-on of the AC almost immediately, but it takes it a while to realize that the AC turned-off. R3 could be the "weak-pull-up" inside the PIC. Note that the input resistors are half Watt. It is active-low at the PIC input.