0% found this document useful (0 votes)
7 views5 pages

Arduino Relay Tutorial for Home Automation

This document explains how to use a KY-019 relay with Arduino to control higher voltage devices. It describes the necessary materials, including an Arduino, a relay, and a 110V light bulb. It explains that a relay allows you to turn on and off large voltages and currents from Arduino and that it works by moving a magnetic switch. It provides instructions for safely connecting the relay and shows sample code to turn the relay on and off.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Arduino Relay Tutorial for Home Automation

This document explains how to use a KY-019 relay with Arduino to control higher voltage devices. It describes the necessary materials, including an Arduino, a relay, and a 110V light bulb. It explains that a relay allows you to turn on and off large voltages and currents from Arduino and that it works by moving a magnetic switch. It provides instructions for safely connecting the relay and shows sample code to turn the relay on and off.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AR

14 T
Tutorial 14: Use of the KY-019 Relay

Objective.

In this practice, we will use a relay to connect devices.


of higher voltage with an external power source, and be able to control them with Arduino this
it is a fundamental basis for home automation.

Materials

1 Arduino Uno

1 cable AB

1 Breadboard

1 Spotlight or a 110v lamp

1 relay module, (or a single relay, but you need to look for the diagram of
connection).
AR
14.1 T
What is the Relay?
The relay is the element you need if you want to manage large voltages and
currents (like those you might have in the electrical network of your house). They
It's simply about an electrical switch that you can turn on and off.
sending signals from your Arduino board (or any other controller
similar). This allows you to turn the light in your room on and off
when someone enters, until making a complete smart home. The limit
here is your imagination.

Although there are many types of relays and each has a function and
a different working range. Simply put, we can say that a
A relay is basically a coil that moves a circuit.

The idea is that when you pass a small current through that
coil, you generate a magnetic field. This field attracts a small plate
metallic (the switch) that moves to open or close another circuit
independent. This allows for a small current like the one that you
with your Arduino, you can turn on or off the element you want,
in the same way as when you press the switch in your living room
AR
14.2 T
Connection.

The connection is really simple but deserves a separate chapter since you are going to
to work with hazardous materials. The steps you must follow are the
next:

Test the operation of your code (for example, turning on and


turning off an LED with the relay.

Turn off the power before connecting (or unplug if necessary)


element that you are going to automate.

Put the relay module as a switch, that is, cut the cable that
power the device and connect it through the relay.

Make sure that the cables are securely fastened and that there is no possibility of
to touch them accidentally.

Activate the current.


AR

Code.
14.3 T
The code is really very simple, it is to turn off and on pin 9, which in
this case sends a 5v pulse to the relay and allows it to handle higher voltages
high and turn on any common electronic device at home. With this
for example we can start to create larger applications, such as controlling
All the lights in the house, which react to some type of sensor. Like
I repeat the limit is imagination.

Question section.

1 Mencione 3 Aplicaciones que podrías realizar con un relé.

What would happen if we had connected the NC instead of the NO?

In short words, what is a relay?

1 Smart control of the house lights, When the temperature is


very hot turn on the air conditioning, Turn on and off the TV
from anywhere in the world via the internet.

2 Normally Closed, then the light bulb would have been on and to the
applying a pulse, it would have turned off executing the orders in reverse.

It is an electromagnetic device that, upon receiving a pulse, opens or closes a.


circuit.

You might also like