I am controlling the compressor of a compact refrigerator using an Arduino Mega and an opto-isolated relay block. The Arduino is connected to the PC using a serial over USB (Atmel version). Since the beginning it has been a struggle to reduce the serial line errors. Here is what I have done and it helped but I still have problems:
- Replaced the stock USB cable with higher quality - helped the USB not reconnecting;
- Powered the Arduino board with an external switch supply - helped the USB not reconnecting, no more reconnections;
I still have problems with data incoming to the Arduino and it happens only when the Arduino switches the compressor on/off. I have a number of questions:
- Do you think this is an EMF problem or power supply problem or ground problem or some interface (for example Arduino to relay board)? Notice that the relay board is powered separately from a lab power-supply.
- What do you think is the best possible step to improve the situation. I have been thinking of the following:
- Replacing the mechanical opto-isolated relay board with solid-state relays;
- Adding ferrites to the power lines? The USB cable already has ferrites on both sides;
- Enclosing the relay board in a metal casing;
- Enclosing the Arduino board in a metal casing;
- Adding a low-pass filter to the compressor?