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!

Getting Started with Ionic Creator

11.41 AM, Home, Just finished my late morning snack. It was then I received an Email from The Ionic Team! It said

Screen Shot 2014-10-23 at 1.47.43 pm

And I was like Yay!!?? And wanted to quickly test drive it. So I clicked the link and navigated to creator.ionic.io. It was like

Screen Shot 2014-10-23 at 1.26.44 pm

My eyes began to widen and I quickly clicked on the Login link.

Screen Shot 2014-10-23 at 1.27.05 pm

Getting started with MQTT

In this post, we will take a look at a communication protocol named Message Queue Telemetry Transport a.k.a. MQTT. MQTT is a lightweight, secure, battery friendly and a machine-to-machine (M2M)/”Internet of Things” connectivity protocol.

Andy Stanford-Clark and Arlen Nipper from Cirrus Link Solutions authored the first version of the protocol in 1999.

What is MQTT?

MQTT (formerly Message Queue Telemetry Transport) is a publish-subscribe based “light weight” messaging protocol for use on top of the TCP/IP protocol. It is designed for connections with remote locations where a “small code footprint” is required and/or network bandwidth is limited. The Publish-Subscribe messaging pattern requires a message broker. The broker is responsible for distributing messages to interested clients based on the topic of a message.

The specification does not specify the meaning of “small code foot print” or the meaning of “limited network bandwidth”. Thus, the protocol’s availability for use depends on the context. In 2013 IBM submitted MQTT v3.1 to the OASIS specification body with a charter that ensured only minor changes to the specification could be accepted. MQTT-SN is a variation of the main protocol aimed at embedded devices on non-TCP/IP networks, such as ZigBee.

Historically, the ‘MQ’ in ‘MQTT’ came from IBM’s MQ message queuing product line. However, queuing per se is not required to be supported as a standard feature in all situations.

Real world applications

Facebook Messenger : Facebook has used aspects of MQTT in Facebook Messenger. However, it is unclear how much of MQTT is used or for what; Moreover it is to be noted that this is a phone application not a sensor application.

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.

Node-Webkit File Player – A File player for your desktop

A few days ago, Ignacio Tartavull reached out to me mentioning that he had built a file viewer based on Node Webkit powered Dashboard application and associated the node webkit app as the default opener for.ipynb files. Which I thought was a pretty genius idea. You can check out the INotebook app here.

Inspired by that idea, I have written a file browser/player app with node webkit that can “play” basic files like txt, log, json, md, mp3, mp4, png and jpeg.

Also, mustapha has reached out to me requesting another tutorial on Node webkit. And Mitesh Agarwal reached out to me requesting a post on a node webkit file viewer. So here it goes.

The final product we are going to build will look like

You can find the completed code here.

So, let us get started.

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.

Image Manipulation with Node.js and L.W.I.P.

Image and Manipulation with Node.js and lwip

I have been looking around the web for quite sometime now for a Node module that can perform a simple image resize. I did find node canvas, GraphicsMagick for node, but they all have pretty heavy dependencies and I did not want to go through so much pain for a simple resize.

Then I stumbled upon LWIP.

This module provides comprehensive, fast, and simple image processing and manipulation capabilities.

There are no external runtime dependencies, which means you don’t have to install anything else on your system.

The last line caught my attention and I wanted to give it a try. I have incorporated the Lwip in my blueimp-file-upload-expressjs module to create thumbnails after upload. And it works like a charm and without any hassle.

Eyal Arubas, the author of the module wrote a neat blog post, explaining why he had to come up with one such module for node.

In this post, we will take a look at Image processing with Node.js and Light weight Image processor. By the end of this post, we will turn this image


into this one


Image credits : https://flic.kr/p/dyvdpu

You can find the completed code and images here.

So, Let us get started.

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.

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