Difference between revisions of "Hall Sensor"

From LinkSprite Playgound
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="c"> /* Analog input, digital output, serial output Reads an analog input pin; T000070 Hall Sensor connected to I0 reacts to the magnet direction ...")
 
(Introduction)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<syntaxhighlight lang="c">
+
==Introduction==
 +
This hall module hosts an magnetic hall sensor that senses the presence of magnetic field.
  
/*
+
[[File:N12DH WHITOUT PACKAGED FRONT.jpg|640px]]
  Analog input, digital output, serial output
 
  
Reads an analog input pin; T000070 Hall Sensor connected to I0 reacts
+
[[File:N12DH WITHOUT PACKAGED BACK.jpg|640px]]
to the magnet direction and uses the result to light up a T010111 LED Module connected on O0.
 
Also prints the value of the Hall Sensor to the serial monitor.
 
  
created on 7 Dec 2010
+
== Features ==
by Davide Gomba
 
  
This example code is in the public domain.
+
Dimensions: 20.0×24.2×10.6mm
  
*/
+
Net weight: 1.6g
  
#define O0 11
+
== Dimension ==
#define O1 10
 
#define O2 9
 
#define O3 6
 
#define O4 5
 
#define O5 3
 
#define I0 A0
 
#define I1 A1
 
#define I2 A2
 
#define I3 A3
 
#define I4 A4
 
#define I5 A5
 
  
// These constants won't change. They're used to give names
+
[[File:hall sensor dimension1.jpg]]
// to the pins used:
 
const int analogInPin = I0;  // Analog input pin that the Hall Sensor is attached to
 
const int digitalOutPin= O0; // Digital output pin that the LED is attached to
 
  
int sensorValue = 0;        // value read from the Linear pot
+
== Schematics ==
 +
*[https://s3.amazonaws.com/linksprite/LinkerKit/Linker+Hall+Sensor.pdf Schematics]
  
void setup() {
+
==Application Ideas==
  // initialize serial communications at 9600 bps:
 
  Serial.begin(9600);
 
  pinMode(digitalOutPin, OUTPUT);
 
}
 
  
void loop() {
+
<syntaxhighlight lang="c">
  // read the analog in value:
 
  
  sensorValue = analogRead(analogInPin);   
+
int ledPin = 13;   
 
+
int out = 12;  
  if (sensorValue < 505) { // notice that the normal value of the sensor is 510
+
   
   digitalWrite(digitalOutPin, HIGH);
+
void setup()  
   } else {
+
{  
   digitalWrite(digitalOutPin, LOW);
+
   pinMode(ledPin, OUTPUT);  
   }
+
   pinMode(out, INPUT);   
  // print the results to the serial monitor:
+
}  
  Serial.print("Hall Sensor Value = " );                      
+
  Serial.println(sensorValue);     
+
void loop()
 +
{
 +
    if ( digitalRead(out) )    
 +
{
 +
          digitalWrite(ledPin,LOW );  
 +
}
 +
   else
 +
{                             
 +
        digitalWrite(ledPin,HIGH);  
 +
}
 +
}
 +
</syntaxhighlight>
  
  // wait 10 milliseconds before the next loop
 
  // for the analog-to-digital converter to settle
 
  // after the last reading:
 
  delay(10);                   
 
}
 
  
 +
[[File:Hall link.jpg]]
  
<syntaxhighlight>
+
==How to buy==
 +
Here to buy Hall Sensor on [http://store.linksprite.com/hall-module-of-linker-kit-for-pcduino-arduino/ store]

Latest revision as of 03:33, 22 July 2016

Introduction

This hall module hosts an magnetic hall sensor that senses the presence of magnetic field.

N12DH WHITOUT PACKAGED FRONT.jpg

N12DH WITHOUT PACKAGED BACK.jpg

Features

Dimensions: 20.0×24.2×10.6mm

Net weight: 1.6g

Dimension

Hall sensor dimension1.jpg

Schematics

Application Ideas

<syntaxhighlight lang="c">

int ledPin = 13; int out = 12;

void setup() {

  pinMode(ledPin, OUTPUT); 
  pinMode(out, INPUT);    

}

void loop() {

   if ( digitalRead(out) )    

{

          digitalWrite(ledPin,LOW ); 

}

  else

{

        digitalWrite(ledPin,HIGH); 

} } </syntaxhighlight>


Hall link.jpg

How to buy

Here to buy Hall Sensor on store