Tutorial: How to Control LED by Using Arduino and Relay

by mybotic in Circuits > Arduino

17018 Views, 5 Favorites, 0 Comments

Tutorial: How to Control LED by Using Arduino and Relay

full model relay.JPG

Hello guys! Today we're going to make project that use SIngle Channel 5V Optocoupler Relay module. This project objective is to control LED by using the combination of Arduino UNO and relay.

Before we start, let me explain to you for short what is relay. Relays are switches that open and close circuits electromechanically or electronically. Relays control one electrical circuit by opening and closing contacts in another circuit. As relay diagrams show, when a relay contact is normally open (NO), there is an open contact when the relay is not energized. When a relay contact is Normally Closed (NC), there is a closed contact when the relay is not energized. In either case, applying electrical current to the contacts will change their state.

But why we need to use arduino? Because we want the project control itself, not we are controlling it 24/7.

Gather You Things Up!

item relay 1.JPG
item relay 2.JPG

You need this components below in order for this project to work:

  1. Single Channel 5V Optocoupler Relay Module
  2. Arduino UNO
  3. 2xLED
  4. 2x 330 ohm resistors
  5. Jumpers
  6. Breadboard
  7. Power Supply (5V)
  8. Power cable (to connect arduino)

Upload the Source Code Into Your Arduino UNO

Upload the source code into your Arduino code that we give. The source code is to control the relay by using timer. We just do the basic function, you can change it according to your creativity.

Downloads

Let's Start!

Tutorial: How to control LED by using relay and arduino

We made a video with on how to setup the project. It is more understandable than you reading it. Good luck on your project! :)