TinkerKit Hall Sensor module Ver más grande La imagen puede diferir del original

TinkerKit Hall Sensor module

T000070

Nuevo

En Stock

6,90 €

Un Sensor de Hall restituye un nivel de tensión dependiendo de los campos magnéticos detectados. Puede ser utilizado para detectar la distancia de un imán cercano. El Sensor de Hall también se puede utilizar para detectar los campos magnéticos producidos por un cable o una bobina.

Output: este modulo restituye 5V cuando un campo magnético (por ejemplo, un cuerpo humano) está situado cerca del sensor, y 0V cuando no hay nada cerca. Si se conecta a una entrada de Arduino que usa el TinkerKit Shield, los valores variarán de 0 a 1023.

Descripción del Módulo: Un Imán al neodimio está colocado sobre una placa TinkerKit; atrás hay un amplificador de señal, un LED verde que indica si el módulo está alimentado correctamente y un LED amarillo cuyo brillo depende de los niveles de salidas del modulo.

Ten en cuenta que en la superficie del sensor hay algunos contactos eléctricos expuestos por esta razón y a fin de evitar un cortocircuito evite tocar la tarjeta con objetos metálicos.

Este modulo es un SENSOR. El conector es un OUTPUT y tiene que ser conectado a los conectores INPUT del TinkerKit Shield.

 

ejemplo de codigo


/*
  Analog input, digital output, serial output

 Reads an analog input pin; T000070 Hall Sensor connected to I0 reacts
 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
 by Davide Gomba

 This example code is in the public domain.

 */


 #define O0 11
 #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
// 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

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  pinMode(digitalOutPin, OUTPUT);
}

void loop() {
  // read the analog in value:

  sensorValue = analogRead(analogInPin);  

  if (sensorValue < 505) { // notice that the normal value of the sensor is 510
   digitalWrite(digitalOutPin, HIGH);
   } else {
   digitalWrite(digitalOutPin, LOW);
   }
  // print the results to the serial monitor:
  Serial.print("Hall Sensor Value = " );                      
  Serial.println(sensorValue);      

  // wait 10 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:
  delay(10);                    
}