LoRa Project With ESP8266 Arduino Control Relay

by techstudycell in Circuits > Arduino

8901 Views, 35 Favorites, 0 Comments

LoRa Project With ESP8266 Arduino Control Relay

IMG20211122083134_01.jpg
vlcsnap-2021-11-29-23h29m44s997.png
vlcsnap-2021-11-29-23h09m11s817.png
vlcsnap-2021-11-29-23h09m31s183.png
vlcsnap-2021-01-17-19h59m11s931.png
thumb _website.jpg
LoRa ESP8266 Arduino control Relay with feedback | Lora Project with Circuit using RYLR896 module

In this Lora project tutorial, I have shown how to make the LoRa Arduino ESP8266 control relay using the RYLR896 LoRa module with real-time feedback.

So after turning on and off the appliances the receiver circuit will send feedback to the transmitter circuit.

In this article, I have covered the following topics.

  • Explained this ESP8266 Arduino Lora home automation project.
  • Explained Transmitter & Receiver Lora circuit.
  • Configure LoRa with AT commands.
  • Explained the source codes for this LoRA project.
  • Connecting the LoRa module with Arduino and ESP8266.
  • Control high voltage appliances with LoRa.

So if you follow all the steps, you can easily make this Lora Arduino project to control any appliances from 10KM away in the rural areas without Wi-Fi and Bluetooth. So this project is very useful in rural areas.

Although the PCB is not mandatory, however, if you want, you can also use this PCB to make the circuit compact and give the project a professional look.

Supplies

Required component for this Lora project:

  • Lora Modules REYAX RYLR896 2no
  • Arduino Nano 1no
  • ESP8266 NodeMCU 1no
  • 5v 4-channel Relay Module 1no
  • 220-ohm Resistor 1no
  • 4.7k Resistor 2no
  • 10k Resistor 2no
  • 5-mm LED 3no
  • Push buttons 4no
  • FTDI232 USB to serial interface board 1no

Required Components for the NodeMCU control Relay Module PCB:

  • Relays 5v (SPDT) (4 no)
  • BC547 Transistors (4 no)
  • PC817 Optocuplors (4 no)
  • 510-ohm 0.25-watt Resistor (4 no) (R1 -- R4)
  • 1k 0.25-watt Resistors (5 no) (R5 -- R9)
  • LED 5-mm (5 no)
  • 1N4007 Diodes (5 no) (D1 -- D5)
  • Push Buttons (4 no)
  • Terminal Connectors
  • 5V DC supply

Transmitter Lora Circuit Using Arduino

transmitter lora arduino circuit.jpg

In the transmitter LoRa circuit, I have used Arduino Nano. I have made a voltage divider using 4.7k and 10k resistors to drop down the 5-volt logic level to the 3.3-volt logic level.

The pushbuttons are connected with the D2, D3, D4, and D5 digital pins of the Arduino.

I have used the INPUT_PULLUP function in Arduino IDE instead of using the pull-up resistors.

And the LEDs are connected with the D7, D8, and D13 digital pins of the Arduino.

On the Arduino board, a resistor is already connected in series with D13 pin, so I have not used any series resistor with the LED for the D13 pin.

You can use any 5V DC supply or 9V battery to supply the circuit.

Receiver Lora Circuit Using NodeMCU

receiver lora esp8266 circuit.jpg

In the receiver LoRa circuit, I have used NodeMCU as the microcontroller. In the circuit, I have also made a voltage divider using 4.7k and 10k resistors to drop down the 5-volt logic level to the 3.3-volt logic level.

I have used D1, D2, D5 & D6 GPIO pins to control the 4 relays.

**The Boot will fail if RX is grounded during the Boot process of NodeMCU. So, connect the LoRa module after giving the supply to NodeMCU.

I have used a 5V 2Amp power supply to supply the NodeMCU and relay module.

Please take the proper safety precautions while working with high voltage.

Configuring the Parameters With AT Commands

vlcsnap-2021-11-29-23h27m56s765.png
vlcsnap-2021-11-29-23h28m22s413.png
AT commands.JPG
vlcsnap-2021-11-29-23h28m02s806.png

First, you have to connect the LoRa module with FTDI232 USB to serial interface board as per the circuit to configure some parameters with AT commands.

In Serial monitor select the Baud rate = 115200 and "Both NL & CR".

AT Commands used for the Transmitter LoRa module

  • AT+ADDRESS=1
  • AT+NETWORKID=5
  • AT+BAND=865000000

AT Commands used for the Receiver LoRa module

  • AT+ADDRESS=1
  • AT+NETWORKID=5
  • AT+BAND=865000000

Select the BAND as per the eligible LoRa bands available in your country.

Please refer to the tutorial video for more details.

Codes for This LoRa Project Using Arduino and ESP8266

vlcsnap-2021-11-29-23h29m02s268.png

In this Lora Project, I have used Arduino Nano for the transmitter circuit, and NodeMCU for the receiving circuit.

First, download the source codes. Then upload the code for the transmitter circuit to Arduino. And upload the code of the receiving circuit to NodeMCU.

Design the PCB for the Receiving LoRa Circuit

vlcsnap-2021-01-17-19h58m26s121.png
vlcsnap-2021-01-17-19h58m40s950.png
vlcsnap-2021-01-17-19h58m50s543.png

To make the circuit compact and give a professional look, I have designed the PCB for the receiving end LoRa circuit.

You can download the PCB Gerber file of this home automation project from the following link: https://drive.google.com/uc?export=download&id=1Jx4D_DSV_ei1y0a82AbtxbsNhy8sjCmY

Order the PCB

JLC 1.jpg
JLC 2.jpg

After downloading the Garber file you can easily order the PCB

1. Visit https://jlcpcb.com/ and Sign in / Sign up.

2. Click on the QUOTE NOW button.

3. Click on the "Add Gerber file" button. Then browse and select the Gerber file you have downloaded.

Uploading the Gerber File and Set the Parameters

JLC3_NodeMCU.png
JLC 4.jpg

4. Set the required parameter like Quantity, PCB masking color, etc

5. After selecting all the Parameters for PCB click on SAVE TO CART button.

Select Shipping Address and Payment Mode

JLC5.jpg
JLC6.jpg
IMG20210109165955_01.jpg

6. Type the Shipping Address.

7. Select the Shipping Method suitable for you.

8. Submit the order and proceed with the payment. You can also track your order from JLCPCB.com.

My PCBs took 2 days to get manufactured and arrived within a week using the DHL delivery option.

PCBs were well packed and the quality was really good at this affordable price.

Solder All the Components on PCB

vlcsnap-2021-01-17-19h59m20s552.png
vlcsnap-2021-01-17-19h59m26s786.png
vlcsnap-2021-01-17-19h59m32s188.png

After that, I have soldered all the components as per the circuit diagram.

Then connect the NodeMCU board with the PCB.

Connect the Appliances With the Relay Module

ESP8266 PCB connection.png

Connect the 4 appliances with the relay module as per the circuit diagram.

Please take proper safety precautions while working with high voltage.

Connect the LoRa Module With Arduino and ESP8266

vlcsnap-2021-11-28-14h34m14s075.png
receiving lora pcb.JPG

After uploading the codes, connect the LoRa modules with the Arduino and NodeMCU.

For the receiving circuit turn ON the 5V supply before connecting the LoRa module.

Control the Appliances With LoRa

vlcsnap-2021-11-29-23h30m18s037.png
IMG20211123072036_01.jpg

Now you can control the appliances with the transmitter LoRa circuit and also monitor the real-time feedback from the receiver LoRa circuit.

Please make sure there should not be any loose connection, otherwise, this circuit may not work.

In the future, I will try to add more features to this LoRa project.

I will really appreciate it if you share your valuable feedbacks. Also if you have any query please write in the comment section.

Thank you & Happy Learning.