Makers and professional engineers are increasingly adopting wireless connections to enhance project functions and connect them to the Internet of Things (IoT). The single board computer (SBC) used in such projects usually integrates Bluetooth and Wi-Fi, but for longer distances, the cellular interface is a good alternative.

Although cellular modems can provide longer distances, the disadvantages are that they increase the complexity, size, cost, and power consumption of the project, and they must also meet regulatory regulations for authorized spectrum allocation.

This article explores the advantages of using cellular modules for wireless connectivity in maker projects, and introduces the hardware, software, and regulatory challenges that arise during the implementation.

After that, this article also provides solutions to help overcome the challenges faced by makers and designers when using cellular-based long-distance radio connections.

Advantages (and disadvantages) of cellular connections

Although today's low-power Bluetooth and Wi-Fi technologies are also brewing changes, they currently do not support direct connection to the Internet of Things. In contrast, smartphones can interoperate with Bluetooth Low Energy, Wi-Fi, and the (cellular) Internet of Things. Therefore, it can be used as a gateway between wirelessly connected devices such as the maker project SBC and the cloud. Similarly, Wi-Fi routers and cable modems can also form gateways for SBCs that support Wi-Fi (Figure 1).

低功耗蓝牙等无线技术的示意图

Figure 1: Wireless technologies such as Bluetooth Low Energy (previously known as Bluetooth Smart) and Wi-Fi require a router or gateway to access the Internet, which limits the mobility and distance of the sensor. The cellular module can be directly connected to other IP-enabled devices, so no router or gateway is required. (Image source: Nordic Semiconductor)

For many maker applications, the Internet of Things connection through the gateway is a satisfactory solution. However, if the sensor moves outside the wireless range of the gateway (for Bluetooth Low Energy and Wi-Fi, more than 30 to 100 meters away), the connection will be interrupted. This restriction prevents makers from developing projects that are located in remote locations or continue to move. The cellular module provides a solution.

Cellular modules are nothing new. A huge industry that provides machine-to-machine (M2M) applications has developed around this technology. For example, vending machines in remote locations are usually connected to the company's computer via a cellular link. In view of the difficulty of designing a cellular modem from scratch, the solution is provided in the form of a plug-and-play module that has been tested, verified, and certified.

Cellular module manufacturers now provide products specifically for makers that are compatible with commonly used SBCs provided by vendors such as Microchip Technology, Arduino and Adafruit. Using the cellular module, the maker project SBC can send data directly to another remote device connected via the Internet, such as the maker's smartphone (when it is far away from the SBC) or cloud server, without using a gateway. Moreover, cellular modems can provide distances as far as tens of kilometers, thereby expanding the scope of wireless maker projects far beyond the home. Moreover, using a cellular modem does not require the extremely inconvenient password input process when adding wireless devices to the LAN.

Cellular communications use authorized frequencies. Although there is a certain usage fee, the advantage is that these frequencies are strictly controlled, and relatively speaking, the congestion problems and related interference that plague unlicensed frequency bands such as 2.4 Ghz are avoided. The process of obtaining network access is the same as that used by mobile phones; users need to subscribe to the services of local operators. After that, they will get a Subscriber Identification Module (SIM), which will be verified when inserted, so that a certain amount of data can be uploaded and downloaded according to the terms of the contract.

In addition to license fees, cellular connections have some other disadvantages. Relatively speaking, these modules are relatively large in size and weight, more expensive, and their power consumption is much greater than low-power Bluetooth and Wi-Fi. Moreover, connecting directly to a cellular network is more complicated than connecting to a smartphone or router.

In addition, there are multiple cellular technologies in the commercial field (such as GSM, GPRS, and CDMA), each of which has multiple generations (2G, 2.5G, 3G, and 4G), and there are dozens of cellular frequency bands worldwide. Therefore, it is necessary to be cautious when selecting a cellular module for a specific location.

Please note that the price of 2G modules is usually the lowest, but it should be noted that operators are phasing out this older technology, although this process may take many years.

Cellular modules can be seen everywhere in maker projects

With the cellular module, all the maker needs to do now is to ensure that the physical interface of the module matches the physical interface of the target SBC, sign an operator contract, insert the SIM, and then select the corresponding antenna.

Cellular module manufacturers are scrambling to enter the fast-growing maker market, and provide units that directly connect to commonly used SBCs through header pins or cables. For example, MikroElektronika provides a large number of cellular modules in its Click Board series, which can be directly connected to Microchip's Curiosity SBC through mechanical connectors.

These SBCs use Microchip’s 8-bit, 16-bit or 32-bit PIC microcontrollers and include an integrated programmer/debugger with USB interface; mTouch buttons, analog potentiometers, switches and RGB LEDs; most importantly, support MikroElektronika MikroBUS interface (Figure 2).

These SBCs can be programmed using Microchip's MPLAB X Integrated Development Environment (IDE), while 8-bit and 16-bit microcontroller versions can be programmed using MPLAB Xpress IDE, which is suitable for makers who are not familiar with PIC microcontrollers.

Microchip 的 Curiosity SBC mikroBUS 接口图片

Figure 2: Microchip's Curiosity SBC uses the mikroBUS interface, so it can easily connect to a 2.5G GSM/GPRS Click Board cellular module. (Image source: Microchip Technology)

MikroElektronika's GSM 4 click is connected to the Curiosity SBC through the header pins, and directly obtains 3.3 volts or 5 volts from the SBC. The cellular module is based on the u-blox SARA-G3 series 2.5G GSM/GPRS modem, which integrates a radio frequency transceiver and a power amplifier to achieve a longer application distance (Figure 3). SARA-G3 is specifically designed for M2M applications, so it is very suitable for makers who only need to send less sensor data across cellular IoT.

The cellular modem contains Ipv4 and Ipv6 communication protocols, so it can interoperate with any other devices on the Internet that support the IP protocol. The quad-band version of SARA-G3 is already on the market and can operate in the 850 and 1900 Mhz frequency bands used in North America, South America and Central America, and the 900 and 1800 MHz frequency bands used in Europe, Africa, the Middle East and Asia.

MikroElektronika 的 GSM 4 click 示意图

Figure 3: MikroElektronika's GSM 4 click is based on the u-blox SARA-G3 modem shown here. The modem integrates a power amplifier (PA) to expand the application range. (Image source: u-blox)

In addition to sending and receiving data, GSM 4 click can also respond and react to telephone calls or messages. It contains an antenna connector (but no antenna) and a SIM card socket. Communication with the PIC microcontroller is via UART connection or USB port.

MikroElektronika provides mikroC IDE for its Click Board product. These include Visual TFT, a "what you see is what you get" graphical user interface design tool, and a fully functional C compiler.

For makers who are familiar with Arduino SBCs that use a UART connection and run from a 3 to 5 volt power supply, Adafruit’s FONA 808 cellular + GPS splitter provides a good choice (but it can also work with almost all microcontrollers With the use of). This module is a quad-band (850/900/1800/1900 Mhz) GSM 2G radio with GPS and GPRS data sending and receiving functions. For example, a 16-pin header must be soldered to the breakout pin hole to connect the module to the Arduino SBC.

Adafruit 的 FONA 808 图片

Figure 4: Adafruit's FONA 808 is very suitable for use with Arduino SBC. Like other cellular modems, it also requires a SIM card and antenna. (Image source: Adafruit)

If developers want to take advantage of the speed and bandwidth of 3G, SparkFun Electronics' Particle Electron 3G kit is a good choice. The kit provides two versions: one is suitable for 850/1900 Mhz working frequency band, and the other is suitable for 900/1800 Mhz working frequency band.

The kit includes not only the cellular module (another u-blox SARA power supply unit), but also an STMicroelectronics STM32 ARM® Cortex®-M3 microcontroller, which can work independently of the SBC if you prefer. The Electron kit comes with Particle IDE and cloud platform for device programming. Particle IDE is similar to Arduino development platform.

Unlike some other cellular modules for maker applications, the Particle Electron kit is very complete, with a SIM card, a 3-month 1 MB/month data plan, and a 2000 mAh lithium battery (the device can also be powered by an external power supply) , Antennas, and test boards for prototype development.

Communicate with cellular modem

Connecting the cellular module and sending and receiving data requires certain coding skills, but these skills will not exceed the range of skills required for programmers familiar with IDEs such as Arduino to program microcontrollers.

The SBC usually communicates with a cellular module using a UART serial link. AT commands are the standard method of controlling cellular modems. The command contains a series of short text strings, which can be combined to generate operations such as dialing, hanging up, and changing connection parameters.

There are two types of AT commands: Basic commands are commands that do not start with "+". "D" (dial), "A" (answer), "H" (check control) and "O" (restore online data state) are all examples of basic commands (List 1).

void gsm4_init( void)

{

engine_init( gsm4_evn_default );

at_cmd_save( "RING", 1000, NULL, NULL, NULL, gsm4_ev_ring );

at_cmd( "AT" );
at_cmd( "AT+CSCS="GSM"" );
at_cmd( "AT+CMGF=1" );
}

Listing 1: This code example uses the AT command in the test routine to reject the call received by the cellular module. (Code source: MikroElektronika)

An extended command is a command starting with "+". For example, "+CMGS" (send SMS information), "+CMGL" (list SMS information), and "+CMGR" (read SMS information). Please note that GSM only uses extended commands.

The "final result" code marks the end of the AT command response. It indicates that the GSM module has completed the execution of the command line. "OK" and "ERROR" are two frequently used final result codes. The "OK" code indicates that the command line has been executed successfully. The "ERROR" code indicates that an error occurred when the cellular module tried to execute the command line. After an error occurs, the cellular module will not process the remaining AT commands in the command line string.

The syntax of the AT command varies depending on the module manufacturer. In addition, the module may only respond to a subset of AT commands, but cellular modules designed for wireless applications usually support AT commands better than ordinary mobile phones. Makers should seek advice from the AT command reference guides of various module manufacturers, and these guides can also inform makers how to format AT commands and how to interpret cellular module responses.

But each modem can respond to four basic AT commands:

The "Set" command [At+=] is used to store the value.

For example, AT+CREG=1 // Set Command

"Extract" command [AT+?] is used to read the stored value.

For example, AT+CREG? // Get Command

The test command [At+=?] is used to determine the supported value range.

For example, AT+CREG=? // Test Command

The execution command [At+] is used to call specific functions of the cellular modem.

For example, AT+CREG // Execution Command

Other general (and practical) AT commands include:

Mobile network registration status (AT+CREG)

Radio signal strength (AT+CSQ)

Battery level and battery charge status (AT+CBC)

Establish data connection with remote modem (ATA, ATD, etc.)

Perform security-related tasks, such as changing passwords (AT+CPWD)

Get or change the configuration of the cellular module. For example, change GSM network (AT+COPS) or radio link protocol parameters (AT+CRLP)

The sending and receiving of AT commands are realized by the specific SBC, IDE and selected programming language through the serial communication link. The cellular module does not know what the other end of the serial link is, but only responds to AT commands sent across the link. (Similarly, SBC does not know that it is connected to a cellular module).

通常采用多个 UART I/O 的蜂窝调制解调器图片

Figure 5: Cellular modems usually use multiple UART I/Os, some of which have specific functions. (Form source: MikroElektronika)

For example, when using Curiosity SBC and GSM 4 click cellular modules, developers can use Microchip MPLAB X, MPLAB Xpress or MikroElektronika mikroC IDE with the help of the agnostic nature of AT commands. After the user downloads the Adafruit FONA library from the GitHub repository and moves it to the Arduino library folder, the FONA 808 can be programmed using the Arduino IDE.

AT commands for almost all cellular module operations can usually be found in the manufacturer's open source code base. The AT commands of MikroElektronika can be found at libstock.mikroe.com, while the AT commands of Adafruit are in the GitHub repository. Other sources of AT commands come from cellular modem manufacturers. For example, u-blox has written an application note that provides AT command examples covering almost all usage scenarios (Reference 1), while Adafruit has provided a manual listing SIM Tech AT commands.

to sum up

The cellular module provides a "plug-in" solution for maker projects that require IoT connections in all scenarios (provided that the project is within the range of cellular base stations). There are a series of mature 2G, 2.5G and 3G cellular modules on the market that can perfectly match the popular Maker SBC, and the hardware considerations are limited to the selection and matching of corresponding antennas, mechanical connectors and batteries. Since the cellular network requires authorization, you also need to use a SIM card and sign a data contract.

Geek Bar Vape

Tsvape is the Chinese supplier of GEEK BAR. We do wholesale business,we sent them from China. Geekbar is an senior e-cigarette brand. It has a high reputation in the world. You can order it with confidence.

Geek Bar575puffsGeek Bar575puffsGeek Bars B4000Geek Bar Disposable Vape

Geek Bar Vape,Vape Qd42-V2 4000 Puffs ,Elr Iget Hqd Elrbar ,Elr Iget High-Powe

TSVAPE Wholesale/OEM/ODM , https://www.tsecigarette.com