(SKU:RB-02S026) Digital Magnetic Sensor

From ALSRobot-Wki
Jump to: navigation, search
Cgy.jpg

Contents

Product overview

Dry reed pipe is a kind of special switch magnetic susceptibility. Glass tube tube parallel encapsulation of reed end overlap, and with a certain interval to form the normally open contacts of the switch. When a permanent magnet near the dry reed pipe, or around the dry reed pipe is formed after the coil electricity make reed magnetization of a magnetic field, reed contact will be inductive polarity opposite poles. Due to the polarity opposite polarity attract each other, when attract magnetic force exceeds the resistance of the reed, separate contact will be off; When magnetic force to reduce to a certain value, under the action of reed resistance contact back to its original state. This is complete the role of a switch. Can be used for detection of magnetic materials (magnet), detection range up to 3 cm (detection range and magnetic strength), and the special sensor Arduino extension plate used in combination, can make interactive work associated with magnetic material (magnet).

specification

Method of use

Pin definition

  • S:Signal output
  • VCC:+
  • GND:-

connection method

By 3 p sensor cable plug received Carduino UNO R3 controller board using special sensor extension

Application of routine

The magnetic induction sensor and LED small lights in accordance with the procedures to access the Arduino UNO controller, observing when magnetic induction sensor close to LED small light condition.

示例程序

int magnetic=9;                //定义数字接口 9为magnetic(磁感应模块)
int led=8;                     //定义数字接口 8为LED灯

void setup()
{
  pinMode(led,OUTPUT);       //设置led为数字输出
  pinMode(magnetic,INPUT);     //设置magnetic为数字输入
}

void loop()
{
  if(digitalRead(magnetic))        //如果感应到强磁场
    digitalWrite(led, HIGH);    //LED灯亮起
  else                       //如果未感应到强磁场
    digitalWrite(led, LOW);    //LED灯熄灭
}

Application effect

After power controller, LED lights should be kept out state (not connected induction sensors, light-emitting diodes (leds) state variable)。 Magnets close to the induction module on the dry spring tube, LED module lights up; Remove the magnet steel, LED light-emitting module.

Products related to recommend

Buy address:[1]

Personal tools
Namespaces

Variants
Actions
Navigation
Tools