Automatic Watering System: LCD problem when pump is on

Ask questions about projects relating to: aerodynamics or hydrodynamics, astronomy, chemistry, electricity, electronics, physics, or engineering.

Moderators: AmyCowen, kgudger, bfinio, MadelineB, Moderators

Post Reply
svapte1
Posts: 3
Joined: Wed Feb 26, 2025 11:36 am
Occupation: Parent

Automatic Watering System: LCD problem when pump is on

Post by svapte1 »

We are trying to build an "Automatic Watering System" using Arduino. We have gone through the videos posted by Science Buddies and combined several different videos to build this.

Arduino is connected to moisture sensor, a buzzer (when pump turns on), LEDs (green and red to show pump off/on respectively), and an LCD display to show (mositure level, pump status). Pump is a very small white pump (3-5V), and initially when it was connected on arduino 5V power-supply, the whole circuit didn't work. Hence an external power supply (2 AA battery pack of 3V) was added together with MOSFET. It was made sure that the Arduino power supply and external supply is not short circuited, but the grounds are connected together to have a common ground. When the mositure sensor is dipped in water, the green LED is on, the LCD shows 100% moisture level and PUMP OFF. As soon as the moisture sensor is removed from water (dry), the LED switches to red, the buzzer is turned on, the LCD shows moisture level low and PUMP ON. Then, the pump is turned on (with about 500ms delay between the LCD display and pump operation). Water is added, pump works, but the LCD display is messed up showing weird characters. If the moisture sensor is dipped inside water, the LED turns green, buzzer is off, pump is off, but the LCD display remains messed up. This maybe happening because the power supply fluctuations when pump is turned on. A current limiting resistor was added between the MOSFET Gate and the arduino pin. Yet, same issue is observed.

Could you please let us know how to fix the LCD? The LCD, the moisture sensor, the the buzzer, and LEDs are all on the arduino power, the pump on a separate low voltage power based on pump capability. Searching on the net, it seems a capacitor should be added. Where should we add this and how? Is a Diode also needed? Please let us know. Thanks in advance.

We want to fix this ASAP as the project is due in couple days. So any quick suggestion would be very useful.
bfinio
Expert
Posts: 964
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Lead Staff Scientist, Science Buddies
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Automatic Watering System: LCD problem when pump is on

Post by bfinio »

Hi - it sounds like you took all the right steps here in terms of providing a separate external power supply for the pump. However, pumps and motors are electrically "noisy" and as you've discovered, this can sometimes cause issues with other parts of the circuit, even if they're powered separately.

One way to deal with this noise is to use a "decoupling capacitor." You can read more about that here: https://learn.sparkfun.com/tutorials/ca ... decoupling. I am honestly not 100% sure about the best placement of this capacitor, but there are a few different options, and you could experiment to see if one works better than the other. I believe you could also just use multiple capacitors in different locations:

1. Between the + and - buses of your breadboard, as close as possible to where the jumper wires connect to the Arduino 5V and GND pins
2. As close as possible to the power and ground pins of the LCD
3. As close as possible to the positive and negative wires for the pump (for some motors you will even see a capacitor soldered directly to the motor terminals)

You can also add something called a "flyback diode," which more specifically helps with voltage spikes when a pump or motor suddenly turns off (think of it like slamming a door). Since you are seeing issues as soon as the pump turns on, I don't think this is your problem, but adding the diode can't hurt. This one needs to go in a specific place - from the negative wire of the pump to the positive wire of the pump: https://learn.sparkfun.com/tutorials/di ... plications (scroll down to the flyback diode section).

As a last resort, since the project is due in a few days, you could just print out the information to the serial monitor if you can't get the LCD to work.
svapte1
Posts: 3
Joined: Wed Feb 26, 2025 11:36 am
Occupation: Parent

Re: Automatic Watering System: LCD problem when pump is on

Post by svapte1 »

Thank you very much for your quick response and detailed solutions! We really appreciate it.

We tried the decoupling capacitors with the transistor and also with LCD. It helped in that, the LCD would show good characters for a while with the pump, but then after some time it would go bad. However, once the pump was off, this time the LCD came back showing proper characters.

We then tried a relay, instead of transistor. Since the relay is not attached to the breadboard (like the transistor), it helped better in isolating the pump with external power supply. We still added the capacitor to the LCD. This worked much better than the transistor. It was not clear why as both of them should really work (transistor is even better than mechanical relay). The solution is not completely fail proof. There were occasions where when the whole system started after rest, the LCD would show weird characters when the pump is on. So it is not completely isolating the pump. Nevertheless, we were able to get the whole thing working.

We have a video of it, but unforunately it doesn't allow me to post (it is 5.7MB).
In any case, really thankful for Sciencebuddies site and all the help and responses. Thanks!
bfinio
Expert
Posts: 964
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Lead Staff Scientist, Science Buddies
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Automatic Watering System: LCD problem when pump is on

Post by bfinio »

Hi - I'm glad you were able to get it to work! Not sure if it's too late because the project was already due, but there are even further steps you can take to isolate a "noisy" load like a motor or pump from the rest of the circuit - there is a part called an "optoisolator" that uses light to bridge the gap between two different circuits. A light-emitting diode (LED) emits light on one side, and the light is detected by a photodiode or phototransistor on the other side, allowing the two circuits to be totally separate with their own power supplies. You could also look into a separate, dedicated voltage regulator to power the LCD instead of relying on the Arduino's onboard regulated 5V which may be noisier.
svapte1
Posts: 3
Joined: Wed Feb 26, 2025 11:36 am
Occupation: Parent

Re: Automatic Watering System: LCD problem when pump is on

Post by svapte1 »

thanks for the suggestion. Although we submitted, we will continue to improve this and will definite try this idea!
Post Reply

Return to “Grades 6-8: Physical Science”