Hello,
I am installing a remote sensor array on an existing weather monitoring station. Thanks to the help of forum members here (Whandall and Robin2), data transmission using nRF24L01 radios is working well.
Since the remote arrays will be solar powered, and because the data requests from the master will occur at very regular and predictable intervals (1 minute), it seemed to make sense to keep the nRF radios in powerDown mode for about 55 seconds of each minute in order to conserve power. But there is a problem.
The measured power consumption of the Arudino Nano controller plus nRF in normal listening mode is about 65 mA. In response to a powerDown code instruction, the power drops by about 10 mA. BUT -- there is no response to powerUp instructions and the radio remains unresponsive.
Code (to simply power the radio up and down repeatedly, at 3 sec intervals):
/*power up-down debugging*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
bool radio_on = true;
const byte thisSlaveAddress[5] = {'R', 'x', 'A', 'A', 'A'};
char payload = 'A';
unsigned long interval_start = millis();
unsigned long led_start;
RF24 radio(9, 10); //CE and CSN, respectively
void setup() {
pinMode(3, OUTPUT); //for LED indicator
radio.begin(); // set up radio in standard listening mode
radio.setDataRate( RF24_250KBPS );
radio.openReadingPipe(1, thisSlaveAddress);
radio.enableAckPayload();
radio.startListening();
radio.writeAckPayload(1, &payload, sizeof(payload)); // pre-load data
}
void loop() {
if (millis() - interval_start > 3000) {
if (radio_on) {
radio.powerDown();
digitalWrite(3, HIGH); //flash an led at each state change
led_start=millis();
radio_on = false;
} else {
radio.powerUp();
digitalWrite(3, HIGH);
led_start = millis();
radio_on = true;
}
interval_start = millis();
}
if (millis() - led_start > 50) {
digitalWrite(3, LOW);
}
}
Observation:
On startup, current draw is at 65 mA for 3 sec. The LED then flashes and current drops to 55 mA. Subsequently, the LED flashes every 3 sec, but the current remains at 55 mA. Also, the CE pin starts out high, drops low after 3 sec, and never goes high again.
I can look at register values or try pushing CE back high with a manual digitalWrite instruction, but wanted to see if anyone else has experience with this. (Also, tinkering is very unpleasant right now due to frigid temps...)
Thanks,
Steve