- DISCONTINUED
The sensor is a double-ended type and may be actuated with an electromagnet, a permanent magnet or a combination of both.
It is based on encapsulated dry reed switch CT10. CT10 is single-pole, single throw (SPST) type, having normally open ruthenium contacts. The sensor is a double-ended type and may be actuated with an electromagnet, a permanent magnet or a combination of both.
Connect the module with Arduino The program below shows how to use the Magnetic switch to control the led. When you put a magnet that has enough magnetic power close to the module, the switch is closed .Then the S pin out put a high voltage. You can use this to control the led.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
const int MagneticPin= 9 ; const int ledPin= 13 ; void setup() { pinMode(MagneticPin, INPUT); pinMode(ledPin,OUTPUT); } void loop() { int sensorValue = digitalRead(MagneticPin); if (sensorValue== 1 ) { digitalWrite(ledPin,HIGH); } else { digitalWrite(ledPin,LOW); } } |
Brick Type | Sensor Brick |
---|---|
Brick Interface | 3PIN |
Brick Power Supply | 5V |
Board Size | 37 × 21 × 1.6mm |
Weight | 15.00g |
Model | IM120710016 |