When you are working with cellular wireless modems, it is important to understand the signal strength quality. On smartphones, there is a signal quality indicator (the number of bars). If the signal quality is low (one or two bars), it may impact voice call quality and network speed. The same holds true for cellular modems in IOT solutions; data throughput will be impacted by poor signal conditions.
A signal strength reading from a cellular modem can help with the questions below:
Is the cellular modem connected to a wireless network?
- A signal strength reading can indicate whether a cellular modem device has a network connection at all. Without a network connection, none of the modem services, such as data call, voice call, or SMS, are possible.
How good is the signal condition?
- A signal strength reading can indicate signal quality. User experience features such as voice call quality and data throughput depend on signal quality.
How does device antenna affect signal condition?
- Many cellular modem solutions have an external antenna, which is intended to improving signal quality. The orientation of the external antenna can sometimes affect signal quality.
How does location affect signal condition?
- The location of a device is an important factor that determines signal quality, as surrounding environmental factors impact the signal path between the device and a cellular base station.
Let's build a signal meter app that can continuously monitor the signal condition of a cellular modem connected to a Raspberry Pi. This app can be useful when you’re developing an IoT (Internet of Things) or M2M (Machine to Machine) solution using cellular modems to set up the antenna and location of a device in optimal signal condition. For this app, I’m using the Node-RED tool on Raspberry Pi. Node-RED is an easy-to-use, UI-based, drag-and-drop programming tool that is included by default in the Raspbian OS.
Before we write the app, let's look at the interface to get signal strength readings from cellular modems. All cellular modems support standard programming interface called AT Commands, which can be used for typical modem services such as data call, voice call, SMS, and network selection. The AT command to get signal strength is AT+CSQ. In our app, we’ll use this AT command to periodically get the signal quality from a cellular modem.
The AT+CSQ command returns the signal strength values in the range of 0-31. To convert to dBM (decibel-milliwatts), dBm = -113 + N *2 (N is the value returned by AT+CSQ command).
Generally, anything above -70 dBM (-51 to -70 dBm) is excellent signal condition, and above -80 is good.
If you want to try out the app, you can get the Node-RED flow from Github.
How Does the Wireless Signal Meter Work?
The UI for the signal meter app displays a dBM value based on the AT+CSQ response from the cellular modem device. The "Start" button will begin continuous monitoring by periodically sending the AT+CSQ command to the modem. The frequency of the request can be configured in the Node-RED flow. When you adjust the external antenna or move the device to a different location, you’ll observe that the signal meter will change.
Let's review the Node-RED flow that generates the app shown above. The "Read signal strength" function node sends the AT command request to the modem device using the serial port node. The start button initiates periodic requests every 3 seconds, the stop button stops the request by setting a global flag. The response from the modem device is fed into the "Convert to RSSI" function node which converts the AT+CSQ response into a dBm value. The "Signal Meter" is a chart node that displays the dBM value. A few debug nodes are included in the flow to monitor the raw response from the modem device on Node-RED UI.
You can use this app to monitor your modem’s signal condition in the development or deployment phase. You can also extend the flow to query other useful queries from the modem device.