How to Use Arduino 4 Channel Relay Shield Using Visual Programming
by RonFrtek in Circuits > Arduino
60 Views, 0 Favorites, 0 Comments
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!
What You Will Need










- Arduino UNO or any other Arduino board
- 4 channel Relay Shield
- Light Bulb
- Power Supply
- Jumper wires
- Breadboard
- Visuino software: Download here
- Remote Control - 433 MHz RF module (Optional)
- Button (Optional)
- 1K ohm resistor (Optional)
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 Resistor1
- Connect 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]
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
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
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" component
- Connect Arduino digital pin [2] to "Button1" pin [In
- Connect "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
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
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