hey guys
Ravi here and this is a LoRa module
specifically the rylr896 from REYAX
who were kind enough to sponsor this
video so big thanks to them anyways
LoRa stands for long range and I mean
long as in up to and even more than ten
kilometers of range this is with line of
sight of course this insane range at low
power requirements is not without issue
though you are sacrificing speed as well
as bandwidth by a lot so don't expect
LoRaa to replace your Wi-Fi anytime soon
but that doesn't mean that you can't use
it for most of the IOT applications you
can think of and that is exactly what I
am going to show you guys in this video
how you can use LoRa in your IOT
projects before we get started though I
want to make one distinction clear to
you guys and that is between LoRa and
LoRaWAN, LoRaWAN is a protocol
developed by the LoRa Alliance which
anybody can use to connect their LoRa
enabled devices to the Internet similar
to how your Wi-Fi enabled devices
connect to your Wi-Fi router to access
the Internet but unlike Wi-Fi LoRaWAN
uses LoRa gateways, works at way longer
distances and for small bandwidth data
if you want to know more about what
LoRaWAN is then I suggest you take a
look at this video by Andreas
he does a really good job of explaining
it all but what I'll be showing you here is
more like Bluetooth. We will connect two
LoRa modules together in a
point-to-point network to share data
between the two. I'll show you how you
can build a simple wireless switch that
works at ridiculously long distances and
you can expand upon that as you wish now
this particular Laura module from REYAX
uses UART for communication with your
microcontroller that is the same
protocol that you use to print to the
serial monitor in Arduino. it's
pretty simple you just use Serial.print()
and send whatever you wanna
send but you do want to send to control
this particular module are AT commands
AT commands if you aren't familiar with
them are even simpler AT stands for
attention like a drill sergeant you
shout attention followed by whatever
orders you wanna send just to
demonstrate I'll connect one module to
my PC using a USB to TTL converter just
connect VCC to 3.3 volt ground-to-ground
RX to TX & TX to rx opening a serial
monitor at the board rate of 115200
you can send to it AT and like a good
little private it will respond with an
okay if you want to send a command you
say AT plus whatever command you wanna
send like we can set this module's address
to 115 press ENTER and it should return
OK for successful execution now we
just need to implement this in an
Arduino sketch I have already written
the sketches one for the transmitter and
one for the receiver both of which you
can download from the link in the
description I am NOT going to go through
the code here because it's boring and no
one wants to sit through that but I do
want to point out a few key things that
you might want to take note of when
you write your own code number one each
AT command needs to end with the
\r\n this is equivalent
to pressing enter on your keyboard
without this the module won't know when
the command has ended second each module
needs to be set up before use this is
what this part of the code does you need
to set the parameter the bandwidth the
network ID and the address
while the first three need to be the
same for both the transmitter and the
receivers the address needs to be unique
for each number three to send data the
syntax is AT plus send equals the
address you want to send to comma the
length of data you want to send in bytes
comma the data you want to send here we
are just sending 0 and 1 depending on
what button is pressed whenever data is
received it is printed directly to the
serial
the syntax of which is this so you need
to look for the string starting with
+RCV the part that we are interested
in is in between the second and third
comma finally make sure to initialize
the serial at 115200 baud rate
which is the default you can change it
with an AT command if you so wish
after uploading the code to both the
Arduinos the wiring couldn't be simpler
connect VCC to 3.3V rx
to TX TX to Rx and ground to ground on
the board with the transmitter code
connect two push buttons to pin five and
six the other end of those push buttons
goes to ground on the receiver connect
the LED between pin five and ground with
a resistor power them both on give them
a few seconds to complete the setup and
now when you press the buttons the LED
should switch States but the cool thing
is that it works at really really large
distances before I leave you to play
with this tho I should mention that
different frequencies are permitted in
different countries so you should buy
only the device that is compatible with
your location and set the frequency
accordingly this particular module
allows for 868 or 915 megahertz which
incidentally are allowed in most of the
world hopefully this video was helpful
leave a like if it was thanks again to
REYAX for sponsoring this video link to
buy their LoRa module will be in the
description down below thanks for
watching and I'll see you guys next time
