0

So I am trying to power an arduino to measure water flow. It works all fine and dandy when I am powering it with laptop, but when I directly power it with 12V 1.5A adaptor the readings take a second to come to the LCD even though the pump starts running. Also when they come, I can see that sometimes it hangs. Why is that?

Before taking the readings I am switching on a motor which is also directly powered by the adaptor just like the arduino.

Below is a block diagram.

enter image description here

Would adding a voltage regulator that steps down 12V to 9v between arduino and adaptor help?

6
  • 1
    Please show your code and your actual wiring, not only a course scheme.
    – chrisl
    Oct 15, 2022 at 14:30
  • @chrisl does code matter if it works fine on power from laptop? Its just a command to switch on the relay (which switches on the pump) switch and next command starts printing the sensor values on LCD... Oct 15, 2022 at 14:51
  • Can you check the voltage of your power supply with a voltmeter? Does it drop when the motor is turned on? Oct 15, 2022 at 15:07
  • @EdgarBonet yup, true, just checked, the voltage to vin drops by nearly one volt even though I am powering it through LM7812 regulator module. The main power source voltage falls by almost two volts. Oct 15, 2022 at 15:36
  • @EdgarBonet I am using this regulator (electronicscomp.com/…), even then voltage is not constant Oct 15, 2022 at 15:43

2 Answers 2

2

Your power supply is actually advertised at 1.2 Amps. It's assumed you are powering the Arduino, the Relay, the Water Valve Solenoid and the Water-Pump-Motor all w/the same 1.2A power supply. It is within reason that the sum of all those loads exceeds your power supply's capabilities.

It works all fine and dandy when I am powering it with laptop ...

It is assumed you were only powering the Arduino with the laptop. Providing the Arudino with an independent power source is a common solution to this type of problem. Obtaining a larger power supply (more Amps) is another possible solution.

Why does it eventually work?

Motors require more Amps when under a physical load. If the water is stationary, the motor will have to "get it moving" requiring more current. The term "locked motor current" is used here in this article.

Also, inductor loads require more Amps when ever the voltage potential is suddenly changed. The motor and relay are likely both seen as inductive loads. This is referred to as inrush current.

Both of these can be assumed transitory. Once the motor is moving and after the potential across the inductive loads are closer to zero, the initial current demand will subside and the power supply may then be capable of sustaining the constant voltage needed by the Arduino's processor.

Alternate solution:

Obtaining a larger power supply is likely the better solution. Another option involves filtering the power only for the Arduino. This option is discussed in this thread on forum.arduino.cc where a diode and capacitor are used to somewhat isolate the power for the motor, relay and solenoid from the Arduino.

18
  • Ok, Ok. My adaptor is 1.5A, so I guess I should go for 2A? And also replace my LM7812 with a more amps module? Can you recommend something? I must use only a single power source, I can't use two power sources, so will have to look for a solution around this... Oct 15, 2022 at 16:43
  • and your answer also explains the voltage drop which I mentioned in my comment on my question? I'm an amateur enthusiast, so might not understand too technical english... Oct 15, 2022 at 16:55
  • Relay is powered by arduino, but yeah, there's a solenoid valve in there also on the power adaptor sucking a lot of current probably Oct 15, 2022 at 17:07
  • If you're constrained to only one power supply then likely you need, as you said, a power supply rated for more amps. I usually add up the maximum required currents and find a power supply with double the capacity. There are ways around this. But they require more knowledge and testing. They are usually reserved for situations that are cost sensitive. Like isolating the power path to the Arduino with a diode and a capacitor. Or somehow attenuating the inrush current to the motor. Something along the lines of a soft start motor device.
    – st2000
    Oct 15, 2022 at 17:12
  • Wait, you have a solenoid valve as well? If the water is under pressure, why use a pump at all? And if not under pressure, why use the solenoid valve?
    – st2000
    Oct 15, 2022 at 17:15
0

Welcome. Your pump is turning on as soon as the power is turned on because the relay is connected to 5V. Your processor needs to initialize itself and then the display, the pump is up and running. On your laptop the pump was powered from the power supply and the Arduino by the laptop. The arduino was on and up and running when the pump was started. Hope this helps. I will take a SWAG and say this is powered up when the pump is needed and powered down when it is not needed.

1
  • So how do I get it out of bed in time? Oct 16, 2022 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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