Surilli
Published © LGPL

Detect Magnetic Field Using Reed Sensor and Surilli GSM

It works when magnetic field is present. It is used in 'pick ups' on bicycle computers and the sensors on window and door alarms.

BeginnerFull instructions provided9 minutes524
Detect Magnetic Field Using Reed Sensor and Surilli GSM

Things used in this project

Hardware components

Jumper wires (generic)
Jumper wires (generic)
×3
Breadboard (generic)
Breadboard (generic)
×1
Surilli GSM
Surilli GSM
×1
LED (generic)
LED (generic)
×1
Reed switch KY-021
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Detect Magnetic Field Using Reed Sensor and Surilli GSM

Code

Reed_Switch

C/C++
int Led = 5 ;// define LED Interface
int buttonpin = 6; // define the Reed sensor interfaces
int val ;// define numeric variables val
void setup ()
{
 pinMode (Led, OUTPUT) ;// define LED as output interface
 pinMode (buttonpin, INPUT) ;// output interface as defined Reed sensor
}
void loop ()
{
 val = digitalRead (buttonpin) ;// digital interface will be assigned a value of 6 to read val
 if (val == HIGH) // When the Reed sensor detects a signal, LED flashes
 {
   digitalWrite (Led, LOW);
 }
 else
 {
   digitalWrite (Led, HIGH);
 }
}

Credits

Surilli
196 projects • 65 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments