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.
jremington:
You need to power the relays separately. Any change in the supply voltage to the Arduino will change the analog input reference voltage, by default.
I suggest to use 5V step-down regulators so that everything is powered by the 12V supply.
Isn't it the same that I have already done? From the image that I uploaded, you may see that I supply the breadboard by a 12V, the 12V is regulated to 5V and 3.3V. The arduino and relays get the power from the 5V.
I understand that I need to power the relays separately, but I do not get how to power arduino and relays from the 5V step-down regulator.
jremington:
Connect all the grounds, and make sure that you have an inductive kick diode on the pump.
Is this used to protect against the reverse current of the pump?
From the looks of the specs. You could just use this : Adafruit motor driver This is what I did. I have them all running for weeks now with no issues. Mine also uses this as the 5V supply : RC power supply.
I take the 12V & Gnd. to both 5V supply and the motor driver.
5V & Gnd from the supply to the µprocssor. Then only the ONE digital line from the processor to the motor driver. Ground out the other driver data line. Hook up motor, done.
Easy peasy. No relays and stuff to make life complicated.
jimLee:
I take the 12V & Gnd. to both 5V supply and the motor driver.
5V & Gnd from the supply to the µprocssor. Then only the ONE digital line from the processor to the motor driver. Ground out the other driver data line. Hook up motor, done.
This sounds very clear! I will try setting up the power lines as you did but keeping the relays. If still won't work, I'll buy the motor drivers.
Thank you very much!