I am working on a project where I want to automate model rail layout using arduino and hall sensor. I am in a beginning phase of my project where I am testing the stuff to figure out things. While testing the hall sensor (with digital output), I have observed that the voltage on the digital pin is different when using 9V battery or AC to 12V DC power adapter. With battery I get 3.7V on digital out and 1.7V with AC-DC power adapter (2 different power adapters tested). In all cases, I have passed the power source through Breadboard Power Supply Module before connecting with hall sensor.
I discovered this by accident. Digital input pin on Arduino mega was floating and randomly translating between zero and one. At first I thought that it could be a common ground issue. I ensured that the power supply GND, arduino Gnd and sensor ground are all connected. However, it did not solve my problem. So, I powered only the sensor without arduino and observed the above voltage difference.
I would really appreciate any guidance on this.
Below is the list of parts and circuit diagram is attached.