the hall effect sensor I am using(MLX90364) is only giving me 2.5 volts when I supply it with 5 from my Arduino. It gives this output when the magnet is or isn't nearby. I am using a N35 magnet, and have created a holder that holds it exactly how far it needs to be(3.5mm), and perfectly aligned.
Here is the circuit diagram:
Here is a picture(I used 2 5kOhm resistors in series to get 10k):
Here is the code:
int analogPin = A2; // potentiometer wiper (middle terminal) connected to analog pin 3
// outside leads to ground and +5V
int val = 0; // variable to store the value read
void setup() {
Serial.begin(9600 ); // setup serial
}
void loop() {
val = analogRead(analogPin); // read the input pin
Serial.println(val);
// debug value
}
Here is the data sheet: Error - Melexis
I would really appreciate any help as I have been experimenting with different wirings for days and have not gotten any output except the 2.5 volts