How to Use Arduino 4 Channel Relay Shield Using Visual Programming

In this tutorial we will learn how simple it is to use Arduino 4 channel Relay Shield to control a 12V light bulb.

In first example the light bulb will just blink and in the second example we will turn On or Off the light bulb using a button and in a third example using a remote control.

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

What You Will Need

What You Will Need

What You Will Need

Arduino UNO or any other Arduino board4 channel Relay ShieldLight BulbPower SupplyJumper wiresBreadboardVisuino software: Download hereRemote Control - 433 MHz RF module (Optional)Button (Optional)1K ohm resistor (Optional)
STEP 2
The Circuit

Example: Light Bulb Blinking

Connect power supply 12V (-) to the Light Bulb negative side (-)Connect power supply 12V (+) to the relay shield - Relay1 pin (COM1)Connect relay shield - Relay1 pin (NO1) to Light Bulb negative side (+)

Example: Button activates the relay

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]

Example: Remote Control activates the relay

Connect Remote pin [VCC] to Arduino relay shield pin [5V]Connect Remote pin [GND] to Arduino relay shield pin [GND]Connect Remote pin [D0] to Arduino relay shield digital pin [2]
STEP 3
Start Visuino, and Select the Arduino Board Type

Start Visuino, and Select the Arduino Board Type

Start Visuino, and Select the Arduino 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 Shield

 

In Visuino click on the board top right button and select "Add Shields".In the "Shields" window expand "Relay" and select "Arduino 4 Relays Shield"Close the "Shields" window
STEP 5
In Visuino Add, Set & Connect Components

 

For the first Light bulb blinking example we will add "Pulse generator" component and connect its pin [Out] to Arduino > Relay1 pin [In]

Upload the project to the Arduino board

For the second Light bulb button or remote control example we will add "Toggle(T) Flip-Flop" component and "DeBounce button" componentConnect Arduino digital pin [2] to "Button1" pin [InConnect "Button1" pin [Out] to "Toggle(T) Flip-Flop" pin [Clock]Connect "Toggle(T) Flip-Flop" pin [Out] to Arduino > Relay1 pin [In]

Upload the project to the Arduino board

STEP 6
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 7
Play

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

icon Relay-shield.rar 2KB Download(0)
License
All Rights
Reserved
licensBg
0