Advertisement

Sri Lanka's First and Only Platform for Luxury Houses and Apartment for Sale, Rent

Sunday, March 13, 2016

Home Security using Raspberry Pi + Web Cam + PIR Sensor and Telegram Bot

I saw a post in Hackaday.com which was about using Telegram API to control LEDs attached to a Raspberry Pi. Telegram is a messaging service similar to Watsapp but it allows a unique bot API to support its non human machine to machine communication. 

Because of this feature it is hacker friendly because the possibilities are only limited by imagination. I had a PIR sensor and a USB web camera lying around and thought it would be cool to put together something related to Telegram bot API using those.

In Sri Lanka CCTV cameras selling like hot cake and office and home security surveillance has become a high priority in the last couple of years. Because of this I thought it would be cool to put a Home security service for me using the aforementioned components. 

Thus came up with the following schematic.


And attached the USB camera to the Raspberry Pi's USB port. 


Finally a little bit of coding 




After installing all important Telegram messenger and creating a bot by going through the Documentation of Telegram, finally I managed to get the whole thing working together. You can see the application in action in the following video.



References
  1. Telegram on Raspberry Pi
  2. Raspberry Pi + PIR
  3. Telegram Bot Python Library
  4. Telegram Bots Introduction
  5. Standard Web Cam usage in Raspberry Pi

Thursday, March 3, 2016

Temperature and Humidity Measuring using Arduino + DHT Sensor

Oven, the somewhat correct word which can be used explain Sri Lankan climate at the moment. It becomes so hot during the day and somewhat similar in the nights. Sleeping is impossible without taking a shower. Ideal time to do a project to measure the Humidity and Temperature.

Had the DHT sensor and a 8x2 LCD (GDM0802A) lying around in my electronics collection and thought to put up a small project. 

Unfortunately the LCD didn't have pins so I had to do a bit of soldering. To be honest not the most experienced man when it comes to soldering, so was a bit worried to get started and going. But anyway went on with it and finally managed to do a pretty decent job with the hot iron and it came out well enough to work.


And managed to get the following schematic in place for the project. 

And a bit of Arduino coding to get the sketch done. 

Finally the whole project in working mode.


And video of humidity changing when a cold water bottle is placed near.



References
  1. DHT Library - https://arduino-info.wikispaces.com/DHT11-Humidity-TempSensor
  2. GDM0802A Datasheet - https://www.robot-r-us.com/pololu/sensorlcd/532-gdm0802a-fl-ybw.html