Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
B

brolly759

@brolly759
About
Posts
53
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Low Power: How much current? [Solved]
    B brolly759

    OK I am going to join the party as this is exactly what I have been testing this past week. I have a uCurrent Gold and running on an 8Mhz 3.3v Nano Pro from this site:

    https://www.sparkfun.com/products/11114

    I have un-soldered the smt jumper to bypass all voltage regulating and running off of 2 AA Batteries.

    I am using the BinarySwitchSleepSensor sketch from the MySensors library. This uses pin 2/3 as an interrupt and sleeps until a pin hits GND. It wakes up, sends the new state, and goes back to sleep. The sketch also makes pin 2/3 high and uses the internal pull-up resistor.

    Originally I was getting 23-24uA in sleep mode when GND was not connected to pin 2/3. 117uA when GND was connected to pin 2/3. We will refer to this as open and closed pin state.

    Here is my methods:
    I downgraded my version of Arduino IDE to 1.0.6 from the latest build 1.6.5 and here are my new numbers:

    2.5-2.7uA sleep mode - Open pin state
    98-100uA sleep mode - Closed pin state

    Then I deleted from the sketch the digitalWrite on pin 2/3 and used an external resistor thanks to the advice from AWI. I plugged in an 10M Resistor to pin 2 to VCC and GND was the switch. Here are my new numbers:

    2.5-2.7uA sleep mode - Open pin state
    3.1-3.2uA sleep mode - Closed pin state

    So far today I have not gotten any false positives in my setup which is freaking amazing.

    Now I used a quick sketch "DallasTemperatureSensor" from the MySensors library to test what my current would be in sleep mode with a watchdog timer. I did NOT connect a temp sensor but my sleep current is: 7.6uA - 7.8uA.

    I hope this helps and if you need any testing let me know.

    I have a post on the Arduino forums here:
    http://forum.arduino.cc/index.php?topic=341958.msg2360300#msg2360300

    You can see me talking to the guy who actually wrote up the gammon website and you can ask him things directly if you ever wanted too. Very helpful guy!

    Hardware

  • Low Power: How much current? [Solved]
    B brolly759

    So an update, you can find all the sleep functions in the MySensor.cpp file.

    Hardware

  • Low Power: How much current? [Solved]
    B brolly759

    YESSSSSSSSSSSSSSS!!!!! I got sleep down to 1.5ua - 1.6uA with NO hardware changes!!!!! WOOOT sorry, kinda excited here lol

    Hardware

  • Low Power: How much current? [Solved]
    B brolly759

    Okay, so originally I was getting 2.7-2.9uA with Arduino/NRF. Stock MySensors library and Arduino 1.0.6 IDE. ( I am using the BinarySwitchSleep Sketch from MySensors lib)

    To get even lower power.... If you open up mysensors.cpp the sleep function is there. For the BinarySwitchSleep sketch you are looking for this sleep function as there are a few:

    You want to add this:

    SPI.end();	
    	for (byte i = 9; i <= 13; i++)
        {
        pinMode (i, OUTPUT);    
        digitalWrite (i, LOW); 
        }  // end of for loop
    

    to this:

    bool MySensor::sleep(uint8_t interrupt, uint8_t mode, unsigned long ms) {
    	// Let serial prints finish (debug, log etc)
    	bool pinTriggeredWakeup = true;
    	Serial.flush();
    	RF24::powerDown();
    	attachInterrupt(interrupt, wakeUp, mode);
    	if (ms>0) {
    		pinIntTrigger = 0;
    		sleep(ms);
    		if (0 == pinIntTrigger) {
    			pinTriggeredWakeup = false;
    		}
    	} else {
    		Serial.flush();		
    		LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
    	}
    	detachInterrupt(interrupt);
    	return pinTriggeredWakeup;
    }
    

    and it will look like this:

    bool MySensor::sleep(uint8_t interrupt, uint8_t mode, unsigned long ms) {
    	// Let serial prints finish (debug, log etc)
    	bool pinTriggeredWakeup = true;
    	Serial.flush();
    	RF24::powerDown();
    	attachInterrupt(interrupt, wakeUp, mode);
    	
    	SPI.end();
    	
    	for (byte i = 9; i <= 13; i++)
        {
        pinMode (i, OUTPUT);    
        digitalWrite (i, LOW); 
        }  // end of for loop
    
    	if (ms>0) {
    		pinIntTrigger = 0;
    		sleep(ms);
    		if (0 == pinIntTrigger) {
    			pinTriggeredWakeup = false;
    		}
    	} else {
    		Serial.flush();		
    		LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
    	}
    	detachInterrupt(interrupt);
    	return pinTriggeredWakeup;
    }
    

    Because you are shutting off and turning all pins low, you will need to add this to the beginning of your program loop to reinitialize the NRF:

    void loop() 
    {  
      sensor_node.begin();
    

    If you add just the SPI.end(); your current will be 2uA.
    If you add both SPI.end(); and LOW pin loop, your current will be 1.5uA

    Hardware
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular