Dear all, I am doing a project in which pc and atmega32 communicate via rs232. The microcontroller send level signal and also receive command to actuate 220v contactor.
Every thing is fine until I connect the relays to drive the contactor I have checked electrical isolation between the board and the high volt, it is okay. The problem occur randomly when the contactor switch. When the problem occurs the microcontroller will not reset it still accept command from the pc but it will stop giving data to the pc through rs232. To solve this I tried to close and reopen the serial port programmatically when the issue occurs but the problem not solved the problem only goes away when I restarted the microcontroller. The source of the problem seems electromagnetic noise but I have done a microcontroller board which controls 220v loads without problem. The only difference here is the microcontroller communicate with computer and with one another microcontroller. Also tbe code is written with arduino ide with atmega plugins.
Every thing is fine until I connect the relays to drive the contactor I have checked electrical isolation between the board and the high volt, it is okay. The problem occur randomly when the contactor switch. When the problem occurs the microcontroller will not reset it still accept command from the pc but it will stop giving data to the pc through rs232. To solve this I tried to close and reopen the serial port programmatically when the issue occurs but the problem not solved the problem only goes away when I restarted the microcontroller. The source of the problem seems electromagnetic noise but I have done a microcontroller board which controls 220v loads without problem. The only difference here is the microcontroller communicate with computer and with one another microcontroller. Also tbe code is written with arduino ide with atmega plugins.