LoRa Arduino Project: Control Relay with Feedback

Welcome to Techal, your go-to destination for insightful and engaging tech content! In this article, we’ll explore a fascinating LoRa Arduino project that allows you to control a relay and receive feedback from a distance of up to 5 to 10 kilometers. No need for Wi-Fi or Bluetooth signals!

LoRa Arduino Project: Control Relay with Feedback
LoRa Arduino Project: Control Relay with Feedback

Introduction

Have you ever wanted to control an appliance from a remote location without the hassle of complex setups? This LoRa Arduino project offers an elegant solution. By following this tutorial, you’ll learn how to create a simple circuit that enables you to control a relay and receive real-time feedback effortlessly.

LoRa Arduino Project

How It Works

Let’s dive into the details of how this project functions. The circuit consists of an AC lamp connected to a relay module. However, you can also utilize a 30 ampere relay to connect other devices, such as a pump. The transmission end and receiving end are connected wirelessly using a LoRa module, which allows for long-range communication.

To turn the lamp on or off, simply press the push button at either the transmitting or receiving end. The status of the relay is displayed on an OLED, providing immediate feedback on whether the lamp is on or off. You can control the lamp from either end and receive feedback accordingly.

In some cases, you might not receive feedback from the receiving end. When this occurs, a “checking” text is displayed on the OLED. To request feedback again, press the status button, and once received, you can monitor the current status of the lamp on the OLED.

Further reading:  NodeMCU ESP8266: Voice Control Home Automation System with Alexa

The project also features a unique capability to remember the previous state of the lamp, thanks to the Eep ROM memory. So, even if you turn off the power supply, the lamp will automatically turn on again when the power is restored.

Getting Started

To embark on this project, you’ll need an Arduino Nano or any other microcontroller of your choice. Additionally, you’ll require a LoRa module, such as the rylr896 module used in this tutorial. For serial communication with the LoRa module, a voltage divider is utilized to drop the logic level from 5 volts to 3.3 volts.

Here’s a list of the components you’ll need:

  • Arduino Nano or any other microcontroller
  • LoRa module (rylr896 or any other compatible module)
  • Relay module (30 ampere or as per your requirements)
  • OLED display
  • Push buttons
  • Resistors and capacitors
  • AC lamp or any other appliance

Circuit Setup

Circuit Setup

To set up the circuit, connect the components according to the schematic diagram. Ensure that you provide a 5-volt supply to the AC circuit. For a more professional and efficient circuit, it is recommended to use a PCB (Printed Circuit Board).

Source Code and Libraries

To program the Arduino Nano, you’ll need to install the necessary libraries for the OLED display. The source code for both the transmitting and receiving ends is available on our website here. Make sure to download the appropriate code for each end.

Now, let’s take a closer look at the code:

In the transmitting end code:

  • Install the OLED library.
  • Configure the LoRa module by entering the necessary details, such as the LoRa band and network ID.
  • Define the setup and loop functions:
    • Setup the serial communication and display unit.
    • Configure the LoRa module and request feedback from the receiving end.
    • Call the manual control and get feedback functions in the loop.
Further reading:  Star-Delta Starter PLC Program and Wiring

In the receiving end code:

  • Install the AC button library.
  • Configure the LoRa module with the appropriate details, ensuring the network ID matches the transmitting end.
  • Define the setup and loop functions:
    • Setup the serial communication and configure the LoRa module.
    • Call the loader control and get feedback functions in the loop.

FAQs

Q: Can I use a different microcontroller instead of an Arduino Nano or Uno?
A: Yes, you can use any other microcontroller of your choice. Make sure to configure the code accordingly.

Q: Is it necessary to use a PCB for this project?
A: Although a PCB is not used in this tutorial, it is recommended for any electronics project for better performance and reliability.

Conclusion

Congratulations! You’ve completed a thrilling LoRa Arduino project that enables you to control a relay and receive valuable feedback remotely. This project offers convenience and flexibility for various applications, allowing you to control appliances from a distance with ease.

If you found this project helpful, don’t forget to give it a thumbs up and share it with your friends. For more exciting tech projects and tutorials, subscribe to our channel. Thank you for choosing Techal!

Image Source

YouTube video
LoRa Arduino Project: Control Relay with Feedback