Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. brolly759
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by brolly759

    • RE: Low Power: How much current? [Solved]

      @NeverDie I never had issues with Gammon's code on v1.6.5 . I had issues with the mysensors v1.4 library with v1.6.5 of Arduino IDE. My power problems went away when I switched to v1.5 of mysensors library. I have stopped troubleshooting for now as I am slightly burnt out but my last test on v.1.6.5 with v1.5 MySensors gave me strange results sometimes. If I edited any files in the sleep mode functions I would not be able to go back to sleep. I was draw a constant ~3mA.

      Congrats though and welcome to the club. I think I am going to just combine nRF Mesh + gammon's code to make my own mesh network setup. (When I actually know programming) 😉

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      No idea why but every so often I have to uninstall Arduino, delete the libraries and basically start over. Getting frustrating and I might go back to 1.0.5 + v1.4 lib.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Correct, I was able to use radio pin to shut it off (pin 4) manually in v1.4 library. I cant inject the code in v1.5. If I can put the code in the sleep function somewhere, it is not easy to find anymore.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]
      void RF24::powerDown(void)
      {
        ce(LOW); // Guarantee CE is low on powerDown
        write_register(CONFIG,read_register(CONFIG) & ~_BV(PWR_UP));
        digitalWrite(4, LOW);
      

      No matter where I put it... the NRF will not fall back asleep. It stays @ 4mA

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      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?

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      I am using v1.6.5. I burned the bootloader for Pro Mini, still no change.
      Sleep mode: 17.9uA

      FYI, 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.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      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);
      } 
      
      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      @NeverDie my 2 AA battery setup right now are @ 3.452v

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      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

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      @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?

      posted in Hardware
      brolly759
      brolly759
    • RE: 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 4
      

      Add 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".

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      GOOD MORNING crazy tinkerer's. Okay here we go again, I am actually going to need someone to verify what I am looking at here, nA and uA are giving me different readings:

      Running the "for(); loop" in sleep() function with NRF VCC UNPLUGGED
      Sleep current: .8uA - .9uA OR 273nA

      Running the "for(); loop" in sleep() function with NRF VCC UNPLUGGED
      Sleep current: .6uA - .9uA OR 114nA

      @scalz I was powering the NRF directly from VCC. I will play around with connecting it directly to a pinOut on Arduino

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      @Sparkman said:

      @brolly759 That's a different issue altogether. It's related to measuring battery voltage...

      Cheers
      Al

      tlund posted 2 months ago reply quote 0
      @tbowmo

      My NRF's are the same $1 nrf's listed in the mysensors store, so probably fake. But I have still measured them to draw ~900nA in powerDown.

      But I think I have found the culprint now. It seems the extra 20uA is caused by Arduino 1.6.5 (it may be that my installation is faulty).

      My test setup:

      pro mini
      nrf
      a simple sketch that does gw.sleep(60s)
      1st test: sketch compiled & uploaded via Arduino 1.0.5-r2: 6uA
      2nd test: sketch compiled & uploaded via Arduino 1.6.5: 24uA

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Someone else complained about the exact same issue here:
      http://forum.mysensors.org/topic/1345/sensebender-micro/250

      posted in Hardware
      brolly759
      brolly759
    • RE: Pro Micro Hookup and Code

      Why dont you burn the bootloader using an Uno onto the nano? That way you can make sure its not a bootloader issue

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Running Arduino+NRF24l01 w/ interrupt consuming 1.5uA in sleep

      I am using this Arduino Nano Pro 8mhz 3.3v :link text
      I am using this NRF chip: link text

      Here is my test environment:

      • Arduino Nano with desoldered jumper for bypassing voltage regulation (If you dont have bypass jumper on the knock off Nano, look at this post: link text )
      • NRF connected via pinout on MySensors guide
      • 3V direct supply from 2 AA Batteries
      • uCurrent Gold testing voltage current
      • Fluke 179 reading in mV
      • Using the BinarySwitchSensor sketch in the MySensors library

      If I upload the sketch as is with the recommended setup guide, Pin 2 or 3 is an interrupt pin and that goes to GND and acts as a switch. Pin 2/3 is HIGH and uses the internal pull up resistor. We will refer to the 2 different states of the switch as follows:

      "oState" (Open, when Pin 2/3 does NOT touch GND)
      "cState" (Closed, when Pin 2/3 touches GND)

      When running everything I get these sleep numbers:
      oState: 23-24uA
      cState: 117uA

      I downgraded my Arduino IDE from 1.6.5 to 1.0.6 and here are my new numbers:
      oState: 2.5-2.7uA
      cState: 98-100uA

      Everything is looking good but my cState is still too high for any battery applications that I am trying to get.

      Removed digitalWrite on pin 2/3. Connected 10M resistor from pin 2 to VCC. GND is switch to pin 2.
      oState: 2.5-2.7uA
      cState: 3.1-3.2uA

      Reference measurements:

      At this point I ran the "DallasTemperatureSensor" to test current using the WDT, I did NOT connect Temp sensor
      Sleep current with WDT enabled @ 30 seconds: 7.6-7.8uA

      Using "BinarySwitchSensor", remove NRF completely and only have Arduino:
      Sleep current: 110-120nA OR .4-.5uA (had issues reading this but I believe it is the nA)

      Connecting VCC/GND only to NRF to read standalone current:
      NRF only: 800-900nA Shutdown current

      Useless numbers while running the BinarySwitchSleepSensor sketch:
      Sleep current: 2.7-2.9uA with NRF/Arduino fully connected
      Sleep current with nRF GND disconnected: 1.7uA
      Sleep current with nRF VCC and GND disconnected: 294nA
      Sleep current with nRF VCC/GND/Pin9 disconnected: 281nA
      Sleep current with nRF VCC/GND/P9/P10 disconnected: 196nA
      Sleep current with nRF VCC/GND/P9/P10/P11/P12/P13 disconnected: 110-112nA
      Sleep mode with ONLY Arduino: 110-112nA
      NRF plugged into VCC/GND only: 800-900nA

      At this point we are 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....

      Open up mysensors.cpp with NotePad++ application
      Look for this code:

      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;
      }
      

      We are going to add this code:

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

      The final code should 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;
      }
      

      IMPORTANT: Because you are ending SPI, you will need to call the sensor at the beginning of your loop to reinitialize the NRF

      void loop() 
      {  
        sensor_node.begin();
      

      Adding both SPI.end(); and for(); loop:
      Sleep current: 1.5uA

      If you add just the SPI.end();
      Sleep current: 2uA

      If you just add the for(); loop:
      Sleep current: 1.9uA - 2.2uA

      • If you are using ONLY the "for(); loop", you do NOT need to reinitialize the radio when you come out of sleep. I have noticed a much longer up time when having to reinitialize.

      OTHER MEASUREMENTS using the DallasTemperatureSensor with WDT at 30 seconds, no sensor connected:

      Edited Sleep with for(); loop:
      Sleep current: 6.4-6.5uA

      Edited Sleep with for(); loop AND SPI.end();:
      Sleep current: (Could not get SPI.end(); to work on sleep(w/WDT))

      Quick comment: There are a few sleep options in the MySensors.cpp Depending on which one you are calling will depend on which one you need to edit. Here are some examples of the sleep functions in the .cpp file:

      void MySensor::sleep(unsigned long ms)
      
      bool MySensor::sleep(uint8_t interrupt, uint8_t mode, unsigned long ms)
      
      int8_t MySensor::sleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mode2, unsigned long ms)
      
      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      I keep watching you edit your post, its freakin me out! lol

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      I have an O-scope just dont know how to use it completely lol. Leaving work now. Stayed extra 2 hours to play with power settings lol

      @NeverDie did you still need me to write up what I did or you followed it pretty much?

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Some more facts here:

      If you ONLY do the for/loop to shut off PIN9-13 in the sleep function and do NOT shut off SPI... you do NOT need to reinitialize the radio on wake-up.

      The current draw for For/Loop LOW w/o shutting off SPI is 2.1uA-2.2uA.

      This is a good and bad. If you have a sensor that is going to be switched on and off a lot, the re initialization time is noticeable on a fluke meter. You can see it staying high much longer. So, if someone knows how long it takes to initialize, then we can determine if shutting off SPI is worth it. ~600nA savings vs high reconnect time.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      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

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

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

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

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

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      @NeverDie I will rewrite everything up again. The numbers I posted about was me just unplugging wires and seeing what my current draw was.... haha the link is where my dual post is located where I am talking to Gammon about this problem 🙂

      @everyone So Gammon said this about our problem:

      "I am guessing you are parasitically powering the NRF. Before sleeping make sure you set the connections to it to high-impedance. For example, SPI.end() followed by making sure the SPI (and other two) pins are inputs (or maybe outputs and LOW). For example, a snippet from my code with that gadget:"

       bool ok = radio.write (&reading, sizeof reading);
        radio.startListening ();
        radio.powerDown ();
        SPI.end ();
        // set pins to OUTPUT and LOW  
        for (byte i = 9; i <= 13; i++)
          {
          pinMode (i, OUTPUT);    
          digitalWrite (i, LOW); 
          }  // end of for loop
        ADCSRA = 0;  // disable ADC
        power_all_disable();
      

      I am looking in the library to see if we do SPI.end() before sleep but cant find anything...

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Lets put this all in perspective. a CR2025 coin cell is 165mAh.

      If we are sleeping forever @ 6uA that means the circuit will last for: 27,500 hours or 1,145 days. The question I guess we need to figure out is what is "good enough" for coin cell applications?

      My goal is to figure out a way to sink the total circuit to around 1uA. That should be possible if Arduino is 100nA and NRF is 800-900nA.

      So why does the NRF draw so much current when connected to Arduino? I know its been touched on already but is there a cleaner way in software without adding mosfets or extra hardware to have the NRF in sleep mode but not drawing any current from Arduino?

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      If you dont mind me asking a stupid question, how would you disable the pins going to the NRF. Wouldn't, I need to reinitialize the radio every time on wake up?

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      I'm back!!
      NeverDie, how could you butcher my username!?

      Some fun facts for everyone.

      When I am running the BinarySwitchSleepSensor sketch:

      Sleep current: 2.7-2.9uA with NRF/Arduino fully connected
      Sleep current with nRF GND disconnected: 1.7uA
      Sleep current with nRF VCC and GND disconnected: 294nA
      Sleep current with nRF VCC/GND/Pin9 disconnected: 281nA
      Sleep current with nRF VCC/GND/P9/P10 disconnected: 196nA
      Sleep current with nRF VCC/GND/P9/P10/P11/P12/P13 disconnected: 110-112nA

      Sleep mode with ONLY Arduino: 110-112nA
      NRF plugged into VCC/GND only: 800-900nA

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      I am digging around and looking at the code, I think it just cycles through 8 second batches.

      We have an unsigned long, so thats 4,294,967,295 ms = 4294967.295 seconds = 71582.78825 minutes = 1193.046470833333 hours = 49.71026961805556 days.

      So IF there is not a cap on the max duration of sleep in the Mysensors library, you can theoretically go to sleep for the max duration of the unsigned long which is about 49 ish days...

      posted in Hardware
      brolly759
      brolly759
    • RE: How low can arduino can go?

      This is an old thread but Tibus, the problem I had was exactly yours with 26uA. I had to downgrade my Arduino software to 1.0.6 . Then I got normal numbers 3uA.

      posted in Troubleshooting
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      You may want to check how the mySensors library actually works. I barely know hardware and coding, I scrape by... lol but in all the sensor examples you have this code:

      unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
      
      gw.sleep(SLEEP_TIME);
      

      That is a 30 second duration for sleep. I haven't tried to increase that time yet but maybe they are looping through the 8 second limit? Dunno. Worth to check though how they do it.

      My issue is that this sleep method uses 7.6-7.8uA. It would be nice to have it at like < 3uA.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Look at this one:
      http://ambiqmicro.com/am18xx-ultra-low-power-rtc

      14nA !!!! haha

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      @NeverDie Trust me, there is never the perfect option... every time you think you have the right part and use it, another one that is better comes out... cant work fast enough anymore lol

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      We really need a separate section just on power consumption, what each person gets per each configuration and instructions lol.

      I have never played with the Chronodot or any time stamp stuff. Is is easy to program?

      It does make sense to remove the watchdog timer: 7uA current with this but, who wants to do the math? What is the rise/fall time of the Chronodot? Depending on the duration of the rise time and frequency of waking up the arduino, we may not be saving much power. (Algebra was never my strong suite. Never went to college lol)

      On a side note, I am working with Gammon on figuring out why the nRF takes so much power: 2.4uA in sleep mode. Though I don't have any hardware at home so we must wait until tomorrow for that. In theory Arduino = 100+- nA + 800-900nA(NRF) = 1uA in sleep mode with an interrupt. That is what we all need to be aiming for, or at least I am.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      This is testing using the Binary Switch Sleep sketch.

      The switch is not active when its in its "open state" so there is no drain. I removed the resistor though and all the jumpes, I am still getting around 2.7-2.8uA is sleep mode without switch.

      In sleep mode with the NRF ONLY VCC unplugged I am getting 1.3uA - 1.5uA.

      In sleep mode with ALL cables unplugged from NRF I am getting a strange reading and not really sure which one is accurate but here are my numbers:
      With uCurrent in uA mode I am getting .4uA -.5uA
      With uCurrent in nA mode I am getting 110-120nA

      I checked on Gammon site using the reference code, the nA of 110-120nA is accurate and the uA mode is wrong when I go down that low. So in short, I am getting 110-120nA when nRF is unplugged completely.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      Dont forget to check the Atmega chip. There is Atmega328 and 328P versions. You need the "P" As that is designed to be power efficient.

      Here is some more info on that:
      link text

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      I think at one time, the pro mini did not have the power jumper and china copies the boards and resells them. They probably never refreshed the product line. Here is an article in 2013 of someone trying to do low power on the boards that you are referring too:

      link text

      Here is the trace you need to cut to bypass all the voltage regulation crap:
      link text

      If you have one of the cheap boards, I would cut the PCB trace first and retest before buying new stuff. Let me know what happens.

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power: How much current? [Solved]

      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!

      posted in Hardware
      brolly759
      brolly759
    • RE: Low Power shutdown mode?

      SO an update, I connected a 10Mohm Resistor and my current draw is only 3.1-3.2uA when the switch is engaged and 2.7-2.8uA when the switch is removed. I think that is really livable numbers. So far not getting any false positives which is great. 🙂

      posted in Development
      brolly759
      brolly759
    • RE: Low Power shutdown mode?

      @AWI

      So Pin 2 -> 1Mohm Resistor -> VCC
      and GND is the switch to Pin 2 ?

      Is that a minimum current the Arduino needs to read a state change?

      posted in Development
      brolly759
      brolly759
    • RE: Low Power shutdown mode?

      I did increase the value of the resistance by 60K and 100K externally, both those values dropped the current consumption but my problem was that there was not enough to power to have the Arduino read that the switch was working. So I was getting nothing basically. I put the resistor in line between the switch. Even when I had that amount of Resistance used I was still drawing 34uA or greater, still above what I am trying to get.

      posted in Development
      brolly759
      brolly759
    • RE: Low Power shutdown mode?

      Hate to act like the idiot here but can you explain what I should do? lol

      posted in Development
      brolly759
      brolly759
    • RE: Low Power shutdown mode?

      Here is information pertaining to interrupts and Arduino:
      http://playground.arduino.cc/Code/Interrupts

      Here is the code from the library:

      #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 SECONDARY_BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch
      
      #if (PRIMARY_BUTTON_PIN < 2 || PRIMARY_BUTTON_PIN > 3)
      #error PRIMARY_BUTTON_PIN must be either 2 or 3 for interrupts to work
      #endif
      #if (SECONDARY_BUTTON_PIN < 2 || SECONDARY_BUTTON_PIN > 3)
      #error SECONDARY_BUTTON_PIN must be either 2 or 3 for interrupts to work
      #endif
      #if (PRIMARY_BUTTON_PIN == SECONDARY_BUTTON_PIN)
      #error PRIMARY_BUTTON_PIN and BUTTON_PIN2 cannot be the same
      #endif
      #if (PRIMARY_CHILD_ID == SECONDARY_CHILD_ID)
      #error PRIMARY_CHILD_ID and SECONDARY_CHILD_ID cannot be the same
      #endif
       
      MySensor sensor_node;
      
      // Change to V_LIGHT if you use S_LIGHT in presentation below
      MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED);
      MyMessage msg2(SECONDARY_CHILD_ID, V_TRIPPED);
      
      void setup()  
      {  
        sensor_node.begin();
      
        // Setup the buttons
        pinMode(PRIMARY_BUTTON_PIN, INPUT);
        pinMode(SECONDARY_BUTTON_PIN, INPUT);
      
        // Activate internal pull-ups
        digitalWrite(PRIMARY_BUTTON_PIN, HIGH);
        digitalWrite(SECONDARY_BUTTON_PIN, HIGH);
        
        // 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);  
        sensor_node.present(SECONDARY_CHILD_ID, S_DOOR);  
      }
      
      // Loop will iterate on changes on the BUTTON_PINs
      void loop() 
      {
        uint8_t value;
        static uint8_t sentValue=2;
        static uint8_t sentValue2=2;
      
        // Short delay to allow buttons to properly settle
        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;
        }
      
        value = digitalRead(SECONDARY_BUTTON_PIN);
        
        if (value != sentValue2) {
           // Value has changed from last transmission, send the updated value
           sensor_node.send(msg2.set(value==HIGH ? 1 : 0));
           sentValue2 = value;
        }
      
        // Sleep until something happens with the sensor
        sensor_node.sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, 0);
      } ```
      posted in Development
      brolly759
      brolly759
    • RE: Low Power shutdown mode?

      Okay, some more news on my front. I downgraded from the latest build of Arduino to 1.0.6 and now here are my numbers for BinarySwitchSleepSensor sketch:

      Sleep mode w/o switch engaged: 2.5uA !!!!!!
      Sleep mode w switch engaged: 98-100uA.

      Now I need to find a way to have the switch engaged use very little current. Any idea's?

      posted in Development
      brolly759
      brolly759
    • RE: **Unnamed Project** USB Hub stick

      @Anticimex Yes I meant the atsha204a. Typing too fast while I am at work 🙂

      @hek welcome to the discussion! OSH would require me to source all files I am assuming. What other alternatives are there besides OSH. Obviously these business discussions can be discussed in private 😉

      posted in Hardware
      brolly759
      brolly759
    • RE: **Unnamed Project** USB Hub stick

      I added the 256 encryption on A3 using the SOT23 package.

      @Anticimex the "daughterboard" is only to add extra sensors? What I am building was supposed to be a limited hardware but still expandable "sensor kit" that's main focus on pre-programming, low power, small size and snap in place ease. I guess you could have 2 product lines... Polished all set hardware and just program and set in place or a tinkerer set. Wonder what could sell better on kickstarter 😉

      posted in Hardware
      brolly759
      brolly759
    • Low Power shutdown mode?

      I am using the BinarySwitchSleepSensor sketch. It uses a pin interrupt on pin 2/3 connected GND to switch. When the switch is not engaged I am getting 23-24uA. When the switch is engaged I am drawing 117uA.

      How can I reduce these numbers even further? I know there is a powerdown/shutdown mode(Cant find how to do it) and maybe adding external resistors to lower the current draw but what does everyone else recommend?

      posted in Development
      brolly759
      brolly759
    • RE: **Unnamed Project** USB Hub stick

      @Anticimex I have used this connector before, you have examples of this on ribbon cables on iphone cell phones. They are pretty simple, I even have it omni directional so you can plug a "sensor board' in either direction. Its really just a difference of opinion and no one is right or wrong. My assumption is, if you can handle a soldering iron, you can plug in this type of connector. I have exposed every pin on the standard 100mil pitch on the Hub on the edges like the Nano board if someone wants to be creative.

      I look at it this way. The hardware is all set for you. If you want to tinker, go for it but you don't need to. You can have a shelf ready product that you program and not worry about all the hardware configurations because its already assembled for you. Though there are exposed pins if needed. Keep it small, simple, battery powered and awesome!

      posted in Hardware
      brolly759
      brolly759
    • RE: **Unnamed Project** USB Hub stick

      Anticimex, I am reading the MYSX connector. Each revision looks like it adds more pins? I dont like this MYSX connector because of the footprint it uses. Here is the connector I am using:product

      tbowmo, I was reading a thread on this last night, the new model is now atsha204a I believe. It does not have it currently but I can add it in there. I need to check what the specs are on the power consumption. At the moment my prototype sensorboard is at 20-24uA in sleep mode using the switch sketch with sleep. Though I am trying to figure out how to put it in shutdown mode rather than sleep... (If you know how please tell me haha) The hub doesn't matter on power usage as its always plugged in. You can also use this as a router and plug it in directly to a usb wall charger as well which is cool.

      On a side note, the Sensor board will have these sensors plugged in and you specify in programming which output pin to turn on to power the sensors:

      -Temp/humidity
      -Barometer/pressure sensor
      -Reed Switch
      -Light Sensor
      -XYZ sensor(accelerometer)
      -port to plug in any type of switch you want ( I was going to add mercury/tilt ball switch but in real use applications I have gotten so many false positives that I decided not to use it.

      posted in Hardware
      brolly759
      brolly759
    • **Unnamed Project** USB Hub stick

      Good evening everyone! So as a disclaimer prior to reading the post, this is a product I am building and briefly mentioned to the admin's. I am not selling it yet but would do so as an affiliate of MySensors in the future. This is just an introduction and asking questions/idea's of what the community thinks/likes/dislikes.

      This is a USB stick that has the FTDI, Arduino, NRF all in a single flash drive size package.
      USB Stick.png

      There is also a special 20 pin connector in the center to allow programming an external sensor node that I will develop next. There is a switch that allows programming between the "USB Stick" and the "Sensor board" (Depending on what you want to burn sketches too). You can also use the USB Stick to burn different bootloaders on the "Sensor board" if you wanted too.

      The board is still a work in progress but It is almost finished. If you have any idea's, questions, concerns, feedback, I would love to hear them!

      Thanks

      posted in Hardware
      brolly759
      brolly759
    • RE: Custom gateway board design

      You have a "store" which you link other products that people can purchase. Would that be allowed?

      posted in Hardware
      brolly759
      brolly759
    • Custom gateway board design

      If I make a board and put all the components on it, arduino/nrf chip as a gateway. Maybe even add a sensor or 2. Would I be able to post it here and sell it?

      posted in Hardware
      brolly759
      brolly759
    • RE: Is powering a node from CR123 or CR123A a good idea?

      I am using a Zigbee Xbee chip at the moment and it is powered by a CR123A battery. Powerful little guys. Dont go rechargeable. Too much of a headache. A CR123A has about 1200-1500mAh capacity. More than enough for a sleeping node for years.

      Rechargeable batteries hold significantly less amperage, so the comfort in not having to replace the battery is eclipsed with extra current consuming circuitry and recharging 2-3x more than replacing the battery by itself.

      My 2cents

      posted in Hardware
      brolly759
      brolly759
    • RE: Can I do all this without a controller?

      So from the sounds of it, I may be better off just learning the RF24 library. The only issue I see is the RF24 library only supports up to 6 devices in a star network, Many to one/ Star network. So 5 end nodes and 1 gateway, which according to the datasheet is a hardware limitation.

      It may be easier than going through all this custom libraries here.

      Though, mysensors.org did a GREAT job for home owner tinkerers. Just not good for prototyping for business applications. Though what do I know, I barely know programming and arduino lol

      posted in Development
      brolly759
      brolly759
    • Can I do all this without a controller?

      Hi everyone. So I have been working with Xbee for a while and looking for a good alternative. I came across this site. I run the serial Gateway code on an Arduino Uno and get this:

      0;0;3;0;14;Gateway startup complete.
      0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
      255;255;3;0;3;
      0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
      255;255;3;0;3;

      I run the BinarySwitchSleep code on a nano I have and in sleep mode get around 22-24uA. Not bad at all.

      My question is this. Why do I need a controller? Can I not identify each node on the Uno and post data in JSON to DWEET/FREEBOARD or some other data collection storage? If so, are there any tutorials on this?

      My ultimate goal is to make a web based sensor solution kit for different applications that uses limited hardware. For now I am just making a bathroom sensor.

      Oh, last question. Has anyone been able to get the sleep mode lower than 20-24uA?

      I was able to get 350nA following these instructions, albeit using an IRQ to wake up and this was ONLY with an Atmel 328P no wireless.
      http://www.gammon.com.au/forum/?id=11497

      Thanks!

      posted in Development
      brolly759
      brolly759