Skip to content

Instantly share code, notes, and snippets.

@Doneezy
Created December 11, 2017 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Doneezy/5062c92701d94165d579a795efead90b to your computer and use it in GitHub Desktop.
Save Doneezy/5062c92701d94165d579a795efead90b to your computer and use it in GitHub Desktop.
The Investigation of a Low Cost DAQ with Arduino and Node red for on/off relay switch alternative

Arduino code that is written on the arduino IDE. The code consists of the on/off algorithm and source codes found online for ds18b20 and thermistor sensors. This is read through the com5 port(applicable) and is fed into a node palette for either the ds18b20 or thermistor in order to plot the graph depiction of the temperature behavior of each sensor, this analyses must be done for each sensor one at a time. A simultaneous visual display does not work. The live data capturing is saved as a csv format on a specified folder that the user must create

[{"id":"5ad86d6d.266f94","type":"tab","label":"Flow 3"},{"id":"abab6f40.422dd","type":"function","z":"5ad86d6d.266f94","name":"convert to string","func":"var newMsg = {payload: msg.payload.toString()};\nreturn newMsg;","outputs":"1","noerr":0,"x":547,"y":280,"wires":[["3d7398fd.0bdf98","8ce1f1f4.365d8"]]},{"id":"3d7398fd.0bdf98","type":"function","z":"5ad86d6d.266f94","name":"thermistor ","func":"var outputMsg = [];\nvar words = msg.payload.split(\" \");\n\nfor(var w in words)\n{\n \n outputMsg.push({payload: words[w]});\n}\nreturn [outputMsg[0]];\n","outputs":1,"noerr":0,"x":780,"y":212,"wires":[[]]},{"id":"8ce1f1f4.365d8","type":"function","z":"5ad86d6d.266f94","name":"ds18b20","func":"var outputMsg = [];\nvar words = msg.payload.split(\" \");\n\nfor(var w in words)\n{\n \n outputMsg.push({payload: words[w]});\n}\nreturn [outputMsg[1]];","outputs":1,"noerr":0,"x":728,"y":392,"wires":[["68bc75dd.e6b6fc","77aea4f6.c87dfc","35b9fa76.8fc8b6","95777692.d9ddf8"]]},{"id":"77aea4f6.c87dfc","type":"ui_chart","z":"5ad86d6d.266f94","name":"","group":"7c715068.e4664","order":0,"width":"15","height":"10","label":"Temperature","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#80ff80","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1086,"y":405,"wires":[[],[]]},{"id":"68bc75dd.e6b6fc","type":"debug","z":"5ad86d6d.266f94","name":"","active":true,"console":"false","complete":"false","x":1147,"y":322,"wires":[]},{"id":"95777692.d9ddf8","type":"file","z":"5ad86d6d.266f94","name":"save to text file","filename":"C:\\Users\\User_2\\Documents\\WORKING DON SYSTEM\\Arduino\\ds18b20\\ds18b20 test","appendNewline":true,"createDir":false,"overwriteFile":"false","x":861,"y":567,"wires":[]},{"id":"35b9fa76.8fc8b6","type":"ui_gauge","z":"5ad86d6d.266f94","name":"","group":"7c715068.e4664","order":0,"width":0,"height":0,"gtype":"gage","title":"ds18b20 gauge","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1124,"y":473,"wires":[]},{"id":"5dec7826.3f6858","type":"serial in","z":"5ad86d6d.266f94","name":"","serial":"836308e8.3ee918","x":175,"y":347,"wires":[["abab6f40.422dd"]]},{"id":"7c715068.e4664","type":"ui_group","z":"","name":"Ds18b20","tab":"93930c59.86aca","disp":true,"width":"15"},{"id":"836308e8.3ee918","type":"serial-port","z":"","serialport":"COM10","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"93930c59.86aca","type":"ui_tab","z":"","name":"ds18b20 test","icon":"dashboard"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment