Hi, I am trying to design a circuit to keep my microcontroller safe from any sudden voltage spikes. Here is a picture of my circuit. The ac source on the left represents the Ac main voltage from the house @ 120V 60Hz stepped down to 2.5v 60Hz. The 28k resistor on the right represents the internal resistance of the microcontroller.The maximum voltage into the adc would be 10V in the μA current range. The purpose of this circuit is to have the microcontroller read in the voltages with its onboard adc. Right now, i am not exactly sure what the "correct" output waveform from the opto would be. I was expecting a sine wave at both the emitter and collector. The Blue waveform is Voltage taken at the emitter, green at the collector, and the sine wave is taken at the source. Can someone please comment on my circuit design/outputs and suggest ways to make this a viable solution? Any suggestions are welcome! I am an undergrad with much still to learn! Thank You.