Hall Effect Sensors can detect a magnet field. If the magnet is the correct way around the sensor will send a signal to the Arduino.
Assembly
The sensor should be bent like the picture
The wires should run past the back of the hall sensor.
Record the color of your 3 wires
Use a pin to bend the little black plastic "tongue" up
Gently slide the plastic housing off the ends of the wires
Remove all 3 of the black plastic housings from the ends of the wires
Insert the ends of 2 of the wire into the block
(From the inside of the block) You may need to push the ends of 2 wires through the hole before you can get the third through.
Push the third wire through
Pull the wires through until the sensor is almost in the block
Make sure it is the same way up as in the picture If you need to flip it over, pull it back to the ends of the wires, flip, and pull it back.
Carefully position the sensor in the block
Check with Mr. Dash before continuing
Make sure you have all the materials in the picture before gluing
(Extra Brick & Wax Paper)
Fill your block with hot glue
Only use enough glue to cover the wires and sensor
(too much and it will squish out the sides)
Cover the block with wax paper (baking paper)
Place another block onto your MagBlock
This makes sure the glue is squished down enough
Look back at the step you recorded your wire colors
Place your 'V' wire in the middle of the connector
Place your 'G' wire on either side and mark that side with a silver pen
Place your 'S' wire in the remaining side position
Connection Diagram
The MagBlock can be connected to any digital pin.
(Don't use 0 or 1 as they are used for mBlock)
Remember the silver stripe always goes to G (Ground).
Hints
You can check the signal from the MagBlock using a read digital pin block
Each time you click on the block it will show true or false
Remember it will be backward (active high)
True (High) = No Magnet
False (Low) = Magnet
You can use a not block to flip the signal the right way around
True (High) = Magnet
False (Low) = No Magnet
You can use a loop to display the result
without having to click on it over and over