{"id":46609,"date":"2020-08-20T00:00:00","date_gmt":"2020-08-20T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/"},"modified":"2025-11-13T12:54:58","modified_gmt":"2025-11-13T20:54:58","slug":"iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/","title":{"rendered":"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC."},"content":{"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 Modbus to read temperature sensor data from an Industrial Shields M-DUINO 21+ Arduino PLC.<\/p>\n<div style=\"text-align: center\">\n<iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/v_iLDfq_C6g\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div>\n<h2>Table of Contents<\/h2>\n<ol>\n<li><a href=\"#raspsetup\">Raspberry Pi Setup<\/a><\/li>\n<ul>\n<li>Raspberry Pi OS<\/li>\n<li>GridDB on Raspberry Pi<\/li>\n<li>NodeJS, GridDB Node client<\/li>\n<li>Install Node Red<\/li>\n<\/ul>\n<li><a href=\"#hwsetup\">PLC Setup<\/a><\/li>\n<ul>\n<li>Hardware Setup<\/li>\n<li>Arduino Setup<\/li>\n<\/ul>\n<li><a href=\"#flows\">Create the Node Red Flows<\/a><\/li>\n<\/ol>\n<h2><A name=\"raspsetup\">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. <\/p>\n<h3>Raspberry Pi OS<\/h3>\n<p>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 fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/pi_imager.png\" alt=\"\" width=\"694\" height=\"472\" class=\"alignnone size-large 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<h3>GridDB on Raspberry Pi<\/h3>\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><!--\nAfter you've logged into the Pi, we can clone the <a href=\"https:\/\/github.com\/griddbnet\/griddb_arm\">GridDB ARM<\/a> repository and build it with GCC 4.8. More details on this step can be found in the  <a href=\"https:\/\/griddb.net\/en\/blog\/griddb-on-arm-time-series-database-for-your-raspberry-pi\">blog post<\/a> on how to run GridDB on an ARM64-based Raspberry Pi.\n\n\n\n<pre>\n# git clone https:\/\/github.com\/griddbnet\/griddb_arm.git\n# cd griddb_arm\n# .\/bootstrap.sh\n# CC=gcc-4.8 CXX=g++-4.8 .\/configure\n# make\n<\/pre>\n\n \n\nOnce the build has finished, you can start GridDB: \n\n\n\n<pre>\nexport GS_HOME=\/home\/ubuntu\/griddb\/\nexport GS_LOG=$GS_HOME\/log\nexport PATH=$PATH:$GS_HOME\/bin\nexport CLASSPATH=$CLASSPATH:$GS_HOME\/bin\/gridstore.jar\n\ngs_startnode\nsleep 5\ngs_stat -u admin\/admin\ngs_joincluster -u admin\/admin -n 1\n<\/pre>\n\n\n--><\/p>\n<h3>NodeJS, NodeJS GridDB Client<\/h3>\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-3.0.12.tar.gz\n$ tar xvfz swig-3.0.12.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<h3>Install Node Red<\/h3>\n<p>Now we can install Node Red and the Nodes we&#8217;re going to use:<\/p>\n<pre>\n# npm install node-red\n# mkdir ~\/.node-red\n# cd ~\/.node-red \n# npm install node-red-contrib-modbus@3.6.1 node-red-dashboard\n<\/pre>\n<p>The GridDB Node Red Node isn&#8217;t available from npm yet, <\/p>\n<pre>\n# cd ~\n# git clone https:\/\/github.com\/griddbnet\/node-red-contrib-griddb.git\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<p>Now, you can visit the Node-Red web page at http:\/\/your_pi_ip:1880\/. We\u00e2\u20ac\u2122re going to add the Modbus server so the mduino application will start properly. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/modbus_server.png\" alt=\"\" width=\"800\" height=\"800\" class=\"alignnone size-large wp-image-26706\" srcset=\"\/wp-content\/uploads\/2020\/07\/modbus_server.png 800w, \/wp-content\/uploads\/2020\/07\/modbus_server-150x150.png 150w, \/wp-content\/uploads\/2020\/07\/modbus_server-300x300.png 300w, \/wp-content\/uploads\/2020\/07\/modbus_server-768x768.png 768w, \/wp-content\/uploads\/2020\/07\/modbus_server-230x230.png 230w, \/wp-content\/uploads\/2020\/07\/modbus_server-400x400.png 400w, \/wp-content\/uploads\/2020\/07\/modbus_server-600x600.png 600w, \/wp-content\/uploads\/2020\/07\/modbus_server-640x640.png 640w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2><a name=\"hwsetup\">PLC Setup<\/a><\/h2>\n<h3>Hardware Setup<\/h3>\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 decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-09-at-7.33.01-AM.png\" alt=\"\" width=\"617\" height=\"287\" class=\"alignnone size-full wp-image-26793\" srcset=\"\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-09-at-7.33.01-AM.png 617w, \/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-09-at-7.33.01-AM-300x140.png 300w, \/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-09-at-7.33.01-AM-600x279.png 600w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/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<h3>Arduino Setup<\/h3>\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 DallasTemperatrure  libraries into the Arduino IDE. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/ide_libs2.png\" alt=\"\" width=\"930\" height=\"525\" class=\"alignnone size-large wp-image-26700\" srcset=\"\/wp-content\/uploads\/2020\/07\/ide_libs2.png 930w, \/wp-content\/uploads\/2020\/07\/ide_libs2-300x169.png 300w, \/wp-content\/uploads\/2020\/07\/ide_libs2-768x434.png 768w, \/wp-content\/uploads\/2020\/07\/ide_libs2-150x85.png 150w, \/wp-content\/uploads\/2020\/07\/ide_libs2-600x339.png 600w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/ide_libs.png\" alt=\"\" width=\"930\" height=\"525\" class=\"alignnone size-large wp-image-26701\" srcset=\"\/wp-content\/uploads\/2020\/07\/ide_libs.png 930w, \/wp-content\/uploads\/2020\/07\/ide_libs-300x169.png 300w, \/wp-content\/uploads\/2020\/07\/ide_libs-768x434.png 768w, \/wp-content\/uploads\/2020\/07\/ide_libs-150x85.png 150w, \/wp-content\/uploads\/2020\/07\/ide_libs-600x339.png 600w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><\/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 ModBus server address which will run on the Raspberry Pi. The actual startup routine simply starts ethernet and serial. <\/p>\n<pre>\n#include &lt;SPI.h&gt;\n#include &lt;Ethernet.h&gt;\n#include &lt;ArduinoRS485.h&gt;\n#include &lt;ArduinoModbus.h&gt;\n#include &lt;OneWire.h&gt;\n#include &lt;DallasTemperature.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;\nModbusTCPClient modbusTCPClient(etherClient);\n\nIPAddress server(192, 168, 1, 80); \/\/ Modbus server\nvoid setup() {\n\n  Ethernet.begin(mac, ip);\n  Serial.begin(9600);\n\n}\n<\/pre>\n<p>The Arduino&#8217;s loop function runs every second, ensuring we have a Modbus server connection, collecting the temperature, multiplying it by 100 so it will fit in a 16-bit integer Modbus register, and sending sending it. <\/p>\n<pre>\nvoid loop() {\n  \n  if (!modbusTCPClient.connected()) {\n    Serial.println(\"Attempting to connect to Modbus TCP server\");\n\n    if (!modbusTCPClient.begin(server, 10502)) {\n      Serial.println(\"Modbus TCP Client failed to connect!\");\n    } else {\n      Serial.println(\"Modbus TCP Client connected\");\n    }\n  } else {\n    \n    sensors.requestTemperatures();\n    float temp = sensors.getTempCByIndex(0);\n    Serial.print(\"Temperature is: \");\n    \/\/ convert the temperature to int and multiply by 100 to not loose precision\n    unsigned int tempbin = (int)(temp*100); \n    Serial.println(tempbin);\n    \n    if (!modbusTCPClient.holdingRegisterWrite(0, 0x00, tempbin)) {\n      Serial.print(\"Failed to write register! \");\n      Serial.println(modbusTCPClient.lastError());\n    }\n\n    delay(1000);\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<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/ide_serial-1-1024x607.png\" alt=\"\" width=\"1024\" height=\"607\" class=\"alignnone size-large wp-image-26714\" srcset=\"\/wp-content\/uploads\/2020\/07\/ide_serial-1-1024x607.png 1024w, \/wp-content\/uploads\/2020\/07\/ide_serial-1-300x178.png 300w, \/wp-content\/uploads\/2020\/07\/ide_serial-1-768x455.png 768w, \/wp-content\/uploads\/2020\/07\/ide_serial-1-600x356.png 600w, \/wp-content\/uploads\/2020\/07\/ide_serial-1.png 1760w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h2><a name=\"flows\">Create the Node Red Flows<\/a><\/h2>\n<p>We&#8217;ve already added a Modbus Server node to our flow, now we will create two more sets of connected nodes. The first set reads from Modbus, transforms the data into the structure expected by the GridDB-Put node and then inserts into GridDB.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/connected_nodes.png\" alt=\"\" width=\"700\" height=\"291\" class=\"alignnone size-large wp-image-26703\" srcset=\"\/wp-content\/uploads\/2020\/07\/connected_nodes.png 700w, \/wp-content\/uploads\/2020\/07\/connected_nodes-300x125.png 300w, \/wp-content\/uploads\/2020\/07\/connected_nodes-600x249.png 600w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>First, the Modbus Read Node needs to be configured to connect to the Modbus server. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/modbus_read.png\" alt=\"\" width=\"499\" height=\"800\" class=\"alignnone size-large wp-image-26707\" srcset=\"\/wp-content\/uploads\/2020\/07\/modbus_read.png 499w, \/wp-content\/uploads\/2020\/07\/modbus_read-187x300.png 187w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/p>\n<p>Then, it can be configured to read the registers we are writing the temperature value to. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/modbus_read2.png\" alt=\"\" width=\"601\" height=\"601\" class=\"alignnone size-large wp-image-26708\" srcset=\"\/wp-content\/uploads\/2020\/07\/modbus_read2.png 601w, \/wp-content\/uploads\/2020\/07\/modbus_read2-150x150.png 150w, \/wp-content\/uploads\/2020\/07\/modbus_read2-300x300.png 300w, \/wp-content\/uploads\/2020\/07\/modbus_read2-230x230.png 230w, \/wp-content\/uploads\/2020\/07\/modbus_read2-400x400.png 400w, \/wp-content\/uploads\/2020\/07\/modbus_read2-600x600.png 600w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/p>\n<p>We transform the data so it is suitable for input to the GridDB-Put Node. The temperature is divided by 100 as it&#8217;s multiplied by 100 to not loose precision and converted to an integer to fit into the Modbus register. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/put-transform.png\" alt=\"\" width=\"420\" height=\"313\" class=\"alignnone size-full wp-image-26721\" srcset=\"\/wp-content\/uploads\/2020\/07\/put-transform.png 420w, \/wp-content\/uploads\/2020\/07\/put-transform-300x224.png 300w\" sizes=\"(max-width: 420px) 100vw, 420px\" \/><\/p>\n<p>The GridDB Put Node is configured with the container to write its schema. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/griddb_put.png\" alt=\"\" width=\"499\" height=\"499\" class=\"alignnone size-large wp-image-26709\" srcset=\"\/wp-content\/uploads\/2020\/07\/griddb_put.png 499w, \/wp-content\/uploads\/2020\/07\/griddb_put-150x150.png 150w, \/wp-content\/uploads\/2020\/07\/griddb_put-300x300.png 300w, \/wp-content\/uploads\/2020\/07\/griddb_put-230x230.png 230w, \/wp-content\/uploads\/2020\/07\/griddb_put-400x400.png 400w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/p>\n<p>The second set of connected nodes reads from GridDB and display the values using Dashboard Nodes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/connected_nodes1.png\" alt=\"\" width=\"774\" height=\"333\" class=\"alignnone size-large wp-image-26702\" srcset=\"\/wp-content\/uploads\/2020\/07\/connected_nodes1.png 774w, \/wp-content\/uploads\/2020\/07\/connected_nodes1-300x129.png 300w, \/wp-content\/uploads\/2020\/07\/connected_nodes1-768x330.png 768w, \/wp-content\/uploads\/2020\/07\/connected_nodes1-600x258.png 600w\" sizes=\"(max-width: 774px) 100vw, 774px\" \/><\/p>\n<p>The latest data is fetched from the GridDB container being written to above:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/griddb_query.png\" alt=\"\" width=\"500\" height=\"500\" class=\"alignnone size-large wp-image-26704\" srcset=\"\/wp-content\/uploads\/2020\/07\/griddb_query.png 500w, \/wp-content\/uploads\/2020\/07\/griddb_query-150x150.png 150w, \/wp-content\/uploads\/2020\/07\/griddb_query-300x300.png 300w, \/wp-content\/uploads\/2020\/07\/griddb_query-230x230.png 230w, \/wp-content\/uploads\/2020\/07\/griddb_query-400x400.png 400w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>The data output by the Query Node needs to be transformed to be usable by the Gauge Dashboard element. The Gauge Node itself needs no actual configuration. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/gauge-1024x640.png\" alt=\"\" width=\"1024\" height=\"640\" class=\"alignnone size-large wp-image-26716\" srcset=\"\/wp-content\/uploads\/2020\/07\/gauge-1024x640.png 1024w, \/wp-content\/uploads\/2020\/07\/gauge-300x188.png 300w, \/wp-content\/uploads\/2020\/07\/gauge-768x480.png 768w, \/wp-content\/uploads\/2020\/07\/gauge-600x375.png 600w, \/wp-content\/uploads\/2020\/07\/gauge.png 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Like above, the data needs to be transformed to be usable by the Chart. The Chart node itself needs no actual configuration. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/chart.png\" alt=\"\" width=\"492\" height=\"391\" class=\"alignnone size-large wp-image-26715\" srcset=\"\/wp-content\/uploads\/2020\/07\/chart.png 492w, \/wp-content\/uploads\/2020\/07\/chart-300x238.png 300w\" sizes=\"(max-width: 492px) 100vw, 492px\" \/><\/p>\n<p>Now with both sets of connected nodes deployed we open the Dashboard page and can see the simple visualizations from the data collected from our PLC: http:\/\/your_pi_ip:1880\/ui\/ <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/07\/ui-1024x604.png\" alt=\"\" width=\"1024\" height=\"604\" class=\"alignnone size-large wp-image-26698\" srcset=\"\/wp-content\/uploads\/2020\/07\/ui-1024x604.png 1024w, \/wp-content\/uploads\/2020\/07\/ui-300x177.png 300w, \/wp-content\/uploads\/2020\/07\/ui-768x453.png 768w, \/wp-content\/uploads\/2020\/07\/ui-600x354.png 600w, \/wp-content\/uploads\/2020\/07\/ui.png 1761w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Your digital temperature sensor, Arduino PLC, Raspberry PI have now been connected together with Modbus, GridDB, and a Node-Red Flow to create a simple IIoT solution that can be easily expanded with more temperature sensors or other sensor types. <\/p>\n<p>If you have any questions regarding this project or anything else related to GridDB, please feel free to ask on StackOverflow: https:\/\/stackoverflow.com\/questions\/ask?tags=griddb<\/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 Modbus to read temperature sensor data from an Industrial Shields M-DUINO 21+ Arduino PLC. Table of Contents Raspberry Pi Setup Raspberry Pi OS GridDB [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":26720,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46609","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>IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC. | 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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC. | 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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\" \/>\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-08-20T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:54:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2020\/07\/blockdia.png\" \/>\n\t<meta property=\"og:image:width\" content=\"810\" \/>\n\t<meta property=\"og:image:height\" content=\"439\" \/>\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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\"},\"author\":{\"name\":\"Owen\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\"},\"headline\":\"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC.\",\"datePublished\":\"2020-08-20T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:54:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\"},\"wordCount\":944,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/07\/blockdia.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\",\"name\":\"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC. | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/07\/blockdia.png\",\"datePublished\":\"2020-08-20T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:54:58+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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2020\/07\/blockdia.png\",\"contentUrl\":\"\/wp-content\/uploads\/2020\/07\/blockdia.png\",\"width\":810,\"height\":439},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.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.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.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.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.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\",\"name\":\"Owen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/owen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC. | 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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/","og_locale":"en_US","og_type":"article","og_title":"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC. | 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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2020-08-20T07:00:00+00:00","article_modified_time":"2025-11-13T20:54:58+00:00","og_image":[{"width":810,"height":439,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2020\/07\/blockdia.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#article","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/"},"author":{"name":"Owen","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66"},"headline":"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC.","datePublished":"2020-08-20T07:00:00+00:00","dateModified":"2025-11-13T20:54:58+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/"},"wordCount":944,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/07\/blockdia.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/","name":"IIoT Project using GridDB on Raspberry Pi, Node-Red, and an Arduino PLC. | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/07\/blockdia.png","datePublished":"2020-08-20T07:00:00+00:00","dateModified":"2025-11-13T20:54:58+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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/iiot-project-using-griddb-on-raspberry-pi-node-red-and-an-arduino-plc\/#primaryimage","url":"\/wp-content\/uploads\/2020\/07\/blockdia.png","contentUrl":"\/wp-content\/uploads\/2020\/07\/blockdia.png","width":810,"height":439},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.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.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.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.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.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66","name":"Owen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.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-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/owen\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/comments?post=46609"}],"version-history":[{"count":1,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46609\/revisions"}],"predecessor-version":[{"id":51291,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46609\/revisions\/51291"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media\/26720"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media?parent=46609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/categories?post=46609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/tags?post=46609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}