Pages: [1]   Go Down
Author Topic: Magnetoresistive Sensor  (Read 42 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, I bought the Honeywell SM353LT magnetoresistive sensor thinking it would be easy enough to read using an Arduino UNO. I bought this one because I need to detect the position of a drawer in an assembly line setting.
Specs found here: http://sensing.honeywell.com/honeywell-sensing-nanopower-series-product-sheet-50095501-a-en.pdf
The gist of it: highly sensitive 14 gauss (up to 20 gauss), supply voltage range of 1.5-5.5V, omnipolar sensing (activates with either pole of the magnet), typical output voltage is 0.03V, typical current draw is 310 nA. According to the spec sheet it does not require an external pull-up resistor.
Now, not knowing where to start, I loaded a couple of different codes for hall effect sensors thinking I could tweak it to fit my needs. With both codes I used I get readings in the hundreds of Gauss (sensor is supposed to read a max of 20 Gauss). Additionally, the readings are pretty erratic moving up or down a couple of hundred Gauss in a couple of seconds with no magnet close by. Please help me debug this and/or provide suggestions (fairly new to programming Arduino).
The first code seems pretty interesting as it displays gauss reading and polarity in a realtime chart. (https://www.youtube.com/watch?v=bnOd8f5Vev0)
Code:
#define XRANGE  50
int x,gss;
void setup(){
  Serial.begin(9600);
}   
void loop(){
  int aValue =analogRead(1);
  x = map(aValue, 0, 1024, 0, XRANGE);
  gss = map(aValue, 102, 922, -640, 640);
  Serial.print("|");
  for (int i=0;i<x;i++){
    if(i==XRANGE/2-1)Serial.print("|");
    else Serial.print("-");
  }
  Serial.print("O");
  for (int i=x+1;i<XRANGE;i++){
    if(i==XRANGE/2-1)Serial.print("|");
    else Serial.print("-");
  }
  Serial.print("|");
  Serial.print(gss);
  Serial.println("Gauss");
  delay(100);
}

This one I thought should have been simple for a raw reading:
Code:
int outputpin= 1;
//sets ground pin to LOW and input pin to HIGH
void setup()
{
Serial.begin(9600);
}

//main loop- Reads the raw value from the output pin and prints it out
void loop()
{
int rawvalue= analogRead(0);
Serial.println(rawvalue);
delay(500);
}
Logged

Offline Offline
Edison Member
*
Karma: 41
Posts: 1375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The output of the sensor is digital, either HIGH or LOW. You can connect it to a digital input.
For an analog sensor value, search Ebay for : ratiometric hall
Logged

Pages: [1]   Go Up
Jump to: