[{"data":1,"prerenderedAt":478},["ShallowReactive",2],{"node-red-\u002Fnode-red\u002Fperipheral\u002Fardiuno":3},{"id":4,"title":5,"body":6,"description":470,"extension":471,"meta":472,"navigation":473,"path":474,"seo":475,"stem":476,"__hash__":477},"nodeRed\u002Fnode-red\u002Fperipheral\u002Fardiuno.md","Connecting Arduino to Node-RED",{"type":7,"value":8,"toc":454},"minimark",[9,17,26,31,67,71,97,108,112,176,180,185,195,250,254,261,300,304,307,341,345,349,352,383,387,390,421,444],[10,11,13],"h1",{"id":12},"",[14,15],"binding",{"value":16},"meta.title",[18,19,20,21,25],"p",{},"This documentation explains how to use Node-RED to interact with an Arduino board via serial communication using the Firmata protocol. It covers how to write to and read from digital and analog pins using the ",[22,23,24],"code",{},"node-red-node-arduino"," package.",[27,28,30],"h2",{"id":29},"requirements","Requirements",[32,33,34,38,49,57],"ul",{},[35,36,37],"li",{},"An Arduino board connected via USB to the device running Node-RED.",[35,39,40,41,48],{},"The ",[42,43,47],"a",{"href":44,"rel":45},"https:\u002F\u002Fgithub.com\u002Ffirmata\u002Fprotocol",[46],"nofollow","StandardFirmata"," sketch uploaded to the Arduino board.",[35,50,51,52,56],{},"Node-RED installed and running on the connected device. The quickest way to set up and run Node-RED is ",[42,53,55],{"href":54},"\u002F","FlowFuse",".",[35,58,59,60,66],{},"The Node-RED package ",[42,61,64],{"href":62,"rel":63},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002Fnode-red-node-arduino",[46],[22,65,24],{}," installed.",[27,68,70],{"id":69},"step-1-install-arduino-nodes","Step 1: Install Arduino Nodes",[72,73,74,77,84,91],"ol",{},[35,75,76],{},"Open the Node-RED editor.",[35,78,79,80,56],{},"Open the main menu and select ",[81,82,83],"strong",{},"Manage Palette",[35,85,86,87,90],{},"Switch to the ",[81,88,89],{},"Install"," tab.",[35,92,93,94,96],{},"Search for ",[22,95,24],{}," and install it.",[18,98,99,100,103,104,107],{},"This will add ",[22,101,102],{},"arduino in"," and ",[22,105,106],{},"arduino out"," nodes to the palette.",[27,109,111],{"id":110},"step-2-configure-arduino-connection","Step 2: Configure Arduino Connection",[72,113,114,123,126,133,160,170],{},[35,115,116,117,119,120,122],{},"Drag either an ",[22,118,102],{}," or ",[22,121,106],{}," node onto the canvas.",[35,124,125],{},"Double-click the node to open the configuration window.",[35,127,128,129,132],{},"Click the pencil icon next to the ",[81,130,131],{},"Arduino board"," field.",[35,134,135,136],{},"Enter the correct serial port:\n",[32,137,138,149],{},[35,139,140,141,144,145,148],{},"Windows: ",[22,142,143],{},"COMx"," (e.g., ",[22,146,147],{},"COM5",")",[35,150,151,152,155,156,159],{},"Linux\u002FmacOS: ",[22,153,154],{},"\u002Fdev\u002FttyUSB0",", ",[22,157,158],{},"\u002Fdev\u002FttyACM0",", etc.",[35,161,162,163,166,167,56],{},"Click ",[81,164,165],{},"Add"," and then ",[81,168,169],{},"Done",[35,171,162,172,175],{},[81,173,174],{},"Deploy",". A green status indicator confirms successful connection.",[27,177,179],{"id":178},"step-3-write-to-arduino-pins","Step 3: Write to Arduino Pins",[181,182,184],"h3",{"id":183},"_31-write-digital-output","3.1 Write Digital Output",[18,186,187,188,119,191,194],{},"To write a digital value (",[22,189,190],{},"0",[22,192,193],{},"1",") to a pin:",[72,196,197,203,226,241,247],{},[35,198,199,200,202],{},"Drag an ",[22,201,106],{}," node to the canvas.",[35,204,205,206],{},"Double-click and set:\n",[32,207,208,217],{},[35,209,210,213,214],{},[81,211,212],{},"Pin",": e.g., ",[22,215,216],{},"13",[35,218,219,222,223],{},[81,220,221],{},"Type",": ",[22,224,225],{},"Digital",[35,227,228,229,232,233,236,237,240],{},"Use ",[22,230,231],{},"inject"," nodes to send ",[22,234,235],{},"true"," (HIGH) and ",[22,238,239],{},"false"," (LOW) payloads.",[35,242,243,244,246],{},"Connect the inject nodes to the ",[22,245,106],{}," node.",[35,248,249],{},"Deploy and test.",[181,251,253],{"id":252},"_32-write-analog-output-pwm","3.2 Write Analog Output (PWM)",[18,255,256,257,260],{},"To write a PWM signal (",[22,258,259],{},"0–255",") to a supported pin:",[72,262,263,268,288,297],{},[35,264,265,266,246],{},"Use an ",[22,267,106],{},[35,269,270,271],{},"Set:\n",[32,272,273,281],{},[35,274,275,213,277,280],{},[81,276,212],{},[22,278,279],{},"5"," (PWM-capable)",[35,282,283,222,285],{},[81,284,221],{},[22,286,287],{},"Analog",[35,289,265,290,292,293,296],{},[22,291,231],{}," node to send a numeric payload (e.g., ",[22,294,295],{},"128",").",[35,298,299],{},"Connect and deploy.",[181,301,303],{"id":302},"_33-write-servo-angle","3.3 Write Servo Angle",[18,305,306],{},"To control a servo:",[72,308,309,313,331,339],{},[35,310,265,311,246],{},[22,312,106],{},[35,314,270,315],{},[32,316,317,324],{},[35,318,319,213,321],{},[81,320,212],{},[22,322,323],{},"9",[35,325,326,222,328],{},[81,327,221],{},[22,329,330],{},"Servo",[35,332,228,333,335,336,56],{},[22,334,231],{}," nodes to send values between ",[22,337,338],{},"0–180",[35,340,299],{},[27,342,344],{"id":343},"step-4-read-from-arduino-pins","Step 4: Read from Arduino Pins",[181,346,348],{"id":347},"_41-read-digital-input","4.1 Read Digital Input",[18,350,351],{},"To read a digital value from a pin:",[72,353,354,358,374,380],{},[35,355,199,356,246],{},[22,357,102],{},[35,359,270,360],{},[32,361,362,368],{},[35,363,364,213,366],{},[81,365,212],{},[22,367,323],{},[35,369,370,222,372],{},[81,371,221],{},[22,373,225],{},[35,375,376,377,246],{},"Connect the output to a ",[22,378,379],{},"debug",[35,381,382],{},"Deploy to see input values in real-time.",[181,384,386],{"id":385},"_42-read-analog-input","4.2 Read Analog Input",[18,388,389],{},"To read from an analog input pin:",[72,391,392,396,413,418],{},[35,393,265,394,246],{},[22,395,102],{},[35,397,270,398],{},[32,399,400,407],{},[35,401,402,213,404],{},[81,403,212],{},[22,405,406],{},"A0",[35,408,409,222,411],{},[81,410,221],{},[22,412,287],{},[35,414,415,416,246],{},"Connect to a ",[22,417,379],{},[35,419,420],{},"Deploy and monitor readings in the debug sidebar.",[18,422,423,424,103,426,428,429,432,433,155,436,439,440,443],{},"Once you have basic read\u002Fwrite functionality working with ",[22,425,231],{},[22,427,379],{}," nodes, you can easily build a ",[81,430,431],{},"dashboard interface"," using ",[22,434,435],{},"ui_button",[22,437,438],{},"ui_slider",", or ",[22,441,442],{},"ui_gauge"," nodes to control and monitor your Arduino through a web-based UI.",[18,445,446,447,450],{},"🔗 If you are looking for a more practical, step-by-step article with examples and a video demo, refer to this guide:",[448,449],"br",{},[42,451,453],{"href":452},"\u002Fblog\u002F2025\u002F02\u002Finteracting-with-arduino-using-node-red\u002F","Interacting with Arduino using Node-RED",{"title":12,"searchDepth":455,"depth":455,"links":456},2,[457,458,459,460,466],{"id":29,"depth":455,"text":30},{"id":69,"depth":455,"text":70},{"id":110,"depth":455,"text":111},{"id":178,"depth":455,"text":179,"children":461},[462,464,465],{"id":183,"depth":463,"text":184},3,{"id":252,"depth":463,"text":253},{"id":302,"depth":463,"text":303},{"id":343,"depth":455,"text":344,"children":467},[468,469],{"id":347,"depth":463,"text":348},{"id":385,"depth":463,"text":386},"Learn how to control and monitor Arduino hardware using Node-RED","md",{},true,"\u002Fnode-red\u002Fperipheral\u002Fardiuno",{"title":5,"description":470},"node-red\u002Fperipheral\u002Fardiuno","JwiB9mg450n-TfOLgL1zCoT9hFvwh991GWbiteVUp7E",1780070557843]