Arduino Forum

Using Arduino => General Electronics => Topic started by: simonescaramozzino on Sep 09, 2019, 10:26 pm

Title: Soil moisture sensor affected when pump+valve relays ON
Post by: simonescaramozzino on Sep 09, 2019, 10:26 pm
Hello everybody!

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!
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: jremington on Sep 10, 2019, 04:45 pm
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 (https://www.pololu.com/category/131/step-down-voltage-regulators) so that everything is powered by the 12V supply.

Connect all the grounds, and make sure that you have an inductive kick diode on the pump.
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: simonescaramozzino on Sep 10, 2019, 07:39 pm
Thank you for the reply!

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 (https://www.pololu.com/category/131/step-down-voltage-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.


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?
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: jremington on Sep 10, 2019, 07:58 pm
Quote
From the image that I uploaded
The images are incomprehensible. Please post a hand drawn wiring diagram or schematic.

The diagram below shows how the essential inductive kick diode is wired, using a MOSFET to control the pump power.
(https://www.gammon.com.au/images/MOSFET_low_side_driver.png)
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: jimLee on Sep 10, 2019, 08:25 pm
What pump are you using? I can't read the specs on it.

I'm in the middle of a nearly identical project.

(http://leftcoast.biz/justStuff/Flora/TheBench.jpg)

-jim lee
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: simonescaramozzino on Sep 10, 2019, 11:39 pm
The images are incomprehensible. Please post a hand drawn wiring diagram or schematic.
Could this fritzing diagram help? It is a simpler version (less sensors and actuators) but this is how it is wired.


What pump are you using? I can't read the specs on it.
Looks great!!

I am using this pump: https://it.aliexpress.com/item/32960386654.html?spm=a2g0s.9042311.0.0.27424c4dSqbz2t
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: jimLee on Sep 11, 2019, 01:55 am
From the looks of the specs. You could just use this : Adafruit motor driver (https://www.adafruit.com/product/3190) 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 (https://www.adafruit.com/product/1385).

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.

-jim lee
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: jremington on Sep 11, 2019, 04:11 am
Quote
Could this fritzing diagram help?
No, Fritzing diagrams are almost always misleading, if they aren't simply useless.
Title: Re: Soil moisture sensor affected when pump+valve relays ON
Post by: simonescaramozzino on Sep 11, 2019, 09:19 am
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!