Magnet Polarity Detection Using Visuino & Arduino

About the project

In this tutorial we are going to learn how to detect Magnet Polarity using the Hall sensor and display it in Visuino using the Instruments.

Project info

Difficulty: Easy

Platforms: ArduinoVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Magnet Polarity Detection module Magnet Polarity Detection module x 1
magnet magnet x 1
Jumper wires (generic) Jumper wires (generic) x 1
Breadboard (generic) Breadboard (generic) x 1
Arduino UNO Arduino UNO x 1

Software apps and online services

Visuino Visuino

Story

It is a simple tutorial for beginners on how to get started with Visuino.

Watch the video!

Step 1: What You Will Need

  • Arduino UNO (or any other Arduino or ESP)
  • Magnet Polarity Detection module
  • Jumper wires
  • Magnet
  • Visuino program: Download Visuino

Step 2: The Circuit

  • Connect Arduino pin [5V] to Magnet Polarity module pin [VCC]
  • Connect Arduino pin [GND] to Magnet Polarity module pin [GND]
  • Connect Arduino Digital pin [2] to Magnet Polarity module North pin [N]
  • Connect Arduino Digital pin [3] to Magnet Polarity module North pin [S]

Step 3: Start Visuino, and Select the Arduino UNO Board Type

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

Step 4: In Visuino Add & Connect Components

  • Add "Packet" component
  • 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"
  • Close the Elements window
  • Connect Arduino digital pin [2] to "Packet1" > "Elements" > "North" pin [In]
  • Connect Arduino digital pin [3] to "Packet1" > "Elements" > "South" pin [In]

Step 5: Generate, Compile, and Upload the Arduino Code

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.

Step 6: Play

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

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...