AMG8833 and a Raspberry Pi camera and turn them into a thermal camera with image overlay.
[{"id":"f31973fb.8619","type":"tab","label":"AMG8833","disabled":false,"info":""},{"id":"f94c07fc.885218","type":"inject","z":"f31973fb.8619","name":"Start","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":110,"y":100,"wires":[["36bb4211.9c6d5e"]]},{"id":"8920a307.62838","type":"inject","z":"f31973fb.8619","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"str","x":110,"y":420,"wires":[["86b10af4.a61a08"]]},{"id":"79666e12.9c7f8","type":"function","z":"f31973fb.8619","name":"Temperature REG.","func":"const address = msg.address;\n\nvar commands=[];\n\nfor (let i=0x80; i<=0xFF; i+=0x10) {\n if (i == 0xF0) {\n commands.push({'address': address, 'command': i, 'bytes': 16, 'complete': true});\n } else {\n commands.push({'address': address, 'command': i, 'bytes': 16,});\n }\n}\n\n\nreturn [commands];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":240,"wires":[["e2b35f41.d0883"]]},{"id":"cef0127d.9e5e9","type":"join","z":"f31973fb.8619","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"address","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":310,"y":300,"wires":[["75331585.d5310c"]]},{"id":"75331585.d5310c","type":"function","z":"f31973fb.8619","name":"Concat & Flip","func":"var temperature = msg.payload;\n\n\nvar flip= [];\nfor (let i=0; i<temperature.length; i++) {\n flip = flip.concat(temperature[temperature.length - i - 1]);\n}\nmsg.payload = flip;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":300,"wires":[["7d693859.5a3118","3459f61c.123dea"]]},{"id":"da2facc3.ffbdd","type":"function","z":"f31973fb.8619","name":"Thermistor REG.","func":"const address = msg.address;\n\nvar commands=[];\n\n//commands.push({'address': address, 'command': 0x0E});\ncommands.push({'address': address, 'command': 0x0E, 'bytes': 2,'complete': true});\n\nreturn [commands];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":420,"wires":[["d2207a09.c34fb8"]]},{"id":"bb346028.95e94","type":"function","z":"f31973fb.8619","name":"Calc Value","func":"var raw = msg.payload;\n\nvar temperature = Array(raw.length / 2).fill();\nfor (let i=0; i<temperature.length; i++) {\n j = i << 1; // Multiply 2\n var sign = raw[j+1] & 0x08;\n var val = ((raw[j+1] & 0x07) << 8) | raw[j] ;\n if (sign != 0) {\n //負\n val = val - 0x07FF -1;\n }\n temperature[i] = val*0.0625;\n}\n\nmsg.payload = temperature;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":460,"wires":[["84525a18.eff6e8"]]},{"id":"582a1a73.0ba254","type":"inject","z":"f31973fb.8619","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"","payloadType":"str","x":110,"y":240,"wires":[["64b57c50.cb5234"]]},{"id":"b46310af.45d3c","type":"comment","z":"f31973fb.8619","name":"Initial reset","info":"","x":80,"y":60,"wires":[]},{"id":"805c16d8.aa77f8","type":"comment","z":"f31973fb.8619","name":"Thermistor","info":"","x":80,"y":380,"wires":[]},{"id":"e4483da1.09fb9","type":"comment","z":"f31973fb.8619","name":"Temperature","info":"","x":90,"y":200,"wires":[]},{"id":"92e947ee.67d3f8","type":"debug","z":"f31973fb.8619","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":300,"wires":[]},{"id":"12fc18c9.a7b7c7","type":"inject","z":"f31973fb.8619","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":110,"y":580,"wires":[["92336dcc.4de73"]]},{"id":"5cff51ba.779dd","type":"comment","z":"f31973fb.8619","name":"FPS","info":"","x":70,"y":500,"wires":[]},{"id":"2b3c0acb.538d46","type":"inject","z":"f31973fb.8619","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":110,"y":540,"wires":[["92336dcc.4de73"]]},{"id":"92336dcc.4de73","type":"ui_switch","z":"f31973fb.8619","name":"","label":"1fps","tooltip":"","group":"38a41d52.5ca782","order":1,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","animate":false,"x":230,"y":560,"wires":[["ca1c530d.5dacc"]]},{"id":"1a5b5747.8e7e69","type":"function","z":"f31973fb.8619","name":"FPS REG.","func":"//msg.address = 0x69;\nmsg.command =\"0x02\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":560,"wires":[["7a34d3da.6bbbbc"]]},{"id":"84525a18.eff6e8","type":"ui_text","z":"f31973fb.8619","group":"38a41d52.5ca782","order":2,"width":"3","height":"1","name":"","label":"Thermistor","format":"{{msg.payload[0] }}","layout":"row-left","x":890,"y":460,"wires":[]},{"id":"4ec4dfa2.4c76d","type":"catch","z":"f31973fb.8619","name":"","scope":null,"uncaught":true,"x":470,"y":40,"wires":[["db6d7a24.1bc808","1c64518a.4fcd7e"]]},{"id":"db6d7a24.1bc808","type":"debug","z":"f31973fb.8619","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"error","targetType":"jsonata","statusVal":"","statusType":"auto","x":880,"y":40,"wires":[]},{"id":"3bf5f2d.29a130e","type":"ui_text","z":"f31973fb.8619","group":"38a41d52.5ca782","order":5,"width":"0","height":"0","name":"","label":"","format":"{{msg.payload}}","layout":"row-left","x":870,"y":80,"wires":[]},{"id":"1c64518a.4fcd7e","type":"change","z":"f31973fb.8619","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"error.message","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":60,"wires":[["3bf5f2d.29a130e"]]},{"id":"ef80fa30.a99948","type":"function","z":"f31973fb.8619","name":"Initialize REG.","func":"//msg.address = 0x68;\nmsg.command =\"0x01\";\nmsg.payload = 63;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":140,"wires":[["44e61ae9.a56994"]]},{"id":"4fc9b4a2.41688c","type":"change","z":"f31973fb.8619","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":100,"wires":[["3bf5f2d.29a130e","7d693859.5a3118"]]},{"id":"763315ad.7de2fc","type":"ui_button","z":"f31973fb.8619","name":"","group":"38a41d52.5ca782","order":6,"width":"0","height":"0","passthru":false,"label":"RESET","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":100,"y":140,"wires":[["36bb4211.9c6d5e"]]},{"id":"3459f61c.123dea","type":"ui_heat_map","z":"f31973fb.8619","group":"38a41d52.5ca782","order":3,"width":"10","height":"10","name":"","rows":"8","columns":"8","minMax":false,"minimumValue":"20","maximumValue":"35","backgroundType":"image","backgroundColor":"#b0b0b0","image":"never","radius":"90","opacity":"0","blur":"1","showValues":false,"gridType":"vals","valuesDecimals":0,"showLegend":false,"legendType":"vals","legendDecimals":"1","legendCount":"4","x":680,"y":340,"wires":[[]]},{"id":"e2b35f41.d0883","type":"i2c in","z":"f31973fb.8619","name":"","busno":"1","address":"","command":"","count":"16","x":650,"y":240,"wires":[["65e3d05b.14f7e"]]},{"id":"d2207a09.c34fb8","type":"i2c in","z":"f31973fb.8619","name":"","busno":"1","address":"","command":"","count":"2","x":610,"y":420,"wires":[["bb346028.95e94"]]},{"id":"44e61ae9.a56994","type":"i2c out","z":"f31973fb.8619","name":"","busno":"1","address":"","command":"","payload":"payload","payloadType":"msg","count":"1","x":690,"y":140,"wires":[["4fc9b4a2.41688c","79666e12.9c7f8"]]},{"id":"7a34d3da.6bbbbc","type":"i2c out","z":"f31973fb.8619","name":"","busno":"1","address":"","command":"","payload":"payload","payloadType":"msg","count":"1","x":690,"y":560,"wires":[[]]},{"id":"36bb4211.9c6d5e","type":"change","z":"f31973fb.8619","name":"Set I2C Address","rules":[{"t":"set","p":"address","pt":"flow","to":"105","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":100,"wires":[["35b7a1b0.31947e"]]},{"id":"ca1c530d.5dacc","type":"change","z":"f31973fb.8619","name":"Get I2C Address","rules":[{"t":"set","p":"address","pt":"msg","to":"address","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":560,"wires":[["1a5b5747.8e7e69"]]},{"id":"86b10af4.a61a08","type":"change","z":"f31973fb.8619","name":"Get I2C Address","rules":[{"t":"set","p":"address","pt":"msg","to":"address","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":420,"wires":[["da2facc3.ffbdd"]]},{"id":"64b57c50.cb5234","type":"change","z":"f31973fb.8619","name":"Get I2C Address","rules":[{"t":"set","p":"address","pt":"msg","to":"address","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":240,"wires":[["79666e12.9c7f8"]]},{"id":"35b7a1b0.31947e","type":"change","z":"f31973fb.8619","name":"Get I2C Address","rules":[{"t":"set","p":"address","pt":"msg","to":"address","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":140,"wires":[["ef80fa30.a99948"]]},{"id":"7d693859.5a3118","type":"delay","z":"f31973fb.8619","name":"","pauseType":"rate","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"0.1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":670,"y":300,"wires":[["92e947ee.67d3f8","79666e12.9c7f8"]]},{"id":"65e3d05b.14f7e","type":"function","z":"f31973fb.8619","name":"Calc Value","func":"var raw = msg.payload;\n\nvar temperature = Array(raw.length/2).fill();\nfor (let i=0; i<temperature.length; i++) {\n j = i << 1; // Multiply 2\n var sign = raw[j+1] & 0x08;\n var val = ((raw[j+1] & 0x07) << 8) | raw[j] ;\n if (sign != 0) {\n // negative\n val = val - 0x0800;\n }\n temperature[i] = val*0.25;\n}\n\n\nmsg.payload = temperature;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":170,"y":300,"wires":[["cef0127d.9e5e9"]]},{"id":"38a41d52.5ca782","type":"ui_group","name":"Thermal Image","tab":"dd1d391f.548498","order":1,"disp":true,"width":"10","collapse":false,"className":""},{"id":"dd1d391f.548498","type":"ui_tab","name":"Thermal Imaging","icon":"image","disabled":false,"hidden":false}]
Are you asking a question or showing how it can be done?
How to join Raspberry Pi camera
Always list nodes you are using when some are not part of the default installation
A short intro what your flow does is always welcome
Are you wanting to overlay static images or overlay live images?
overlay live images
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.