I am trying to build an irrigation system but I am not very good in electronics.
I have an Arduino Nano powered by an external power supply through the 5V pin.
I have a soil moisture sensor and a temperature sensor connected.
I have a pump and a valve that are controlled using two relays. The pump and valve are 12V devices and take the power from an external 12V power supply. The relays are powered by the same 5V that powered the arduino.
So, when the relays are off the soil moisture sensor reads ok. When the relays are on the reading is lower. For instance, having the sensor at open air the reading passes from 0% to -10%.
I believe I have to change the power supply connections, but I have no idea what would be the right way to avoid this issue.
At the end, the idea is to connected 5 soil moisture sensors, 1 temperature sensor, 5 valves and a pump.
Thanks in advance for the help!