{"id":52006,"date":"2020-09-24T00:00:00","date_gmt":"2020-09-24T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/"},"modified":"2020-09-24T00:00:00","modified_gmt":"2020-09-24T07:00:00","slug":"monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana","status":"publish","type":"post","link":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/","title":{"rendered":"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana."},"content":{"rendered":"<style>\n#toc p {\n line-height: 0;\n}\n<\/style>\n<p>In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red flow that uses MQTT to read temperature sensor data from an Industrial Shields M-DUINO 21+ Arduino PLC and then visualizes that data using Grafana. <\/p>\n<div style=\"text-align: center; margin: 10px\">\n<iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/_TyYKrxm4Tk\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div>\n<div id=\"toc\">\n<h2>Table of Contents<\/h2>\n<ol><a href=\"#hardware\"><\/p>\n<li>PLC Setup<\/li>\n<p><\/a><br \/>\n<a href=\"#pi\"><\/p>\n<li>Raspberry Setup<\/li>\n<p><\/a><br \/>\n<a href=\"#mqtt\"><\/p>\n<li>MQTT<\/li>\n<p><\/a><br \/>\n<a href=\"#arduino\"><\/p>\n<li>Arduino Programming<\/li>\n<p><\/a><br \/>\n<a href=\"#griddb\"><\/p>\n<li>GridDB + WebAPI<\/li>\n<p><\/a><br \/>\n<a href=\"#nodejs\"><\/p>\n<li>NodeJS<\/li>\n<p><\/a><br \/>\n<a href=\"#nodered\"><\/p>\n<li>Node Red<\/li>\n<p><\/a><br \/>\n<a href=\"#grafana\"><\/p>\n<li>Grafana<\/li>\n<p><\/a><\/ol>\n<\/div>\n<h2 id=\"hardware\">Hardware Setup<\/h2>\n<p>For the hardware setup, we\u00e2\u20ac\u2122re going to mount the hardware to a DIN rail, wire the temperature sensor, setup the Arduino IDE, and deploy our Arduino sketch to the PLC. <\/p>\n<p>We mounted the Raspberry Pi4 to a <a href=\"https:\/\/dinrplate.com\/\">DINRplate<\/a> for a clean installation on a DIN rail and are using a generic terminal block from <a href=\"https:\/\/www.amazon.com\/Electronics-Salon-Position-Terminal-Distribution-Module\/dp\/B07R647PSW\/ref=sr_1_1?dchild=1&#038;keywords=Electronics-Salon+Slim+DIN+Rail+Mount+16A%2F300V+4x3+Position+Screw+Terminal+Block+Distribution+Module.&#038;qid=1593616215&#038;sr=8-1\">Amazon<\/a>. Having everything mounted on the DIN rail will keep it neat and tidy, something very beneficial if you have 100s of temperature sensors.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-24-at-4.06.34-PM.png\" alt=\"\" width=\"716\" height=\"376\" class=\"aligncenter size-full wp-image-26934\" srcset=\"\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-24-at-4.06.34-PM.png 716w, \/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-24-at-4.06.34-PM-300x158.png 300w, \/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-24-at-4.06.34-PM-600x315.png 600w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/p>\n<p>The ground wire of the temperature sensor is connected to the M-DUINO&#8217;s ground pin. The 5 volt wire is also connected to the M-DUINO&#8217;s +5 VDC pin. The sensor wire is connected to Pin2 and a 4.7k Ohm resistor is placed between the +5 VDC bus and the sensor bus. Multiple DS18B20 sensors can be attached to the same M-DUINO pin if you have a large enough terminal block which is one advantage of using the DS18B20 over using an Analog sensor. <\/p>\n<h2  id=\"pi\">Raspberry Pi Setup<\/a><\/h2>\n<p>First, we\u00e2\u20ac\u2122re going to start by getting our Raspberry PI up and running. We need to install Ubuntu and build and install the GridDB Server, NodeJS, GridDB NodeJS Client along with Node Red and the Nodes we\u00e2\u20ac\u2122ll be using. GridDB needs to run on a 64-bit OS, so we\u00e2\u20ac\u2122ll use Pi Imager to write a 64-bit Ubuntu 18.04 server image to our micro SD card. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/pi_imager.png\" alt=\"\" width=\"694\" height=\"472\" class=\"aligncenter size-full wp-image-26699\" srcset=\"\/wp-content\/uploads\/2020\/07\/pi_imager.png 694w, \/wp-content\/uploads\/2020\/07\/pi_imager-300x204.png 300w, \/wp-content\/uploads\/2020\/07\/pi_imager-600x408.png 600w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><\/p>\n<h2  id=\"mqtt\">MQTT<\/h2>\n<p>We&#8217;ll use the Mosquitto MQTT broker on the Raspberry PI. The M-DUINO will publish messages to a topic on the broker while Node-RED will subscribe to that topic. No configuration is required for our simple demo, so we simply install and start. <\/p>\n<pre>\nsudo apt-get -y install mosquitto\nsudo systemctl enable mosquitto\nsudo systemctl start mosquitto\n<\/pre>\n<h2  id=\"arduino\">Arduino Setup<\/h2>\n<p>After installing and starting the <a href=\"https:\/\/www.arduino.cc\/en\/main\/software\">Arduino IDE<\/a> for your preferred OS (It can be on the Raspberry Pi but I prefer to connect it directly to my development workstation) install the Arduino Modbus and DallasTemperature libraries into the Arduino IDE. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/ide_libs2.png\" alt=\"\" width=\"930\" height=\"525\" class=\"aligncenter size-full wp-image-26701\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/arduino-mqtt-libs.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26935\" srcset=\"\/wp-content\/uploads\/2020\/09\/arduino-mqtt-libs.png 1920w, \/wp-content\/uploads\/2020\/09\/arduino-mqtt-libs-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/arduino-mqtt-libs-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/arduino-mqtt-libs-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/arduino-mqtt-libs-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>For the Arduino setup, the required headers are included and our M-Duino\u00e2\u20ac\u2122s mac and ip address are configured. We\u00e2\u20ac\u2122re using PIN2 to receive the signal from our DS18B20 so we configure the OneWire library appropriately. <\/p>\n<p>Then we configure the MQTT broker address which will run on the Raspberry Pi. The actual startup routine simply starts ethernet, serial and connects to the MQTT broker. <\/p>\n<pre>\n#include &lt;SPI.h&gt;\n#include &lt;Ethernet.h&gt;\n#include &lt;ArduinoRS485.h&gt;\n#include &lt;OneWire.h&gt;\n#include &lt;DallasTemperature.h&gt;\n#include &lt;ArduinoMqttClient.h&gt;\n\nbyte mac[] = { 0xBE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nbyte ip[] = { 192, 168, 1, 100 };\n\n#define ONE_WIRE_BUS 2\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\n\nEthernetClient etherClient;\nMqttClient mqttClient(etherClient);\n\nconst char broker[] = \"192.168.1.69\";\nint        port     = 1883;\nconst char topic[]  = \"temp\";\n\nIPAddress server(192, 168, 1, 80); \/\/ Modbus server\nvoid setup() {\n\n  Ethernet.begin(mac, ip);\n  Serial.begin(9600);\n\n  if (!mqttClient.connect(broker, port)) {\n    Serial.print(\"MQTT connection failed! Error code = \");\n    Serial.println(mqttClient.connectError());\n\n    while (1);\n  }\n\n  Serial.println(\"Connected to the MQTT broker!\");\n\n}\n\n<\/pre>\n<p>The Arduino&#8217;s loop function runs every second, collecting the temperature and publishing it to the MQTT broker. <\/p>\n<pre>\nvoid loop() {\n  \n    sensors.requestTemperatures();\n    float temp = sensors.getTempCByIndex(0);\n    Serial.print(\"Temperature is: \");\n    Serial.println(temp);\n\n    mqttClient.beginMessage(topic);\n    mqttClient.print(\"{ \"sensor\" : 1, \"temperature\" : \");\n    mqttClient.print(temp);\n    mqttClient.print(\" }\");\n    mqttClient.endMessage();\n\n    delay(1000);\n  \n}\n\n<\/pre>\n<p>Now with our Arduino code complete we can compile, upload and verify it\u00e2\u20ac\u2122s working.<\/p>\n<h2  id=\"griddb\">GridDB  and GridDB WebAPI Setup<\/h2>\n<p>Now that you can log into the Pi, we can follow this <a href=\"https:\/\/griddb.net\/en\/blog\/griddb-on-arm-time-series-database-for-your-raspberry-pi\">blog post<\/a> on how to compile and run GridDB on an ARM64-based Raspberry Pi.<\/p>\n<p>Once GridDB is running, we can download and install the WebAPI:<\/p>\n<pre>\n$ wget https:\/\/github.com\/griddb\/webapi\/releases\/download\/2.2.0\/griddb_webapi-2.2.0-bin.tar.gz\n$ tar zxvf griddb_webapi-2.2.0-bin.tar.gz\n$ cd webapi\/\n$ export GS_WEBAPI_HOME=\/home\/ubuntu\/webapi\n$ nohup java -jar .\/lib\/griddb-webapi-ce-2.2.0.jar &\n<\/pre>\n<h2 id=\"nodejs\">NodeJS, NodeJS GridDB Client<\/h2>\n<p>To build the Node.js client required for Node-RED, we need to install Node.js, its development headers, and node native abstractions for Node.js.<\/p>\n<pre>\n$ sudo apt-get install nodejs nodejs-dev node-nan\n<\/pre>\n<p>Now we need to build dependencies for the Node.js GridDB client, PCRE and SWIG.<\/p>\n<pre>\n$ export LD_LIBRARY_PATH=\/usr\/local\/lib\n$ wget https:\/\/sourceforge.net\/projects\/pcre\/files\/pcre\/8.39\/pcre-8.39.tar.gz\n$ tar xvfz pcre-8.39.tar.gz\n$ cd pcre-8.39\n$ .\/configure\n$ make\n$ make install\n\n$ wget https:\/\/prdownloads.sourceforge.net\/swig\/swig-4.0.0.tar.gz\n$ tar xvfz swig-4.0.0.tar.gz\n$ cd swig-3.0.12\n$ .\/configure\n$ make\n$ make install\n<\/pre>\n<p>With the prerequisites built, we can clone and build the Node.js GridDB client.<\/p>\n<pre>\n$ git clone https:\/\/github.com\/griddb\/nodejs_client.git\n$ cd nodejs_client && make\n<\/pre>\n<h2  id=\"nodered\">Node Red Setup<\/h2>\n<h3>Install Node Red<\/h3>\n<p>Now we can install Node Red and the Nodes we&#8217;re going to use:<\/p>\n<p>The GridDB Node Red Node isn&#8217;t available from npm yet, <\/p>\n<pre>\n\n$ npm install node-red\n$ git clone https:\/\/github.com\/griddbnet\/node-red-contrib-griddb.git\n$ mkdir ~\/.node-red\n$ cd ~\/.node-red\n$ npm install ~\/node-red-contrib-griddb \n<\/pre>\n<p>Now we add the GridDB Client to our NODE_PATH and start node red. <\/p>\n<pre>\n# export NODE_PATH=:\/home\/ubuntu\/nodejs_client\n# ~\/node_modules\/node-red\/bin\/node-red-pi\n<\/pre>\n<h3>Node Red Flows<\/h3>\n<p>First we&#8217;ll add a MQTT listener in Node-RED that subscribes to the <code>temp<\/code> topic.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/node-red-topic.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26876\" srcset=\"\/wp-content\/uploads\/2020\/09\/node-red-topic.png 1920w, \/wp-content\/uploads\/2020\/09\/node-red-topic-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/node-red-topic-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/node-red-topic-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/node-red-topic-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>For the listener to work, it needs to have a MQTT broker configured, in this case our broker is running on localhost and no special authorization is required.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/node-red-mqtt-broker.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26875\" srcset=\"\/wp-content\/uploads\/2020\/09\/node-red-mqtt-broker.png 1920w, \/wp-content\/uploads\/2020\/09\/node-red-mqtt-broker-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/node-red-mqtt-broker-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/node-red-mqtt-broker-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/node-red-mqtt-broker-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>The output of the MQTT listener is converted from a string into a JSON object before being converted into the format the GridDB PUT node expects.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/node-red-function.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26873\" srcset=\"\/wp-content\/uploads\/2020\/09\/node-red-function.png 1920w, \/wp-content\/uploads\/2020\/09\/node-red-function-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/node-red-function-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/node-red-function-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/node-red-function-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>Finally the GridDB-Put node has the data schema configured for what it is input. Here, the Container name is not required as the container is specified by msg.topic in the input. This way, multiple sensors can have their data written to multiple containers without individual GridDB-Put nodes. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/node-red-griddb.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26874\" srcset=\"\/wp-content\/uploads\/2020\/09\/node-red-griddb.png 1920w, \/wp-content\/uploads\/2020\/09\/node-red-griddb-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/node-red-griddb-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/node-red-griddb-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/node-red-griddb-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<h2  id=\"grafana\">Grafana<\/h2>\n<p>We can install and start Grafana per their <a href=\"https:\/\/grafana.com\/tutorials\/install-grafana-on-raspberry-pi\/#3\">instructions&#8221;<\/a>:<\/p>\n<pre>\nwget -q -O - https:\/\/packages.grafana.com\/gpg.key | sudo apt-key add -\necho \"deb https:\/\/packages.grafana.com\/oss\/deb stable main\" | sudo tee -a \/etc\/apt\/sources.list.d\/grafana.list\nsudo apt-get update\nsudo apt-get install grafana\nsudo systemctl enable grafana-server\nsudo systemctl start grafana-server\n<\/pre>\n<p>Then we download and install the Grafana GridDB Datasource:<\/p>\n<pre>\nwget https:\/\/github.com\/griddb\/griddb-datasource\/archive\/1.1.0.tar.gz\ntar zxvf 1.1.0.tar.gz\nsudo cp -a griddb-datasource-1.1.0\/dist \/var\/lib\/grafana\/plugins\nsudo systemctl restart grafana-server\n<\/pre>\n<p>Now with Grafana running, we can log in with our web browser.<\/p>\n<p>The first step will be too create a GridDB data source and confirm it works by inputing hostname, port, cluster name, username and password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/grafana-dashboard.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26877\" srcset=\"\/wp-content\/uploads\/2020\/09\/grafana-dashboard.png 1920w, \/wp-content\/uploads\/2020\/09\/grafana-dashboard-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/grafana-dashboard-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/grafana-dashboard-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/grafana-dashboard-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>With the data source working, we can create a panel in a dashboard. We select which container to view and and the time series column and the data is plotted. Grafana makes it easy to zoom in and out of the data ranges to examine details or explore long term trends. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/09\/grafana-panel.png\" alt=\"\" width=\"1920\" height=\"1200\" class=\"aligncenter size-full wp-image-26878\" srcset=\"\/wp-content\/uploads\/2020\/09\/grafana-panel.png 1920w, \/wp-content\/uploads\/2020\/09\/grafana-panel-300x188.png 300w, \/wp-content\/uploads\/2020\/09\/grafana-panel-768x480.png 768w, \/wp-content\/uploads\/2020\/09\/grafana-panel-1024x640.png 1024w, \/wp-content\/uploads\/2020\/09\/grafana-panel-600x375.png 600w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>If you have any questions regarding this project or anything else related to GridDB, please feel free to ask on StackOverflow: <a href=\"https:\/\/stackoverflow.com\/questions\/ask?tags=griddb\">https:\/\/stackoverflow.com\/questions\/ask?tags=griddb<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red flow that uses MQTT to read temperature sensor data from an Industrial Shields M-DUINO 21+ Arduino PLC and then visualizes that data using Grafana. Table of Contents [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":52007,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-52006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana. | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana. | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-24T07:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"716\" \/>\n\t<meta property=\"og:image:height\" content=\"376\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Owen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Owen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\"},\"author\":{\"name\":\"Owen\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\"},\"headline\":\"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana.\",\"datePublished\":\"2020-09-24T07:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\"},\"wordCount\":898,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\",\"name\":\"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana. | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png\",\"datePublished\":\"2020-09-24T07:00:00+00:00\",\"description\":\"In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png\",\"contentUrl\":\"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png\",\"width\":716,\"height\":376},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\",\"name\":\"Owen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"caption\":\"Owen\"},\"url\":\"https:\/\/griddb.net\/en\/author\/owen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana. | GridDB: Open Source Time Series Database for IoT","description":"In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/","og_locale":"en_US","og_type":"article","og_title":"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana. | GridDB: Open Source Time Series Database for IoT","og_description":"In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red","og_url":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2020-09-24T07:00:00+00:00","og_image":[{"width":716,"height":376,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png","type":"image\/png"}],"author":"Owen","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"Owen","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/"},"author":{"name":"Owen","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66"},"headline":"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana.","datePublished":"2020-09-24T07:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/"},"wordCount":898,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/","url":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/","name":"Monitoring Temperature Sensor Data with an Arduino based PLC, MQTT, Node-RED, GridDB and Grafana. | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png","datePublished":"2020-09-24T07:00:00+00:00","description":"In this demonstration, we show how you to build a low cost Industrial Internet of Things (IIoT) solution using GridDB on a Raspberry Pi 4 with a Node-Red","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/monitoring-temperature-sensor-data-with-an-arduino-based-plc-mqtt-node-red-griddb-and-grafana\/#primaryimage","url":"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png","contentUrl":"\/wp-content\/uploads\/2025\/12\/Screen-Shot-2020-09-24-at-4.06.34-PM.png","width":716,"height":376},{"@type":"WebSite","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66","name":"Owen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","caption":"Owen"},"url":"https:\/\/griddb.net\/en\/author\/owen\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/52006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/comments?post=52006"}],"version-history":[{"count":0,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/52006\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media\/52007"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media?parent=52006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/categories?post=52006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/tags?post=52006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}