element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sub -1 GHz Band
  • Challenges & Projects
  • Project14
  • Sub -1 GHz Band
  • More
  • Cancel
Sub -1 GHz Band
Blog Sub-1GHz Band Challenge – Home Automation using LoRa with HMI display
  • Blog
  • Forum
  • Documents
  • Files
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sub -1 GHz Band to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balajivan1995
  • Date Created: 22 Sep 2023 9:32 PM Date Created
  • Views 1797 views
  • Likes 8 likes
  • Comments 5 comments
  • lorawan
  • NUCLEO-WL55JC1
  • Sub-1 GHz Band
  • sub1ghzbandch
  • lora
  • stmicroelectronics
Related
Recommended

Sub-1GHz Band Challenge – Home Automation using LoRa with HMI display

balajivan1995
balajivan1995
22 Sep 2023
Sub-1GHz Band Challenge – Home Automation using LoRa with HMI display

image

Introduction

In the previous blogs, I have run the example codes that are already available as a part of BSP package. As a finishing blog, I have decided to create a wireless offline home automation device that has an HMI display interfaced to it.

Source code

Hosted in my 

Test

  1. Transmit the temperature and humidity data from sensor node to responder node.
  2. Parse the incoming data
  3. Display the resulting information along with RSSI on the display
  4. Create a toggle button to send output signal to sensor node.

Sensor node Setup

  • Nucleo-WLxx board
  • DHT11 sensor. I have simulated the sensor for a simper proof of concept.
  • One output device. Could be a relay or any simple GPIO based output. I have selected to use the available LED in Nucleo board

Responder node Setup

  • Nucleo-WLxx board
  • Nextion HMI display

Block diagram

image

Sensor node Code explanation

Comment the RECEIVER_NODE definition to enable sensor node. 

image

To avoid overshooting of simulated values, range was set to get the random value between upper and lower bound. Adjust the upper/lower values of temperature and humidity sensor as per your preferred range. For temperature (datatype = 1), upper and lower values are set as 45 and 30 respectively. For temperature (datatype = 0), upper and lower values are set as 85 and 60 respectively.

image

Get the value of simulated data and copy it into CONFIG_FILE struct instance config. On PingPong_Process function, payload will be transmitted on RX state.

image

On OnRxDone function, add GPIO toggle function.

image

Responder node Code explanation

Enable the RECEIVER_NODE to activate responder node

On OnRxDone function, copy the received payload to a temporary CONFIG_FILE struct instance.

image

Parse the value stored and print it over the vcom.

Send the data to display by calling sendCommand(int, int).

image

On receiving data from sensor node, send the “PING” message to sensor node to toggle the current state of LED through PingPong_Process function.

image

Issues faced and mitigation

  • UART1 connected to display does not work when LORA application is running. When I disable the main application and run the test code for display checking, UART works and the HMI values change.
  • The press button on display was initially designed to send “PING” data to sensor node whenever pressed, as the UART does not work, message from display is not received at controller. So to toggle LED, whenever responder receives LORA message it will send “PING message”
  • Yet to include the fix to enable the UART along with main example.

Outcome

A simple home automation device was created and the working was tested.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

ToDo

  • Enable the UART communication between responder and display.
  • Connect the LORA node to gateway using LORA gateway device or wifi router using host device.
  • Connect multiple LORA and provide an unified way to display them in HMI
  • Sign in to reply
  • balajivan1995
    balajivan1995 over 1 year ago in reply to DAB

    This is simply a proof of concept. I still need to ensure the second UART line works properly. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 1 year ago

    Nice update.

    Good idea to test the protocol at close range before go for longer distances.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balajivan1995
    balajivan1995 over 1 year ago

    Updated to include block diagram.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balajivan1995
    balajivan1995 over 1 year ago in reply to dougw

    STM32 has a LoRa gateway nucleo board. I am not a fan of lorawan, so I would rather set one LoRa node to connect to other lora nodes mean while receiving data through a wifi module interface. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 1 year ago

    Nice display. What LoRa gateway are you considering?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube