Arduino Electromagnet Module Using Visuino

by RonFrtek in Circuits > Arduino

128 Views, 1 Favorites, 0 Comments

Arduino Electromagnet Module Using Visuino

Arduino Electromagnet Module using Visuino

In this tutorial we are going to learn how to turn the Electromagnet module ON or OFF with a button. It is a simple tutorial for beginners on how to get started with Visuino. Since Electromagnets can be used in many projects this will serve you as a great guide for the future prtojects.

When the Electromagnet is active the LED on Arduino will be Turned ON.

Watch the video!

What You Will Need

2024-10-23_13-58-01.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
breadboard.png
button.png
F5OFEUQJJ4ZYFKY.LARGE.jpg
download.jpg
VisuinoAdvrtisemenPortentaC33-small.png
  1. Arduino UNO (or any other Arduino or ESP)
  2. 1K ohm resistor
  3. Button
  4. Electromagnet module
  5. Jumper wires
  6. Breadboard
  7. Visuino program: Download Visuino


The Circuit

2024-10-23_14-01-48.jpg
  1. Connect Arduino Digital pin [2] to button on the breadboard and to the Resistor1
  2. Connect other side of the resistor1 to the breadboard pin [GND]
  3. Connect Other pin of the button to the breadboard positive pin [5V]
  4. Connect Arduino pin [5V] to breadboard positive pin [Red line]
  5. Connect Arduino pin [GND] to breadboard negative pin [Black line]
  6. Connect Arduino Digital pin [3] to the Electromagnet module pin [SIG]
  7. Connect breadboard negative pin [Black line] to Electromagnet module pin [GND]
  8. Connect breadboard positive pin [Red line] to Electromagnet module pin [VCC]


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

F9TGB4ZL1P0GJHI.jpg
F4YZAIUL1P0GJIO.jpg
2024-10-23_14-42-50.jpg
2024-10-23_14-41-36.jpg
magnet-button.png
  1. Add "Debounce Button" component
  2. Add "Toggle(T) Flip-Flop" component
  3. Add "Digital Multi Source" component
  4. Connect Arduino digital pin [2] to "Button1" pin [In]
  5. Connect "Button1" pin [Out] to "TFlipFlop1" pin [Clock]
  6. Connect "TFlipFlop1 pin [Out] to "MultiSource1" pin [In]
  7. Connect "MultiSource1" pin [0] to Arduino digital pin [3]
  8. Connect "MultiSource1" pin [1] to Arduino digital pin [13]



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

If you power the Arduino module, press the button and the Electromagnet and Arduino LED will turn ON or OFF.

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