5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10

ARDUBLOCK Project 18: Reed Switch Module

Posted by Fiona Su on

The reed switch grass tube is full of highly purified inactive gas. Before operating, the two reeds are separated. Extra magnetic field produces different polarity around the endpoint of the two reeds, so that two different polar reeds attract each other and close.
In this project, we use graphical programming and regard reed switch module and magnet as a switch to control the on and off of LED.
Materials Required:

  • 1. KEYESTUDIO UNO Control Board *1
  • 2. V5 Sensor Shield*1
  • 3. Piranha LED*1
  • 4. Reed Switch Module*1
  • 5. Female to Female Dupont Line*6

Connection Diagram:


After wiring, we can start programming.



Click “download to Arduino” to see the following codes in IDE interface:
Sample Code:

void setup()
  pinMode( 3 , INPUT);
  pinMode( 6 , OUTPUT);

void loop()
  if (( digitalRead(3) && HIGH ))
    digitalWrite( 6 , HIGH );
    digitalWrite( 6 , LOW );

After downloading is done, you can check whether there is magnetic field using reed switch module. 

All Projects

Buy it >> ARDUBLOCK Graphical Programming Starter Kit for Arduino



Leave a comment

Please note, comments must be approved before they are published