Raspberry Pi, Node.js and Twilio – Is It Raining Arvind? #IoT

Usually my mom dries the clothes on the terrace and whenever I am at home she keeps asking me to look outside and tell her if it raining or not. Literally every half an hour or every time she hears a swoosh or a woosh from outside.

I was fed up and wanted to eliminate the middle man (me). So I came up with an app. It is called “Is it raining Arvind?” (LOL I know) . All the app does is tell my mom if it is raining outside now. And when it starts raining, the app triggers a buzzer and sends an SMS to my mom. Smart right! And I was off the hook.

So, this is how the app works. It uses the conductive property of the water. There are 2 wires that are connected to the Pi between a GPIO pin and 5v. And when these 2 pins are connected, it triggers a High on GPIO pin. So, we place these 2 wires outside on the terrace inside a bowl. Once the bowl is filled with water because of the rain, the circuit is completed and a High is triggered on the GPIO.

We take advantage of the GPIO high and then trigger the buzzer and send an SMS using Twilio. Smart right!?

Below is a quick demo of the app

Sweet right!

You can find the completed code here.

So, let us get started.

Raspberry pi, an Ultrasonic Sensor and Node.js – Measure Distances

In this post, we will interface an Ultrasonic sensor – HC-SR04 and Raspberry Pi B+. And then we will write a Node.js program to detect the distances between an object and the Ultrasonic sensor. We will be using an awesome Node.js module named r-pi-usonic to interact with the Ultrasonic sensor from our Pi.

We will be implementing 2 variations of measuring distances using the Ultrasonic sensor. One variation is to get the distance on demand. And the second one is to continuously measure the distance.

Below is a quick demo on

Measuring on-demand

A continuous measurement of distance

You can find the completed code here.

So, let us get started.

Raspberry Pi, 16×2 LCD and Node.js – Print stuff

In this post, we will interface Raspberry Pi and a 16 X 2 Liquid Crystal Display. And then we will write a Node.js program to print some information on the LCD using the lcd node module. We will see how to print a Digital clock, get the Pi’s IP Address and print the same and how we can interact with the world wide web and display the same on the LCD.

Below is a quick demo of how you can print stuff using a Web Browser

You can find the completed code here.

So let us get started.

Node Webkit, Firebase and Ionic Framework – A one to one chat client

A few days ago Pooja Pasupu reached out to me after reading one of my articles on Node webkit named Building a Chat App with node-webkit, Firebase, and AngularJS. In the above article I have shown how to create a desktop based group chat client using Node webkit and Firebase. She wanted to know if we can build a desktop application for one to one chatting like Google talk or Yahoo messenger using node webkit. And this post is a response to that query.

In this post, we are going to build a desktop application that is like your typical one to one chat client. Where, a user logs in, sees a list of other users. And can chat with any of them. This app is called Chatter.

Below is a quick demo of the completed app.

PS : I have opened 2 clients on the same machine to demo the application.

As you can see from the above demo, we have used Firebase as our data store to manage the user’s presence and their chat messages. And also, if you did notice, when User B sent a new message to User A, a new chat window opened automatically, like a typical chat app.

We will take a look at how all the above can be achieved. So, let us get started on building Chatter.

You can find the completed code here.

Angularjs, Material Design and Twitter Streams – A Twitter Live Search App

Recently I have stumbled upon Angular Material an Angularjs implementation of the Material Design and wanted to take it for a quick spin. This post gives an overview of  the same along with couple of other technologies.

If you have not heard about Material Design, take a look at this.

Material Design is a specification for a unified system of visual, motion, and interaction design that adapts across different devices.

The material design project for Angular is

a complementary effort to the Polymer project’s paper elements collection. Our goal is to provide a set of AngularJS-native UI elements that implement the material design system.

In this post, we will be using Twitter’s Streaming API to access public stream with the help of a Node module named Twit and then filter the stream based on the search text a user enter.

We would be using socket.io to keep the Node.js server in sync with the Angular client.

The final app would look like

Screen Shot 2014-11-08 at 2.44.12 pm

You can find the completed code here.

So, let us get started.

Web Speech API, Phonegap and Phonegap build – A Smart Mouth App

Imagine you are on a vacation to Paris and you do not know how to speak French! Wouldn’t that be a big bummer? What if, there was an App that can speak french on your behalf?

Sounds intriguing right?

I got this idea from Eric Bidelman’s demo on the Web Speech API

Note : The Web Speech API starts @ 30 minutes into the video

So, I wanted to replicate this idea as a hybrid mobile app. But because of the poor webview support for Web Speech API, I was looking around for a polyfill.

Getting Started with Web Speech API

For the past few days, I have been playing around with the Web Speech API and to be honest it is very impressive!

It started with the post named Web apps that talk – Introduction to the Speech Synthesis API by Eric Bidelman on HTML5 Rocks. Below is a video excerpt from that post

Raspberry Pi, Camera and Node.js – Live Streaming with Websockets #IoT

A few days ago Bala Kolluru has reached out to me asking if we can control a Raspberry Pi camera module using Web browser, so he can view a live stream from any HTML5 powered device. I was intrigued by this idea and wanted to give it a try.

In this post, we will see how we can implement a system that can “stream” a video from our pi to a browser. The completed system would look like

Pretty sweet right! I am able to see my aquarium from any where and check on my only gold fish. This can be extended to do anything.

For instance, you can hook the camera up pointing at the front door, as soon as someone rings the bell, you can see who is at the door by opening the video stream URL in your mobile/tablet/computer and confirm if you need to wear pants to open the door.

So let us see how we can build such an awesome multi-purpose system.

You can find the complete code for this system here.

Raspberry Pi, Camera, Node.js – Video & Email The Intruder

In one of my earlier posts : Raspberry pi, PIR Sensor and Node.js – An IoT Intruder Alert system, I have shown how you can detect intruders with Raspberry Pi and a PIR sensor.  And once the intruder is detected, an email will be sent with the time of incident.

This is good but not that helpful. In this post, instead of just sending an email, we will record a video of the intruder as the “act” is performed and then attach that video along with the email. Sweet right!

Below is a quick demo that show how things work

The video is a bit fast and too shaky. So Let me quickly run you through it. First we start the node program. As soon as a intruder is detected, the buzzer gets triggered. At the same time, we start the recording on the camera. We record a video for 10 seconds and then start sending the same in an email.

Pretty sweet right!

You can find the completed code here.

So let us get started building this IoT Video and Email The Intruder system!