Hi,
I have a compact solution where I want my microcontroller to detect a open/close of a switch.
Due to existing cabling I can only provide 230VAC or nothing via this switch.
In order to get this interfaced with my microcontroller I used an optocoupler. (see schematic)
It all works fine except that if I my switch/optocoupler is too close to my power supply/microcontroller and I open or close the switch, I see interference in my power circuit and as a result my microcontroller reboots.
I can avoid it by placing the optocoupler far away but that I cannot use because it all has to fit on 1 small PCB. (except the switch, this is a wall pushbutton in the field).
Even if the transistor is not connected to the microcontroller I still have the problem. The problem comes from emissions in the power circuit.
On my oscilloscope I see glitches in the 3.3VDC circuit every time I open close the switch?
How can avoid this unwanted reboots?
I don't know how to filter out this unwanted glitches. (I also don't have a lot of space)
The easiest way would be to filter them out on the 3.3VDC side, but how?
Is there another, safer way to convert my 230VAC signal to a 3.3VDC input signal?
Thanks for helping.
I have a compact solution where I want my microcontroller to detect a open/close of a switch.
Due to existing cabling I can only provide 230VAC or nothing via this switch.
In order to get this interfaced with my microcontroller I used an optocoupler. (see schematic)
It all works fine except that if I my switch/optocoupler is too close to my power supply/microcontroller and I open or close the switch, I see interference in my power circuit and as a result my microcontroller reboots.
I can avoid it by placing the optocoupler far away but that I cannot use because it all has to fit on 1 small PCB. (except the switch, this is a wall pushbutton in the field).
Even if the transistor is not connected to the microcontroller I still have the problem. The problem comes from emissions in the power circuit.
On my oscilloscope I see glitches in the 3.3VDC circuit every time I open close the switch?
How can avoid this unwanted reboots?
I don't know how to filter out this unwanted glitches. (I also don't have a lot of space)
The easiest way would be to filter them out on the 3.3VDC side, but how?
Is there another, safer way to convert my 230VAC signal to a 3.3VDC input signal?
Thanks for helping.