|
Post by papa on Apr 4, 2019 13:54:08 GMT
Flame Sensor Node with Alarm, Wiring Updated April 13, 2019
Needed in order for the following to work: See this thread on achieving an RFM69 Gateway & RFM69 nodes. See this thread on installing openHAB/MQTT on a local network-connected computer.
If we are sometimes near a node (like for a Flame Sensor or a MQ2 Gas/Smoke Sensor), we might desire an alarm sound if a risk condition is detected. Here's a wiring diagram of adding a piezo alarm to an IR_Flame_Sensor_digital node. This includes an optional push button on Arduino pin D8 to silence the alarm.
<< Forum members (free registration), click on pic for larger view. Next, Flame Sensor Node with Alarm, Programming
|
|
|
Post by papa on Apr 5, 2019 13:53:00 GMT
Flame Sensor Node with Alarm, ProgrammingFrom here, download the latest choose_nodes sketch & follow the basic customization in that thread. That node sketch now includes code that can add a piezo alarm to some nodes. Follow this sketch customization for the IR_Flame_Sensor_digital node. ALSO UNcomment (remove // from) this line: // #define ALARM Other places in the sketch you might customize: int alarmMins = 3 ; // 1-32,767 = customize minutes to sound alarm while risk condition exists int flameWatchMins = 2 ; // customize: minutes of no flame before all clear
Next, Flame Sensor Node with Alarm, Operation
|
|
|
Post by papa on Apr 5, 2019 13:59:20 GMT
Flame Sensor Node with Alarm, Operation
As before, with activating only #define IR_FLAME_SENSOR_digital: A flame directly across from the board's LED-looking sensor will generate a Serial Monitor message & will send openHAB a 1 (one) on device 42. If no more flames are detected after the flameWatchMins, the Serial Monitor reports that & openHAB is sent a 0 (zero).
When #define ALARM is also activated, a flame detection will set off the alarm which will run until the optional button is pushed or no flame is detected for flameWatchMins or the alarmMins run out.
Next, MQ_Gas/Smoke Sensor Node with Alarm, Wiring
|
|
|
Post by papa on Apr 6, 2019 13:10:01 GMT
MQ_Gas/Smoke Sensor Node with Alarm, Wiring
Here's a wiring diagram of adding a piezo alarm to an MQ_Gas node. This includes an optional push button on Arduino pin D8 to silence the alarm.
<< Forum members (free registration), click on pic for larger view.
Next, MQ_Gas/Smoke Sensor Node with Alarm, Programming
|
|
|
Post by papa on Apr 6, 2019 13:13:11 GMT
MQ_Gas/Smoke Sensor Node with Alarm, Programming
From here ( if you have not already), download the latest choose_nodes sketch & follow the basic customization in that thread. That node sketch now includes code that can add a piezo alarm to some nodes.
If you're not putting a flame sensor on the node, you can disable #define IR_Flame_Sensor_digital by changing it to // #define IR_Flame_Sensor_digital Other places you might customize in the choose_nodes sketch: int alarmMins = 3 ; // 1-32,767 = customize minutes to sound alarm while risk condition exists #define mqThreshhold 253 // papa: reading above this level = gas or smoke concern, set for your situation Next, MQ_Gas/Smoke Sensor Node with Alarm, Operation
|
|
|
Post by papa on Apr 6, 2019 13:23:56 GMT
MQ_Gas/Smoke Sensor Node with Alarm, Operation
In general with a MQ Gas/Smoke node, you will need to experiment with a good value for mqThreshhold. The MQ gas sensor needs some time between reads. So it is checked every 60 seconds during the periodic radio send. This may mean a slight delay before detecting gas/smoke or all clear. As before ... if the sensor value is at or above the mqThreshhold, the Serial Monitor reports that & openHAB is sent a 1 (one).
When #define ALARM is also activated, a value above mqThreshhold will set off the alarm which will run until the optional button is pushed or the value goes below mqThreshhold or the alarmMins run out.
Next, Adding an ALARM Option to Other Nodes
|
|
|
Post by papa on Apr 6, 2019 13:28:10 GMT
Adding an ALARM Option to Other Nodes
So far the ALARM feature is only implemented for IR_Flame_Sensor_digital Node & MQ_Gas/Smoke Sensor Node.
For hints on adding an alarm to other sensors, search for #ifdef IR_Flame_Sensor_digital or #ifdef MQ_Gas AND #ifdef ALARM within those defined sections. Basically one has the code set alarmFlag to 1 (one) when a risk condition is found or set to 0 (zero) when the risk condition is sufficiently cleared.
|
|