Difference between revisions of "Maduino Lora Radio (433M868M)"

From MakerFabsWiki
Jump to: navigation, search
(Blanked the page)
Line 1: Line 1:
== 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 rang ,low power application ) such as, smart farmer, smart warehouse, smart community etc. <br>
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.<br>
This guide help you the basic usage of Maduino Lora Radio. <br>
'''Model: [https://www.makerfabs.com/maduino-lora-radio-433m.html Maduino Lora Radio V1.5 ]'''<br>
== Features ==
• ATMEL SAMD21G18A: 32-bit ARM® Cortex®-M0 up to 48MHz, 256KB flash, 32KB SRAM, LQFP48v
• Powered by lithium battery(3.4-4.2V) or AC-DC Adapter<br>
• GSM Quad-band: 850/900/1800/1900Mz<br>
• GPS Location<br>
• Bluetooth 3.0 + EDR(Enhanced Data Rate), up to 2.1Mbps<br>
• Interface: I2C/SPI/UART/ADC/DAC/I2S/38*GPIO<br>
• Arduino Compatible: You can play it with Arduino IDE<br>
• More cost-effective and high quality than Arduino Zero<br>
• Working Temperature: -20 ~ +85℃<br>
• Default baud rate: 115200bps<br>
• Size: 40*55mm<br>
== Interface Function ==
① Micro USB: USB to serial communication (*Note that the USB is not for power supply)<br>
②DC-05: Supply power for the board<br>
③Switch: Power switch<br>
④VBAT: 3.7V Lipo battery connector<br>
⑤GSM: GSM Antenna IPX Interface<br>
⑥NET: SIM808 Network indicate<br>
⑦STA: SIM808 status indicate<br>
⑧1PPSTime Mark outputs<br>
⑨GPS: GPS Antenna IPX Interface<br>
⑩SWD: Bootloader downloading<br>
⑪RESET: Reset button for ATSAMD21G18<br>
①Micro SIM Card Holder<br>
②Micro SD Card Holder<br>
③BT: Bluetooth IPX Interface<br>
{| cellspacing="0" cellpadding="5" border="1"
| align="center" width="150" | '''Indicator LED'''
| align="center" width="200" | '''Status'''
|- style="font-size: 90%"
| align="center" | PWR
| align="center" | Light on when switch on, light off when switch off
|- style="font-size: 90%"
| align="center" | CHG
| align="center" | Charge indicate
|- style="font-size: 90%"
| align="center" | NET
| align="center" | Off:SIM808 is not working. <br>64ms On/800ms Off: SIM808 not registered the network. <br>64ms On/3000ms Off: SIM808 registered to the network. <br>64ms On/300ms Off: PPP GPRS communication is established.
|- style="font-size: 90%"
| align="center" | STA
| align="center" | Light on when GSM module powered on.<br> Light off when GSM module powered off.
|- style="font-size: 90%"
| align="center" | 1PPS
| align="center" | Time Mark outputs timing pulse related to receiver time
'''Warning''': Don't operate when in power supply on (That is, don’t plug or unplug the Antenna ,SIM Cars, SD Card , in case of short-circuit that may burn the IC down.)
Note After [https://www.arduino.cc/en/Guide/HomePage a Arduino IDE] installed, there is no package to support Maduino Zero(Arduino Zero ), we need to install the Arduino Zero package in Arduino IDE to continue.
===1. Install Software for the Arduino/Genuino Zero===
The following screens show how to install software for the Maduino(Arduino/Genuino) Zero boards in the Arduino IDE. <br>
1.1. Open the Boards Manager
From the top Arduino IDE menu, select Tools-> Board-> Boards Manager… to open the Boards Manager dialog box.
1.2. Select Arduino SAMD Boards and Install
In the '''Boards Manager''' dialog box, type '''Arduino Zero''' into the search field to easily find the Arduino SAMD package for 32-bits ARM Cortex-M0+ boards as shown in the image below. Install it.<br>
1.3. Find the Arduino Zero Boards on the Arduino IDE Menu
After the software package has been installed, the new Arduino boards can be seen on the Arduino IDE Board menu found under '''Tools →Board''' as shown in the image below.
A new section called '''Arduino SAMD (32-bits ARM Cortex-M0+) Boards''' can be seen on the Board menu which contains Arduino M0, M0 Pro, Zero, MKR boards and others.  This means the right package has been installed and Maduino ready to go.
===2. Hardware Connection===
• Plug a MicroSIM card.<br>
• Plug a GPS Antenna to designator which shows GPS.<br>
• Plug a GSM Antenna to designator which shows GSM.<br>
• Plug a Bluetooth Antenna to designator which shows BT.<br>
• Plug a Micro USB Cable to Maduino Zero SIM808.<br>
• Plug a 3.7V lithium battery to J6 or AC-DC Adapter to Maduino Zero SIM808<br>
*Note1: A 3.7V lithium battery normal voltage is 3.7V, but the range voltage often from 3.4V to 4.2V<br>
*Note2: Micro USB just used for communicate with the board, it doesn’t supply power to the board because the SIM808 Module need a 2A pulse current when power on.<br>
*Note3: The current of AC-DC Adapter should be 2A or more. Otherwise the SIM808 may not work or work unstable.<br>
*Note4: Both the battery or the DC jack can be used for power supply. While DC connected, the board will be powered by DC, while DC removed, it will switch to battery automaticly.<br>
====3. Program the Maduino Zero====
Select the desired '''Arduino/Genuino Zero(Native USB port)''' board from the Arduino IDE Board menu and then select the correct Port number from the menu item below Board on the Tools Menu. The Maduino board can now be programmed in the usual manner.<br>
Select Arduino/Genuino Zero(Native USB port)
Open our first programming code [https://github.com/Makerfabs/SIM808_Demo SIM808_AT_Commands_Test.ino]<br>
Click Verify button to compile it.<br>
If there is no any errors, it will show Done compiling.<br>
Click Upload button to upload firmware to the Maduino Zero SIM808 GPS Tracer board.<br>
After done uploading, it will show the programming OK, as below:<br>
From the top Arduino IDE menu, select '''Tools → Serial Monitor'''… to open the Serial Monitor dialog box.<br>
Select “Carriage return”, and baud rate 115200, it will shows the board begin to works:<br>
Click Send button after input AT and it will response OK.<br>
Now you can input other AT Commands refer to SIM800_Series_AT_Command_Manual_V1.09.pdf,Such as AT+ICCID to show ICCID, AT+CSQ to report GSM/GPRS signal quality and so on.<br>
===3.1 How to get GPS Location information?===
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. This example show you how to get GPS location.<br>
Attention: To get GPS location, please ensure you are outdoor, and plug the GPS Antenna. Indoor may get the incorrect location or no location information.<br>
1. Turn on GPS, using the AT command “AT+CGNSPWR=1” to turn the GPS:
2. Define the last NMEA sentence that parsed by AT command “AT+CGNSSEQ=RMC”
3. GNSS navigation information parsed from NMEA sentences, by AT command” AT+CGNSINF”, then the Maduino GPS will begin to navigate the GPS info:
4. Turn on navigation data URC report, and report every GNSS FIX, by “AT+CGNSURC=1”
If not get the GPS signal, it returns:
+CGNSINF: 1,0,19800105235944.000,,,,0.00,0.0,0,,,,,,0,0,,,,,
===Maduino Zero SIM808 GPS Tracker Projects===
Project_1:    Shows the GPS location on OLED display
We need a 0.96" I2C OLED 128x64 at:<br>
[[https://www.makerfabs.com/0.96-i2c-oled-128x64-blue.html 0.96" I2C OLED 128x64 - Blue]]<br>
Check the Pin J3 on Maduino Zero SIM808 (GND/3V3/SCL/SDA), as the pins definition compatible, plug the OLED directly on J3:.<br>
And install the SSD1306 OLED driver library<br>
And then download our example ([https://github.com/Makerfabs/SIM808_Demo  SIM808_GPS_OLED.ino]) to Maduino board, the result show:<br>
There you can check the local time/longitude/ latitude on the OLED(when making this guide, our local time is 20191031094835, and longitude/ latitude:  22.612207/113.835075<br>
We can show our location where we are in https://www.gps-coordinates.net/ <br>
===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.<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"
| align="center" width="150" | '''Sensor'''
| align="center" width="200" | '''Maduino Pins'''
|- style="font-size: 90%"
| align="center" | Sensor's GND
| align="center" |  Maduino's GND
|- style="font-size: 90%"
| align="center" | Sensor's DATA
| align="center" | Maduino's D6
|- style="font-size: 90%"
| align="center" | Sensor's Vcc
| align="center" | 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
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.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>
3.3 Input name, Description, Select Field 1, Field 2,Field3, Field4. Then save channel on the bottom.<br>
3.4 Copy the API Key, we will use it in the program<br>
The Codes for this application is very simple, define the SIM808 Power control pins:<br>
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([https://github.com/Makerfabs/SIM808_Demo 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:<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  ==
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 ==
*[http://makerfabs.com/wiki/index.php?title=File:MaduinoLoraRadioV1.5_SCH.pdf MaduinoLoraRadio_SCH]

Latest revision as of 07:30, 13 December 2019