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.

Continue reading

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.

Continue reading

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.

Continue reading

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.

Continue reading

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!

Continue reading

Raspberry pi, PIR Sensor and Node.js – An IoT Intruder Alert system

In this post, we will build an Internet of Things Intruder alert system. This system uses a PIR Sensor along with the Raspberry pi. When the PIR Sensor detects a change in a given surrounding, it will trigger the Pi to send out an email to a user with the time of intrusion. Sweet right!

The final system would look like

You can find the completed code here.

So, let us get started.

Continue reading

Raspberry pi, a Buzzer and Node.js – An IoT Doorbell

In this post, we will build an embedded system – A Doorbell, with Raspberry pi B+, A Buzzer and Node.js. This embedded system will act as both a normal Doorbell with a button switch and the same doorbell can be controlled over internet.  Simple right?

The final output of this embedded system would look like

 

The completed code can be found here.

So, let us get started.

Continue reading

Raspberry Pi, Node.js and a LED – Emit Morse Code

Raspberry Pi, Node.js and a LED – Emit Morse Code

In this post, we will get our hands a bit dirty with Raspberry Pi, Node.js and a LED. We will be writing a simple program in Node.js to turn a LED on and off. Then we will extend this logic to build a simple piece of embedded system that can take a piece of string and emit its morse code.

Interesting right? Below is a quick video as what we will be building

The above LED is emitting the Morse code for SOS. That is (… ___ …) [Dot Dot Dot, Dash Dash Dash, Dot Dot Dot]. Nice right?

You can get the completed code here.

So, let us get started.

Continue reading

Getting Started with Raspberry pi and Node.js

Getting Started with Raspberry pi and Node.js

Did you know that there will be 6.18 billion devices connected to the internet by the end of 2014 and a whooping 19.42 billion devices between 2015 and 2017. Imagine the fight for bandwidth!

With so many devices connected to the Internet, the next big thing for us is the “Internet of Things” or the IoT.  If you do not already know what Internet of Things is, check out this video

So what can we really do with IoT, take a look at this

Awesome right! A piece of hardware, some internet and a world full of opportunities.

This post marks the beginning of a bunch of posts that are targeted at integrating Hardware/embedded devices like sensors and motors with the internet and build meaningful and smart apps that would know and do things as per your instructions taking us one step closer to pure Artificial Intelligence!

In this post, we will take the first few tiny steps towards IoT. For most of the experiments, I am going to use Raspberry Pi B+. And as you might have guessed, all the programming we are going to do will be in Javascript.

First we will take a look at connecting our pi to our computer and next, we will install Node.js.

So, let us get started

Continue reading