I am creating project kind of a logger. When any AC appliance is turned on it's signal goes to microcontroller and date/time are stored in flash memory.
Right now, I am thinking of putting transformer in parallel with AC line and then converting it to dc in usual way. But it will make my circuit bulkier.
Is there any other way to say AC line is on or off for microcontroller compatible voltage? is there any sampling IC available?
For low pwoer applications direct IC is there or you can do with diode also, i have done couple of years back, find out on the net, i could not recollect properly
Cause AC on/off is a digital information, an optocoupler would be the least expensive part available for signal isolation (assuming isolation is required at all).
I had seen protecting diode in the input pin. Recommendation for 5MOhm resistance was mention, I think 1/4 watt resistor would work over here. Because MCU won't be sinking >20mA of current and there's any need for 5W resistor.
It needs a current limiting resistor anyway, in this case, the resistor has to dimensioned for power line voltage. Also, you need at least an antiparallel diode to cut off the negative half waves, respectively an AC input optocoupler or a small bridge rectifier.
P.S. gold contacts are better since you will likely have very little current passing through them and the contact resistance tends to deteriorate over time.