Sunday, April 21, 2024

IoT Based Smart Camera Using Android And Raspberry Pi

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.

Smartphone setup

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.

IoT based smart camera: My Butterfly Pi
Fig. 1: My Butterfly PIs
Fig. 2: My Butterfly PIs screen window

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).

- Advertisement -
Fig. 3: Add new item
Fig. 4: Device name and security code
Fig. 5: Butterfly TV offline mode

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 file in RPi as given below:

- Advertisement -

$ sudo nano /home/pi/scripts/

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).

Fig. 6: Butterfly online mode

To watch live video streams being captured by RPi camera, click Play (Fig. 6).

If Butterfly TV is still off, find 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.

Fig. 7: Video capture on the smartphone

Live video streaming will be automatically saved in your mobile. So you now have a mobile app controlled smart security camera.

If you found this IoT project useful then you may also like Top 30+ IoT Projects | IoT Project Ideas for Enthusiasts.

Biswajit Das was manager – R&D, EFY Labs, till recently


  1. Hello, When I try to download the image of Butterfly Pi from the given link I keep getting “Preview not available” error and a download option is given. When I try the download option, “Google virus scanning warning” is displayed at the title of the web page. Nothing is downloaded and at times the browser closes by itself. Can you please check if the link is working and correct it if it is not working.

    Thanks & Regards


Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components