I’m currently working on a water level indicator project. I’m using an ultrasonic distance sensor( HC-SR04) to compute the level of water in the tank and display the same on an LCD. (16X2) This part of my project works fine. However, I’m having problems when I connect a DC water pump to Arduino Uno, interfaced using a MOSFET transistor. ( IRF530) If the water level is below the minimum mark (specified), the pump is switched ON and is switched OFF when the water level reaches maximum height. (specified) The pump is powered by a 9V DC source.
When the motor is activated, my LCD shows random characters. Why does this happen? How do I fix this?? It’s kinda urgent. Please reply ASAP.
The source code and circuit diagram have been attached for your reference. I’ve used the LiquidCrystal header file.
Thanks in advance. Cheers.
WLI.ino (1.79 KB)