|
|
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>
| |
− | [[File:Maduino_Lora_Radio_V1.50_01.jpg|500px]]
| |
− |
| |
− | == 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 ==
| |
− |
| |
− | [[File:MaduinoLoraRadioV1.5_V02.jpg]]
| |
− |
| |
− | ① 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
| |
− | |}
| |
− |
| |
− | ==Usage==
| |
− | '''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.
| |
− | [[File:Arduino_Board_V1.0.png|800px]]
| |
− |
| |
− |
| |
− | 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>
| |
− | [[File:Arduino_BoardManager_V1.0.png|800px]]<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.
| |
− |
| |
− | [[File:Arduino_Serial.png|800px]]
| |
− |
| |
− | 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>
| |
− | [[File:Arduino_Zero_NativeUSB_V1.0.png]]<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>
| |
− | [[File:Arduino_Verify_V1.0.png]]<br>
| |
− | If there is no any errors, it will show Done compiling.<br>
| |
− | [[File:Arduino_Done_Compiling_V1.0.png]]
| |
− | Click Upload button to upload firmware to the Maduino Zero SIM808 GPS Tracer board.<br>
| |
− | [[File:Arduino_Upload_V1.0.png]]<br>
| |
− | After done uploading, it will show the programming OK, as below:<br>
| |
− | [[File:Arduino_Done_Uploading_V1.0.png]]
| |
− | From the top Arduino IDE menu, select '''Tools → Serial Monitor'''… to open the Serial Monitor dialog box.<br>
| |
− | [[File:Arduino_SerialMonitor_V1.0.png]]
| |
− | Select “Carriage return”, and baud rate 115200, it will shows the board begin to works:<br>
| |
− | [[File:Arduino_SerialMonitorShow_V1.0.png]]
| |
− | Click Send button after input AT and it will response OK.<br>
| |
− | [[File:Arduino_SerialMonitorReply_V1.0.png]]
| |
− |
| |
− |
| |
− | 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:
| |
− | <pre>
| |
− | AT+CGNSPWR=1
| |
− | </pre>
| |
− |
| |
− | 2. Define the last NMEA sentence that parsed by AT command “AT+CGNSSEQ=RMC”
| |
− | <pre>
| |
− | AT+CGNSSEQ=RMC
| |
− | </pre>
| |
− |
| |
− | 3. GNSS navigation information parsed from NMEA sentences, by AT command” AT+CGNSINF”, then the Maduino GPS will begin to navigate the GPS info:
| |
− | <pre>
| |
− | AT+CGNSINF
| |
− | </pre>
| |
− | 4. Turn on navigation data URC report, and report every GNSS FIX, by “AT+CGNSURC=1”
| |
− | <pre>
| |
− | AT+CGNSURC=1
| |
− | </pre>
| |
− | [[File:Arduino_GPS_Result_V1.0.png]]<br>
| |
− | If not get the GPS signal, it returns:
| |
− | <pre>
| |
− | +CGNSINF: 1,0,19800105235944.000,,,,0.00,0.0,0,,,,,,0,0,,,,,
| |
− | </pre>
| |
− |
| |
− | ===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>
| |
− | [[File:i2c_0.96_oled.JPG|700px]]<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>
| |
− | [[File:Zero_SIM808_v3.5_OLED.jpg|700px]]<br>
| |
− |
| |
− | And install the SSD1306 OLED driver library<br>
| |
− | [[File:Arduino_mgr_library_V1.0.png]]
| |
− | [[File:Arduino_SearchSSD1306_V1.0.png]]
| |
− |
| |
− | And then download our example ([https://github.com/Makerfabs/SIM808_Demo SIM808_GPS_OLED.ino]) to Maduino board, the result show:<br>
| |
− | [[File:Zero_SIM808_v3.5_GPS_OLED_V1.0.jpg|1000px]]
| |
− |
| |
− | 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
| |
− |
| |
− | [[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>
| |
− | [[File:SIM808_API_CODE_01.PNG|700px]]<br>
| |
− |
| |
− | [[File:SIM808_API_CODE_02.PNG|700px]]<br>
| |
− |
| |
− | The Codes for this application is very simple, define the SIM808 Power control pins:<br>
| |
− |
| |
− | Connect to GPRS/GSM network
| |
− | <pre>
| |
− | //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
| |
− | Open the link: https://thingspeak.com/channels/916902 it will show the data as below:<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 ==
| |
− | 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]
| |