Difference between revisions of "Maduino Lora Radio (433M/868M)"

From MakerFabsWiki
Jump to: navigation, search
(4. Lara Radio Transmitter Programming:)
(Project_2: A Simple IOT Project- Environment Remote Monitor)
Line 123: Line 123:
 
Put it aside, now we need to make the Lora Radio Receiver.<br>
 
Put it aside, now we need to make the Lora Radio Receiver.<br>
  
===Project_2:  A Simple IOT Project- Environment Remote Monitor===
+
===5. Lora Radio Receiver Programming===
SIM808 Module is a GPRS/GSM+ GPS Quad-band module, with this board, we can use it as a GPS tracker, data acquisition, remote control and a lot of IOT project or smart home project.
+
Connector an OLED to Maduino Lora board as: <br>
In this project, we will detect the humidity/temperature of our soldering lab, and reports it to internet thingspeak(https://thingspeak.com/channels/916902), so we can monitor the lab environment remotely.<br>
 
We use the humidity /temperature sensor at: <br>
 
[[https://www.makerfabs.com/dht11-temperature-humidity-module.html DHT11 Temperature& Humidity Module]]
 
  
 
1. Sensor Connection
 
Connect the simple sensor to Maduino boards as following:
 
  
 
{| cellspacing="0" cellpadding="5" border="1"
 
{| cellspacing="0" cellpadding="5" border="1"
 
|-
 
|-
| align="center" width="150" | '''Sensor'''  
+
| align="center" width="150" | '''Maduino Lora Radio'''  
| align="center" width="200" | '''Maduino Pins'''  
+
| align="center" width="200" | '''OLED'''  
  
 
|- style="font-size: 90%"
 
|- style="font-size: 90%"
| align="center" | Sensor's GND
+
| align="center" | A4
| align="center" |  Maduino's GND
+
| align="center" |  SDA
 +
|- style="font-size: 90%"
 +
| align="center" |  A5
 +
| align="center" |  SCL
 
|- style="font-size: 90%"
 
|- style="font-size: 90%"
| align="center" | Sensor's DATA
+
| align="center" | 3V3
| align="center" | Maduino's D6
+
| align="center" | VCC
 
|- style="font-size: 90%"
 
|- style="font-size: 90%"
| align="center" | Sensor's Vcc
+
| align="center" | GND
| align="center" | Maduino's 3V
+
| align="center" | GND
 
|}
 
|}
  
 +
Plug Lora Radio Antenna and Micro USB Cable.<br>
 +
[[File:Maduino_Lora_Radio_v1.5_12]]<br>
  
2. Insert a Micro SIM card and GSM antenna, power the Maduino with battery or DC
+
Install SSD1306 library in Library Manager. If you had installed it, go to next step.<br>
The Maduino Zero SIM808 board uses the micro SIM card that is widely used in Android phone, install the Micro SIM card to the holder as below picture, and also the GSM antenna
+
[[File:Maduino_Lora_Radio_v1.5_13]]<br>
 
 
[[File:SIM808_CONNECTION_01.png|700px]]<br>
 
[[File:SIM808_CONNECTION_02.png|700px]]<br>
 
Note that some fee maybe needed for each SMS depends on your local GSM Operator, make sure that the SIM Card is active and enough money left for this application.<br>
 
 
 
3.Programming<br>
 
3.1 Sign up an account in https://thingspeak.com/ . If you already have one, sign in directly.<br>
 
3.2 Click New Channel to create a new ThingSpeak channel.<br>
 
[[File:Maduino_Zero_SIM800C_08.png|700px]]<br>
 
 
 
3.3 Input name, Description, Select Field 1, Field 2,Field3, Field4. Then save channel on the bottom.<br>
 
 
 
[[File:Maduino_Zero_SIM800C_08B.png|700px]]<br>
 
 
 
  
3.4 Copy the API Key, we will use it in the program<br>
+
Open the program [https://github.com/Makerfabs/MaduinoLoraRadio ReceiverOLED.ino]<br>
[[File:SIM808_API_CODE_01.PNG|700px]]<br>
 
  
[[File:SIM808_API_CODE_02.PNG|700px]]<br>
+
* If your board is Maduino Lora Radio 868Mhz, Modify the micro<br>
 +
  #define RF95_FREQ 868.0 from #define RF95_FREQ 433.0
 +
[[File:Maduino_Lora_Radio_v1.5_14]]<br>
  
The Codes for this application is very simple, define the SIM808 Power control pins:<br>
+
Click Verify button to compile it.<br>
 +
[[File:Maduino_Lora_Radio_v1.5_15]]<br>
  
Connect to GPRS/GSM network
+
If there no errors, it will show done compiling.<br>
<pre>
+
[[File:Maduino_Lora_Radio_v1.5_16]]<br>
//define the power control pin of SIM808:
 
int PWR_KEY=9;    //power on/off
 
</pre>
 
Connect to GPRS/GSM network
 
<pre>
 
sendData("AT+CGATT=1", 1000, DEBUG);
 
</pre>
 
Initialize HTTP Service
 
<pre>
 
sendData("AT+HTTPINIT", 1000, DEBUG);
 
</pre>
 
Set HTTP parameters value
 
<pre>
 
String command = "AT+HTTPPARA=\"URL\",\"http://api.thingspeak.com/update.json?api_key=" + apiKey + "&field1=" + (String)latitude +"&field2=" + (String)longitude + "&field3=" + (String)temp +"&field4=" + (String)humi + "\"";
 
sendData(command, 3000, DEBUG);//Set HTTP Parameters Value
 
</pre>
 
POST the data that set in command "AT+HTTPPARA"
 
<pre>
 
sendData("AT+HTTPACTION=1", 1000, DEBUG);//HTTP POST success if get responce: +HTTPACTION: 1,200,0
 
</pre>
 
Select the right port and Arduino board: '''Arduino Zero(Native USB Port)''' to upload the code([https://github.com/Makerfabs/SIM808_Demo SIM808_GSM_DHT11.ino]) to Maduino Zero SIM808 GPS board
 
  
4. Result Show
+
Click Upload button to upload firmware to the Maduino Lora Radio board.<br>
Open the link: https://thingspeak.com/channels/916902  it will show the data as below:<br>
+
[[File:Maduino_Lora_Radio_v1.5_17]]<br>
[[File:SIM808_IOT_RESULT_SHOW_01.PNG|700px]]<br>
 
(I touched the sensor to show the result, so the temperature and humidity grow high)
 
There we can get the real time humidity& temperature result from other place on internet.
 
  
 
== FAQ  ==
 
== FAQ  ==

Revision as of 11:34, 13 December 2019

Introduction

Maduino Lora Radio is an IoT (Internet of things) Solution based on the Atmel’s Atmega328P MCU and Lora module. It can be a real project for IoT projects(especially long-range, low power application ) such as smart farmer, smart warehouse, smart community, etc.

The Maduino Lora Radio based on the Arduino, users can program it with Arduino IDE, which is very easy especially suit for the none-programmers. There are also guide for users to learn how to create the first IoT project with this board, with which the starters can learn the hardware and programming skill quickly.

This guide helps you with the basic usage of Maduino Lora Radio.


Model: OAC433MLR OAC868MLR
Maduino Lora Radio V1.50 01.jpg

Features

• Classic ATMEL AVR 8-bit Atmega328P
• USB-to-Serial: CP2104
• Powered by lithium battery(3.4-4.2V) or Micro USB cable
• Digital I/O Pins: 14
• Analog Input Pins: 6
• Flash Memory: 32KBytes of which 2KBytes used by bootloader
• RAM: 2KBytes
• EEPROM: 1Kbytes
• Clock Speed: 8 MHz
• Interface: I2C/SPI/UART/ADC/
• Arduino Compatible: You can play it with Arduino IDE
• Working Temperature: -20 ~ +85℃
• Default baud rate: 9600bps
• Size: 40*55mm

Interface Function

MaduinoLoraRadioV1.5 V02.jpg

①Micro USB: USB to serial communication and supply power
②CHG: 5V power input, can connect the solar panel to charge the lipo battery.
③VBAT: 3.7V Lipo battery connector
④PWR: Power indicate
⑤CHG: Charge indicate
⑥ANT: Lora Antenna
⑦RESET: Reset button for ATMega328P

Usage

Warning: Don’t operate when in power supply on (That is, don’t plug or unplug the Antenna, Sensor, OLED, in case of short-circuiting that may burn the IC down.)

We will use one of Maduino Lora Radio board transmit temperature and humidity via Lora radio, and another Maduino Lora Radio shows the things on OLED Screen after received the message.

Prepares:

Item Quantity
Maduino Lora Radio 2
Lora Radio Antenna 2
Micro USB cable 2
Dupont Line 7
DHT11 Sensor 2
128*32 OLED Display Screen 1


1. Open Arduino IDE, select Arduino Pro or Pro Mini in Boards

Maduino Lora Radio V1.50 02.png

2. Select Atmega328P(3.3V,8MHz) in Processor and correct Port

Maduino Lora Radio V1.5 03.png

3. Search Key word Lora Radio, Install Lora Radio 433Mhz 868Mhz library in Library Manager. If you had installed it, go to next step.

Maduino Lora Radio V1.5 04.png

4. Lara Radio Transmitter Programming:

Connect the Maduino Lora board to DHT11 Sensor as:

Maduino Lora Radio DHT11
3V3 VCC(Grey Wire)
D4 DATA(White Wire)
GND GND(Black Wire)

Plug Lora Radio Antenna and Micro USB Cable
Maduino Lora Radio v1.5 05.png

Install DHT sensor library in Library Manager. If you had installed it, go to the next step.
Maduino Lora Radio v1.5 06.png

Open Program TransmitterDHT11.ino

  • If your board is Maduino Lora Radio 868Mhz, Modify the macro
 #define RF95_FREQ 868.0 from #define RF95_FREQ 433.0

Maduino Lora Radio v1.5 07.png

Click the Verify button to compile it.
Maduino Lora Radio v1.5 08.png

If there no errors, it will show done compiling.
Maduino Lora Radio v1.5 09.png

Click Upload button to upload firmware to the Maduino Lora Radio board.
Maduino Lora Radio v1.5 10.png

If it runs okay, open Serial Monitor we can see something like this:
Maduino Lora Radio v1.5 11.png
Put it aside, now we need to make the Lora Radio Receiver.

5. Lora Radio Receiver Programming

Connector an OLED to Maduino Lora board as:


Maduino Lora Radio OLED
A4 SDA
A5 SCL
3V3 VCC
GND GND

Plug Lora Radio Antenna and Micro USB Cable.
File:Maduino Lora Radio v1.5 12

Install SSD1306 library in Library Manager. If you had installed it, go to next step.
File:Maduino Lora Radio v1.5 13

Open the program ReceiverOLED.ino

  • If your board is Maduino Lora Radio 868Mhz, Modify the micro
 #define RF95_FREQ 868.0 from #define RF95_FREQ 433.0

File:Maduino Lora Radio v1.5 14

Click Verify button to compile it.
File:Maduino Lora Radio v1.5 15

If there no errors, it will show done compiling.
File:Maduino Lora Radio v1.5 16

Click Upload button to upload firmware to the Maduino Lora Radio board.
File:Maduino Lora Radio v1.5 17

FAQ

You can list you question here or contact with support@makerfabs.com for technology support. A detailed descriptions of your question will be helped to solve your question.

Resources