#169 LoRa one-to-one Connection for a Mailbox Notifier with an Arduino and a Wemos Shield

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
you might have heard about Laurel on a network of connected nodes with gateways brokers and more if this is too complicated for you you do not have an internet connection or if you do not want to depend on others infrastructure this video is for you today we will build a point-to-point connection using two plane Laura modules and of course we will check out the range of this connection in the end I will know when the postman put the nice packets from China into my mailbox without going to the freezing winter weather Great Sea youtubers here is the guy with the Swiss accent with a new episode around sensors and microcontrollers today we will build two lovely Laura nodes one with an Arduino and one with an esp8266 the Arduino Laura node will be the sender of the sensor data the we must note will act as a receiver of the data it will also get an MQTT connection to node red we will take some precautions against lousy communication conditions and implement the feedback mechanism we will do some range testing of this Laura connection we will learn about reducing the power consumption of Arduino boards using the sleep mode I will use pre compiler directives to ease a programmers life and at the end you will also know what Laura has to do with drums will we succeed the stars of today's video are two of these small hope RF m95 Laura modules fortunately Charles Allah created PCBs for us to build Laura nodes or gateways easily the first module is already known to my frequent viewers it consists of an RF m95 a we must e1 mini and the small OLED display we used this previously for our single channel Laura Gateway the next node consists of an RF m95 a 3.3 volt arduino pro mini on 8 megahertz and a battery because there is no regulator on board I use a life fo for battery also here regular viewers know that these cells are well suited for this purpose because they have a minimum voltage of around three point six volts the result is a small device which later on I will place in my mailbox this note has an I square C connected to attach a wide range of sensors because the I square C pins on the Pro Mini are on the analog pins a four and a five we could also connect an analog or digital input signal to these pins if we need more pins we have to use the dirty way and solder a wire directly to the pro mini board now let's continue with a soft part what do we want to do differently than we did in the last videos laura1 is a whole network consisting of sensors gateways and back-end computers on the Internet today we only want to build a point-to-point connection between two Laura modules no gateway no internet no cloud if we want to connect to Laura one we have to use the LM IC software based on IBM's work if we are going to create a point-to-point connection we usually end up with the library called Radiohead no this library was not invented by the rock band with the same name but perhaps its creator was a big fan this Radiohead library supports many small RF transceivers including the RF 69 W module we used in video number one one eight and including the RF m95 Laura module we will use today the library has many bells and whistles but I was not exactly sure how to select the Laura mode of the RF m95 and I wanted to make absolutely sure we use Laura and not FSK for our range test so I used the Laura library which comes with the Arduino IDE I'm pretty sure I will use the Radiohead library in a future video in RF communication we have to know three words transmitter and transceiver transceiver means that it has a transmitter and the receiver in the same device the Laura modules all our transceiver modules but the software in the examples make a difference it has an example sketch for a client or receiver module and one for a server or transmitting module for our tests we upload the client sketch to the we mas note and the server sketch to the arduino the sensor will be connected to the arduino port and we can read its data on the WHMIS the we MOS is very suitable for the receiving part because it already has a small display and later we want to connect it by a Wi-Fi to node rate on the other hand the integrated battery of the Arduino board fits the purpose of the sending part ideally in the next step we have to deal with another problem the wiring of the RF m95 to the processor modules it uses the spi bus for communication and it needs a few additional connections like a reset or others called d io the way we communicate these connections to the software is through the command laura dot set pin the command for the Wemo sport is therefore set pin 16 17 15 and for the arduino set pin 10 a 0 2 if you are like me and you do not like to change these definitions all the time you can use a trick which also can help you in other situations so called pre compiler directives the sketch looks now like that this line tells the compiler to choose the first statement if your board is an esp8266 and the second if not if you look into the sketches on github you see that I use these pre compiler directives also for other purposes like if a pressure sensor is attached or if we want to use Wi-Fi on the Remos with this statement we can compile and load both examples to either one of the notes and they will work one always will be the transmitter and the other one has to be the receiver if we send a JSON string we can read it on the receiving node but what happens if we encounter an interference somewhere in the air between the sender and the receiver then the receiver cannot decode the message and you can imagine that this would be extremely bad because I would have to wait longer for my cute packages from China I think this should be enough fuel for my brains to find a better solution and the answer is quite simple the sender transmits its message and if you are happy the receiver gets it now the receiver calculates a number which is unique for each message for example it builds the sum of all characters of the message and sends this number back to the sending device this is possible because the receiving node also has a transmitter built in the sender can now also build its sum and if the two are the same it's pretty sure that the receiver caught the message correctly if not or if it does not get feedback at all it sends the same message again till it is sure that it's message safely arrived on the receiver side if the sender runs on batteries we might end this effort after a timeout maybe you remember that you heard something like that in another context MQTT QoS one uses a similar concept so we created a quite stable communication channel for our valuable content by the way this is a big difference between Laura bond and this point-to-point connection because of some laws with Laura bond we are not allowed to acknowledge every message and we cannot create such a reliable connection as we can do here the last link in our communication is the connection to the MQTT broker I added a pops-up client to the WHMIS node and connected to my broker done now the mailbox can alarm me if the postman here next we have to reduce the power consumption of the sender the receiver anyway will always be on and will be connected to a power supply fortunately the Arduino also has a sleep mode which is even more helpful than the one of the esp8266 if we return from deep sleep in the ESP it reboots and forgets all the variables we had to use some tricks to avoid this the Arduino is different if we use the low power library we can issue a sleep command very similar to a delay command the Arduino sleeps for a maximum of 8 seconds and afterwards continuous with the next line in the code the variables are also still there and the best the RF m95 also has a sleep mode so let's start with no sleep at all the whole center node without the sensor uses around 6 milliampere if we set the Laurel transceiver to sleep if not used the center node needs about 4 milliampere during sending it needs about 120 milli ampere but this period is only very short if we also sleep the Arduino we have to change the sensitivity of the micro current called current meter and we can measure 114 micro ampere this is not a very good value according to the datasheet the Atmel 328p itself needs only 15 micro ampere max and the hope chip only 1 micro ampere the high consumption is because the Arduino Pro Mini is not optimized for low power if we compare it with an entirely streamlined design like the whisper node with the same components we see that they can reach around 10 micro ampere on 3 volt but for my mailbox this is OK I also implemented a feature which measures the actual voltage and I can use this to make node read alarm me if the battery becomes empty this small battery should last about 100 days and the large 18 650 Xu lasts for more than a year after creating a solid one-to-one communication link over the air of course we want to understand how far this connection to reaches last time I used my car and drove around this time I want to use a more modern approach and backpack the sender to a maverick Pro Robin I also attached a PMP 0 85 pressure sensor to the I square C pass of the Arduino note it will report the height of the drone to show us that we get signals from the sensor in the Mavic to mount the arduino note on a Matic pro it's not easy because the drone has sensors everywhere first we placed it below the drone then the landing sensors were blocked and the Mavic did not like it so we put it on top there it influenced the compass and the navigation in the end we solved it like the Swiss pilots if they have to rescue people in the Alps with a long line below the helicopter or in our case the quadcopter on the display we see the altitude of the sensor the signal strength also called our SSI and the counter of the messages transmitted the RSSI is a negative number a signal with an RSS eye of minus 10 is stronger than one with an RSS eye of minus 100 we start with a straight flight and see that the signal stays quite high till we can hardly see the drone so a line of sight is no problem as expected the next test is harder we place the sender behind the tree also here no problem filming the whole thing in this distance is tougher and flying the drone also was not easy today because we had some wind November here in Switzerland can be a very windy month for the third test we fly the drone behind a row of houses also here we get all messages even if the sender is quite far away summarized we can use this point-to-point connection everywhere around my house by the way all these tests performed on spreading factor 9 SF 12 did not work in my case and I did not find out why the last step is to put the sender in the mailbox this box is entirely built of metal and shields most of the radio waves but we get a signal on my receiver in our kitchen so we should be good to go I want to use a reed switch and the magnet to detect if the lid of the Box moved up Reed switches are closed by the proximity of a magnet when closed it pulls pin 3 to 3.3 volts and triggers interrupt one of the Arduino in the sketch I had to replace sleep on the score eight seconds with sleep on the score forever also I had to attach the interrupt to the right pin now it sends a message every time the magnet is close to the red switch and now the cold and windy winter days can come and I never will go too early to the mailbox and return frozen and disappointed mail from China has arrived mail from China has arrived summarized we built to Laura notes using ready-made PCBs you will find a link in the description if you want to buy one of them the Arduino Laura node acted as a sender and the we Mo's as a receiver if you want you can also enable an mqtt connection to note red we stabilized the communication over the air against disturbances the range tests showed that also one-to-one Laura connections have a big range we were able to save lots of power by putting the Arduino and the Laura module in sleep mode maybe you will also find pre compiler directives handy to ease your life and I have to admit we had lots of fun during the range test using a drone instead of a car I hope this video was useful or at least interesting for you if true then like bye you
Info
Channel: Andreas Spiess
Views: 115,194
Rating: undefined out of 5
Keywords: Lora point-to-point, arduino, ESP8266 datasheet, mailbox, ESP8266 drone, PowerDirector14, Mailbox notifier, pora peer, peer-to-peer, eevblog, lora, lorawan, CyberLink, Arduino drone, ESP32 datasheet, esp32, LoRa Range, ESP8266 project, peer, ESP8266 mailbox, wemos, Wemos D1 mini, electronics, lora mailbox, esp8266, one, Arduino mailbox
Id: WV_VumvI-0A
Channel Id: undefined
Length: 15min 53sec (953 seconds)
Published: Sat Nov 11 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.