keyestudio
Share your creative ideas with us here
By Alisa | 29 May 2024 | 0 Comments

How to Use Hall Magnetic Sensor with Micro:bit?

Overview
 

In this project, you will learn how to use our hall magnetic sensor to control 5*5 LED of micro:bit display different images.


Component Introduction
 

Hall Magnetic Sensor:
 

The main component used in this sensor is A3144E. This hall magnetic sensor can be used to detect a magnetic field, outputting Digital signal. It can sense the magnetic materials within a detection range up to 3cm.

Note that it can only detect whether exists a magnetic field nearby but can not detect the strength of magnetic field.


Component Required:
 

  • Micro:bit main board*1

  • Keyestudio Micro bit Sensor V2 Shield*1

  • USB Cable*1

  • keyestudio Hall Magnetic Sensor*1

  • Dupont jumper wire*3

  • Premium Battery Holder 6-cell AA*1

  • 1.5V AA Battery*6


Connection Diagram
 

13


Test Code
 

Img


Test Results
 

Done wiring and powered up, send the code to micro:bit. You can place a magnetic bead near the sensor.

When hall sensor doesn’t detect the magnetic field around, you should see the LED matrix of micro:bit show the icon like a heartImg . Or else, it will show the icon like thisImg .

Leave a Reply

Your email address will not be published.Required fields are marked. *
Name
E-mail
Content
Verification code