My LORA remote relay system?
My LORA remote relay system?
0
Components
Hardware components
WIZnet - W5500 Ethernet Shield
x 1
220V Relay
x 4
RFM95 LORA
x 1
Aduino mega 2560
x 1
Main MCU
Project description
Description
- ?Ethernet module to connect to MQTT server and host a simple webserver
- ?RTC module to save time and the time is synchronized on regular bases to an NTP server.
- ?RF95 900Mhz?module to communicate via lora radio to the remote lora relay modules
- LCD screen with 4 buttons and 1 rotary encoder and 1 buzer as human interface
- Aduino mega 2560 as main MCU
- Aduino nano as MCU for the RF95 module
- 5Vdc buck converter
- 3.3Vdc buck converter
Component
| ?Arduino Mega 2560 | ??Ethernet W5500 | ||
| ?Arduino nano | ?RF95 module | ||
| ?RTC module | ? |
?LCD 4x20 | |
| ?LM 2596 Buck Converter | ? |
?Rotary encoder | |
| Omron Push button | ?5v buzzer | ||
| ?74HC14N | ?Other passive component as Resistor, capacitor, trim pot jumpers etc... | ?Check diagram below |
Schematic
Communication protocol:
| ?Name | ?Lora Address | ?Name | Lora Address |
| ?MONITOR1 | 1 | ?COTTAGE12 | 12? |
| MONITOR2 | ?2 | ?COTTAGE14 | 14 |
| ?PROBE | ?3 | ?COTTAGE11 | 11 |
| ?DIVING1? | ?4 | ?COTTAGE10 | 10 |
| ?RESTAURANT1 | ?17 | ?COTTAGE9 | 9 |
| ?RESTAURANT2 | ?18 | ?COTTAGE8 | 8? |
| ?BAR1 | ?19 | ?COTTAGE7 | 7 |
| ?BAR2 | ?20 | ?COTTAGE6 | 6 |
| ?PIER1 | ?13 | ?LORA | Internal no address |
| ?Command | ?Description | ?Reply | ?Description | |
| RST | ?Reset the module | ?OK | ?The message have been received and acknowledge | |
| PING | ?Send a ping command and wait for reply | PONG | ?Reply to a ping command the RLY state is transmitted as payload | |
| SETRELAY | ?Set the Relay to the int RLY | ?FAILED | ?The transmission of the message failed | |
| GARDENON | ?Switch on the Garden relay | ?LORAFAILED | ?The LORA module on the nano failed to initialize | |
| GARDENOFF | ?Switch off the Garden relay | ?LORASTARTED | ?The LORA module on the nano has started | |
| WALLON | ?Switch on the wall relay | |||
| WALLOFF | ?Switch off the wall relay | |||
| NIGHTON | ?Switch on the Garden? and wall relay | |||
| NIGHTOFF | ??Switch on the Garden? and wall relay | |||
| COTTAGESON | ?Switch on the cottage relay | |||
| COTTAGESOFF | ?Switch off the cottage relay | |||
| FRIDGESON | ?Switch on the fridge relay | |||
| FRIDGESOFF | ?Switch off the cottage relay | |||
| ?LORARESET | ?REset the nano Lora module |
The relay state and Relay mask:
MQTT:
| ?Topic?? ?? ??? | ?Description | Type? | ?Topic | Description | Type? |
| ?batteryvolts | ?From the inverter | ?Float | ?humidity | ?from the weather station | ?float |
| ?SOC | ?Battery State Of Charge from the inverter | int | ?temp | ?from the weather station | float |
| ?loadwatts | ?System Load from the inverter | long int | ?MONITOR1CMD | ?general command which apply either to the monitor itself or all the buildings. | Text |
| ?gridmode | ?power source from generator or battery | bool | ?node-RED/SETMSK | ?set mask command from the nod red interface | Json |
| ?dust | dust in ug/m2 from the dust sensor | float | ?/"Building"/RELAYX | ?Set the relay of a specific bungalow | ?int |
| ?/"Building"/CMD | ?send a command to a specific bungalow. | text |
- PING: Send a ping command to all the devices
- RST: send a reset command to all the building
- GARDENON:Switch ON all thegarden lights on all the devices
- GARDENOFF: Switch OFF all the garden lights on all the devices
- WALLON:Switch ON all the wall lights on all the devices
- WALLOFF: Switch OFF all the wall lights on all the devices
- NIGHTON:Switch ON all the garden and wall lights on all the devices
- NIGHTOFF: Switch OFF all the garden and wall lights on all the devices
- ALLON: Put the RELAYSTATE to 15 to all the devices
- ALLOFF:??Put the RELAYSTATE to 0 to all the devices
- COTTAGESON:Switch ON the cottage relays on all the devices
- COTTAGESOFF: Switch OFF the cottage relays on all the devices
- FRIDGESON:Switch ON all the fridge relay on all the devices
- FRIDGESOFF: Switch OFF all the fridge relay on all the devices
- LORARST: rEset the Lora module on the monitor
Web Server:
- /?home page display time and date of the day.
- /?data=DIVING1&RELAY1&0? Set the Relay1 of Diving1 to OFF ex:/?data=COTTAGE6&RELAY4&1
- /?rqst=MONITOR1RST?Reset monitor1
- /?rqst=GETALARM?Get time for night lights On/Off.
- /?rqstSETLARMOFF&Time=66000000?set time for alarn nightOn/Off time is in ms (1h=3600000ms).
- /?rqstSETLARMOFF&Time=79200000
- /?rqst=PINGALL?send a ping command to all lora devices.
- /?rqst=RSTALL?Reset all lora devices.
- /?rqst=ALLON?Switch On all relays on all lora devices.
- /?rqst=ALLOFF?Switch Off all relay on all lora devices.
- /?rqst=GARDENON?Switch On all garden lights on all lora devices.
- /?rqst=GARDENOFF?Switch Off all garden lights on all lora devices.
- /?rqst=WALLON?Switch On all wall lights on all lora devices.
- /?rqst=WALLOFF?Switch Off all wall lights on all lora devices.
- /?rqst=NIGHTON?Switch On all Night lights (Garden/Wall) on all lora devices.
- /?rqst=NIGHTOFF?Switch Off all Night lights (Garden/Wall) on all lora devices.
- /?rqst=COTTAGESON?Switch On all Cottages
- /?rqst=COTTAGESOFF?Switch Off all Cottages.
- /?rqst=FRIDGESON?Switch On all Fridges
- /?rqst=FRIDGESOFF?Switch Off all Fridges.
Serial Commands:
| sendTO:?send data packet to LORA
ping:?send ping command
NTPtime:?set RTC time
RTCtime:?set RTC time
printTime:?Get time from RTC module
printDate:?Get date from RTC module
setAlarm:?Set ON/OFF time garden lights
printAlarm:?Get night lights alarm
loraRst:?Reset lora module? ?module
RESET:?Reset this device
PingAll:?send Ping to all devices
rstAll:?Reset all the Lora devices
allOn:?All the realy ON on all lora devices |
allOFF:?All the realy OFF on all lora device
gardenOn:?all garden lights ON
gardenOff:?all garden lights OFF
wallOn:?all wall lights ON
wallOff:?all wall lights OFF
nightOn:?all night lights ON
nightOff:?all night lights OFF
cottagesOn:?all cottages lights ON
cottagesOff:?all cottages lights OFF
fridgesOn:?all fridges ON
fridgesOff:?all fridges OFF
printMenu:?print this menu
|









