Back
Loading views...NB_IoT
NB-IoT
Category: Wireless
Overview
NB-IoT (Narrowband IoT) is a 3GPP Low Power Wide Area (LPWA) cellular standard using a 200 kHz narrowband channel within LTE spectrum. It is optimized for ultra-low power, very high device density, and deep coverage, making it ideal for static IoT sensors that transmit small amounts of data infrequently.
1. Theory & Fundamentals
- Bandwidth: 200 kHz (one GSM channel)
- Deployment: In-band (within LTE carrier), guard-band, or standalone (GSM channel)
- Data rate: 26 kbps downlink, 63 kbps uplink (Multi-Tone); 20 kbps (Single-Tone)
- Coverage: MCE 164 dB; 20 dB better than GSM for deep indoor penetration
- PSM + eDRX: Sleep for hours to days; peak current only during TX
- Chipset: Quectel BC66, Nordic nRF9160 (multi-mode LTE-M/NB-IoT), u-blox SARA-N3
2. Frame / Packet Structure
NB-IoT uses LTE subframe structure (1ms) but narrowband:
NPDSCH (downlink data) | NPUSCH (uplink data)
NPDCCH (downlink control) | NPRACH (random access)
Non-IP Data Delivery (NIDD):
Device → eNB → MME → SCEF → Application Server
No IP stack on device; smaller overhead
CoAP over UDP typical for NB-IoT data:
4-byte header | Options | Payload
3. Protocol Mechanics
- No handover: Device is static; attaches to one cell
- eDRX: Extended sleep; wake to check paging channel at intervals
- PSM: Fully powered off except RTC; wake to transmit, then sleep
- Release Assistance Indication (RAI): Device signals no more data → fast release
- OTDOA: NB-IoT positioning (100–300m accuracy)
4. Hardware Implementation
- Quectel BC66: Cost-optimized NB-IoT module, AT commands via UART
- Nordic nRF9160: SiP with ARM Cortex-M33, modem, GNSS-ready
- u-blox SARA-N310: NB-IoT module with SPI/UART
- Antenna: Internal or external; 50Ω monopole for target band
- SIM: NB-IoT specific SIM (eUICC/eSIM recommended)
5. Register-Level / Configuration
// BC66 NB-IoT AT commands
void NBIOT_Init(void) {
UART_Send("AT+QCFG="nbsibscramble",0
"); // Scrambling off
UART_Send("AT+QCFG="band",B5
"); // Band 5
UART_Send("AT+CGDCONT=1,"IP","nb.carrier.com"
");
UART_Send("AT+CEREG=1
");
UART_Send("AT+CFUN=1
");
// Wait for +CEREG: 0,1
}
// Send UDP datagram (CoAP)
void NBIOT_SendUDP(const char *host, uint16_t port, uint8_t *data, uint16_t len) {
char cmd[60];
sprintf(cmd,"AT+QIOPEN=1,0,"UDP","%s",%d,12345,0
",host,port);
UART_Send(cmd); WaitOK(5000);
sprintf(cmd,"AT+QISEND=0,%d
",len);
UART_Send(cmd); UART_SendRaw(data,len);
}
6. Driver / Software Development
- Use lightweight CoAP library (libcoap, microCoAP) for data format
- PSM: After TX complete, execute PSM sleep command; RTC wakes after interval
- Error handling: Network attach timeout; retry with exponential backoff
- Non-IP mode (NIDD): Even simpler; no IP stack needed
7. Debugging & Testing
- AT commands via UART terminal
- Carrier IoT portal: View device connections and data
- Common issues: No coverage (check carrier NB-IoT map); SIM not NB-IoT compatible; APN wrong
- AT+NUESTATS: NB-IoT specific stats including ECL (coverage level), SNR, cell info
8. Real-World Applications
- Smart water meters (indoor meter pits)
- Underground parking sensors
- Utility AMI (automatic meter reading)
- Agricultural soil sensors (remote fields)
- Manhole monitoring and flood detection
9. Advanced Topics & Edge Cases
- ECL (Extended Coverage Level): 0=normal, 1=enhanced, 2=maximum coverage repetition
- Non-IP: Some modules support direct data without IP stack (AT+NSOST)
- NIDD over SCEF: Operator provides direct API; no IP needed on device
- nRF9160: Full modem + MCU SiP; most integrated NB-IoT solution
10. Standards & Variants
| Feature | NB-IoT | LTE-M |
|---|---|---|
| BW | 200 kHz | 1.4 MHz |
| DL rate | 26 kbps | 1 Mbps |
| Coverage | 164 dB | 156 dB |
| Mobility | No | Yes |
| Voice | No | Yes |
| Power | Ultra-low | Low |
💡 Practical Examples
Example 1: Send temperature reading
uint8_t coap_payload[] = {0x48, 23, 50}; // simple CoAP payload
NBIOT_SendUDP("coap.server.com", 5683, coap_payload, 3);
NBIOT_PSMSleep(3600); // Sleep 1 hour
Example 2: PSM sleep cycle
Transmit → RAI signal → network releases → PSM → RTC wakeup → repeat.
Example 3: ECL coverage check
AT+NUESTATS → returns ECL=0 (good), RSRP=-85dBm, SNR=10dB
🧪 Practice Questions
Beginner
- What bandwidth does NB-IoT use?
- What is PSM?
- How does NB-IoT achieve deeper building penetration?
- Can NB-IoT devices roam between cells?
- What data rate does NB-IoT support?
Intermediate
- Compare NB-IoT vs LTE-M for a smart parking sensor use case.
- Implement CoAP over UDP on NB-IoT module.
- How does ECL affect battery life and range?
- Configure PSM + eDRX for a smart meter sending data daily.
- What is NIDD and when is it preferred?
Advanced
- Design a 100,000-device NB-IoT smart metering system.
- Implement FOTA for NB-IoT device over NIDD.
- Optimize nRF9160 for 15-year battery life.
- Build multi-band NB-IoT device supporting global deployment.
- Implement end-to-end encryption for NB-IoT sensor data.
Hands-on Projects
- Smart Sensor: nRF9160 sends hourly sensor readings via CoAP.
- Parking Sensor: NB-IoT + ultrasonic sensor, report occupancy.
- Water Meter: Monthly meter readings over NB-IoT to cloud.
Checklist
- [ ] Configure APN and register on NB-IoT network
- [ ] Send data via UDP/CoAP
- [ ] Configure PSM and eDRX
- [ ] Use RAI for fast radio release
- [ ] Check signal quality (RSRP, SNR, ECL)
- [ ] Handle network attach failure and retry
- [ ] Implement CoAP client
- [ ] Use nRF9160 SiP with modem firmware
- [ ] Achieve target battery life
- [ ] Integrate with IoT platform