Difference between revisions of "LoRa-HAT-for-Raspberry-Pi"

From SB-Components Wiki

Line 52: Line 52:
  
 
== Installation ==
 
== Installation ==
===Setting up Pico Barcode Hat===
 
* First you need to change the mode of the Pico Barcode Hat. 
 
  * Mode is TTL/RS232 (serial communication interface) for this you need to scan below the barcode, Connect USB to pico barcode hat.
 
[[File:RS232.PNG|400px]]
 
 
 
  * Change the baud rate to (9600) for this you need to scan the below barcode by pressing the scan button on the Pico Barcode Hat
 
[[File:9600.PNG|400px]]
 
 
 
==== MicroPython ====
 
* Stack Raspberry Pi Pico on the female header of Pico Sense HAT.
 
* Connect USB cable on Raspberry Pi Pico USB port.
 
* Choose interpreter as MicroPython (Raspberry Pi Pico).
 
[[File:Thonny-interpreter.PNG|600px]]
 
 
 
* In the folder you see two files one is "st7789.py" and the other is "firmware.uf2"
 
      * Save the "st7789.py" file in the pico ( this is the LCD library file )
 
      * For the second file "firmware.uf2" do this, Before raspberry pico connects to the laptop, press the boot button of the pico then connect to the laptop, you see the new device named "RPI-RP2". Drag and drop the "firmware.uf2" file to the RPI-RP2.
 
  
* In the folder you see a file name "Barcode_Scanner_demo.py", run this file, this is demo code. From this code, you easily understand the working of this module. using this basic code you make many applications.
+
=== '''For Communication between two LoRa Hat ===
    
+
 
* One of the applications we mention in that folder, the folder name is "smart attendance system". when you open this folder you see three file
+
[[File:LORA1.jpg|400px]]
    * employee.py (the file you need to enter the employee name and the barcode of that employee (it is like a database ))
+
 
    * main.py (the file you need to run (this is the main file ))
+
* First take 2 LORA Hat boards and set jumper position as mentioned below:
    * servo_control.py ( this file controls the servo motor )
+
  * ''' Mode Selection Jumper:''' we are going to use pi GPIO pin 13 and 15 to control MODE Selection
   
+
  * '''LoRa mode selection jumpers'''
* Save the three files in the pico, "main.py" file is automatically run when you give power to pico
+
    * short M0, short M1: transmission mode (In this project we use transmission mode)
 +
    * short M0, open M1: configuration mode (You can configure the Lora via this mode)
 +
    * open M0, short M1: WOR mode
 +
    * open M0, open M1: deep sleep mode
 +
 +
  * '''Device Selection Jumper(Board Selection, This is also mention in the board) :'''
 +
    * Set it as '''MODE 1''' to enable USB to LORA Communication (Without raspberry pi)
 +
    * Set it as '''MODE 2''' to enable PI to LORA Communication (With raspberry pi)
 +
 
 +
 +
=== Code ===
 +
In this folder you see two python codes
 +
  * Lora_transmitter.py -> run this file to transmit the data (any data eg: sensor data,any string and message etc)
 +
  * Lora_receiver.py    -> run this file to receive data from other lora
 +
 +
=== '''Applications''' ===
 +
In this folder you see two application
 +
   * Pi Lora Broadcast (with LCD display), In this folder you see three files
 +
      * PCLinuxOSFonts -> this folder contains various fonts
 +
      * transmitter.py -> run this file to broadcast the data (any data eg: sensor data,any string and message etc)
 +
      * receiver.py   -> run this file to receive broadcast data from other lora
 +
      * ST7789.py      -> this is the lcd library file
 +
 +
  * Pi Lora Homeautomation (with LCD display), In this folder you see three files
 +
      * pi_lora_transmitter_home_automation.py
 +
      * pi_lora_receiver_home_automation.py
 +
      * ST7789.py
 +
 +
=== '''Lora GUI (run with the help of GUI)''' ===
 +
For this, you need to use Lora onboard USB (use jumper wire at board selection 1)
 +
Go to the Lora GUI folder, and run the LORA_GUI.py file. from this file, you can configure the Lora and you are able to transmit, receive the data  (eg: baud rate, channel, etc)
 +
 +
[[File:LORA2.jpg|400px]]
  
 
== Resources ==
 
== Resources ==
 
<b> Github </b>
 
<b> Github </b>
 
* [https://github.com/sbcshop/Pico-Barcode-HAT.git Source Code]
 
* [https://github.com/sbcshop/Pico-Barcode-HAT.git Source Code]

Revision as of 11:52, 21 January 2022

LoRa HAT for Raspberry Pi (433/868/915)

LoRa™ HAT, a low-power consumption data transmission module, comes with an onboard CH340 USB TO UART converter, Voltage Level Translator(74HC125V), E22-900T22S and E22-400T22S SMA antenna connector, IPEX antenna connector, LoRa™ Spread Spectrum Modulation technology with auto multi-level repeating.

Features

  • Communication range up to 5 KM
  • Supports auto repeating to transmit longer
  • Low Power Consumption
  • Highly Secured
  • For Evaluating signal quality with the RSSI or “Received Signal Strength Indicator”
  • Wireless parameter configuration support
  • Fixed-point transmission support
  • SMA and IPEX Antenna Connector
  • USB to LORaTM and Pi to LoRaTM Communication via UART
  • Comes with development resources and manual
  • LED Indicators:

RXD/IXD: UART RX/TX indicator

AUX: Auxiliary indicator

PWR: Power indicator

  • Serial/USB selection Jumpers:

A: USB TO DART to control the LoRa module through USB

B: Control the LoRa module through Raspberry Pi

  • Data/Command made selection jumpers:

Short M0, short M1: Transmission mode

Short M0, open M1: Configuration mode

Open M0, short M1: WOR mode

Open M0, open M1: Deep sleep mode

Specifications

  • Frequency - 915/868/433 MHz
  • Power - 22dBm
  • Distance - Up to 5 KM
  • Interlace - DART Communication
  • Serial Port Module - E22-900T22S/E22-400T22S
  • Voltage Level Translator - 74HC125V
LoRa HAT for Raspberry Pi
Buy it From : Click Here

Installation

For Communication between two LoRa Hat

LORA1.jpg

  • First take 2 LORA Hat boards and set jumper position as mentioned below:
 *  Mode Selection Jumper: we are going to use pi GPIO pin 13 and 15 to control MODE Selection
  * LoRa mode selection jumpers
    * short M0, short M1: transmission mode (In this project we use transmission mode)
    * short M0, open M1: configuration mode (You can configure the Lora via this mode)
    * open M0, short M1: WOR mode
    * open M0, open M1: deep sleep mode

 * Device Selection Jumper(Board Selection, This is also mention in the board) :
   * Set it as MODE 1 to enable USB to LORA Communication (Without raspberry pi)
   * Set it as MODE 2 to enable PI to LORA Communication (With raspberry pi)


Code

In this folder you see two python codes
  * Lora_transmitter.py -> run this file to transmit the data (any data eg: sensor data,any string and message etc)
  * Lora_receiver.py    -> run this file to receive data from other lora

Applications

In this folder you see two application

  * Pi Lora Broadcast (with LCD display), In this folder you see three files
      * PCLinuxOSFonts -> this folder contains various fonts
      * transmitter.py -> run this file to broadcast the data (any data eg: sensor data,any string and message etc)
      * receiver.py    -> run this file to receive broadcast data from other lora
      * ST7789.py      -> this is the lcd library file

  * Pi Lora Homeautomation (with LCD display), In this folder you see three files
      * pi_lora_transmitter_home_automation.py
      * pi_lora_receiver_home_automation.py 
      * ST7789.py

Lora GUI (run with the help of GUI)

For this, you need to use Lora onboard USB (use jumper wire at board selection 1) Go to the Lora GUI folder, and run the LORA_GUI.py file. from this file, you can configure the Lora and you are able to transmit, receive the data (eg: baud rate, channel, etc)

LORA2.jpg

Resources

Github