Ultra-Low-Power Sensor Hub Using nRF24L01 Modules

Somnath Bera is an avid user of open source software. Professionally, he is a thermal power expert and works as additional general manager at NTPC Ltd

19458
 

Transmitter unit

Fig. 3 shows the transmitter circuit. It can be powered by a 3.7V Li-ion cell or two 1.5V pencil cells. Theoretically, the devices used here are capable of running at up to 1.8 volts, but at less than 2 volts the nRF24L01+PA&LNA radio stops working and at less than 2.8 volts the DHT22 sensor will not function. Small capacitors are added to the supply bus of the DHT22 and the nRF24L01 for stability. Vcc supply for the DHT22 is taken from port PD4 (pin 6) of ATmega328P, whereas the nRF24L01+ is directly connected with 3.7V supply. To reduce power consumption by the radio in idle state, we use powerDown( ) command of the radio in the code.

Transmitter circuit
Fig. 3: Transmitter circuit

Before burning the code (nrf24l01_tx6.ino) into a fresh ATmega328P chip, burn the bootloader code for the inbuilt internal 8MHz clock. For details, see under AVR programmer sub-head.

Receiver unit

Fig. 4 shows the receiver circuit. The nRF24L01+ radio is designed to operate between 1.9-3.6 volts only. Connecting the module to 5 volts may damage it permanently; it overheats in case of reverse connection or high-voltage connection. Connect a small capacitor (say, 10µF) between Vcc and GND leads of nRF24L01+ radio. Pin details of nRF24L01+ (shown in Fig. 5) and nRF24L01+PA and LNA modules are the same.

Fig. 4: Receiver circuit

The nRF24L01+ module is connected to an I2C 64×128 OLED through an ATmega328P. The humidity and temperature data received by the module is displayed on the OLED. You can also see this data on the serial monitor of Arduino IDE. All the nRF24L01+ radios are capable of transmitting six channels simultaneously. Unique pipe addresses or IDs selected here for both the transmitter and receiver modules are 0xE8E8F0F0E1LL.

Pin details of nRF24L01+ module
Fig. 5: Pin details of nRF24L01+ module

AVR programmer

To make this project work, you need an AVR programmer. You can make one yourself as described under ‘Arduino as AVR Programmer’.

This small setup requires an Arduino board, a ZIF (zero-insertion force) socket, a blank ATmega328P and a few passive components. With these, you can create as much Arduino as you want on the fly.

First, burn the bootloader for the internal 8MHz oscillator of the ATmega328P chip. To do this, in any latest Arduino IDE, select ToolsBoardsArduino LilyPad and then burn the Arduino bootloader onto the ATmega328P chip. LilyPad is the simplest Arduino board on internal 8MHz clock. In case the chip is already burnt as Arduino Uno (16MHz clock), it will not burn the 8MHz internal clock bootloader, unless the 16MHz quartz is connected to it. Once the internal 8MHz clock bootloader is burnt, remove the 16MHz quartz and proceed to burn the main sketch.

Extreme low power

A small lithium-ion button cell is good enough to run the small sensor hub and transmit signals up to 500 metres away for more than 25 days non-stop. On a 3.7V cell, the transmitter takes just 6-7mA current for two seconds and then sleeps for 40 seconds drawing 30µA current. The battery runs for weeks together.

The receiver draws 32mA current for ten seconds and then sleeps for 32 seconds on 8mA current.

Here’s the calculation:

Current consumption (transmitter)=(2×7)+(40×0.030)=15.2mA seconds in 42 seconds

Therefore, in 1 second = 15.2/ 42 mA seconds=0.3619mA seconds

In 1 minute = 0.3619×60

In 1 hour = 0.3619×60×60 mA seconds

In 24 hours=0.3619×60×60× 24 mA seconds
=(0.3619×60×60×24)/3600 mA hours
=8.68571mAh

On a 3.7-volt, 150mAh battery it will last for 150/8.68571 = 17 days

Current consumption (receiver) is {(10×32)+(32×8.0)}/42 = 13.714mA seconds
=(13.714×60×60×24)/3600
=329.143mAh

On a 3.7-volt, 150mAh button cell, it will last for about 150/329= 27 minutes.

Display consumes more current.

Note that nRF24L01 radios operate off at maximum 3.6 volts. Sometimes, when the Li-ion battery is fully charged, the voltage may go as high as 4.01 volts, so the radio may not work. Put a diode in series with the battery connection so that the voltage drops by 0.7 volt and the radios start working again.

Construction and testing

An actual-size PCB layout for the transmitter circuit is shown in Fig. 6 and its components layout in Fig. 7. PCB layout for the receiver circuit is shown in Fig. 8 and its components layout in Fig. 9. After assembling the circuits on respective PCBs, enclose these in suitable cabinets and place them some distance apart.

Fig. 6: PCB layout of the transmitter
Fig. 7: Components layout for the PCB in Fig. 6
Fig. 8: PCB layout of the receiver
Fig. 9: Components layout for the PCB in Fig. 8

Download PCB and component layout PDFs: click here

Download source code

Connect the battery to the transmitter unit and measure the current. The current withdrawn is 6-7 mA while transmitting for two seconds and 30µA for the remaining 40 seconds. For periodicity, we used the WDT of the MCU, which is not very precise. It provides five incremental steps of 250ms, 500ms, 2, 4 and 8 seconds. That means, it will transmit once every 5×8+2=42 seconds. The DHT22 sensor requires a minimum of 2.8 volts to operate. Therefore put a fairly big capacitor (100-470µF) across its Vcc and GND pins. Else, you will get temperature and relative humidity values as zero. The sensor takes two seconds between readings.


Feel interested? Check out more electronics projects.

SHARE YOUR THOUGHTS & COMMENTS

Please enter your comment!
Please enter your name here