Author Topic: Mailbox Notifier for R3/RFM69H  (Read 2910 times)

CodyPChristian

  • Newbie
  • *
  • Posts: 9
  • Cody P Christian
    • Cody P. Christian
Mailbox Notifier for R3/RFM69H
« on: September 01, 2013, 01:05:04 PM »
Hello guys, so yesterday I was having a problem with my R3s, came down to the code I was using was for R2s.

I've taken the R2 Mailbox code and ported it to R3. In my project I am using a light sensor/resistor instead of the hall sensor. So in the code I labeled it as 'sensor'.

This reads and sends the value every 10 seconds to the receiver and if the value is over 70 it says open if its under its closed.

Receiver: http://codep.in/2S
Sender: http://codep.in/2T

Felix: Feel free to look at this and improve, I'm new to using your libs and I could be doing something wrong.

Edit: Looks like I need Felix to help adjust the code here, the device isnt sleeping at all so after 15hrs of it sending data every 10 seconds the battery has dropped from 8.4V to 6.7V.

Hope this helps anyone else.
« Last Edit: September 01, 2013, 03:09:54 PM by CodyPChristian »
Thanks, Cody P. Christian
about.me/codypchristian
codypchristian.net

CodyPChristian

  • Newbie
  • *
  • Posts: 9
  • Cody P Christian
    • Cody P. Christian
Re: Mailbox Notifier for R3/RFM69H
« Reply #1 on: September 01, 2013, 03:02:51 PM »
Hey guys, here is a post about the project I did related to this, part of my home automation project: http://blog.codypchristian.net/post/59996872871/jarvis-mailbox-notifier
Thanks, Cody P. Christian
about.me/codypchristian
codypchristian.net

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5938
  • Country: us
    • LowPowerLab
Re: Mailbox Notifier for R3/RFM69H
« Reply #2 on: September 01, 2013, 09:45:09 PM »
Hey Cody,
Thanks for sharing!

The sleeping section is the same as the R2 code, so you can pretty much copy paste. There's a sleep function in RFM69 lib so you can use that to sleep the radio. There is no wakeup() function since any other call to receiveDone() will wakeup the radio.
To save power you have to sleep the transceiver, then sleep the atmega chip. For that you need the LowPower lib from RocketScream (http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/) or you could also use the Narcoleptic library (https://code.google.com/p/narcoleptic/)
You also need to sleep any other peripherals that might draw or sink power, like your light sensor or anything else attached to the Moteino.
Other improvements are keeping the messages short, or use structs for very short transmissions. Also keeping the antenna perpendicular to the mailbox metallic enclosure should help the signal.
« Last Edit: September 01, 2013, 09:52:43 PM by Felix »

CodyPChristian

  • Newbie
  • *
  • Posts: 9
  • Cody P Christian
    • Cody P. Christian
Re: Mailbox Notifier for R3/RFM69H
« Reply #3 on: September 02, 2013, 01:14:42 AM »
Hey Felix,

I will see what I can do to copy over the low power lib and code from your other sample. Do you have any recommendations to powering down the sensor? The other items are covered in your other lib.
Thanks, Cody P. Christian
about.me/codypchristian
codypchristian.net

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5938
  • Country: us
    • LowPowerLab
Re: Mailbox Notifier for R3/RFM69H
« Reply #4 on: September 02, 2013, 09:00:54 AM »
You could do it many ways but the easiest I think is like I've done it (if the sensor does not need a lot of power). In my mailbox version of this I powered the sensor from a Moteino pin [digitalWrite(pin, HIGH) then read the sensor, then digitalWrite(pin, LOW)].

CodyPChristian

  • Newbie
  • *
  • Posts: 9
  • Cody P Christian
    • Cody P. Christian
Re: Mailbox Notifier for R3/RFM69H
« Reply #5 on: September 02, 2013, 11:36:44 AM »
Thanks Felix, that will work great because I am already powering it from a pin. I'll post back the revised code when its all done.
Thanks, Cody P. Christian
about.me/codypchristian
codypchristian.net

igammie

  • Newbie
  • *
  • Posts: 1
Re: Mailbox Notifier for R3/RFM69H
« Reply #6 on: October 12, 2013, 02:08:33 AM »
I would like to purchase one of these; ideally in a weather proof enclosure.

Feel free to email me igammie at gmail.com

Thanks in advance

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5938
  • Country: us
    • LowPowerLab
Re: Mailbox Notifier for R3/RFM69H
« Reply #7 on: October 12, 2013, 09:22:01 AM »
igammie,
It's not available yet as an off the shelf product. My latest post about the mailbox project shows how I put everything in a cheap enclosure and used clear tape to weather proof it. That's good enough since it's always inside the mailbox anyway.

I might make it a kit or off-the-shelf thing, but that would require some kind of receiver. Actually I wanted to do this a while back, but got busy with other projects.