Home Security Bot

Internet Controlled Car and Webcam.

I bought a kit that contained some wheels, DC motors, and frame for a do-it-yourself car kit but to my surprise I was left with having to use my own microcontroller/microcomputer without any software. Fortunately around the same time the new Raspberry Pi 2 was also released and therefore saw a good opportunity to test my programming navigation software and electronic engineering skills. It was then decided, I was going to make an internet controlled robotic car with a webcam attachment that can be controlled and viewed from an android application.

After assembling the wheels to the frame, I began with designating IO pins on the Raspberry Pi to control each of the four motor wheels. Then developed basic movement software using Python GPIO but was limited to only digital IO therefore could not have the control that analog IO provides. Thankfully the RPi2 has a USB slot, so network access was solved with a simple WiFi dongle plugged in. Afterwards, I created a Python based websocket server on the Raspberry Pi to act as the communication medium to receive controls from over a network to correspond with the movement software. Using another USB port, I plugged in a simple webcam, and developed basic streaming software to send video stream packets to the websocket server. From here, I developed a responsive web page that is hosted on the RPi2 that uses the websocket server as the backend controller. The webpage receives the video stream packets, and sends socketed controls to the movement software. At this point the web page is only able to control the robot over a local network. This is solved with a mixture of using Dynamic DNS, router port forwarding, static IP addresses to give world wide access to the system. Lastly, with responsive web design in mind, made integration into an android application very simple. It simply needs a hard coded URL webview within a responsive Android frame. Given this brief overview, a user is able to use their android application to control the robotic car to navigate around their home and view the webcam feed of what the robot "sees".

I recommend anyone who wishes to develop software or learn more about electronics take up this kind of project. The idea seems simple but there is so much opportunity for learning and growth to come from this. There are circuit designs, electrical power calculations, efficient computing considerations, software architecture, motor programming, network programming, DNS routing, port-forwarding, websocket server development, communication logic strategies, packetizing images, web design, asynchronous web strategies, and Android development all encapsulated within this project.

Not shown in the demonstration, is the updated user interface of webpage. The following image shows the embedded web page in an Android application.