Daily Archives: November 10, 2022

Remote Sensing with nRF24L01+ Modules

RF modules, nRF24L01+, from Nordic Semiconductor, are low-cost solutions for two-way wireless communication. Users can configure the modules via their SPI or Serial Peripheral Interface. The SPI interface also allows control over a microcontroller. The Internet has many examples of projects using these RF modules with Arduino boards.

The RF module nRF24L01 has a built-in PCB antenna. Moreover, the module has an extra feature that utilizes the two-way communication feature for detecting any loss of communication between the transmitter and the receiver. The modules offer two-way communication because they act as a transmitter and a receiver at the same time. However, one module acts as the main transmitter and transmits the state of a PIR or Passive Infrared Sensor to the other module that receives the data for further processing.

Remote sensors need this ability to detect the loss of communications. This is because, in the absence of communication, it is easy to lose data or information without notice. Again, this is an important feature when installing the sensor to verify if both RF modules are actually talking to each other, and are not out of range.

Although the RF modules nRF24L01 need powering with 3.3 VDC, their IO pins are 5 VDC tolerant. That makes it easy to connect the SPI bus of the nRF24L01 modules to an Arduino Pro Mini working on 5 VDC.

It is very significant to place the power supply bypass capacitors as close as possible to the microcontroller and the nRF24L01 modules, as this effectively suppresses most of the switching noise from these chips. Overlooking this in such projects often leads to all types of unexpected problems. It is also necessary to use multiple bypass capacitors. Users can effectively parallel capacitors of different values, like an electrolytic capacitor of 100 µF and a polypropylene capacitor of 100 nF. The electrolytic capacitor filters out noises of lower frequencies, but it is ineffective for filtering any high-frequency noise. The polypropylene capacitor filters the higher frequency noise.

The PIR sensor connects to the microcontroller. A voltage level translator offers the sensor the optimum voltage level it needs to function. Therefore, depending on the type of PIR sensor, the voltage level translator can supply a 5 VDC, 3.3 VDC, or other lower level outputs. The polarity of the voltage level translator transistor decides whether the trigger output is high active or low active.

A red LED begins to flash when the transmitter and the receiver have lost their connection. On restoring the connection, the red LED stops flashing.

When the PIR sensor senses motion, a blue LED lights up to indicate this. The transmitter sends this trigger event over to the receiver as a trigger code byte. If there is no motion to detect, the transmitter sends only a live beat code to the receiver. This is how the receiver knows if the sensor has sent a motion trigger.

The receiver sends the same code it receives back to the transmitter as an acknowledgment. There is thus continuous communication between the receiver and the transmitter, and both can easily determine as soon as they have lost connection.