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

From MakerFabsWiki
Jump to: navigation, search
(4. Lara Radio Transmitter Programming:)
(4. Lara Radio Transmitter Programming:)
Line 120: Line 120:
  
 
If it runs okay, open Serial Monitor we can see something like this:<br>
 
If it runs okay, open Serial Monitor we can see something like this:<br>
[[File:Maduino_Lora_Radio_v1.5_11.png]]
+
[[File:Maduino_Lora_Radio_v1.5_11.png]]<br>
 
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>
  

Revision as of 11:22, 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.

Project_2: A Simple IOT Project- Environment Remote Monitor

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. 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.
We use the humidity /temperature sensor at:
[DHT11 Temperature& Humidity Module]


1. Sensor Connection Connect the simple sensor to Maduino boards as following:

Sensor Maduino Pins
Sensor's GND Maduino's GND
Sensor's DATA Maduino's D6
Sensor's Vcc Maduino's 3V


2. Insert a Micro SIM card and GSM antenna, power the Maduino with battery or DC 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

SIM808 CONNECTION 01.png
SIM808 CONNECTION 02.png
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.

3.Programming
3.1 Sign up an account in https://thingspeak.com/ . If you already have one, sign in directly.
3.2 Click New Channel to create a new ThingSpeak channel.
Maduino Zero SIM800C 08.png

3.3 Input name, Description, Select Field 1, Field 2,Field3, Field4. Then save channel on the bottom.

Maduino Zero SIM800C 08B.png


3.4 Copy the API Key, we will use it in the program
SIM808 API CODE 01.PNG

SIM808 API CODE 02.PNG

The Codes for this application is very simple, define the SIM808 Power control pins:

Connect to GPRS/GSM network

//define the power control pin of SIM808:
int PWR_KEY=9;    //power on/off

Connect to GPRS/GSM network

sendData("AT+CGATT=1", 1000, DEBUG);

Initialize HTTP Service

sendData("AT+HTTPINIT", 1000, DEBUG);

Set HTTP parameters value

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 

POST the data that set in command "AT+HTTPPARA"

sendData("AT+HTTPACTION=1", 1000, DEBUG);//HTTP POST success if get responce: +HTTPACTION: 1,200,0

Select the right port and Arduino board: Arduino Zero(Native USB Port) to upload the code(SIM808_GSM_DHT11.ino) to Maduino Zero SIM808 GPS board

4. Result Show Open the link: https://thingspeak.com/channels/916902 it will show the data as below:
SIM808 IOT RESULT SHOW 01.PNG
(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

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