Magnet Polarity Detection Using Visuino & Arduino
by RonFrtek in Circuits > Arduino
60 Views, 1 Favorites, 0 Comments
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
- Arduino UNO (or any other Arduino or ESP)
- Magnet Polarity Detection module
- Jumper wires
- Magnet
- Visuino program: Download Visuino
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]
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
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]
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.
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