Skip to main content

Magnetic Sensor


Introduction​

Features​

Jacdac Magnetic Sensor: Uses the Hall effect to detect changes in magnetic fields and converts magnetic field strength into electrical signals. Commonly used for motor speed detection, inferring rotational speed by sensing magnetic field changes of the rotor; in applications such as electronic compasses, it can accurately determine the direction of navigation and positioning devices.


Specifications​

ItemParameter
NameMagnetic Sensor
SKUEF16013
Connection TypeAnalog Output
Operating Voltage4.15V
Product Dimensions38.00mm × 28.20mm (Length × Width)

Appearance and Dimensions​


暂无


Quick Start​

Hardware Connection Diagram​


Usage Tutorial​

Programming Software​

Microsoft MakeCode


MakeCode Programming​

Step 1: How to Add Jacdac Extension​

  1. Go to Microsoft MakeCode and click "New Project".

  1. Enter the project name in the pop-up window and click "Create".

  1. Click "Extensions" in the code drawer.

  1. Enter "Jacdac" in the pop-up interface and click the search icon. Select the Jacdac software library as shown.


Step 2 :​

  1. Connect the micro:bit to the computer using a data cable. Note: If the micro:bit is running a Jacdac program for the first time, please pre-install a blank Jacdac program on the micro:bit first; otherwise, skip this step.

    Note: Make sure the power selection switch is set correctly. When using the micro:bit board to power the Jacdac modules, set the switch to micro:bit. When using an external power module, set the switch to Power.

  1. Connect the sensor. MakeCode will automatically recognize it and simulate its status. The sensor will provide real-time feedback in the simulation area.

  1. Click "ADD BLOCKS" for the sensor extension module. Note: When connecting a new sensor, repeat the operation of clicking "ADD BLOCKS" for the sensor extension module.


Program Example as Shown​


https://makecode.microbit.org/_51DU2LPKPHpx

You can also download it via the embedded link:


Results​

When the magnetic sensor detects a magnet, the micro:bit displays "√"; otherwise, it displays "×"