LowPowerLab Forum
Software support => Coding questions => Topic started by: zzzap 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
-
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 (https://github.com/LowPowerLab/RFM69/tree/master/Examples).
-
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... :)
-
How long does the battery have to last?
Are you aiming for lowest possible power?
-
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?
-
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.
-
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.
-
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.
-
Thanks a lot Felix for the help....
Stefano
-
Hi Felix where i can find some example for the LISTEN MODE with your library?
Thanks
-
They are in this branch of the RFM69 library (https://github.com/LowPowerLab/RFM69/tree/ListenMode/Examples).
See the ListenMode_Master and ListenMode_Node examples in there.
-
Thanks! Now we can start...... :)