Maker.io main logo

How to Use Arduino 4 Channel Relay Shield Using Visual Programming

427

2025-07-17 | By Ron Cutts

License: General Public License DC Motor Light Power Supplies Relays Arduino

 

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

In the 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 the 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

  1. Arduino UNO or any other Arduino board

  2. 4 channel Relay Shield

  3. Light Bulb

  4. Power Supply

  5. Jumper wires

  6. Breadboard

  7. Visuino software: Download here

  8. Remote Control - 433 MHz RF module (Optional)

  9. Button (Optional)

  10. 1K ohm resistor (Optional)

Step 2: The Circuit

The Circuitimageimage

Example: Light Bulb Blinking

  1. Connect the power supply 12V (-) to the Light Bulb negative side (-)

  2. Connect power supply 12V (+) to the relay shield - Relay1 pin (COM1)

  3. Connect relay shield - Relay1 pin (NO1) to Light Bulb negative side (+)

Example: Button activates the relay

  1. Connect Arduino Digital pin [2] to the button on the breadboard and Resistor1

  2. Connect the other side of resistor 1 to the breadboard pin [GND]

  3. Connect the 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]

Example: Remote Control activates the relay

  1. Connect Remote pin [VCC] to Arduino relay shield pin [5V]

  2. Connect the Remote pin [GND] to the Arduino relay shield pin [GND]

  3. 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 in Picture 2

Step 4: In Visuino, Add the Shield

In Visuino Add Shield

In Visuino Add Shield

  1. In Visuino, click on the board top right button and select "Add Shields".

  2. In the "Shields" window, expand "Relay" and select "Arduino 4 Relays Shield"

  3. Close the "Shields" window

Step 5: In Visuino, Add, Set & Connect Components

imageimageimage

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

Upload the project to the Arduino board

  1. For the second Light bulb button or remote control example, we will add "Toggle(T) Flip-Flop" component and "DeBounce button" component

  2. Connect Arduino digital pin [2] to "Button1" pin [In

  3. Connect "Button1" pin [Out] to "Toggle(T) Flip-Flop" pin [Clock]

  4. 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 project. You can download it and open it in Visuino: https://www.visuino.com

Download Visuino file: Relay-Shield.visuino

Download Visuino file: Relay-Shield-Button-Or-Remote.visuino

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.