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. My Project
  3. Mailbox Sensor

Mailbox Sensor

Scheduled Pinned Locked Moved My Project
21 Posts 7 Posters 24.2k 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.
  • bjornhallbergB bjornhallberg

    Nice project. I was going to post a new topic until I found yours. I currently have a 433MHz doorbell -> Arduino w. ethernet shield set up as a mailbox notifier / alarm but I'm looking to replace that with a MySensors version as soon as things are up and running here.

    I currently use a ball tilt switch to trigger the sender and it has been working pretty flawlessly so far, all things considered. Also thought about using a light sensor, a simpler photoresistor, an actual button trigger, some sort IR beam break detection or a reed switch but eventually settled for one of the simpler designs. The tilt switch worked like charm for the doorbell since it only needs to simulate a button press and is of very simple design. I wonder if a tilt sensor / switch would work as well with an Arduino with regard to interrupts and battery savings.

    Which light sensor did you use exactly? How has it worked out with the batteries so far? Any other considerations when moving the mailbox sensor project to MySensors that you can think of?

    BulldogLowellB Offline
    BulldogLowellB Offline
    BulldogLowell
    Contest Winner
    wrote on last edited by
    #5

    @bjornhallberg

    I used a digital light sensor, so far the batteries are the same as when I posted.

    If I did it again, I would use a contact switch, any motion or tilt should do well.

    The light sensor doesn't always report if the weather is very dull. I haven't really focused on fixing it, of course...

    bjornhallbergB 1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #6

      I still have an good old fibaro z-wave universal sensor with magnetic switch on my mailbox+pleg+sonos tts.

      I should probably replace it with a MySensors wireless sensor. Just for the sake of using MySenosrs ;) Eat your own shit. Right?

      1 Reply Last reply
      0
      • BulldogLowellB BulldogLowell

        @bjornhallberg

        I used a digital light sensor, so far the batteries are the same as when I posted.

        If I did it again, I would use a contact switch, any motion or tilt should do well.

        The light sensor doesn't always report if the weather is very dull. I haven't really focused on fixing it, of course...

        bjornhallbergB Offline
        bjornhallbergB Offline
        bjornhallberg
        Hero Member
        wrote on last edited by bjornhallberg
        #7

        @BulldogLowell Yeah that is what I suspected. It would have to be a trigger that could work in low light conditions. Plus the design of your mailbox and placement of the sensor doesn't seem to work in your favor. Still, it's easier to tuck away electronics in there than in the bucket-like mailboxes we all have over here.

        @hek I was wondering about the BinarySwitchSensor sketch? It does seem like the obvious choice for this application and overall it's a very versatile sketch, but it doesn't sleep or react to interrupts from button presses? Or am I misunderstanding the Arduino's capabilities here? Sorry for the noobish question.

        hekH 1 Reply Last reply
        0
        • bjornhallbergB bjornhallberg

          @BulldogLowell Yeah that is what I suspected. It would have to be a trigger that could work in low light conditions. Plus the design of your mailbox and placement of the sensor doesn't seem to work in your favor. Still, it's easier to tuck away electronics in there than in the bucket-like mailboxes we all have over here.

          @hek I was wondering about the BinarySwitchSensor sketch? It does seem like the obvious choice for this application and overall it's a very versatile sketch, but it doesn't sleep or react to interrupts from button presses? Or am I misunderstanding the Arduino's capabilities here? Sorry for the noobish question.

          hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #8

          @bjornhallberg said:

          I was wondering about the BinarySwitchSensor sketch? It does seem like the obvious choice for this application and overall it's a very versatile sketch, but it doesn't sleep or react to interrupts from button presses? Or am I misunderstanding the Arduino's capabilities here? Sorry for the noobish question.

          No it does not sleep in it's current form. It was actually more an example of using the debounce library. You probably could live without this and just go for the 1.4 build in:

           gw.sleep(INTERRUPT, CHANGE);
          
          bjornhallbergB epierreE 2 Replies Last reply
          0
          • hekH hek

            @bjornhallberg said:

            I was wondering about the BinarySwitchSensor sketch? It does seem like the obvious choice for this application and overall it's a very versatile sketch, but it doesn't sleep or react to interrupts from button presses? Or am I misunderstanding the Arduino's capabilities here? Sorry for the noobish question.

            No it does not sleep in it's current form. It was actually more an example of using the debounce library. You probably could live without this and just go for the 1.4 build in:

             gw.sleep(INTERRUPT, CHANGE);
            
            bjornhallbergB Offline
            bjornhallbergB Offline
            bjornhallberg
            Hero Member
            wrote on last edited by bjornhallberg
            #9

            @hek said:

            @bjornhallberg said:

            I was wondering about the BinarySwitchSensor sketch? It does seem like the obvious choice for this application and overall it's a very versatile sketch, but it doesn't sleep or react to interrupts from button presses? Or am I misunderstanding the Arduino's capabilities here? Sorry for the noobish question.

            No it does not sleep in it's current form. It was actually more an example of using the debounce library. You probably could live without this and just go for the 1.4 build in:

             gw.sleep(INTERRUPT, CHANGE);
            

            Thanks I'll look into it. I expect I'll get a lot of use out of that sketch. After the obvious things like door / window sensors and the upgraded mailbox alert sensor I'm thinking of adding a mouse trap sensor to my humane "tincat" trap. It would be fantastic for everyone involved to know when the trap doors have been opened. No accounting for gnawed off wires of course.

            2skxctli.jpg

            1 Reply Last reply
            0
            • hekH hek

              @bjornhallberg said:

              I was wondering about the BinarySwitchSensor sketch? It does seem like the obvious choice for this application and overall it's a very versatile sketch, but it doesn't sleep or react to interrupts from button presses? Or am I misunderstanding the Arduino's capabilities here? Sorry for the noobish question.

              No it does not sleep in it's current form. It was actually more an example of using the debounce library. You probably could live without this and just go for the 1.4 build in:

               gw.sleep(INTERRUPT, CHANGE);
              
              epierreE Offline
              epierreE Offline
              epierre
              Hero Member
              wrote on last edited by
              #10

              @hek there is no interrupt related debouncing as far as I know, this is why I used the time debounce for my reed switch sketch of the water meter

              z-wave - Vera -> Domoticz
              rfx - Domoticz <- MyDomoAtHome <- Imperihome
              mysensors -> mysensors-gw -> Domoticz

              BulldogLowellB 1 Reply Last reply
              0
              • epierreE epierre

                @hek there is no interrupt related debouncing as far as I know, this is why I used the time debounce for my reed switch sketch of the water meter

                BulldogLowellB Offline
                BulldogLowellB Offline
                BulldogLowell
                Contest Winner
                wrote on last edited by
                #11

                @epierre

                you can debounce an interrupt:

                void PushButton() //interrupt.
                { 
                  static unsigned long last_interrupt_time = 0;
                  unsigned long interrupt_time = millis();
                  if (interrupt_time - last_interrupt_time > 200) // If interrupts come faster than 200ms, assume it's a bounce and ignore
                  {
                    counter++;// your interrupt flag here
                  }
                  last_interrupt_time = interrupt_time;
                }
                
                epierreE 1 Reply Last reply
                0
                • BulldogLowellB BulldogLowell

                  @epierre

                  you can debounce an interrupt:

                  void PushButton() //interrupt.
                  { 
                    static unsigned long last_interrupt_time = 0;
                    unsigned long interrupt_time = millis();
                    if (interrupt_time - last_interrupt_time > 200) // If interrupts come faster than 200ms, assume it's a bounce and ignore
                    {
                      counter++;// your interrupt flag here
                    }
                    last_interrupt_time = interrupt_time;
                  }
                  
                  epierreE Offline
                  epierreE Offline
                  epierre
                  Hero Member
                  wrote on last edited by
                  #12

                  @BulldogLowell yes tjis is time debouncing as opposed to the debouncing library from tje switch sketch

                  z-wave - Vera -> Domoticz
                  rfx - Domoticz <- MyDomoAtHome <- Imperihome
                  mysensors -> mysensors-gw -> Domoticz

                  BulldogLowellB 1 Reply Last reply
                  0
                  • epierreE epierre

                    @BulldogLowell yes tjis is time debouncing as opposed to the debouncing library from tje switch sketch

                    BulldogLowellB Offline
                    BulldogLowellB Offline
                    BulldogLowell
                    Contest Winner
                    wrote on last edited by
                    #13

                    @epierre

                    right, yes.

                    1 Reply Last reply
                    0
                    • Moshe LivneM Offline
                      Moshe LivneM Offline
                      Moshe Livne
                      Hero Member
                      wrote on last edited by
                      #14

                      A silly question - wouldn't PIR be the best option here? very responsive and interrupt driven so low power consumption? or am I missing something?

                      BulldogLowellB 1 Reply Last reply
                      0
                      • Moshe LivneM Moshe Livne

                        A silly question - wouldn't PIR be the best option here? very responsive and interrupt driven so low power consumption? or am I missing something?

                        BulldogLowellB Offline
                        BulldogLowellB Offline
                        BulldogLowell
                        Contest Winner
                        wrote on last edited by
                        #15

                        @Moshe-Livne

                        The PIR is a light sensor, so they are quite similar. The light sensor works for me, and I did try it with a motion sensor too. I'm not hung up on either but I can't say what is best.

                        Try it with the motion and let us know how it goes for you!

                        Moshe LivneM 1 Reply Last reply
                        0
                        • BulldogLowellB BulldogLowell

                          @Moshe-Livne

                          The PIR is a light sensor, so they are quite similar. The light sensor works for me, and I did try it with a motion sensor too. I'm not hung up on either but I can't say what is best.

                          Try it with the motion and let us know how it goes for you!

                          Moshe LivneM Offline
                          Moshe LivneM Offline
                          Moshe Livne
                          Hero Member
                          wrote on last edited by
                          #16

                          @BulldogLowell will do! that is one of my next projects. wouldn't PIR be easier to mount, as you can mount it at the back or at the top of the compartment? not trying to criticize, I am pretty much a newbie and trying to see if I miss anything.

                          BulldogLowellB 1 Reply Last reply
                          0
                          • Moshe LivneM Moshe Livne

                            @BulldogLowell will do! that is one of my next projects. wouldn't PIR be easier to mount, as you can mount it at the back or at the top of the compartment? not trying to criticize, I am pretty much a newbie and trying to see if I miss anything.

                            BulldogLowellB Offline
                            BulldogLowellB Offline
                            BulldogLowell
                            Contest Winner
                            wrote on last edited by
                            #17

                            @Moshe-Livne

                            I'm sure you PIR will work well... if you look at the box I built, I didn't have a mounting problem.

                            Likewise I tried a mechanical switch, but didn't like what happened if the door wasn't closed all the way and I wanted to be able to get the 'module' in and out as I tested it.

                            The PIR was similarly an issue for me, if the box wasn't closed it would constantly send messages (changes in light from sun's position, car/person walking by, etc) during the day. so if you trust your letter carrier... :wink:

                            it is easy to try your idea; for me that is part of the fun of the world of electronics. And open-source is what makes reasonably well-crafted ideas into even better ideas!

                            Moshe LivneM 1 Reply Last reply
                            0
                            • BulldogLowellB BulldogLowell

                              @Moshe-Livne

                              I'm sure you PIR will work well... if you look at the box I built, I didn't have a mounting problem.

                              Likewise I tried a mechanical switch, but didn't like what happened if the door wasn't closed all the way and I wanted to be able to get the 'module' in and out as I tested it.

                              The PIR was similarly an issue for me, if the box wasn't closed it would constantly send messages (changes in light from sun's position, car/person walking by, etc) during the day. so if you trust your letter carrier... :wink:

                              it is easy to try your idea; for me that is part of the fun of the world of electronics. And open-source is what makes reasonably well-crafted ideas into even better ideas!

                              Moshe LivneM Offline
                              Moshe LivneM Offline
                              Moshe Livne
                              Hero Member
                              wrote on last edited by
                              #18

                              @BulldogLowell our mailboxes have slots, not door so there is no problem or door being left open. will try it the minute i'll get my hands on some more dupont cables!!!!

                              BulldogLowellB 1 Reply Last reply
                              0
                              • Moshe LivneM Moshe Livne

                                @BulldogLowell our mailboxes have slots, not door so there is no problem or door being left open. will try it the minute i'll get my hands on some more dupont cables!!!!

                                BulldogLowellB Offline
                                BulldogLowellB Offline
                                BulldogLowell
                                Contest Winner
                                wrote on last edited by
                                #19

                                @Moshe-Livne said:

                                will try it the minute i'll get my hands on some more dupont cables!!!!

                                :thumbsup:

                                1 Reply Last reply
                                0
                                • C Offline
                                  C Offline
                                  Cai_Niao
                                  wrote on last edited by
                                  #20

                                  Hi,I think you have done a good job.I am very interested in your IOS app, it's written by yourself or other open-source project? Thanks.

                                  BulldogLowellB 1 Reply Last reply
                                  0
                                  • C Cai_Niao

                                    Hi,I think you have done a good job.I am very interested in your IOS app, it's written by yourself or other open-source project? Thanks.

                                    BulldogLowellB Offline
                                    BulldogLowellB Offline
                                    BulldogLowell
                                    Contest Winner
                                    wrote on last edited by
                                    #21

                                    @Cai_Niao

                                    I am using HomeWave, an iOS app developed for Vera which is my controller.

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


                                    16

                                    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