user87106: 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.

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

user20245: 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.

87106: <p>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?</p>
<p>Before taking the readings I am switching on a motor which is also directly powered by the adaptor just like the arduino.</p>
<p>Below is a block diagram.</p>
<p><a href="https://i.stack.imgur.com/uNCsp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uNCsp.png" alt="enter image description here" /></a></p>
<p>Would adding a voltage regulator that steps down 12V to 9v between arduino and adaptor help?</p>
 20245: <p>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.</p>
<blockquote>
<p>It works all fine and dandy when I am powering it with laptop ...</p>
</blockquote>
<p>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.</p>
<p>Why does it eventually work?</p>
<p>Motors require more Amps when under a physical load.  If the water is stationary, the motor will have to &quot;get it moving&quot; requiring more current. The term &quot;locked motor current&quot; is used <a href="https://www.jadelearning.com/blog/understanding-motor-starting-inrush-currents-nec-article-430-52/" rel="nofollow noreferrer">here in this article</a>.</p>
<p>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 <a href="https://www.sunpower-uk.com/glossary/what-is-inrush-current/" rel="nofollow noreferrer">inrush current</a>.</p>
<p>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.</p>
<p>Alternate solution:</p>
<p>Obtaining a larger power supply is likely the better solution.  Another option involves filtering the power only for the Arduino.  This option is discussed <a href="https://forum.arduino.cc/t/noise-filter-for-uno-power-supply/228542" rel="nofollow noreferrer">in this thread</a> 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.</p>
