Difference between revisions of "Lora Relay"

From MakerFabsWiki
Jump to: navigation, search
(Hardware Connections)
(Usage)
Line 150: Line 150:
  
  
Open [https://github.com/Makerfabs/Lora-Soil-Moisture-Sensor/tree/master/LoraTransmitterADCAHT10 LoraTransmitterADCAHT10.ino], verify and upload the firmware to Lora Soil Moisture.<br>
+
Open [https://github.com/Makerfabs/Lora-Relay/tree/master/LoraRelayReciecer LoraRelayReciecer.ino], verify and upload the firmware to Lora Relay.<br>
 
Modify the frequency macro according to your board is 433Mhz or 868Mhz or 915Mhz.<br>
 
Modify the frequency macro according to your board is 433Mhz or 868Mhz or 915Mhz.<br>
 
If your Lora board is 433MHz:<br>
 
If your Lora board is 433MHz:<br>
Line 166: Line 166:
  
  
Tips: Lora Soil Moisture designed as a product, so it not integrates the USB-to-UART on board. If you upload the firmware fails, press and hold the Reset button before upload the firmware. When the IDE shows below, then release the button that may helped to upload the firmware success. That’s we need a reset the MCU when upload the firmware.<br>
+
Tips: Lora Relay designed as a product, so it not integrates the USB-to-UART on board. If you upload the firmware fails, press and hold the Reset button before upload the firmware. When the IDE shows below, then release the button that may helped to upload the firmware success. That’s we need a reset the MCU when upload the firmware.<br>
 
[[File:Lora_Soil_10A.jpg|700px]]<br>
 
[[File:Lora_Soil_10A.jpg|700px]]<br>
  
Install the AAA*2 batteries and put the Lora Soil Moisture aside, now we need to make the Lora Radio Receiver.<br>
+
Pins
 +
The following table lists all of the relay's pins and their functionality.<br>
 +
{| cellspacing="0" cellpadding="5" border="1"
 +
|-
 +
| align="center" width="150" | '''Pin'''
 +
| align="center" width="200" | '''Description'''
 +
|- style="font-size: 90%"
 +
| align="center" | NC
 +
| align="center" | Normally Closed
 +
|- style="font-size: 90%"
 +
| align="center" | NO
 +
| align="center" | Normally Opened
 +
|- style="font-size: 90%"
 +
| align="center" | COM
 +
| align="center" | Switch Common
 +
|}
  
2. Lora Radio Receiver.<br>
+
Normally, when Pin D4 output LOW the relay is not triggered, COM connects to NC. <br>
 +
Contrarily, when Pin D4 output LOW the relay is triggered, COM connects to NO.<br>
 +
 
 +
The Power LED will light up when the board is powered. The RL LED will light up when the relay has been triggered.<br>
 +
 
 +
The onboard screw terminal should be used to connect your high-power load. The middle COM pin should be hooked up to the Live wire (Usually black) coming from the wall, while NO or NC should be connected to the Live wire on the device side of things.<br>
 +
 
 +
[[File:Lora_Relay_10.jpg|700px]]<br>
 +
 
 +
Example wire connection<br>
 +
 
 +
[[File:Lora_Relay_11.jpg|700px]]<br>
 +
 
 +
Example wire connection<br>
 +
 
 +
Note: Not sure about what color insulation wiring is used in your region? Check out the standard wire insulation colors listed online for reference. If you are unsure about the standard wiring color in your region, please consult a certified electrician to connect to the AC input voltage side.<br>
 +
 
 +
 
 +
⚡ Warning! Make sure the cable is not plugged into the wall as you cut into the wire in the following section.<br>
 +
You'll also need to place the relay in line with the AC powered item you're attempting to control. You'll have to cut your live AC line (usually black or red) and connect one end of the cut wire to COM and the other to NC or NO, depending on what you want the resting state of your device to be. If your AC device is going to be on for most of the time, and you occasionally want to turn it off, you should connect one end to COM and the other to NC. Connect to NO if the device will be off for most of the time.<br>
 +
 
 +
⚡ Warning!  Please be careful when handling the contacts when the cable is plugged into a wall outlet. Touching the contacts while powered could result in injury.<br>
 +
 
 +
Forbidding connect Live and Neutral wire to the onboard screw terminal, it will make Live and Neutral in short circuit in normal case or when relay triggered.<br>
 +
 
 +
[[File:Lora_Relay_12.jpg|700px]]<br>
 +
 
 +
 
 +
[[File:Lora_Relay_13.jpg|700px]]<br>
 +
 
 +
 
 +
Put the Lora Relay aside, now we need to make the Lora Radio Transmitter.<br>
 +
 
 +
2. The Lora Transmitter<br>
 
Plug the Maduino Lora Radio to PC via microUSB cable.<br>
 
Plug the Maduino Lora Radio to PC via microUSB cable.<br>
 
[[File:Lora_Soil_11A.jpg|700px]]<br>
 
[[File:Lora_Soil_11A.jpg|700px]]<br>
  
Open the code [https://github.com/Makerfabs/Lora-Soil-Moisture-Sensor/tree/master/LoraReceiver LoraReceiver.ino] <br>
+
Open the code [https://github.com/Makerfabs/Lora-Soil-Moisture-Sensor/tree/master/LoraReceiver LoraTransmitter.ino] <br>
 
Select the Arduino Pro or Pro mini<br>
 
Select the Arduino Pro or Pro mini<br>
  
Line 192: Line 240:
  
 
===Result:===
 
===Result:===
The Lora Soil Moisture will send messages via Lora Radio frequency. And the Maduino Lora Radio will receive the result and print them in the Serial Monitor.<br>
+
The Transmitter will send message via Lora 433/868Mhz frequency. And the Lora Relay will receive the result and print them in the Serial Monitor. The Lora Relay Received the message from the Maduino Lora Radio, it will switch on or off repeatedly.<br>
[[File:Lora_Soil_16.jpg|700px]]<br>
+
[[File:Lora_Relay_16.jpg|700px]]<br>
 
 
We can see it gets the air humidity and temperature and soil moisture from the Lora Soil Moisture Sensor.<br>
 
[[File:Lora_Soil_17.jpg|700px]]<br>
 
  
 
== FAQ  ==
 
== FAQ  ==

Revision as of 08:31, 24 June 2020

Introduction

Lora Relay 01.jpg

Warning: If Lora Relay is used for controlling AC110V/AC220V Devices, be aware of safety.

This is a relay module that could be controlled by Lora, with max current 30A/240V. Based on RFM98W, it support max 4~5 km Lora communication.
This Lora relay module is preloaded Arduino Pro mini(3.3v 8M) bootloader and simple demo firmware Lora Relay V1.1, the users could freely change/update the firmware with Arduino IDE, with a common UART tool (Note that if there no DTR in your UART tool, you will need to press reset button to reset the controller Mega328P manually).
Lora Relay transceivers feature the LoRa long range modem that provides ultra-long range spread spectrum communication and high interference immunity.
Lora Relay offers bandwidth options ranging from 7.8125kHz to 500 kHz with spreading factors ranging from 6 to 12, there are three choices of the working frequency.
Item Lora Module working frequency
Lora Relay 433M RFM98W-433MHz/SX1278 433MHz
Lora Relay 868M RFM95W-868MHz 433MHzcommunication is established.
Lora Relay 915M RFM95W-915MHz 915MHz

Lora Soil 01A.jpg
Free ISM bands world Wide(come from TI)
Lora Relay based on the Arduino, users can program it with Arduino IDE, which is very easy especially suit for the none-programmers. There are also guide for users to learn how to create the first IoT project with this board, with which the starters can learn the hardware and programming skill quickly.

Required Materials

1. Lora Relay 2. Maduino Lora Radio 3. USB-to-UART tool 4. DC12V Adapter(at least 200mA) 5. microUSB Cable 6. PC


Lora Relay 02.jpg

This guides help you how to use a Maduino Lora Radio transmit messages to control the Lora Relay switch on or off. You can get Maduino Lora Radio from:
https://www.makerfabs.com/maduino-lora-radio-433m-868m-915m.html

Lora Relay 03.jpg

This Lora Relay can be used to switch the AC bulb light on or off. We integrated the 30A current relay, which will give you a wide use for large current device. Notice: Maduino Lora Radio and the Lora Relay must have the same work frequency. Otherwise, it receive nothing from another.

Features

• ATMEL Atmega328P: High Performance, Low Power Atmel®AVR® 8-Bit Microcontroller
• Speed Grade:20Mhz
• Flash:32Kbytes
• RAM: 2KBytes
• EEPROM: 1KBytes
• DC12V input
• Max Switch current:30A
• Max Switch Voltage: 250VAC
• Max Switch Power:7200VA
• Relay Contact form: SPDT
• Relay Coil Rated voltage:12V DC
• Relay Coil Rated current:75mA
• Relay Coil Rated resistance:160Ω±10%
• Relay Coil Pick-up Voltage: 75%Max
• Relay Coil Dropout Voltage: 10%Min
• Relay Coil Maximum voltage: 130%Max
• Mechanical Service life: 100,000 operations min. (at 1,800 operations/hour)
• Electrical Service life: 10,000,000(at 1,800 operations/hour)
• Temperature Range: -40C to 85C
Certified rating
Lora Relay 04.jpg

Indicator LED Status
PWR Light on when powered on, light off when powered off
RL Light on when COM connect to NO, Light off when COM connect to NC Normally light off
Status Blink, can be controlled by PIN D5

Interface Function

Lora Relay 05.jpg
①screw terminal
②PWR: power LED
③Lora Module
④Status: Status LED
⑤U2: Atmega328P
⑥J10:UART
⑦reset button
⑧DC: DC12V in
⑨RL: Relay LED
⑩Relay: 30A Relay
Lora Relay requires a USB-to-UART tool to upload firmware to it, you can get it from:
https://www.makerfabs.com/usb-uart-convertor-cp2102.html
Install the CP2102 driver from:
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

Hardware Connections

Lora Relay 06.jpg

Lora Relay USB-to-UART Tool
3V3 3V3
GND GND
RX TXD
TX RXD

Lora Relay 07.jpg

Usage

After a Arduino IDE installed, there is a default package to support Lora Soil Moisture Sensor(Arduino Zero ), From the top Arduino IDE menu, select Tools-> Board-> Arduino Pro or Pro Mini

Lora Soil 06.jpg

From the top Arduino IDE menu, select Tools-> Processor->Atmega328P(3.3V,8Mhz)
Lora Soil 07.jpg

After inserted the USB-to-UART tool to you PC, select the related Port. In my PC, there is COM7 that may different in your PC.
Lora Soil 08.jpg

Download the RadioHead file, click Add.ZIP.Library, select RadioHead.
https://github.com/Makerfabs/MaduinoLoraRadio
Lora Soil 09.jpg


Open LoraRelayReciecer.ino, verify and upload the firmware to Lora Relay.
Modify the frequency macro according to your board is 433Mhz or 868Mhz or 915Mhz.
If your Lora board is 433MHz:

#define RF95_FREQ 433.0

If your Lora board is 868MHz:

#define RF95_FREQ 868.0

If your Lora board is 915MHz:

#define RF95_FREQ 915.0


Tips: Lora Relay designed as a product, so it not integrates the USB-to-UART on board. If you upload the firmware fails, press and hold the Reset button before upload the firmware. When the IDE shows below, then release the button that may helped to upload the firmware success. That’s we need a reset the MCU when upload the firmware.
Lora Soil 10A.jpg

Pins The following table lists all of the relay's pins and their functionality.

Pin Description
NC Normally Closed
NO Normally Opened
COM Switch Common

Normally, when Pin D4 output LOW the relay is not triggered, COM connects to NC.
Contrarily, when Pin D4 output LOW the relay is triggered, COM connects to NO.

The Power LED will light up when the board is powered. The RL LED will light up when the relay has been triggered.

The onboard screw terminal should be used to connect your high-power load. The middle COM pin should be hooked up to the Live wire (Usually black) coming from the wall, while NO or NC should be connected to the Live wire on the device side of things.

Lora Relay 10.jpg

Example wire connection

Lora Relay 11.jpg

Example wire connection

Note: Not sure about what color insulation wiring is used in your region? Check out the standard wire insulation colors listed online for reference. If you are unsure about the standard wiring color in your region, please consult a certified electrician to connect to the AC input voltage side.


⚡ Warning! Make sure the cable is not plugged into the wall as you cut into the wire in the following section.
You'll also need to place the relay in line with the AC powered item you're attempting to control. You'll have to cut your live AC line (usually black or red) and connect one end of the cut wire to COM and the other to NC or NO, depending on what you want the resting state of your device to be. If your AC device is going to be on for most of the time, and you occasionally want to turn it off, you should connect one end to COM and the other to NC. Connect to NO if the device will be off for most of the time.

⚡ Warning! Please be careful when handling the contacts when the cable is plugged into a wall outlet. Touching the contacts while powered could result in injury.

Forbidding connect Live and Neutral wire to the onboard screw terminal, it will make Live and Neutral in short circuit in normal case or when relay triggered.

Lora Relay 12.jpg


Lora Relay 13.jpg


Put the Lora Relay aside, now we need to make the Lora Radio Transmitter.

2. The Lora Transmitter
Plug the Maduino Lora Radio to PC via microUSB cable.
Lora Soil 11A.jpg

Open the code LoraTransmitter.ino
Select the Arduino Pro or Pro mini

Lora Soil 12A.jpg

Select ATmega328P(3.3V,8Mhz)

Lora Soil 13A.jpg

Verify and upload the firmware.


Lora Soil 14A.jpg

Lora Soil 15A.jpg

Result:

The Transmitter will send message via Lora 433/868Mhz frequency. And the Lora Relay will receive the result and print them in the Serial Monitor. The Lora Relay Received the message from the Maduino Lora Radio, it will switch on or off repeatedly.
Lora Relay 16.jpg

FAQ

You can list your questions here or contact with support@makerfabs.com for technology support.

Resources