2

I'm making automatic water plant system. I'm using:

Arduino Uno

3.3-6V water pump -https://www.amazon.com/Vipe-Micro-Submersible-Motor-Water/dp/B01N0X3CW4

Capacitive soil moisture sensor - https://www.amazon.com/Gikfun-Capacitive-Corrosion-Resistant-Detection/dp/B07H3P1NRM

I've noticed that when motor turns on sensor readings are much higher. First I thought that the problem is in sensor, but when I measured sensor output in both cases (when motor is on and when motor is off) there was no difference, voltage was the same. Then I measured voltage in analog pin A0 that I used, and I saw there is increase in voltage when pump is on (+0.4V), so my guess is that this voltage is added to sensor output voltage which is giving me higher values in my serial monitor.

For powering my pump I'm using same circuit as in this example: https://www.devacron.com/arduino-tip120-control-dc-motor/

Just except potentiometer there is my sensor, powered via 3.3V Arduino pin (its GND is connected to Arduino GND). I also tried connecting all grounds together in one point, didn't help. I powered Arduino with usb and with 9V supply, in both cases same problem. Tried powering pump and Arduino with same and with different power supplies, no luck either.

I should also add that there is no change in AREF and 5V pin when pump is working. 4.97V in both cases.

Does anyone have any idea what can be the problem and how to solve it?

Here is how I wired everything: https://imgur.com/a/I70lRVZ

I also tried with 0.1uF ceramic and 10nF electrolytic capacitors. as suggested, wiring it like this: https://imgur.com/a/jWfkbJG Didn't make much difference, problem is still there.

12
  • Nothing coming to mind immediately, at least nothing I have good reason to think is actually the problem. Even with the reference diagram and understanding how you've effectively replaced the potentiometer with the sensor, it would be good to have a picture of the actual wiring. Sometimes it just reveals things you didn't think to mention.
    – timemage
    Dec 1 '20 at 18:24
  • My first thought is that you have a noise problem with either the sensor itself picking up noise and misinterpreting it as input or noise being picked up by the analog pin and interfering with your readings. You might try it without the pump motor hooked up so that you can isolate the problem.
    – jwh20
    Dec 1 '20 at 18:25
  • @jwh20 without the motor, sensor reading are stable when connected to analog pin. Can there be a problem with Arduino? I do not have other just this one, but I don't know what are the chances that something is wrong...I bought it just for this project and I must also add that in this project I had a lot more components connected (I removed everything except pump and sensor to try to isolate the problem, just as you said) and everything else works great, even bme280 sensor and oled display, which are connected to A4 and A5 pins. Maybe is noice from the pump...But I can't remove it completely...
    – marejosef
    Dec 1 '20 at 18:43
  • Why don't you show how you have things hooked up? I suspect you have either a power supply issue or a noise issue caused by the motor. You either need to beef up the supply to your motor and/or filter the noise being produced by it.
    – jwh20
    Dec 1 '20 at 18:44
  • 1
    @timemage jwh20 I added link in my first post hope it's clear enough
    – marejosef
    Dec 1 '20 at 19:16
1

Try adding some bypass capacitors at the two points I've added arrows to:

Bypass Caps

I suggest two in each spot, one a 0.1uF (or similar) ceramic dipped or disc and the other a 1 or 10uF electrolytic. Keep the polarity in mind for the electrolytic.

Oh, and another thing. Be sure your motor is not pulling your power supply voltage down. It's possible your phone charger supply is inadequate to supply the power needs of the motor. Use a voltmeter across the input to the Arduino and check the voltage when the motor runs. If it's dropping much below 5V you need a better power supply. Well, I see now that you are only powering the motor from that 5V supply. So that's probably not it.

9
  • Thank you very much for suggestion. Unfortunately, I don't have them right know at my place, but I could get them tomorrow when shops are open, so I will post results then :)
    – marejosef
    Dec 1 '20 at 19:30
  • ok I tried with capacitors, one 0.1uF ceramic, and one 10uF electrolytic where I put longer lead to + side and shorter to -. I can get a picture of my circuit if it's needed if you think I maybe wired it bad. Didn't help. Sensor value in water is 250 and when motor is on, in a few seconds value goes up to 450, then it goes down to 400 in about 30 seconds and that's it...
    – marejosef
    Dec 2 '20 at 14:10
  • Please update your question with a photo of what you've tried.
    – jwh20
    Dec 2 '20 at 14:14
  • ok I added and put a photo hope it's clear enough
    – marejosef
    Dec 2 '20 at 14:25
  • It's clear there is some sort of interference caused by the motor or your motor control circuit that is causing the reading from what I suspect is a very sensitive "antenna" moisture sensor and the caps are just not enough. How about a different approach? You might try pumping water for a few seconds and then stopping the pump and taking a series of readings over a few minutes until the values stabilize. Then repeat as needed until you get to the moisture reading you want.
    – jwh20
    Dec 2 '20 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.