I need to build a dimmer controlled by an arduino and need to sync a timer to AC phase so the triac works properly. Can i connect one of the digital input pins directly to AC line voltage via a 20 megaohm resistor?
A PIC Can handle it. http://ww1.microchip.com/downloads/en/AppNotes/40171a.pdf ( page 3 )
Or should i use a zener diode?