Capacitive moisture sensor, Pump and Mosfet issue. Electric Design

Dear all,

I'm working in a proyect that involves the use of :

  • Arduino Pro mini 5v -16 mhz
  • Mosfet Module LRF 520
  • 12v Water Pump R385
  • Capacitive Moisture Sensor.
  • 12v 1.5 amp PSU power Adapter

The basic schematic is this:

The code is relatively simple: when the moisture capacitive sensor goes under the treshold of 70 %, the pump starts and irrigate water. Meanwhile, the sensor is "listening" for new moisture levels. When cross the upper limit 70 + 3 %, it's stops.

As you can see on the schematic , i used only one 12v 1.5 amp power source to feed the arduino through a 7805 and the motor. The motor is activated via mosfet.

I avoided the use a relay because in my testings, when the relay is on, consume circa 60 mA from the arduino pins and this changes the readings of the moisture sensor. So, to fix that, i had to use a Constant added to the reading to compensate this behaviour....Because i was trying to avoid the use of this Constant, i decided to try a mosfet.

The problem is that when the mosfet connect the motor pump, the lectures of the capacitive moisture sensor starts to oscilatte like crazy. When the motor stops, the readings return to be Very stable.

I'm not sure if this design presented here is appropriated for this application.
Anyone see any significant mistake in the design? or can be improved?
I have to use relay instead of mosfet? two different psu ? get rid of ripple?

Thanks in advance!
Gabriel

Use a star connection for GND. Use one point to distribute GND. Don't use 2 GND on the controller.
Use a kick back diode for the motor unless the driver has one.

1 Like

Hi @Railroader , thank you so much.

Ok. Regarding to the kick back diode, you mean something like this?

Exactly! Using just a transistor the diode must be there.

Use this GND point, bottom of the picture, for the LM 7805 as well! That creates the best noise immunity.

1 Like

Hi!

Do you think that perhaps using a relay instead of mosfet add less noise to the circuit?

If you need a clean circuit, because you use sensors, the add of noise a bad lectures are a pain.

Rencently read this: IRF520 MosFET not a good choice for Arduino use.

Assuming the pump is on 100% (and not pwm'd) then the drive circuit makes absolutely no difference.

To test this you can disconnect the drive from the motor, then connect the motor directly to the supply. Monitor the sensor.

I suggest your not try to fight the noise the motor makes but modify your program flow. Consider this:

When the moisture level drops below 70%, turn the pump on for xxx seconds. Turn the pump off and read your sensor. You also may want to delay your readings or read for a certain period of time for the added water to reach the sensor.

Thank you for your help, i'm desperate. :slight_smile:

This is the frustated fight with the motor: added 100nf capacitor between terminals, 2 inductors in each terminal, decouplings caps, etc This reduced the noise a little, but noth enough: the interference with the capacitive moisture sensor still there, and is moving up and down. The problem is that when the motor starts, the sensor level drops something like 10 % , adding a 10% more that the user initially selected... and this isn't correct.

Today i discovered that, if the motor pump is forced to push more flow in the outlet, voltage drop is even more. A solution was that, after some trial and errors observing the differences in readings when the motor is on and off, i would add a constant to compensate de difference when the pump starts, a way of "masking". But, if differences in water preassure changes, then that constant is not a solution.

So, reading your comment gave me a new option : when moisture reachs the lower limit (70%), before starting the motor, i keep the value (value_ant). Then, when the pumps starts, i wait few seconds until the motor and system gets stable (voltage drop) i make a new reading (value_post). Then, for the next readings, i add them the difference between value_ant and value_post. This, with some filtering, could do the trick. What doy you think?

This are the specs for the pump, i used a external 12v 1.5 amp PSU, I supouse that is enough to drive the arduino micro and the pump. Isn't it?

  • Model : R385.
  • Rated Voltage : DC 6V to 12V (1 amps)
  • Working current: 0.5A to 0.7A (Max)
  • Power: 4W-7W.
  • Max Lift: 3m.
  • Max Suction: 2m.
  • Max Water Temp: 80 °C.
  • Pump Size: 90mm * 40mm * 35mm approx.

The use of a double PSU of 5v and 12v 1.5 amp, to drive the arduino and the motor separately could work?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.