I have an Arduino Mega, Adafruit RFM96W 433MHz LoRa Transceiver Breakout and 2 Channel OptoCoupler Relay Module.
The Arduino Mega runs a sketch that waits for the press of a button and then:
If Button A:
Switches on a 12V pump connected to the Relay for 30 seconds Then sends a radio message (using RH-RF94 library) to another device
If Button B:
Sends a radio message (using RH-RF94 library) to another device https://github.com/kenbiba/RH-RF95
The Ardunio is being powered by the USB connector.
The Relay Board has it's own 5V supply and is connected to the arduino by a digital line (for the pump) and the Vcc to Arduino 5V
There is a 12V power supply in the COM terminal, then the +ve lead of the pump is in NO.
The problem: When the 12V power supply is connected to the COM terminal the Arduino will freeze when trying to send a radio message (send) - even if the pump has not been activated and there is no 12V current flowing.
I have only seen this happen when I have an antenna on an extension wire connected to the LoRa transceiver. If there is no antenna, or a very short antenna with no extension wire I do not see this problem.
An antenna on a extension wire works no problem if I unplug the 12V supply from the relay board - even if the transformer is left plugged in within the project enclosure.
I am very confused by this.
Initially, I suspected there was some sort of power surge going on when the pump started (big motor) but I see this problem even if the pump never runs, all it takes is the 12V power supply be applied to the relay.
Is it possible that the 12V transformer is creating EM interference that's coupling onto a long antenna cable?
Thanks for any help.