I'm almost done calibrating an energy meter based on ADE7753 and STM32 MCU. I don't have yet a liquid crystal display for my meter but using IAR (IDE used to program STM32) and ST-link, I have been able to read more or less accurate measurements from the energy meter. However, I noticed that there are times when an error occurs on the MCU and what I do is I just reset the MCU until it goes back to normal operation again. This error happens rarely and I think its just because of the female header pins on the PCB that tend to loose contact at times. I used to put 100 W lamps as load and I also tried a 1000 W electric iron and the meter did okay. But, when I tried a 1/2 HP Airconditioner, the moment I turn on the Airconditioner, the MCU malfunctions. On another case, if I turn on the airconditioner first before powering up the meter, the meter operates normally and the readings are okay. What could have caused this error? Is it because of the high starting current of the compressor in the airconditioner?
I suspect on the isolation of the SPI lines between ADE7753 and STM32 MCU because I did not place an opto-isolator on those lines. Is it necessary to place an opto-isolator on the SPI lines?