The Rover

Everything started with this little robot, the Rover. During my doctoral studies I became more and more familiar with electrical engineering and wanted to develop something by myself. For a first try, the result is not too bad. The best thing is, that I still use the Rover every day. It sits on a shelf in a corner of the living room, and I can access its webcam worldwide, over my smartphone.

What inspired me to build the Rover?

Before I was thinking about building the Rover, I just wanted to build a surveilance camera for my apartment, which could be accessed via my phone and sends me a message when it detects movement. With a Raspberry Pi and a Raspberry Pi camera this can be easely done. There are a lot of tutorials available online on how to develop your own surveilance camera (e.g. Scavix).

When I was done with that, I realized that I was not able to see every corner of my apartment. For this reason, I needed a step motor in order to turn the camera. A good explanation on how you can control a step motor is given here.

As you can imagine, that was even not enough, and I wanted to be able to see every room and every corner of my apartment. This finally inspired me to build the Rover.


What does the Rover do?

The Rover works mainly as a surveilance system. Equipped with a camera and Passive InfraRed (PIR) motion sensor (see pictures below), it does a very good job of this. You will find a good explanation on how to include a PIR sensor into your project here. In general, the PIR sensor and the camera are connected to the Raspberry Pi. A Python code is running and waits until the PIR sensor detects a movement. If this is the case, the Python code executes other Python programs, like sending an email or activating the camera. The camera stream is implemented on a website, which is based on an Apache-server and also runs on the Raspberry Pi.

To let the Rover drive, it is built on movable chassis. It includes six AA batteries and two engines (one for the left and one for the right wheels). To maneuver the engines forward and backward as well as right and left, a module with 4 relays (switches) is necessary. A circuit diagram, which shows the wiring between the engines (M1, M2), the relays (S1, S2, S3, S4) and the batteries, is given in the schematic below. S1 and S2 control the single engines. S3 and S4 are switched on and off at the same time and control the current flow, which results in a forward or backward movement of the Rover. An introduction to how to connect and control the relays with the Raspberry Pi is given here. I decided to write a single Python code for every movement (forward, backward, right turn, left turn, turn around). If you want to run the Rover remotely, it needs some sort of power supply too. To keep it simple, I just used a power bank where you can connect the Raspberry Pi directly.

Using an ultrasonic sensor to avoid obstacles

Because I became more and more interested in autonomous vehicles, I wanted to let the Rover drive by itself. For this reason, I attached a simple ultrasonic sensor above the camera unit. This positioning allows a detection of higher objects and avoids any damage to the camera. A nice side effect is, that the ultrasonic sensor looks like eyes :-). Like a blinker, the LEDs indicate the direction of the upcoming turn. An example of how the Rover is avoiding obstacles is given in the video below.

How to control the Rover

Controlling the Rover is very straightforward. An Apache-server is installed to host a website. I created a simple website (with a very simple layout) to access the stream and to control the motion of the robot. You actually see some screenshots from my phone below. The left picture shows the upper part of the website. It includes the video stream and some buttons for controlling the movement of the Rover. The middle picture shows what happens when you scroll down. Below the arrows there are some links activating the surveilance system (in German: „Alarmanlage“) and the LED lights (in German: „Scheinwerfer“) in front of the rover. The picture on the right shows you the environmental temperature in degrees Celsius (lower left corner), which is also measured by the Rover. And you see some links, like Christmas lights (in German: „Weihnachtsbeleuchtung“). These links are part of my home automation project, which is explained here.

Thanks for reading!