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. Simple door sensor battery node drains 2 x AA in a week due to pin D2

Simple door sensor battery node drains 2 x AA in a week due to pin D2

Scheduled Pinned Locked Moved Troubleshooting
6 Posts 3 Posters 46 Views 4 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.
  • N Offline
    N Offline
    novicit
    wrote on last edited by
    #1

    I am looking for some input on a problem I have encountered with a battery powered node. Any comments appreciated.

    Problem: Bettery powered node is exhausting 2 AA batteries within 5 days due to pin D2 'sinking' ~7ma while sleeping.

    Node Description: This is a simple node. It monitors two garage doors for when they open or closed and reports the change to the controller. It sleeps perhaps 95% of the time. The hardware is a standard MySensors pcb with only two components mounted, a pro mini and a nrf24l01 radio. (Plus pin headers.) Pins D2 and D3 are used in "interupt on change mode", one for each garage door. The 'sensors' on the doors are standard magnetic reed switches. They are open when the door is open, and the magnet closes the contact when the door is shut. When shut, the reed switch pulls the respective pin (D2 or D3) to ground. To minimize current draw, the internal pullups on the pins are not used. A 3.3M ohm resistor is pullup for each pin. The software is a sketch created by @anticimex located here https://github.com/iot-playground/Arduino/blob/master/external_libraries/MySensors/examples/BinarySwitchSleepSensor/BinarySwitchSleepSensor.ino. The only changes made are to put in node id and comment out use of the internal piullups.

    The node works perfectly. When a door opens or shuts, the interupt awakens the node, it reports the change, and then returns to sleep. The ONLY problem is burning thru batteries.

    Investigation: I have put a fluke meter on the node to measure current draw. When pin D3 in in either the pulled up or pulled down position and the node is sleeping the node uses 20micro amps. When pin D2 is in pulled up position and node sleeping, also 20micro amps. But when D2 is in the pulled down position (the garage door is closed) it draws ~6-8ma while sleeping! This draw drains the batteries quickly. I have programmed 4 pro mini's, including one that works fine on another battery powered temp node, and they all perform the same way. I also tried programing the pro minis both with Platformio & Arduino IDE, and there is no difference.

    I have no idea why only D2 sinks so much current when the node is sleeping. Any ideas are much appreciated!

    1 Reply Last reply
    0
    • bjacobseB Offline
      bjacobseB Offline
      bjacobse
      wrote on last edited by
      #2

      is the D2 pin also connected to the RF module?

      1 Reply Last reply
      1
      • N Offline
        N Offline
        novicit
        wrote on last edited by
        #3

        @bjacobse Thank you for your comment. I should have looked at that but it has been ~6 years since I paid attention to basic radio connections. :( I am using the MYS11 board from www.sa2avr.se and the schematic shows D2 connected to the IRQ pin of the radio. That could be it. I will test it out.

        The "connecting the radio" page of MySensors states: "The IRQ pin is only required to be connected if the MY_RX_MESSAGE_BUFFER_FEATURE is defined in the sketch. I am not using that feature for this node so I might be able to fix it by cutting a trace.

        I post my results after testing. Again, great input! Thanks.

        1 Reply Last reply
        1
        • N Offline
          N Offline
          novicit
          wrote on last edited by
          #4

          To close this post out, @bjacobse was correct. After cutting the trace to the IRQ pin of the radio there is no more drain on the D2 pin. Even though the pin was not used by MySensors, the radio apparently still drained current.

          Thank You!

          OldSurferDudeO 1 Reply Last reply
          2
          • OldSurferDudeO Offline
            OldSurferDudeO Offline
            OldSurferDude
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • N novicit

              To close this post out, @bjacobse was correct. After cutting the trace to the IRQ pin of the radio there is no more drain on the D2 pin. Even though the pin was not used by MySensors, the radio apparently still drained current.

              Thank You!

              OldSurferDudeO Offline
              OldSurferDudeO Offline
              OldSurferDude
              wrote on last edited by
              #6

              @novicit @bjacobse Good call!

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


              22

              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