Tag Archives: Raspberry Pi


I was unable to find a suitable pan and tilt solution for Raspberry-Pi so I decided to create one. The object is 3D printable and provides a stable platform to develop remote surveillance, time lapse and computer vision projects. I wanted it to look well polished and feel like a commercial product so I put some extra effort in the aesthetic and functionality.

The hardware part is developed using OpenScad, an opensource CAD system based on command line rather than graphical point-and-click instructions. The software is sometimes referred as “the programmer” CAD as you effectively have to write code to generate 3D models. I believe this approach is much better for mechanical design as it allows easy model parameterisation.

1 2
Exploded view of the pan and tilt enclosure for raspberry Pi 2Cam-Pi assembled

The software of choise is Node.js, JavaScript and Foundation to create a web application that runs well on mobiles, tablets or desktops.

At the moment functionalities are limited to video streaming and time lapse, but the platform can be used in conjunction with OpenCV for more advanced computer vision applications. For the moment I have used it to do some timelapses from my balcony.

You can find some more assembly information on the Thinghiverse post or the source code on Github.


The balancing act of the one-eyed robot

During the last 9 months I have been busy working on my latest robotic project: a two wheeled self-balancing robot. I previously wrote about the reasons; in essence I think it is a great way to better understand the technologies that surround us and also a good personal development to derive some teachings about management and leadership on which I will soon write.

In the beginning I thought it would have been a few week-ends project; now almost one year in the process I just started scratching the surface of it. I thought that I had most of the necessary knowledge, instead I had to learn new tools, new programming languages and new engineering concepts.

The purpose of this article is to outline particular aspects of the design of the robot with special regards to some tricky issues I solved long the way, not to be a step-by-step guide. In case you are interested in missing details just drop me a line and I will do my best to provide you the information.

Continue reading

One day in Zurich gone in seconds: time-lapse with Raspberry

Time-lapse videos are a great dramatic feature of many TV shows and movies; for example the entire opening titles of House of Cards is made using this technique.

Experiments like the one described in this post are easy to do with little equipment and still the final result is pleasing.

In its simplest form time-lapse consists in a series of snapshots put together to create a movie, more complex productions create a dynamic effect by having the camera moving while shooting. One important tip to remember is to choose a scene with many moving items. for this reason my short sunset video above is more interesting than the second one at the end of this article. Also, remember to check if you need any permissions to shoot in public places.

The Raspberry Pi (inside its original packaging) is powered by a USB portable power bank and the camera is held still by using helping hands (better than tape).

The Raspberry Pi (inside its original packaging) is powered by a USB portable power bank and the camera is held still by using helping hands (better than tape).

My set-up is improvised: a raspberry Pi, a USB power-bank, a Wi-Fi antenna, the camera module and “helping hands” to hold the camera steady (you can find these in any electronics shop). This setup can be also used to create a IP cam using a software called motion.

As mentioned the process is divided in two steps:

1) take pictures
You just need to open an ssh terminal in the Raspberry and digit the following code

raspistill -o myimage2_%04d.jpg -tl 30000 -t 43200000

where 30000 is the time in milliseconds between shots and 43200000 is the the duration of the session (12 hours). “&” at the end of the command tell Linux to run it in background. Alternatively you can use VNC and log in the Raspberry and open the command prompt.

2) put them together in a movie
After the pictures are taken we need to copy them in a more powerful computer for further processing. Naturally it is possible to use ssh or other methods such as ftp or telnet but I think the fastest method is to slot the SD card of the Raspberry into a reader connected to a Linux machine.

Next step is to create the video and to do that I used mencoder (see the Wikipedia entry for alternatives). Using the command prompt you have to position yourself into the folder where you saved the images and first create a text file containing the names of the images to stitch together:

ls -1tr > frames.txt

After that let the mencoder to the magic. One notable parameter is
fps frame per second. The higher the value the faster the scene will move and the shorter the move will be. I normally use 10 fps. You can try different values for example 20 fps for faster action.

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 -mf type=jpeg:fps=10 mf://@frames.txt -o time-lapse.avi

Although this setup is bare-bone it allows to get some nice results. Further improvements can be to use better hardware and add features such as  a system to move the camera. Look for the  David Hunt time lapse controller for the best example I was able to find.



RobotPi Part 2 – The remote

The robot remote runs on Android and allows to control many functionality of the robot
The remote control can allow a stable interface across different improvements of the robot. Feedback on the status is is provided as well.

I want to be able in the future to connect the robot with Internet, so I think a good starting point is to design a remote control running on my Android tablet. The target is to create something that can be used for different missions, so I took some time to develop a generic design to cater for different needs. Continue reading

RobotPi Part 1 – Key concepts

The idea is to build a robot and use it in various experiments such as autonomous navigation. The ambition is to try to do something more rewarding that a simple “go forward, detect obstacle and turn left” type of programs and use as much as possible open source elements (a great game changer, on which I will write later on).


Open Source Software and Hardware will change the way we interact with technology (http://opensource.org/)

I think it is worthy to spend some time on this project, as it goes beyond a pastime and helps to understand how different technologies can interact to shape our  future. Continue reading

Raspberry Pi and XBMC

Raspberry Pi working as a network playerI am  an engineer and a vocational tech geek, therefore always fascinated by technological progress, specifically by the fact that now we have access to cheap solutions, unthinkable only a decade ago. It is the case of the Raspbery PI, a mini computer slightly bigger than a credit card able run Linux to be used for a variety of applications.

The potentiality to solve real world problems is endless as the computer can be fitted with an optional I/O board to control switches, motors and read data from sensors. Continue reading