Low Power: How much current? [Solved]
-
OKAY so... more numbers to play with... This is Arduino turning on/off NRF using an output pin.
-
Connect Pin4 to VCC on NRF
-
Add SPI.end(); and for();loop to include Pin 4 to turn LOW in sleep function
Add this code in define area:
#define WIRELESS_POWER 4Add this code in loop():
void loop() { digitalWrite(WIRELESS_POWER, HIGH); delay(5); sensor_node.begin();Sleep current oState: .5uA - .6uA
Sleep current cState: .8uA - .9uA@scalz Yes all my testing is on "binaryswitchsensor" sketch. I use the "DallasTempSensor" sketch when I want to test sleep() with a timer. There are SO MANY things you can do with a simple reed switch sensor. Doors, locks, windows, mailbox, fridge, cabinets, drawers... pretty much anything that moves and goes back in a certain place can be used with the "binaryswitchsensor".
-
-
@brolly759 When taking your measurements, were you using the current version of the MySensors library (v1.5) or a different one? Are all your other libraries the most up-to-date versions?
You used a Nano Pro, which I don't have. When the red Mini Pro's from Amazon arrive sometime later today, I'll try them.
Unless someone knows of a reason for the different results relating to different IDE versions, I think I will approach this by calling the underlying libraries directly, rather than through MySensors's abstraction layer. That way, if I don't encounter the differences, we'll know that it's a MySensors issue. For example, perhaps something you're setting is being undone by MySensors part way through the process of powering down, or something like that.
-
@brolly759 : I am happy for you. I was thinking that you were trying to make a sensor node (not only for binaryswitch). I agree with you for binaryswitch.. I think how you do is right for this purpose. cool. just one thing is with time, your coin cell will not provide full 3v for radio power transmission but it's another story.
See you soon.
-
@NeverDie Good catch, I just checked the version.h file. v1.4.1
#define LIBRARY_VERSION "1.4.1"In the utilities folder in MySensors library, all the files like RF24.h, LowPower.h are provided by the MySensors library. So I am assuming they were up to date when the MySensors library was created.
@scalz Even though its not full 3.3v it should be fine. The power range for NRF is 1.9v - 3.6v
My next project is to figure out battery monitoring as low as possible. ;) I know there are 2 ways, internal 1.1v reference or voltage divider. Can I do a voltage divider on an output pin and shut the output pin off when not using it?
-
@brolly759 : I am happy for you. I was thinking that you were trying to make a sensor node (not only for binaryswitch). I agree with you for binaryswitch.. I think how you do is right for this purpose. cool. just one thing is with time, your coin cell will not provide full 3v for radio power transmission but it's another story.
See you soon.
@scalz said:
@brolly759 : I am happy for you. I was thinking that you were trying to make a sensor node (not only for binaryswitch). I agree with you for binaryswitch.. I think how you do is right for this purpose. cool. just one thing is with time, your coin cell will not provide full 3v for radio power transmission but it's another story.
See you soon.
Actually, your point regarding the coincell not providing full power could be relevant to the measurements (not saying it is in brolly759's case, but I definitely have seen it myself happen with a coincell powered arduino using the NRF24L01+): in cases where the coincell is low, doing a transmission can (because of internal resistance and the much higher current) can cause NRF voltage to drop below threshold, thereby shutting off the radio (not just sleeping it), which would obviously throw off the current measurement. Definitely something to be aware of.
-
This is so frustrating, you know that?
So I reseated my cables to make sure I am getting the best connection. Now my current is the last configuration is:
sleep current oState: ~105nA
sleep current cState: ~457nA@NeverDie my 2 AA battery setup right now are @ 3.452v
-
I recommend you don't use a coincell while testing. Use a big enough battery so that you won't be getting flakey results.
-
This is so frustrating, you know that?
So I reseated my cables to make sure I am getting the best connection. Now my current is the last configuration is:
sleep current oState: ~105nA
sleep current cState: ~457nA@NeverDie my 2 AA battery setup right now are @ 3.452v
@brolly759 said:
This is so frustrating, you know that?
So I reseated my cables to make sure I am getting the best connection. Now my current is the last configuration is:
sleep current oState: ~105nA
sleep current cState: ~457nA@NeverDie my 2 AA battery setup right now are @ 3.452v
In a way this might be good news. Perhaps something similar was causing the difference in your earlier measurements and not the different IDE versions?
I've had similar happen to me. Epecially because of plugging/un-plugging arduino's to modify programming jostles the wires or otherwise loosens connections, and then suddenly your measurements change for no apparent reason. Sometimes it can takes a while to figure out that's what's happening.
The NRF24L01+ is well known to be very sensitive to loose connections--a lot more than other radios. If you can solder your connections, definitely do!
In fact, it's so sensitive that even just running your supply and ground lines to the NRF close to the data lines can cause serious problems as well! Keep them as far aspart as you can. It's an unusually touchy radio.
-
I just upgraded to Arduino IDE 1.6.5:
Board: "Arduino Pro or Pro Mini"
Processor: "Atmega328 (3.3V, 8MHz)Sleep current: 19uA.
Using previous IDE I was @ 100nA.
Here is the sketch I am using:
#include <MySensor.h> #include <SPI.h> #define SKETCH_NAME "Binary Sensor" #define SKETCH_MAJOR_VER "1" #define SKETCH_MINOR_VER "0" #define PRIMARY_CHILD_ID 3 #define SECONDARY_CHILD_ID 4 #define PRIMARY_BUTTON_PIN 2 // Arduino Digital I/O pin for button/reed switch #define WIRELESS_POWER 4 MySensor sensor_node; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED); void setup() { pinMode(WIRELESS_POWER, OUTPUT); digitalWrite(WIRELESS_POWER, HIGH); sensor_node.begin(); pinMode(PRIMARY_BUTTON_PIN, INPUT); // Send the sketch version information to the gateway and Controller sensor_node.sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER"."SKETCH_MINOR_VER); // Register binary input sensor to sensor_node (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. sensor_node.present(PRIMARY_CHILD_ID, S_DOOR); } void loop() { digitalWrite(WIRELESS_POWER, HIGH); delay(5); sensor_node.begin(); uint8_t value; static uint8_t sentValue=2; sensor_node.sleep(5); value = digitalRead(PRIMARY_BUTTON_PIN); if (value != sentValue) { // Value has changed from last transmission, send the updated value sensor_node.send(msg.set(value==HIGH ? 1: 0)); sentValue = value; } sensor_node.sleep(PRIMARY_BUTTON_PIN-2, CHANGE, 0); } -
I hope I won't see this difference too when I will retry with 1.6.5 (I tried with 1.6.0, and it was with Mysensors 1.4). otherwise I will move to Atmel studio...
-
I hope I won't see this difference too when I will retry with 1.6.5 (I tried with 1.6.0, and it was with Mysensors 1.4). otherwise I will move to Atmel studio...
@scalz said:
I hope I won't see this difference too when I will retry with 1.6.5 (I tried with 1.6.0, and it was with Mysensors 1.4). otherwise I will move to Atmel studio...
@scalz Can you retry with both IDE 1.6.5 and MySensors v1.5 fairly soon? Of course, as you've explained, I realize you have other commitments.... It just would help a lot if we're all on the same page.
-
I am using v1.6.5. I burned the bootloader for Pro Mini, still no change.
Sleep mode: 17.9uAFYI, when upgrading from v1.4 to v1.5 of MySensors lib, DO NOT overwrite all the files, Delete the folder, add the new v1.5 I had a lot of errors just now
I switched to v1.5 with v1.6.5 and I am getting 2uA in oState now. Now I am trying to play with the new sleep settings. will give an update soon.
-
The new sleep library is all over the place and I cannot make heads or tails of it.
I am using IDE 1.6.5 and MySensors v1.5 and I am getting 2uA in sleep mode with my modified BinarySensorSwitch sketch.
I want to be able to shutdown the radio pin and LOW all the pins but I don't know where to add it. Anywhere I add, the radio stays high forever basically. Any idea's?
-
Notionally, I should think it would fit well as a subclass of the RF24's powerDown method.
-
The new sleep library is all over the place and I cannot make heads or tails of it.
I am using IDE 1.6.5 and MySensors v1.5 and I am getting 2uA in sleep mode with my modified BinarySensorSwitch sketch.
I want to be able to shutdown the radio pin and LOW all the pins but I don't know where to add it. Anywhere I add, the radio stays high forever basically. Any idea's?
@brolly759 said:
I am using IDE 1.6.5 and MySensors v1.5 and I am getting 2uA in sleep mode with my modified BinarySensorSwitch sketch.
I want to be able to shutdown the radio pin and LOW all the pins but I don't know where to add it. Anywhere I add, the radio stays high forever basically. Any idea's?
Does your wiring change at all when you switch from the first scenario to the second? I'm guessing that in the first scenario you're powering the radio through vcc, but in the second you're powering it through a pin (what you're calling the "radio pin" and which you intend to set LOW in order to turn-off the NRF rather than "power down" sleep it). Is that right?