Send a Tweet From Raspberry Pi GPIO Pin

Use NodeCode Studio and a Twitter Service to send a tweet when motion is detected using a PIR sensor

Similar projects worth following
Use NodeCode Studio and a Twitter Service to send a tweet when motion is detected using a PIR sensor.

We use a RPiGpio Service running on the Raspberry Pi to send a signal to a Text Generator Node running on a Transform Service that is then sent to a Send Tweet Node running on a Twitter Service.

We use three NodeCode Services on two different machines that are wired together using DataStreams (can be thought of as virtual wires) two send update our status on Twitter.

We are using the following Nodes:

  • Interrupt Pin Reader Node in the RPiGpio Service.
  • Bool To Signal Node in the Transforms Service.
  • Constant Signal To Text Node in the Transforms Service.
  • Send Public Status Node in the Twitter Service.


The exported motion detector Fritzing diagram.

Portable Network Graphics (PNG) - 279.81 kB - 10/22/2016 at 20:22



The motion detector Fritzing diagram.

fzz - 9.70 kB - 10/22/2016 at 20:22


  • 1
    Step 1

    We love the idea of using signals from sensors to kick off all sorts of different processes. We use NodeCode to orchestrate many different signals from many different devices and direct them to perform actions.

    In this case, a simple signal from a motion detector will be sent to a Service that has the ability to convert the true/false signal from the motion detector into a text signal that is then passed to another Service that is able to Tweet.

    To get started with NodeCode, go to, download the installer and then try the LED tutorial. If you are able to get through that then you should be able to set this up (as well as anything else you can imagine) very easily.

    First, we need to wire up our PIR sensor.

  • 2
    Step 2

    We will need a RPiGpio Service Pack downloaded and added to the Raspberry Pi with the Motion Detector hooked up.

    We can then drag-n-drop an Interrupt Pin Reader onto the Program Canvas and set the Pin Number to 0. NodeCode uses the excellent Wiring Pi library and has inherited the Wiring Pin numbering scheme ( We've renamed the Pin to 'Motion Detector' here as well.

  • 3
    Step 3

    We then need the Transform Service Pack downloaded and added to any device that has a NodeCode Agent installed. The same machine that is running NodeCode Studio works in this case.

    We've added a Bool To Signal Node as well as a Constant Signal To Text Node from the Transform Service. The Constant Signal To Text Node has one property that you need to set. This will be the text value that is sent to the Twitter Service.

View all 5 instructions

Enjoy this project?



Alex Martin wrote 11/09/2016 at 22:52 point

Cool idea! What sort of applications do you have in mind for this device?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates