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. Troubleshooting
  3. Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

Is it possible to run more than one pin to an interrupt for sleep/wake purposes?

Scheduled Pinned Locked Moved Troubleshooting
55 Posts 7 Posters 14.2k Views 5 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.
  • D Offline
    D Offline
    drock1985
    wrote on last edited by
    #1

    Hi,

    I have a 4x4 keypad working as a scene controller with MySensors. Before I decided to run hard power wire to each point I want to run a keypad, I would like to look at going battery powered. I know I can't run the Nano and the radio continuously for long, so I need to use a sleep function. The only problem with that of course is, the 8 pins I am using for the keypad aren't all interrupts.

    Just wondering if there is any way around this?

    My Projects
    2 Door Chime Sensor
    Washing Machine Monitor

    SparkmanS AWIA 2 Replies Last reply
    0
    • D drock1985

      Hi,

      I have a 4x4 keypad working as a scene controller with MySensors. Before I decided to run hard power wire to each point I want to run a keypad, I would like to look at going battery powered. I know I can't run the Nano and the radio continuously for long, so I need to use a sleep function. The only problem with that of course is, the 8 pins I am using for the keypad aren't all interrupts.

      Just wondering if there is any way around this?

      SparkmanS Offline
      SparkmanS Offline
      Sparkman
      Hero Member
      wrote on last edited by
      #2

      @drock1985 Here's one method: http://www.gammon.com.au/forum/?id=11091.

      Cheers
      Al

      1 Reply Last reply
      0
      • Ivan ZI Offline
        Ivan ZI Offline
        Ivan Z
        Hardware Contributor
        wrote on last edited by
        #3

        I hav 6 buttons
        https://www.openhardware.io/view/26/Battery-button-sensor

        D 2 Replies Last reply
        1
        • Ivan ZI Ivan Z

          I hav 6 buttons
          https://www.openhardware.io/view/26/Battery-button-sensor

          D Offline
          D Offline
          drock1985
          wrote on last edited by
          #4

          @Ivan-Z

          Yes, I have seen your project :) I love it, and would love to incorporate it for my scene controllers; just presently I need to have access to 8 digital pins for it to work right. I'm working on a way to get itdown to 1 analog pin, but that doesn't help my interrupt problem at all.

          @Sparkman

          I'll look into this more, thank you.

          My Projects
          2 Door Chime Sensor
          Washing Machine Monitor

          1 Reply Last reply
          0
          • Ivan ZI Ivan Z

            I hav 6 buttons
            https://www.openhardware.io/view/26/Battery-button-sensor

            D Offline
            D Offline
            drock1985
            wrote on last edited by
            #5

            @Ivan-Z

            Just looked closer at your design; you already have the interrupt set up on D2 don't you? :)

            If that's the case; out of curiosity, is there room for a couple of analog pins in the design that could work as digital?

            My Projects
            2 Door Chime Sensor
            Washing Machine Monitor

            1 Reply Last reply
            0
            • Ivan ZI Offline
              Ivan ZI Offline
              Ivan Z
              Hardware Contributor
              wrote on last edited by
              #6

              This is only a project (In progress).
              Be sure to add
              But I think that it only increase consumption

              1 Reply Last reply
              0
              • D drock1985

                Hi,

                I have a 4x4 keypad working as a scene controller with MySensors. Before I decided to run hard power wire to each point I want to run a keypad, I would like to look at going battery powered. I know I can't run the Nano and the radio continuously for long, so I need to use a sleep function. The only problem with that of course is, the 8 pins I am using for the keypad aren't all interrupts.

                Just wondering if there is any way around this?

                AWIA Offline
                AWIA Offline
                AWI
                Hero Member
                wrote on last edited by AWI
                #7

                @drock1985 A quick drawing of a circuit which enables you to use only one interrupt...

                When any of the keys is pressed you get an interrupt (FALLING) on D2. From that moment on you can poll the keyboard. Any of the digital and analog pins can be used for that purpose (except those in use by the radio..)

                0_1455631736914_upload-4b4253c4-b2ea-4aa7-862f-efe109b9b269

                (you need to change the resistor values on the left side of the drawing to 10Mohm)

                D karl261K 2 Replies Last reply
                3
                • AWIA AWI

                  @drock1985 A quick drawing of a circuit which enables you to use only one interrupt...

                  When any of the keys is pressed you get an interrupt (FALLING) on D2. From that moment on you can poll the keyboard. Any of the digital and analog pins can be used for that purpose (except those in use by the radio..)

                  0_1455631736914_upload-4b4253c4-b2ea-4aa7-862f-efe109b9b269

                  (you need to change the resistor values on the left side of the drawing to 10Mohm)

                  D Offline
                  D Offline
                  drock1985
                  wrote on last edited by
                  #8

                  @AWI

                  Thanks AWI, i'll prototype something out a bit later and give it a shot.

                  My Projects
                  2 Door Chime Sensor
                  Washing Machine Monitor

                  1 Reply Last reply
                  0
                  • AWIA AWI

                    @drock1985 A quick drawing of a circuit which enables you to use only one interrupt...

                    When any of the keys is pressed you get an interrupt (FALLING) on D2. From that moment on you can poll the keyboard. Any of the digital and analog pins can be used for that purpose (except those in use by the radio..)

                    0_1455631736914_upload-4b4253c4-b2ea-4aa7-862f-efe109b9b269

                    (you need to change the resistor values on the left side of the drawing to 10Mohm)

                    karl261K Offline
                    karl261K Offline
                    karl261
                    wrote on last edited by
                    #9

                    @AWI I have such a keypad 4x4 and I would like to use it with the famous my slim aa battery node. I think I understand your drawing. What I don't understand is what diodes do I need to use? I mean what type?

                    Also, if I was to include a green and red diode, or a bi-colour diode, what specifications would they need to have? Any links to the usual "shops"?

                    Thanks!

                    AWIA 1 Reply Last reply
                    0
                    • karl261K karl261

                      @AWI I have such a keypad 4x4 and I would like to use it with the famous my slim aa battery node. I think I understand your drawing. What I don't understand is what diodes do I need to use? I mean what type?

                      Also, if I was to include a green and red diode, or a bi-colour diode, what specifications would they need to have? Any links to the usual "shops"?

                      Thanks!

                      AWIA Offline
                      AWIA Offline
                      AWI
                      Hero Member
                      wrote on last edited by AWI
                      #10

                      @karl261 You can use almost any diode, e.g a 1Nxxxx type

                      And for bi-color LED's many choices , just include a resistor (around 300ohm) in series.

                      1 Reply Last reply
                      0
                      • Nca78N Offline
                        Nca78N Offline
                        Nca78
                        Hardware Contributor
                        wrote on last edited by
                        #11

                        Maybe a stupid question but why don't you change your keypad with a capacitive touch keypad ?
                        I have one of these and it's convenient, low power usage in sleep mode and one interrupt pin for keypress on any of the keys. Just make sure you only connect it to 3.3V, for power AND logic.
                        http://www.aliexpress.com/item/MPR121-Capacitive-Touch-Keypad-Shield-module-sensitive-key-keyboard/32642505921.html

                        karl261K 1 Reply Last reply
                        0
                        • Nca78N Nca78

                          Maybe a stupid question but why don't you change your keypad with a capacitive touch keypad ?
                          I have one of these and it's convenient, low power usage in sleep mode and one interrupt pin for keypress on any of the keys. Just make sure you only connect it to 3.3V, for power AND logic.
                          http://www.aliexpress.com/item/MPR121-Capacitive-Touch-Keypad-Shield-module-sensitive-key-keyboard/32642505921.html

                          karl261K Offline
                          karl261K Offline
                          karl261
                          wrote on last edited by
                          #12

                          @Nca78 yes, you are absolutely right. Maybe that is what I'll do. Sound much easier. Thanks for the link, I check it out!

                          1 Reply Last reply
                          0
                          • karl261K Offline
                            karl261K Offline
                            karl261
                            wrote on last edited by
                            #13

                            But in the end, I prefer the keypad I have. It looks nice.

                            Maybe this is the simplest solution? It turns the keypad into i2c:
                            https://www.hackster.io/venkatesh_rao/i2c-keypad-73a012

                            1 Reply Last reply
                            0
                            • karl261K Offline
                              karl261K Offline
                              karl261
                              wrote on last edited by
                              #14

                              Wow, this is so cool, the pcf8574 port expander works out of the box. If now even the interrupt works...

                              1 Reply Last reply
                              0
                              • karl261K Offline
                                karl261K Offline
                                karl261
                                wrote on last edited by karl261
                                #15

                                Ok, in the end I am stuck. So, I got the keypad working, no problem. But I cannot get it to trigger an interrupt. The PCF8574 has an interrupt pin, but it seems this does not work with this keypad. Or at least I could not figure out how to. So, my keypad speaks I2C now, but still has no interrupt capabilites.

                                Can anyone advise?

                                If not I will need to build the circuit from @AWI. Btw, in that circuit, Are ALL resistors 10 MOhm?

                                Or are R1-4 1 MOhm?

                                1 Reply Last reply
                                0
                                • karl261K Offline
                                  karl261K Offline
                                  karl261
                                  wrote on last edited by
                                  #16

                                  Few crazy solutions:

                                  1. I put in an on / off switch. So before I type, I switch the whole thing on, wait until it registers with the gw, and then here we go. And then off. No need to sleep and wait for interrupts.

                                  2. I can install a button device. So, the thing is sleeping, I press the button, the thing wakes up for 30 secs, that gives me time to type and send, and back it goes to sleep.

                                  3. I have a 4x4 keypad. So, I don't need the ABCD. I could connect the ABCD in a way, that it acts like button device, so I can trigger the interrupt with ABCD, then type my number, and then it goes back to sleep.

                                  AWIA 1 Reply Last reply
                                  0
                                  • karl261K karl261

                                    Few crazy solutions:

                                    1. I put in an on / off switch. So before I type, I switch the whole thing on, wait until it registers with the gw, and then here we go. And then off. No need to sleep and wait for interrupts.

                                    2. I can install a button device. So, the thing is sleeping, I press the button, the thing wakes up for 30 secs, that gives me time to type and send, and back it goes to sleep.

                                    3. I have a 4x4 keypad. So, I don't need the ABCD. I could connect the ABCD in a way, that it acts like button device, so I can trigger the interrupt with ABCD, then type my number, and then it goes back to sleep.

                                    AWIA Offline
                                    AWIA Offline
                                    AWI
                                    Hero Member
                                    wrote on last edited by AWI
                                    #17

                                    @karl261 these options seem all very odd to me. I2c should work, did you activate a pull-up for the interrupt pin? Can you post your sketch and hardware connections?

                                    karl261K 1 Reply Last reply
                                    0
                                    • AWIA AWI

                                      @karl261 these options seem all very odd to me. I2c should work, did you activate a pull-up for the interrupt pin? Can you post your sketch and hardware connections?

                                      karl261K Offline
                                      karl261K Offline
                                      karl261
                                      wrote on last edited by karl261
                                      #18

                                      @AWI Thanks for trying to help! Just a quick question first: Do I draw the circuit by hand or is there a good cheap (free) way to do it on the PC? Or tablet?

                                      I think it is how the pcf8574 is designed. I detect no change on the interrupt pin. But yes, maybe my wiring is not good.

                                      mfalkviddM AWIA 2 Replies Last reply
                                      0
                                      • karl261K karl261

                                        @AWI Thanks for trying to help! Just a quick question first: Do I draw the circuit by hand or is there a good cheap (free) way to do it on the PC? Or tablet?

                                        I think it is how the pcf8574 is designed. I detect no change on the interrupt pin. But yes, maybe my wiring is not good.

                                        mfalkviddM Offline
                                        mfalkviddM Offline
                                        mfalkvidd
                                        Mod
                                        wrote on last edited by
                                        #19

                                        @karl261 by hand is quick and easy. I like to use Fritzing, which is a free tool.

                                        karl261K 1 Reply Last reply
                                        0
                                        • karl261K karl261

                                          @AWI Thanks for trying to help! Just a quick question first: Do I draw the circuit by hand or is there a good cheap (free) way to do it on the PC? Or tablet?

                                          I think it is how the pcf8574 is designed. I detect no change on the interrupt pin. But yes, maybe my wiring is not good.

                                          AWIA Offline
                                          AWIA Offline
                                          AWI
                                          Hero Member
                                          wrote on last edited by
                                          #20

                                          @karl261 As @mfalkvidd said. just make an simple hand drawing on how you connected the pfc8574 and the int pin. The rest is obvious. The pcf8574 can generate an interrupt on any change of the input pins.

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


                                          23

                                          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