I have encountered problem with Arduino UNO and water flow sensor. So here's situation:
I have connected a 12 V power supply from DC battery and then used 5 V regulator which output is used as input to 3.3 V regulator.
Ground of all power supply is the same that is ground of 12 V. It is connected to 5 V and then 3 V. I have a water flow sensor which uses 5 V from output of the 5 V regulator also this output is used to power the Arduino.
When serial port is connected to a laptop, the sensor works fine and gives accurate output. But when serial port disconnected sensor gives output even if there is no flow of water.
Best Answer
In the Arduino Uno design, if power is detected from the USB port, the power from the external barrel jack is disconnected.
That explains how the Arduino is working while connected to your laptop.
Now for the bit when it is not working. From the Aruduno Uno web page:
So, if you are connecting your 5 volt regulated output to the barrel jack of the Arduino, you will likely encounter unexpected results.