• Home
  • Privacy Policy
  • Raspberry Pi Online Course Video Training Tutorials
  • Sitemap
  • Raspberry PI Projects RSS Feeds
  • Home
  • Privacy Policy
  • Raspberry Pi Online Course Video Training Tutorials
  • Sitemap
  • Raspberry PI Projects RSS Feeds
Raspberry PI Projects Raspberry PI Projects
  • Home
  • Projects List
    • Projects List
    • Raspberry Pi Projects by Application
  • PDF Projects Downloadable
    • Raspberry PI Projects List in PDF Download
    • Raspberry Pi Complete Project List in PDF
    • Raspberry Pi Home Automation Projects PDF download offline
  • E-Books
    • E-Books
    • Free E-Books
  • Tutorials
    • Raspberry Pi Online Course Video Training Tutorials
    • Video Tutorials for Raspberry
  • Blog
  • News & Updates
    • Raspberry PI News
  • Contact Us
Menu
  • Home
  • Projects List
    • Projects List
    • Raspberry Pi Projects by Application
  • PDF Projects Downloadable
    • Raspberry PI Projects List in PDF Download
    • Raspberry Pi Complete Project List in PDF
    • Raspberry Pi Home Automation Projects PDF download offline
  • E-Books
    • E-Books
    • Free E-Books
  • Tutorials
    • Raspberry Pi Online Course Video Training Tutorials
    • Video Tutorials for Raspberry
  • Blog
  • News & Updates
    • Raspberry PI News
  • Contact Us
loading...
Latest Feeds
  • ONION OMEGA2 PRO – A TINY, OPEN SOURCE LINUX DEV BOARD
  • Raspberry Pi quadruped robot with deep learning technology
  • REVIEW: ICHIGOJAM SINGLE BOARD COMPUTER
  • PCB Sponsorship for Non-Profit Projects and Crowd Funding Projects
  • PLAY CHESS LIKE HARRY POTTER
  • Gesture Controlled Robot Using Raspberry Pi
  • Garz and Fricke’s launches new SBC that runs Linux on i.MX6 ULL and i.MX6 Solo
  • An introduction to GPIO Settings
  • AMS AS7024 Vital Signs Sensor Module
  • LoRa-to-Ethernet Gateway
Home Projects Home Automation Projects Home Automation with Raspberry Pi

Home Automation with Raspberry Pi

on: January 22, 2016In: Home Automation Projects
Print Email
Share this:
  • Share via Facebook
  • Share via Google
  • Share via Twitter
  • Share via WhatsApp
  • Share via LinkedIn
  • Share via Pinterest
  • Share via Ravelry
  • Share via StumbleUpon
  • Share via VK
  • Share via Email
  • Share via Xing
  • Share via Reddit
  • Share via Tumblr
  • Share via Digg

The Surveillance System

this year I planned to travel with my family to China for a few weeks, so we had to leave alone our house. While being on vacation, I wanted to check sometimes if everything was alright at home. So I decided to install two more cameras and connect them to the webserver of my home automation system. I had one camera attached already before and I wrote about it here. Both cameras I placed inside the house so I did not have to bother about rain. One was directed to our garden through a window, the other was directed to our living room. I could have done more thoughts about the camera placement, but I considered this more as an experiment. Also I was constrained with the cables. I wanted to use the raspberry connected to the cameras without wireless, so there was only one place left to put the cameras without drilling holes: close to my dsl modem. Home Automation with Raspberry Pi

The webcams and the hub

I bought two webcam vx-800 mostly because they are cheap, and I had good experience with them with the my first camera. Unfortunately this type of camera has a fixed shutter, so it controls the light passed through with the shutter speed. The problem is that the pictures are very often overexposed. But for this time I did not want to spend more money on the them. The usb ports of the raspberry pi can only deliver about 100mA, and with two cameras, it will be over the limit. So I also bought a 4 port hub from logilink. A power supply came with it, and it was able to provide more than 1 A. It never came up to my mind before, but when you have a power supply for the hub, you dont need an additional one for the raspberry. It draws its power from the hub via usb.

The motion detection

I think it is quite useless to have a pure webcam, which constantly delivers life pictures. It is better that the cameras detect motions and store the motions on the sd card as a video. For this I installed the application motion. I created a howto guide here, so I will only describe a few settings here. In the motion config file motion.conf, I had to add (or take out the comments) the following two lines: thread /etc/motion/thread1.conf thread /etc/motion/thread2.conf So since I had two cameras, there were two config files. In the files thread1.conf and thread2.conf I adjusted the parameters target_dir and webcam_port. It worked almost instantly (I had few problems, but honestly I forgot about them). You can setup motion to generate shockwave files each time the number of pixels exceeds a threshold between two sequential pictures. I assume it is the parameter ffmpeg_video_codec. And this is exactly what I want. If there is some movement, the raspberry pi is storing this movement as a short video. Now the webserver just needs to pick up the videos and integrates them into the webpage generation process. Home Automation with Raspberry Pi Code

The video retrieval

my webserver runs on a different raspiberry pi, than the one which runs the motion detection with the cameras. So I implemented a getter program which downloads the swf files from the camera raspberry. I pasted the code which is doing this below. The first step, it logs into the camera raspberry with ssh and it uses a public key to overcome the need for a password, see the -i option. Then it executes the find command to get all swf files which are not older than 3 hours. In the second step, it searches for all swf files in an directory of the webserver. In the foreach loop, the program checks if the swf files already have been loaded, if not, it loads them with a scp command. Note the -i option, which is needed to omit the password entry.

my @args1 = (“ssh”, “-i /home/pi/cam23key”, “pi\@192.168.2.103 “, “\”find /data/webcam/cam2/ -mmin -180 -type f  | grep swf; \””); my @args2 = (“find /var/www/cgi-bin/pics/cam3 -type f | grep swf”); my line;my @lines1;my @lines2;open(IN1, “@args1 |”) or die “Can’t open pipe: !”;while(<IN1>) {    line = _;    chomp(line);    push(@lines1, line); }close(IN1); open(IN2, “@args2 |”) or die “Can’t open pipe: !”;while(<IN2>) { line = _;    chomp(line);    push(@lines2, basename(line));}close(IN2);foreach(@lines1) {    line = _;    if (grep {_ eq basename(line)} @lines2) {    print “Found line\n”;    } else {    print “No line, copying …\n”;    my ret = system(“scp -q -i /home/pi/cam23key pi\@192.168.2.103:line /var/www/cgi-bin/pics/cam3”);    } }
 
For more detail: Home Automation with Raspberry Pi



Low cost PCB on PCBWay - only $5 for 10 PCBs and FREE first order for new members
PCB Assembly service starts from $88 with Free shipping all around world + Free stencil
PCBWay 2nd PCB Design Contest

READ  Home-Made Raspberry Pi Cobbler
Tags: automationhomeraspberry pi
  • Previous

    Part 2: How to build a High-Definition FPV UAV using a Rasperry PI with HD camera, using a high speed WiFi link

  • Next

    Aaron’s piHouse Monitor

Related Articles

  • MATRIX ALEXA HOME AUTOMATION – MATRIX VOICE/CREATOR & RASPBERRY PI

    MATRIX ALEXA HOME AUTOMATION – MATRIX VOICE/CREATOR & RASPBERRY PI

    January 25, 2019
  • Telemonitoring System With Raspberry Pi

    Telemonitoring System With Raspberry Pi

    November 02, 2018
  • Octopod: Smart IoT Home/Industry Automation Project

    Octopod: Smart IoT Home/Industry Automation Project

    October 11, 2018

let’s socialize

Tools

PCB Assembly Services
Free PCB Design Software - EasyEDA
Draw Schematic and Board here:
https://easyeda.com/editor
$2 to Prototype PCB - JLCPCB
Online Instant PCB Quote

Raspberry PI Weekly Newsletter

Subscribe To A Specific Category

Get Notified Whenever There Is A New Project In Your Desired Category

Projects by Application

Raspberry Battery ProjectsRaspberry Battery Projects
Raspberry Calculator Based ProjectsCalculator Projects
Raspberry Camara ProjectsRaspberry Video – Camera – Imaging Projects
Raspberry Car Auto projectsRaspberry Car Projects
Raspberry Clock and Timer ProjectsClock – Timer Projects
Raspberry CNC Machines ProjectsCNC Machines Projects
Raspberry Development Board ProjectsDevelopment Board – Kits Projects
Raspberry DIY ProjectsHow To – DIY – Projects
Raspberry Game and Entertainment ProjectsGame – Entertainment Projects
Raspberry GPS ProjectsGPS Based Projects
Raspberry Home Automation ProjectsHome Automation Projects
Raspberry InterfacingUSB ProjectsInterfacing(USB – RS232 – I2c -ISP) Projects
Raspberry Internet and LAN ProjectsInternet – Ethernet – LAN Projects
Raspberry LCD Based ProjectsRaspberry LCD Projects
Raspberry LED Based ProjectsRaspberry LED Projects
Raspberry Medical and Health ProjectsMedical – Health based Projects
Raspberry Memory and Storage ProjectsMemory – Storage Projects
Raspberry Metering Instrument projectsMetering – Instrument Projects
Raspberry Motor based projectsRaspberry Motor Projects
Raspberry Others ProjectOther Projects
Raspberry Phone ProjectsPhone Projects
Raspberry PWM ProjectsRaspberry PWM Projects
Raspberry Radio ProjectsRadio Projects
Raspberry RFID ProjectsRaspberry RFID Projects
Raspberry Robotics ProjectsRobotics – Automation Projects
Raspberry RTOS ProjectsRaspberry RTOS – OS Projects
Raspberry Security and Safety ProjectsSecurity – Safety Projects
Raspberry Sensor Detector ProjectsSensor – Transducer – Detector Projects
Raspberry Sound and Audio ProjectsSound – Audio Projects
Raspberry Temperature Measurement ProjectsTemperature Measurement Projects

Sponsor Us

advertise with us

Useful Resources

  • Blog
  • E-Books
  • News & Updates
  • Tutorials
  • Projects List
  • Online Video Training / Courses
  • Raspberry Pi Online Course Video Training Tutorials

Facebook

Advance Search

Select Category:



Enter Search Terms:



Recent Posts

IoT based Raspberry Pi home automation using IBM Bluemix

March 04, 2015

Home Energy Monitoring System

January 04, 2016

Raspberry Pi Home Automation – Control lights, computers, CCTV and more!

July 29, 2016

© 2015 Powered By Wise Technologies, Use Raspberry for Projects | Privacy Policy

  • Blog
  • E-Books
  • News & Updates
  • Tutorials
  • Projects List
  • Online Video Training / Courses
  • Raspberry Pi Online Course Video Training Tutorials
Desktop Version Mobile Version