Arduino UNO sensor works fine when connected to laptop but gives problem when connected to external power supply
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:


  The board can operate on an external supply from 6 to 20 volts. If
  supplied with less than 7V, however, the 5V pin may supply less than
  five volts and the board may become unstable. If using more than 12V,
  the voltage regulator may overheat and damage the board. The
  recommended range is 7 to 12 volts.


So, if you are connecting your 5 volt regulated output to the barrel jack of the Arduino, you will likely encounter unexpected results.