Help with these hall effect sensors.

Hey everyone I’ve been waiting a while for these hall effect sensors, but for some reason they aren’t working.
http://www.ebay.ca/itm/370886189912?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

I worked out that from left to right with the top of the board facing you it must be OUTPUT-VCC-GND.

The thing is when I use the script I get a reading of -700 and the magnet does not affect it at all, what gives?

Here is the code, I got it from the hall effect playground.

#define NOFIELD 505L    // Analog output with no applied field, calibrate this

// Uncomment one of the lines below according to device in use A1301 or A1302
// This is used to convert the analog voltage reading to milliGauss
#define TOMILLIGAUSS 1953L  // For A1301: 2.5mV = 1Gauss, and 1024 analog steps = 5V, so 1 step = 1953mG
// #define TOMILLIGAUSS 3756L  // For A1302: 1.3mV = 1Gauss, and 1024 analog steps = 5V, so 1 step = 3756mG

void setup() 
{
  Serial.begin(9600);
}

void DoMeasurement()
{
// measure magnetic field
  int raw = analogRead(0);   // Range : 0..1024

//  Uncomment this to get a raw reading for calibration of no-field point
//  Serial.print("Raw reading: ");
//  Serial.println(raw);

  long compensated = raw - NOFIELD;                 // adjust relative to no applied field 
  long gauss = compensated * TOMILLIGAUSS / 1000;   // adjust scale to Gauss

  Serial.print(gauss);
  Serial.print(" Gauss ");

  if (gauss > 0)     Serial.println("(South pole)");
  else if(gauss < 0) Serial.println("(North pole)");
  else               Serial.println();
}

void loop() 
{
    delay(1000);
    DoMeasurement();
}

Bleh I had it wrong, found the part and traced the wiring, it's GND VCC OUTPUT, now the trigger LED goes off when the magnet is on. One thing though, with no magnets around it it's reading around 500 gauss, sometimes it's 800 (thats what it was staying at before, and it got up to 1k at one point, all saying south pole, it only triggers on the north pole of the magnet.

Do you think it's because I wired them up backwards, maybe I screwed them up somehow? That would really suck cause I wanted to use one as a Gauss meter. It will work for just counting RPM I think though, with a bit of work.

it also only detects really close and always at -962. Guess i ruined them for anything but on/off sensing :frowning:

The e-bay listing you posted states:

the output is a digital voltage signal

This mostly likely means you have a logical sensor that outputs just a HIGH or LOW output depending on magnetic field strength applied is above or below a specific threshold value. There are hall effect sensors that output a continuous analog output voltage proportional to the strength of the magnetic field.

retrolefty: The e-bay listing you posted states:

the output is a digital voltage signal

This mostly likely means you have a logical sensor that outputs just a HIGH or LOW output depending on magnetic field strength applied is above or below a specific threshold value. There are hall effect sensors that output a continuous analog output voltage proportional to the strength of the magnetic field.

Ah, I'll try that in a script tommorow, if that's true i guess it may be easier to count the number of times it is activated per second.

Sigh, I’ve been trying everything and I cant get the damn thing to count properly and I don’t know where to go from here, I figured it would be easy but it’s frustrating as fuck, and I can’t find any good examples online relating to this. UHG