Electrical – Why does relay switch cause change of voltage

arduinorelayvoltage

I am making an Arduino Thermostat. The arduino draws power from an adapter and the relay draws power from the 5v arduino. I have an LED that changes color according to temperature brackets.

The heater, which i want to turn ON and off is also plugged in the same power strip.

The problem is: when the relay swtiches, there is a noticeable change in brightness on the LCD and LED light. Somewhere the voltage changes, but i can't figure out why and how to avoid it.

If I power the Arduino with a 9v battery instead of an adapter, things are fine, and there is no change in display or LED.

Why is this happening and how can I prevent it?

"""(if it matters at all, i am using Pololu (https://www.pololu.com/product/3101) instead of Arduino Uno"""

In case schematic is not viewable, here is a bigger image:
https://www.circuitlab.com/circuit/7j8duh/screenshot/1024×768/

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

The relay module spec says:

Supply voltage +5V

Supply current 72mA typ. (75mA max.)

Current on pin IN 14mA typ.

That looks to me as though it will need 72 + 14 = 86 mA for the relay board.

The Pololu spec says:

The board can either be powered directly from the USB 5 V supply or from a separate 5.5 V to 15 V source on the VIN pin, which is reduced to 5 V by a 100 mA low-dropout (LDO) regulator; you can access this 5 V supply through the 5V power output pin. Additionally, the ATmega32U4 contains an internal 3.3 V regulator whose output is available on the 3V3 pin. Current drawn from the 3V3 output should not exceed about 50 mA, and when the board is being powered through VIN, the sum of the 5V output current, 3V3 output current, GPIO output current, and current used by the board itself (typically about 25 mA) should not exceed 100 mA.

So just adding the board brings the total up to 86 mA + 25 mA = 111 mA.

I think the voltage regulator is under stress. You'll have to come up with another 5 V supply for the relay.