Circuit 3D

Wireless modules

Wireless modules are small ready-made radio boards that give a microcontroller a link without wires: RFID readers for cards, Bluetooth for phones, the nRF24L01 between boards, LoRa for kilometers, and GPS for position. Most run on 3.3 V and talk to the board over SPI or a serial UART.

λ ÷ 4 = c ÷ 4f

the length of a simple quarter-wave wire antenna, where c is 3 × 10⁸ m/s and f the module’s frequency: about 17.3 cm at 433.92 MHz.

The lower the data rate and frequency, the farther a module reaches for the same power.

What are wireless modules?

Wireless modules are small, ready-made radio boards that give a microcontroller such as an Arduino a link without wires, each built for one job: reading cards, talking to phones, linking boards or finding position.

They differ most in how far they reach and how fast they send, as Figure 1 shows. Most connect over SPI or a UART and run on 3.3 V, so check before wiring one to a 5 V board.

RFID HC-05 nRF24 433 MHz LoRa 1 cm1 m100 m10 km

nRF24L01: 2.4 GHz, wired to a microcontroller by SPI on 3.3 V; it two of them link boards up to about 100 m in open air with the printed antenna, about 100 m.

Figure 1. Typical range in open air for five common modules, on a scale where each step is a hundred times the last. Walls, antennas and power change every one.

How does RFID work?

RFID works by a reader making a changing magnetic field that powers a nearby tag’s chip through the tag’s coil; the chip answers by switching a load on that coil, which the reader detects as its ID.

That is why a passive RFID card needs no battery, as Figure 2 shows. Access fobs often use 125 kHz, payment and transit cards 13.56 MHz, and shop and warehouse tags 860 to 960 MHz, which reach meters. It is the same induction a transformer uses.

reader 3 cm card read

3 cm: the reader’s 13.56 MHz field induces enough voltage in the card’s coil to power its chip, which answers by switching a load on its coil, a flicker the reader hears. The card has no battery.

Figure 2. A passive RFID card in front of a 13.56 MHz reader, seen from the side. The dashed arcs stand for the reader’s magnetic field.

How does NFC work?

NFC, near-field communication, is 13.56 MHz RFID made for a few centimeters, which lets a phone read tags, pay at a card reader, or exchange data with another phone held against it.

The short range is deliberate, so only the card you hold to the reader answers. A phone can read NFC tags and many 13.56 MHz cards, but not 125 kHz access fobs.

How do you use an RC522 RFID reader?

To use an RC522 RFID reader, power it from 3.3 V, wire it to the microcontroller’s SPI pins, and use an MFRC522 library to read each card’s ID when it comes within a few centimeters.

It reads 13.56 MHz MIFARE cards and key fobs, the kind most kits include. Use the ID to unlock a door with a relay or light an LED; never treat an ID alone as secure, since cheap cards can be copied.

What is a Bluetooth module like the HC-05?

The HC-05 is a Bluetooth Classic serial module: whatever bytes you send its UART at 9,600 baud come out on the phone or computer paired with it, about 10 m away, with 1234 as its usual PIN.

It can act as master or slave; the similar HC-06 is slave only. Its logic is 3.3 V, so divide a 5 V board’s TX down to it. Neither is Bluetooth Low Energy, so iPhones can’t use them for serial data; a BLE module or an ESP32 can.

What is an nRF24L01?

The nRF24L01 is a 2.4 GHz transceiver that links two or more microcontrollers over SPI, sending packets of up to 32 bytes at up to 2 Mbps, about 100 m in open air with its printed antenna.

It needs 1.9 to 3.6 V, though its inputs accept 5 V logic, and a 10 µF capacitor across its supply pins steadies its bursts of current. A version with an amplifier and an external antenna reaches far farther.

What are 433 MHz RF modules and LoRa?

A 433 MHz RF module pair is the cheapest radio link: a transmitter that switches a 433.92 MHz carrier on and off with your data, and a receiver that turns it back into bits, one way, tens of meters.

LoRa modules, at 868 MHz in Europe and 915 MHz in the Americas, use a spread-spectrum signal that reaches kilometers at very low data rates, suiting sensors that report a few bytes now and then. Rules on power and duty cycle differ by country.

How does a GPS module work?

A GPS module works by timing signals from satellites about 20,200 km up: from the delays from at least four, it works out its position and the time, then sends them as NMEA text over its UART, once a second.

The common NEO-6M fixes position to about 2.5 m under an open sky and takes around half a minute to find satellites from cold. Indoors it may find none at all.

How do you size an antenna and time a packet?

Divide the speed of radio waves by four times the frequency for a quarter-wave antenna, and divide a packet’s bits by the air rate for its time on air.

Example 1: a module’s wire antenna

How long should a quarter-wave wire antenna be for a module at 433.92 MHz?

Given
a module at 433.92 MHz, with radio waves at 3 × 10⁸ m/s
Find
the length of a quarter-wave wire antenna
Solution
λ ÷ 4 = c ÷ 4f = 3 × 10⁸ ÷ (4 × 433.92 MHz) ≈ 17.3 cm
Answer
about 17.3 cm of wire

Example 2: an nRF24L01 packet’s airtime

An nRF24L01 sends a full 32-byte payload at 1 Mbps. How long are those bits on air?

Given
an nRF24L01 sending its largest payload, 32 bytes, at 1 Mbps
Find
how long the payload’s bits take on air
Solution
32 bytes × 8 = 256 bitst = 256 ÷ 1,000,000 = 256 µs, plus a little for the address and checksum
Answer
256 µs

Summary

Key equations

  • λ ÷ 4 = c ÷ 4f a quarter-wave antenna
  • t = bits ÷ rate time on air

Key terms

RFID
Radio identification of tags.
NFC
Short-range RFID that phones speak.
Transceiver
A module that sends and receives.
NMEA
The text a GPS module sends.

Practice problems

  1. What frequency does an RC522 RFID reader use?

  2. Which module links two boards at 2.4 GHz over SPI?

  3. How is a passive RFID card powered?

  4. What supply voltage does an nRF24L01 need?

  5. How long is a quarter-wave antenna for 433.92 MHz?

FAQ

What is the difference between the HC-05 and HC-06?

Both are Bluetooth Classic serial modules; the HC-05 can act as master or slave, the HC-06 only as a slave. Neither is Bluetooth Low Energy.

What is the range of an nRF24L01?

Typically tens of meters to about 100 m in open air with its printed antenna, and much farther with the amplified version and an external antenna.

Can a phone read RFID cards?

A phone with NFC can read 13.56 MHz tags and many cards at that frequency; it cannot read 125 kHz access fobs.

Do 433 MHz modules need a license?

Low-power 433 MHz devices are license-free in many countries within strict power and duty limits, and some regions use 315 MHz instead. Check your local rules.

How accurate is a GPS module?

A NEO-6M fixes position to about 2.5 m under a clear sky, takes around half a minute to start from cold, and sends its fixes as NMEA text over a serial port.