Magnet Polarity Detection Using Visuino & Arduino

by RonFrtek in Circuits > Arduino

60 Views, 1 Favorites, 0 Comments

Magnet Polarity Detection Using Visuino & Arduino

Magnet Polarity Detection Using Visuino & Arduino

In this tutorial we are going to learn how to detect Magnet Polarity using the Hall sensor and display the polarity in Visuino using the Instruments tool. It is a simple tutorial for beginners on how to get started with Visuino.

Watch the video!

What You Will Need

2024-10-24_13-36-34.jpg
VisuinoAdvrtisemenPortentaC33.png
F5OFEUQJJ4ZYFKY.LARGE.jpg
FZEK4WBK3XGYAP0.LARGE.jpg


  1. Arduino UNO (or any other Arduino or ESP)
  2. Magnet Polarity Detection module
  3. Jumper wires
  4. Magnet
  5. Visuino program: Download Visuino



The Circuit

2024-10-24_13-44-54.jpg
  1. Connect Arduino pin [5V] to Magnet Polarity module pin [VCC]
  2. Connect Arduino pin [GND] to Magnet Polarity module pin [GND]
  3. Connect Arduino Digital pin [2] to Magnet Polarity module North pin [N]
  4. Connect Arduino Digital pin [3] to Magnet Polarity module North pin [S]


Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add & Connect Components

2024-10-24_14-28-51.jpg
2024-10-24_14-29-26.jpg
2024-10-24_14-29-42.jpg
2024-10-24_14-29-55.jpg
2024-10-24_14-34-11.jpg
magnet-pole-sensor.png
  1. Add "Packet" component
  2. Double click on the "Packet1" and in the Elements window drag "Digital" to the left side and in the properties window set "Name" to "North", drag another "Digital" to the left side and in the properties window set "Name" to "South"
  3. Close the Elements window


  1. Connect Arduino digital pin [2] to "Packet1" > "Elements" > "North" pin [In]
  2. Connect Arduino digital pin [3] to "Packet1" > "Elements" > "South" pin [In]

Generate, Compile, and Upload the Arduino Code

Visuino-Compile-UNO.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

2024-10-24_14-36-32.jpg

After you upload the project, click Serial tab and Instruments Tab, Make sure that you select correct Port and Click on the Connect button. Now you should be able to see the magnet pole detected by the sensor.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.com