Power Failure Indicator in NRF24LE1
Nowadays most of our devices are portable and run on batteries. We often do not know when the battery is about to get discharged. Many systems have the battery voltage display to indicate the battery voltage but what if we don’t have the display in our system. In such a case, using a small LED to indicate low battery is very helpful for users to know about the battery status.
In this article, we are going to discuss a very important feature of NR24LE1 which enables power failure indicator.
The NRF module comes with an inbuilt comparator known as Power-Failure (POF) Comparator. This comparator gives the MCU (Microcontroller Unit) an early warning of power failure. The comparator compares VDD (Supply voltage) and threshold voltage. It gives a warning when the VDD voltage falls below a threshold level. We know that the threshold level is a voltage level that can be set by user as per requirement. There are four threshold levels offered by NRF module: 2.1, 2.3, 2.4 and 2.5V.
The register through which we can access the functionality is POFCON (Power Failure Control) register. It’s an 8-bit register. Functions of various bits of the register are given below :
• Bit 7 – enable/disable POF comparator. 0:disable, 1:enable
• Bit 6:5 – set threshold level. 00 : 2.1V, 01 : 2.3V, 10 : 2.5V, 11 : 2.7V
• Bit 4 – warning. 0 : VDD above threshold, 1: VDD below threshold
• Bit 3:0 – not used
For using POF comparator we have to enable it by writing 1 at 7th bit of POFCON register. After enabling the comparator, we have to choose our desired threshold level from different threshold level and write bit6:5 accordingly. When we have enabled the POF and set our desired threshold level, we can check the warning of power failure indicated by bit4 of the POFCON.
To enable the POF
To set threshold level:2.1V, 2.3V, 2.5V, or 2.7V
To check POF warning
0 – No warning1 - Warning
Check out the code to understand how to do the programming for this feature. The code has been commented for a clearer understanding.
Another great feature that comes with NRF is Brown Out Reset. This feature puts the microcontroller in reset state whenever VDD falls below BOR threshold level. The BOR threshold level is 1.7V. The MCU again becomes operational whenever the VDD gets above 1.77V.
The module seems to be an amazing module with so many features. We are really enjoying our work on the module. Do let us know what you make using the module and share your project with us in the comments below.