Presented here is a project that lets your Raspberry Pi (RPi) turn into an IoT based smart camera and then control and watch live video being captured by this camera on your smartphone from anywhere on the planet. You just need an Internet connection on your RPi and smartphone. This project explains step-by-step procedure to build your own remote smart security camera.
Hardware required for building the camera are Android smartphone (4.0 or higher), RPi 2, Raspberry camera module, 5V, 1A power adaptor with micro-USB output, USB audio adaptor (optional) and USB Wi-Fi dongle (RPi 2-compatible).
Software required for this project is Buttery TV app. Since the project is developed using Butterfly TV and RPi, we have named it Butterfly PI. It has the following features:
1. You can broadcast live video in several resolutions.
2. It communicates with your audience via comments while you are broadcasting.
3. It allows you to share live video with your friends and followers on Facebook and Twitter.
4. You can sign up through Facebook or Google+.
5. You can watch and share your videos later and delete whenever you want.
Download and install Butterfly TV from Google Play store. Butterfly TV is integrated with the smartphone camera. Login to Butterfly TV and click on My Butterfly PIs item in the menu (Fig. 1). You should see the screen shown in Fig. 2 when you first open My Butterfly PIs screen.
Click on Add new Butterfly PI in the menu as shown in Fig. 3. Write your chosen camera name as device name and security code in Add new Butterfly PI dialogue box. You will need the name and code later to authenticate RPi. For example, let us select Balboa for both device name and security code (Fig. 4). After clicking OK, you should see your Butterfly PI as offline (Fig. 5).
Raspberry Pi setup
Download the image of Butterfly PI for RPi from here.
To write images to an SD card, the tutorial found on following link might be helpful: click here
Plug the MicroSD card into RPi and interface the camera to it. Make sure that power adaptor is unplugged. Now plug in your keyboard and mouse, and power on RPi. From the terminal, edit startup.sh file in RPi as given below:
$ sudo nano /home/pi/scripts/startup.sh
Change the following line:
java -jar /home/pi/butterflypi.jar
[DeviceName] [Security Code] &
Here, enter your device name and security code as Balboa. Press Ctrl+o to save it and Ctrl+x to exit the program.
Press Alt+Ctrl+F2, and you will get Command prompt. Enter pi as login user name and butterflypi as password.
Set up your Wi-Fi network from Menu→Preferences→WiFi Configuration. Enter your Wi-Fi SSID and password and click OK. Check your Internet connection and reboot your system. Your Butterfly TV will become online (Fig. 6).
To watch live video streams being captured by RPi camera, click Play (Fig. 6).
If Butterfly TV is still off, find startup.sh file in path/home/pi/scripts and open it to verify the device name and security code. Security code is a kind of password for your camera.
Live video streaming will be automatically saved in your mobile. So you now have a mobile app controlled smart security camera.
More projects are available here.
Biswajit Das was manager – R&D, EFY Labs, till recently