Posting Arduino Serial data to twitter using Node-Red

With Node-Red it is very easy to create work flows. Here will learn how to build a simple workflow to post the Serial output of Arduino (or any device that can send serial data) to twitter.

First you need to install Node-Red on your host (can be a windows system/Raspberry Pi) . Once installation is completed run the node-red , you will get a browser interface to edit the workflows.

Node-Red
Node-Red

In my case it is running on port 1880, open this link in your browser you will get a interface to edit workflows.

You can drag and drop the block you required into flow area. We are using Serial(input), debug(output) and Twitter(Output) blocks.

Serial Block
Serial Block
Twitter-block
Twitter-block
Debug
Debug

 

 

 

 

 

 

 

 

 

 

 

Connect the block in the following way. You can edit the properties of each block by double clicking on them. You need to mention COM port for Serial (Optionally you can give a name as well ), for twitter you need to authenticate with your twitter account.

 

Twitter_flow
Twitter_flow

 

Edit Serial port
Edit Serial port

finally load this script to Arduino

void setup() {
Serial.begin(9600);
}

void loop() {
delay(15000);
Serial.println(“Test data from Node-red”);
}

Deploy the flow, you can see your tweet in your feeds.

Note: If you try post same data within 5 min, you will get 403 error message with description “Status is duplicate”, that’s normal. You can change your data or wait for 5min.

twitter feed
twitter feed

Add a Comment

Your email address will not be published. Required fields are marked *