

#ARDUINO RELAY SHIELD TUTORIAL CODE#
So, now we are ready to make the Arduino code for enabling the communication between the Arduino board and the smartphone. Arduino Bluetooth Communication Example Source Code On the other hand, the line between the Bluetooth module TX pin and the Arduino RX pin can be connected directly because the 3.3V signal from the Bluetooth module is enough to be accepted as a high logic at the Arduino Board. Introducing the Relay Module A relay is an electrically operated switch that can be turned on or off, letting the current go through or not, and can be controlled with low voltages, like the 5V provided by the Arduino pins. So, the line between the Arduino TX (Transmit Pin, which has 5V output) and the Bluetooth module RX (Receive Pin, which supports only 3.3V) needs to be connected through a voltage divider in order not to burn the module. By the end of this tutorial, you should be able to control any electronics appliances with your Arduino using a relay module. However, the logic voltage level of the data pins is 3.3V. The particular module that I have can be powered from 3.6 to 6 volts, because it comes on breakout board which contains a voltage regulator. Here’s how we need to connect the module to the Arduino Board. As an Amazon Associate I earn from qualifying purchases. How Do Relays Work At the core of a relay is an electromagnet (a wire coil that becomes a temporary magnet when electricity is passed through it). Breadboard and Jump Wires ……… Amazon / Banggood / AliExpressĭisclosure: These are affiliate links. This tutorial will walk you through setting up the relay module to turn on a lamp or other device, but first, a quick primer on relays.Arduino Board …………………………… Amazon / Banggood / AliExpress.You can get the components needed for this Arduino tutorial from any of the sites below:
#ARDUINO RELAY SHIELD TUTORIAL SERIAL#
The HC-05 module is a Bluetooth SPP (Serial Port Protocol) module, which means it communicates with the Arduino via the Serial Communication. There are several different versions of this this module but I recommend the one that comes on a breakout board because in that way it’s much easier to be connected. Comparing it to the HC-06 module, which can only be set as a Slave, the HC-05 can be set as Master as well which enables making a communication between two separate Arduino Boards. Before we start with the first example, controlling an Arduino using a smartphone, let’s take a closer look at the HC-05 Bluetooth module.
