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
  1. Home
  2. General Discussion
  3. Waking up 3.3v Pro Mini

Waking up 3.3v Pro Mini

Scheduled Pinned Locked Moved General Discussion
5 Posts 3 Posters 1.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • y4CdW42Ol8Y Offline
    y4CdW42Ol8Y Offline
    y4CdW42Ol8
    wrote on last edited by
    #1

    Hello,
    Other than using an interrupt on a pin level change (ie: D2), what are the ways to wake up a 3.3v Pro Mini from "sleeping"?

    Or are using interrupts the only way?

    I would like to put the Pro Mini to sleep for 12 hours, then wake it up to transmit data, and put it back to sleep...

    Thanks.

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Yes, waking up by timer is supported. From the "Sleeping" section in the api documentation:

      void sleep(unsigned long ms);
      

      ms - Number of milliseconds to sleep.

      See the temperature example for a working example.

      For 12 hours you would set SLEEP_TIME to 1,000 * 60 * 60 * 12 = 43,200,000

      1 Reply Last reply
      1
      • y4CdW42Ol8Y Offline
        y4CdW42Ol8Y Offline
        y4CdW42Ol8
        wrote on last edited by
        #3

        Thanks.

        I do have another question on what happens when an interrupt occurs. In the below example sketch, what code gets executed when the interrupt occurs: Is it at the interrupt handler "wakeUP()", or is it after the "detachInterrupt(1); ??

        Typically when the interrupt happens, the interrupt handler code gets executed, and then it goes back to whatever code it was running when the interrupt happened.

        Since, in this case, the interrupt handler does nothing, will it then execute the line after the "detachInterrupt(1);" ?

        #include "LowPower.h";
        void wakeUp(){
        }
        void setup() {
        pinMode(3, INPUT_PULLUP);

        Serial.begin(115200);
        delay(1000);
        }

        void loop() {
        Serial.println("Sleep Mode Entered");
        delay(500);
        attachInterrupt(1, wakeUp, CHANGE);
        LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
        detachInterrupt(1);

        Serial.println(F("woke up"));
        delay(500);

        }

        B 1 Reply Last reply
        0
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          I have no experience with the LowPower library (MySensors has its own functions) but detachInterrupt should be executed after wakeup.

          Add some debug prints and try, that's usually the best way to learn. Or read the documentation for that library.

          1 Reply Last reply
          1
          • y4CdW42Ol8Y y4CdW42Ol8

            Thanks.

            I do have another question on what happens when an interrupt occurs. In the below example sketch, what code gets executed when the interrupt occurs: Is it at the interrupt handler "wakeUP()", or is it after the "detachInterrupt(1); ??

            Typically when the interrupt happens, the interrupt handler code gets executed, and then it goes back to whatever code it was running when the interrupt happened.

            Since, in this case, the interrupt handler does nothing, will it then execute the line after the "detachInterrupt(1);" ?

            #include "LowPower.h";
            void wakeUp(){
            }
            void setup() {
            pinMode(3, INPUT_PULLUP);

            Serial.begin(115200);
            delay(1000);
            }

            void loop() {
            Serial.println("Sleep Mode Entered");
            delay(500);
            attachInterrupt(1, wakeUp, CHANGE);
            LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
            detachInterrupt(1);

            Serial.println(F("woke up"));
            delay(500);

            }

            B Offline
            B Offline
            boozz
            wrote on last edited by
            #5

            @y4CdW42Ol8

            Have a look at the examples as supplied with the mySensors library. Both ways are implemented extensively.
            The gw.sleep(...) function will be the way to go for the 12 hrs. you'd like to put the sensor asleep. This is used in many examples
            For waking up with interrupt have a look at the example for the power meter. It wakes up the sensor when an interrupt occurs.

            Be my guest to find your own way of programming this, but as @mfalkvidd already pointed out: MySensors has its own functions!

            Good luck,

            Boozz.

            1 Reply Last reply
            1
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            25

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

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