|
Post by papa on Mar 14, 2019 17:10:57 GMT
An IR Flame Sensor Node, Updated March 16, 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.
An IR Flame sensor could watch for a flame that is desired or NOT desired. I used this sensor that will operate on 3.3 volts. It only gives digital output, not analog. << Forum members (free registration), click on pic for larger viewThe sensor has a power LED & another LED that lights when a infrared radiation is detected from a flame. It also has a small potentiometer to adjust sensitivity which I did not change. When no flame is detected, the digital out pin gives 1 (one, HIGH, or ON). When a flame is detected, the digital out pin gives 0 (zero, LOW, or OFF). A small candle with a good flame & directly opposite the LED-looking sensor triggered the flame detection around 2 feet away. Continues ...
|
|
|
Post by papa on Mar 15, 2019 14:54:33 GMT
Building an IR Flame Sensor Node WiringHere's a diagram of how you might wire the IR Flame Sensor to an RFM69 node. Posts below assume this wiring. If you change the pin number, change it in later places.
<< Forum members (free registration), click on pic for larger view.
Continues ...
|
|
|
Post by papa on Mar 16, 2019 12:44:29 GMT
An IR Flame Sensor Node
Software
For the IR_FLAME_SENSOR_analog node, Joshua's code displays the read flame value at the time of periodic sending (once a minute). For the IR_FLAME_SENSOR_ digital node, I programmed a periodic send plus sending every time the flame value changed so we could receive a prompt warning. From here, download the latest choose_nodes sketch & follow the basic customization in that thread. That node sketch now includes an IR_FLAME_SENSOR_digital option which will immediately send a change of flame status. Near the sketch's end, see version updates & credits. See the links in this post for documentation on several kinds of nodes you can program with this sketch.
This sketch ^^ was updated March 18, 2019: For one thing, as before when a new flame is sensed, that is flagged & sent immediately. However, now the flame flag is not cleared & sent until no flame has been detected for 60,000 milliseconds (a minute).
In addition to the above basic customization ...
// #define IR_FLAME_SENSOR_digital << UNcomment this line (delete //) #define NODEID 05 << change 05 to a unique number in your RFM69 network (For this node, I suggest you use NODEID 42 as I will below.)
Next, Serial Monitor Results
|
|
|
Post by papa on Mar 16, 2019 13:06:51 GMT
Using an IR Flame Sensor Serial Monitor ResultsBy this time, you should have at least an RFM69 Gateway ( see this post above) & an IR Flame Node 42 programmed for NetworkOne.
When the Gateway is local network-connected & running, the node was programmed with DEBUG, the node is USB-connected to the Arduino IDE computer, & the Arduino IDE Serial Monitor is opened: you should immediately & then at least every 60 seconds see four device values:
1) device 02 (Radio Signal Strength),
2) dev 04 (node voltage),
3) dev 09 (how many times the node tried to resend data before the gateway acknowledged receiving),
4) dev 42 (flame value: 1= no flame, 0= flame). In addition on the Serial Monitor, immediately when dev 42 (flame value) changes to zero, you should see "FLAME detected" [dev 42 = 0]. Update, March 18, 2019: The lack of flame does not register until dev 42 has a value of one for at least 1 minute & then you will see "No Flame detected for 60 secs." This will help make sure that the possibility of a flame is not cleared too soon. Later when we have a servo sweep the sensor's field of vision, this will preserve a flame detection even when the servo moves the sensor away from the position of detection. Next, IR Flame Node, openHAB configuration
|
|
|
Post by papa on Mar 18, 2019 14:21:48 GMT
IR Flame Node, openHAB configuration PaperUI\configuration\Things Add Thing (click + in blue disc)click MQTT Binding Add Manually Generic MQTT Thing Node42 Location (arbitrary physical location) BaseFR MQTT Broker - mqtt:systemBroker:embedded-mqtt-broker save (click check mark in blue disc) PaperUI\Configuration\Things\Node42 Add channels (click + in blue disc) Type: Text Channel ID: Node42Channel02 Label: Node42_RSSI State topic home/rfm_gw/nb/node42/dev02 Type: Number Channel ID: Node42Channel04 Label: Node42_Volts State topic home/rfm_gw/nb/node42/dev04 Type: Text Channel ID: Node42Channel42 Label: Node42_IR_Flame_Dig State topic home/rfm_gw/nb/node42/dev42
Next, OpenHAB configuration, Items
|
|
|
Post by papa on Mar 19, 2019 13:40:48 GMT
IR Flame Node, openHAB Configurations, Continued In openHAB's \conf\ items folder add to an .items file, perhaps a new Node42.items String Node42RSSI "Node42rssi (db)[%s]" <network> (Nodes) { channel="mqtt:embedded-mqtt-broker:topic:mything:Node42Channel02" } Number Node42Vlts "Node42Volts [%.2f Vdd]" <battery> (Nodes) { channel="mqtt:embedded-mqtt-broker:topic:mything:Node42Channel04" } String Flame42 "Flame42 [Flame %s]" <fire> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node42Channel42" } Link the above items to the channels in the previous post (you may need to stop & restart openHAB).
In openHAB's \conf\sitemaps folder. add to a .sitemap file: Text item=Flame42
|
|