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!

STEP 1
What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

Arduino UNO (or any other Arduino or ESP)1K ohm resistorButtonElectromagnet moduleJumper wiresBreadboardVisuino program: Download Visuino
STEP 2
The Circuit

The Circuit

Connect Arduino Digital pin [2] to button on the breadboard and to the Resistor1Connect other side of the resistor1 to the breadboard pin [GND]Connect Other pin of the button to the breadboard positive pin [5V]Connect Arduino pin [5V] to breadboard positive pin [Red line]Connect Arduino pin [GND] to breadboard negative pin [Black line]Connect Arduino Digital pin [3] to the Electromagnet module pin [SIG]Connect breadboard negative pin [Black line] to Electromagnet module pin [GND]Connect breadboard positive pin [Red line] to Electromagnet module pin [VCC]
STEP 3
Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

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

In Visuino Add & Connect Components

In Visuino Add & Connect Components

In Visuino Add & Connect Components

 

Add "Debounce Button" componentAdd "Toggle(T) Flip-Flop" componentAdd "Digital Multi Source" componentConnect Arduino digital pin [2] to "Button1" pin [In]Connect "Button1" pin [Out] to "TFlipFlop1" pin [Clock]Connect "TFlipFlop1 pin [Out] to "MultiSource1" pin [In]Connect "MultiSource1" pin [0] to Arduino digital pin [3]Connect "MultiSource1" pin [1] to Arduino digital pin [13]
STEP 5
Generate, Compile, and Upload the Arduino Code

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

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

icon EL-MAG-BUTTON.zip 1KB Download(0)
License
All Rights
Reserved
licensBg
0