Author Topic: Help for school project  (Read 2795 times)

zzzap

  • NewMember
  • *
  • Posts: 8
Help for school project
« on: January 09, 2019, 02:48:27 PM »
Hello everybody ...We are 2 students at the last year of computer programming school. We are working to a simply project with Moteino.
1 gateway with an oled display powered by usb 5v
3 node (   1 door sensor and 2 motion sensor) powered by 2 aa battery.
We are study the listen mode to make  node low power  but....
The question is...
All nodes will be in Listenig mode
A button on Gateway enable the sensor of node( all or one)  with a tx message(Wake up) .Now the nodes can  send alarm message  when a movement is detected( enable or disable  the interrup pin connected to the  sensor)
Gateway receive an alarm message if a sensor detect  something.If the  button is pressed again the Gateway send a  tx message (sleep) to disable the alarm sensor of node.
Can you help me? any idea to how proceed?
Thank for all help and sorry for my bad english

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help for school project
« Reply #1 on: January 09, 2019, 03:39:02 PM »
All nodes will be in Listenig mode
If all you need is a way to tell when an event happens (ex. motion), then you don't need ListenMode.

A button on Gateway enable the sensor of node( all or one)  with a tx message(Wake up) .Now the nodes can  send alarm message  when a movement is detected( enable or disable  the interrup pin connected to the  sensor)
Gateway receive an alarm message if a sensor detect  something.If the  button is pressed again the Gateway send a  tx message (sleep) to disable the alarm sensor of node.
Is it a strong requirement that the Gateway has to be able to wake the node at any time?

If not, then you already have working examples - see Gateway/PiGateway and MotionMote examples in RFM69 library.

zzzap

  • NewMember
  • *
  • Posts: 8
Re: Help for school project
« Reply #2 on: January 09, 2019, 04:55:16 PM »
Thanks for reply!
The motion sensor and the door sensor are in the classroom so the pir sensor and swicth  detect a lot of movement and send always a tx message to  gateway (and the battery will drain quickly).
The idea is put in sleep mode the sensor( listening mode) and wait the end of lession to active with a button  the sensor node with a "ARM" message(for the night).
The following day, in the morning all sensor will be disable by a text command as "DISARM".
It a simply alarm  1 gateway with oled and 3 node... :)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help for school project
« Reply #3 on: January 09, 2019, 04:59:57 PM »
How long does the battery have to last?
Are you aiming for lowest possible power?

zzzap

  • NewMember
  • *
  • Posts: 8
Re: Help for school project
« Reply #4 on: January 09, 2019, 05:14:24 PM »
The original project provide a CR 2450 (about 600ma) The gateway distance is about 50m ( it is into the office on ground floor) The module are RFM69Hw

Are there other mode to enable the interrup pin on node  only when need it?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help for school project
« Reply #5 on: January 09, 2019, 06:03:55 PM »
Small battery yes, I would use something else if I had a choice.
But if you choose the right PIR you can sleep at a few uA and only transmit at low power, perhaps a RFM69CW is appropriate for this application.

Are there other mode to enable the interrup pin on node  only when need it?
Thats what an interrupt is, it interrupts when you want it to.
And you can enable/disable it whenever you want.

zzzap

  • NewMember
  • *
  • Posts: 8
Re: Help for school project
« Reply #6 on: January 10, 2019, 03:29:15 AM »
Sorry for late of reply but we are in ITALY with different time zone  ;).
 We already have 4  module Hw... and pir sensor  HC-SR505
Yes ...we must disable and enable with a message from gateway(burst or normal message?) the interrup of arduino node (where is connect the sensor)that is in listening mode to save battery. When message is received and checked  from node, the interrup pin is enable (or disable) and they can send a tx alarm to gateway only if sensor ( by night for example)  detect movement or  door openig. The gateway have a buzz...for alarm detect.
A question...
If node send always a TX message (10us for example) for every movement and go to sleep  the battery drain is the same ?
Sorry for all question but when the project is ready we must explain to the professor how it work.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help for school project
« Reply #7 on: January 10, 2019, 09:22:01 AM »
If node send always a TX message (10us for example) for every movement and go to sleep  the battery drain is the same ?
Sorry for all question but when the project is ready we must explain to the professor how it work.
It takes several ms (not us) to send a short packet.
And no, its not the same, depends on MANY things, especially the TX power level, how often you transmit, if you use retries etc. To get an approximate power figure, you have to average your sleep and wake/transmission cycles.

So one option is LISTEN_MODE, uncomment the #defines in the RFM69 library to enable it, then there are some examples for it, how to wake a node.
Or you could implement a system where the node wakes periodically and polls the gateway, to see if it needs to sleep. It's more simple but the tradeoff is latency and more power consumption.

zzzap

  • NewMember
  • *
  • Posts: 8
Re: Help for school project
« Reply #8 on: January 10, 2019, 10:26:15 AM »
 Thanks a lot  Felix for the help....
Stefano


zzzap

  • NewMember
  • *
  • Posts: 8
Re: Help for school project
« Reply #9 on: January 11, 2019, 08:04:50 AM »
Hi Felix where i can find some example  for  the LISTEN MODE with your library?
Thanks

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Help for school project
« Reply #10 on: January 11, 2019, 08:55:09 AM »
They are in this branch of the RFM69 library.
See the ListenMode_Master and ListenMode_Node examples in there.

zzzap

  • NewMember
  • *
  • Posts: 8
Re: Help for school project
« Reply #11 on: January 11, 2019, 08:57:05 AM »
Thanks! Now we can start...... :)