Close
0%
0%

Surveillance Robot Camera (SUROCAM)

A simple and cheap online Camera Robot Based on The MagPi magazine issue no.9. No hectic port forwarding configuration required.

Similar projects worth following
This project was build based on idea on how to make a simple and cheap online surveillance camera robot that everyone can build. Not only that the robot also have to be easy to use and maintain. Using the raspberry pi, few cheap components, a robot chassis/RC car, and webiopi tutorial on the MagPi magazine this project was successfully build. For launching this robot to be accessible online, ngrok service from www.ngrok.com is used. Without any hectic and difficult port forwarding configuration this robot now can be controlled from anyone in the world by just using firefox or chrome browser.
Here is a demo video: http://www.youtube.com/watch?v=9osFoNgC9cw

Hardware:

The Blok Diagram for the whole system:

No soldering is required to build this robot because I use jumper wire to connect all necessary connection between the GPIO to the L298n motor driver module, and then i connect the two dc motor to the mounting hole on the L298n module.

you can arrange all the parts to the main body all the way you like and then make it attach really strong using a few nuts and spacer.

the main thing you have to concern is arranging the cables neatly so the robot can move easily.

Software:

This robot run on raspbian using the webiopi framework. 

If you don't know how to install raspbian you can check:

http://www.raspberrypi.org/documentation/installation/installing-images/README.md

you can install webiopi using this tutorial:

https://learn.adafruit.com/raspberry-pi-garage-door-opener/web-io-pi

for the camera stream I use mjpg-streamer which give a very good streaming live video for the robot. this is how you can easily install it using this tutorial:

http://www.linuxcircle.com/2013/02/06/faster-video-streaming-on-raspberry-media-server-with-mjpg-streamer/

after installing the software needed you can grab my code from github:

https://github.com/chalei/surocam

make sure the raspberry pi is connected to your network.

launch the python program using on your raspberry pi using:

$ sudo python surocam.py

launch your browser then open:

<raspberrypiipaddress>:8000

and voila now you can control the robot by only using the web browser.

The configuration above is for using the robot offline which means you can only control it in a local network.

To make it online its a bit tricky because it need a static IP and whole lot other configuration needed. Most of it cannot be succeeded and its hard to find what went wrong for me

For using the robot online the simple way I use ngrok service. the information on how to use and download it, you can find it here:

https://ngrok.com/

make sure you sign up and get a token key, because you can choose the subdomain the way you want.

after you download the ngrok first you have to run the python program in the background using this command:

$ sudo python surocam.py &

then launch the ngrok software with the network port that was used and the subdomain you desired, for example:

$ ngrok -subdomain=surocam 8000

Open the web browser again but now open the DNS that you've choose before:

https://surocam.ngrok.com

Now you can easily access the robot from anywhere in the world just by using a web browser

  • 1 × Raspberry Pi Model B the main brain
  • 1 × 8 GB SD Card to store the software
  • 1 × Logitech C170 USB webcam for the eye of the robot
  • 1 × L298n Motor Driver Module Module to drive the 2 DC motor
  • 1 × Tp-Link Tl-WN722N USB wifi dongle for giving the robot an online connectivity

View all 11 components

  • Driving the Motors

    Hendra Kusumah08/19/2014 at 03:38 0 comments

    In order to drive the motor I don't need to use another microntrollers board because the Raspberry Pi capable to run Motor driver motor directly.

    For the motor driver I choose the L298n motor driver module because it can give 2 A to the motors and has 4 mounting hole that can be attached with nut or spacer and also it is quite cheap ($3 at amazon)

    The specs told me that it need 5v logical input and raspberry pi have 3,3v output from the GPIO. But on the first try it can take the 3,3 V input from the raspberry pi. and it also run well. the robot move smoothly no matter what kind of chassis it used.

    it also have onboard heatsink that can make L298 IC little bit "cooler"

  • Various Chassis option

    Hendra Kusumah08/19/2014 at 03:14 0 comments

    For the first robot prototype I use any material that was laying around my workstation. I found my cheap RC car that was used for my previous arduino project. So I unplugged the Arduino and plug in the Raspberry Pi to the RC car chassis

    this first prototype run very well and fast. Next I need to make it more good looking

    The 2nd prototype I used a track set kit from tamiya, after arranging all the parts and cables i got a better result

    but I still not satisfy with this chassis and it runs unstable because the weight problem.

    For the 3rd and final prototype I Use the RP5 Tank and it look better than before

    not only all the parts attached neatly, the robot runs very stable with this chassis.

  • Going Online The easy way

    Hendra Kusumah08/19/2014 at 02:57 0 comments

    After successfully make this robot run on a local network, the next step is to connect this robot to the world (via internet). After a few google hunt, they say I need to do a port forward and ip public is needed. If i dont have ip public I can use dynamic DNS service, but most of them does not come for free. Because It need a little bit hectic configuration and I also don't have any international money account (difficult country regulation), I need find the another option.

    Then I found pagekite from http://pagekite.net/, it is a service that based on python. I just download a few files and sign up free. After that just launch the pagekite app and the robot now can be access online anywhere. But there is still problem with this, because it only have one month trial and to continue the service I have to pay, the service is really cheap actually but I dont have any account to make the payment.

    After another google hunt I found about tunneling, and there are a lot of tunneling service. Then I choose ngrok from https://ngrok.com/ because of its simplycity. After signing up and get a token key, I insert the token to the raspberry pi and then launch the ngrok application. because I have already sign up I can choose any subdomain I want as long as it is not been used by other user. And the very great thing about this service is, it is free forever and does not require any difficult configuration.

  • Power Source option

    Hendra Kusumah08/19/2014 at 02:31 0 comments

    This robot use two power source, one for the Raspberry Pi and one for the L298n Motor Driver.

    For the raspberry Pi, I use two kind of USB battery Pack. 

    1. One with the big size has the capacity for 10.000 mAh with two output for 1 A and 2 A. with this battery Pack I can turn on the raspberry pi for 8-9 hour straight. but the problem here is the size for the battery pack is too big. On my not so big chassis, I need to forcely fit the battery pack, and the result was not good

    2. The second one is a smaller one with the capacity 5600 mAh and has one output for 1 A. Surprisingly the whole size of this USB battery pack fits perfectly to my chassis. It has shorter time to turn on the raspberry pi (4 hour) but I think its enough.

    For the L298n Motor Driver I use AA baterry with the minimum voltage of 6 V:

    1. First I use a pack of 4 AA alkaline battery that give 6 V to the motor driver module. Using this pack the wheel of the robot runs perfectly stable because the motor driver give 2 A current which is sufficient to make the robot walk normally. But again the size for this battery is too big for the chassis, and after 1 hour controlling the robot, the battery run out of power and I have to change the battery again and again.

    2. Later I use AA 3,7 V UltraFire Rechargable Battery. For this battery I only use two pieces and it already give me 7,4 V for the motor driver module. Since the module can receive voltage up to 12 V,  I don't need to add a power regulator. Because it only use 2 pieces battery, I can fit this battery pack anywhere I want in the chassis. It can make the robot run longer than the previous one for about 2 hour run time. And everytime it run out of power I just need to recharge it again

View all 4 project logs

Enjoy this project?

Share

Discussions

abhinavsonone777 wrote 04/26/2017 at 15:03 point

I am having interfacing issues with this project

my stream does not get load on html page

also controlling the two motors is not going properly

can u post the webiopi config file here so that ill get some idea

  Are you sure? yes | no

appupriya656 wrote 03/10/2017 at 07:21 point

i got a problem while installing the os.. i had mailed to u the detailed description of the problem pls..help me...

  Are you sure? yes | no

appupriya656 wrote 03/01/2017 at 05:32 point

Will PC with Windows OS can be used for operating raspberry pi i.e.,. to install raspbian os in pi board????

  Are you sure? yes | no

Hendra Kusumah wrote 03/01/2017 at 05:34 point

yes it can. try to use windisk32imager and to format the sd card, use sd formatter

  Are you sure? yes | no

appupriya656 wrote 02/06/2017 at 09:01 point

those code u have given will it work for any other model and version of raspberry pi????

  Are you sure? yes | no

Hendra Kusumah wrote 02/06/2017 at 09:07 point

hi priya, few of the repo is obselete. Check your mail for further information

  Are you sure? yes | no

ActualDragon wrote 12/09/2016 at 16:34 point

it'd be cool to send it up one of the adorondack high peaks

  Are you sure? yes | no

tromboneandy wrote 10/14/2016 at 20:40 point

Hello.  Thanks for this project,  I have made my own robot which I could not have done without your help!  I just have one question,  ngrok works well but does not display the web cam feed when trying to control from outside the WiFi network.  Is this a problem you encountered? Do I need 2 tunnels? 

  Are you sure? yes | no

Hendra Kusumah wrote 10/15/2016 at 01:44 point

great to hear that. 

Yup, for the camera and the control to works in ngrok you need to open 2 ssh session and tunnel 2 ports for it. because the webcam has different port.

  Are you sure? yes | no

suneel kumar wrote 04/12/2016 at 11:45 point

on clicking , the IN icons are not changing to OUT while dealing with webiopi in raspberry pi2 model B.and also the output voltages icons are not changing.please tell how to fix this error.....

  Are you sure? yes | no

Hendra Kusumah wrote 12/09/2016 at 16:44 point

there's a different configuration of webiopi for the pi 2 and Pi 3. Try google webiopi raspberry pi 2. 

  Are you sure? yes | no

suneel kumar wrote 04/12/2016 at 11:39 point

on clicking ,the IN  icons are not changing to OUT  while dealing with webiopi in raspberry pi2 model B.and also the output voltage icons are also not changing.please tell how to fix this error

  Are you sure? yes | no

melvinc1929 wrote 07/03/2015 at 02:48 point

This is an interesting project. . . can | ask something?

Q: Is it possible to install a support for the camera which is a servo motors so that you can control its vision in 4 direction?

  Are you sure? yes | no

Hendra Kusumah wrote 07/04/2015 at 06:55 point

thank you.

Yes you can. Just add another code function at python script and javascript at the html. But be aware that do not take 5v from the raspberry pi GPIO pin to power the servo, it is better to add another power supply for the servo

  Are you sure? yes | no

melvinc1929 wrote 07/16/2015 at 12:11 point

Hello sir, Is it okay if I use this project for my robotics project? :3 oh and this link above: https://learn.adafruit.com/raspberry-pi-garage-door-opener/web-io-pi it is bad link sir . . .

  Are you sure? yes | no

El Shaaranaz wrote 01/14/2015 at 10:30 point

hey there,

the link for the tutorial on how to install webiopi is dead. can you please recommend another site that will work with your project?

thanks

  Are you sure? yes | no

Hendra Kusumah wrote 01/16/2015 at 13:22 point

sorry for that, this video explain how to install it very clearly

and I see that you are from malaysia. I've also already make a tutorial in Bahasa Indonesia

http://raspiduino.blogspot.com/2013/12/halo-semua-sebelumnya-saya-ucapkan.html

  Are you sure? yes | no

ehtisham1212 wrote 01/03/2015 at 23:01 point

hi there i was just wondering where shall i store the python and the html files

  Are you sure? yes | no

Hendra Kusumah wrote 01/08/2015 at 05:51 point

You can make a new folder that only contain those two files

  Are you sure? yes | no

Hendra Kusumah wrote 01/08/2015 at 05:51 point

You can make a new folder that only contain those two files

  Are you sure? yes | no

david_is_da wrote 12/22/2014 at 19:22 point
Can anybody tell me, where to get this red plate the Pi is sitting on? What to search for?

  Are you sure? yes | no

Hendra Kusumah wrote 12/23/2014 at 01:28 point

You can get the chassiss plate from here:

https://www.sparkfun.com/products/12866

  Are you sure? yes | no

El Shaaranaz wrote 10/26/2014 at 11:00 point
Hey there,
I'm really interested in carrying out this project for my final year project.
Can I have your email address so that I can easily contact you if I face any problem?
By the way, here is mine naz_way@yahoo.com.my
Thanks!

  Are you sure? yes | no

Hendra Kusumah wrote 10/29/2014 at 07:09 point
you can email me at hendra.kusumah@raharja.info

  Are you sure? yes | no

arjotema wrote 10/22/2014 at 21:59 point
Hi
I am somewhat difficult to test the project, it is necessary to make changes to the etc / webiopi / config? where you can put your files?
thank you

  Are you sure? yes | no

Hendra Kusumah wrote 10/29/2014 at 07:08 point
yes in the index.html you need to input your mjpg-streamer ip address in order to lanuch the video stream in the web page

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates