Wednesday, August 12, 2015

Home automation server - Sphaera

When I showed you my RaPiRo some post ago I explained why I would not use it as a case for my home automation server.

Let's summarize just something...

First of all the power. 12 motors are quite "hungry" and this means that using batteries is not an option if you need to keep it active all the day. You need to power with a plug, so it's mobility would be greatly limited.

It's noisy. All that motors can be quite annoying.

It can detect movement, but only when it's not moving itself, so it can check just a small area at a time.

There are other cons, but these are enough to let me think about a different solution for my home automation server.

After considering all my needs and doing some test, I designed a case that is almost perfect for me and named it Sphaera (latin name for sphere).

Here I will show you this object and if you really like it (and you have access to a 3D printer) you can also make it by yourself!

As you can guess by the name, it's a sphere. This is a photo of the finished system:

Now some of the Sphaera features:
  • Diameter is 16.8cm and height is 15.5cm
  • Fisheye lens for a 180° field of view
  • Speaker and USB audio card
  • NeoPixel strand with 22 leds (just to make it cool)
  • Wi-Fi connection
  • Powered by standard 12Vcc supply
  • Raspberry Pi 2 (but you can adapt to other controllers if you wish)

Of course there is much more than this and most of the features not in the list are just made by software. By now you have to program by yourself because I have no stable and complete system as I'm still experimenting...

One nice thing is that you can actually use whatever RPi model you wish as the connection is wireless. Of course you cannot use an external usb audio card with model A or A+.

The fisheye lens (the kind used for smartphones) allows to check a really wide area without using moving parts (so lowering the power needed for the whole thing as there are no motors).

Let's see the various Sphaera printed parts...

The bottom

This part contains the power plug and the speaker.

There are also some ventilation openings to avoid an excess of heating inside the sphere. These are also used to spread the audio from the speaker.
In the last photo you can see the step-down circuit to go from 12V to 5V and the speaker support glued to the base (the only printed part that needs some glue).
To keep the plug and the step-down in place I used a bit of hot glue.

The ring

This is the "interface" section of the case. It contains the fisheye lens, the PiCamera and the NeoPixel strand.

Unfortunately I discovered that not all of the fisheye lenses are equal in size, so I had to move back a bit the PiCamera after printing this part. Anyway it was an easy task.

To keep the light from going to the bottom I painted black part of this ring. Note that the part has been printed using clear ABS (actually it came out as translucent, but this is what I needed to diffuse the light from the leds).

The NeoPixel strand has been placed using double sided tape. This strand is really wonderful as you can specify the color of every led and it's quite bright. Of course this means you need some more power...
To find more info about NeoPixel just go to Adafruit site.

This is a snapshot from the PiCamera using the fisheye lens:

I can really see almost the whole room!

The upper part

This is the support for the Raspberry Pi. The mounting holes work with models A+ and B+. For previous RPi models you can use just two of these holes, but it should be enough.

Note that the PiCamera cable should be twisted 180° to be inserted in the RPi, so in the 4th photo the cable is plugged the wrong way (it was just to see the whole thing before the final installation).

In the last photo you can see a circuit plugged at the top of the RPi. This is to distribute the power and to connect the sensors (I added humidity, temperature and barometric pressure sensors to the project). You can also see the wi-fi usb dongle.

The cap

This is the last part of Sphaera. It's just that, a cap for the sphere. Like the bottom part it has some ventilation openings, but nothing more than this.

All the parts snaps together almost perfectly, but they need to be printed with a well calibrated 3D printer. Also they have to be printed using supports (apart from the speaker adapter that can be printed without them).

As the printing process is quite time consuming, I decided to print at mid-low resolution (0.24mm layer). I like the result, so I won't go for high resolution prints in the future.

Some more photo of the assembling and the finished Sphaera:

Finally some photo and a video of the cool part (NeoPixels at work):

Of course NeoPixels could be used also for more than just "coolness". For example you can set a color to notify something without disturbing with an audio message when you are at home (so you can competely leave out the audio part if you wish), or maybe use them to "show" the outside weather conditions, and so on.
Unfortunately you cannot use them to light a room in the darkness for the PiCamera as frontally there is too few light emitted from the ring.

Another thing to note is that you really shoud not use the speaker with the internal RPi audio card when NeoPixels are connected as there is too much noise (and it cannot be removed). That's why I bought the USB audio card.

Here is the list of the parts bought for this project (leaving out the RPi parts and the ABS):

You can find these things elsewhere if you wish. All the extra parts not listed here where already at home, so no need for me to buy them.

You can get all the printable files from Redpah. If you do not own a 3D printer you can always use to find someone in your zone that can print them for you.

In the next post I will describe some of the software solutions I'm using for Sphaera, but you are really free to program it as you prefer.

I really like how Sphaera came out. It's cool and can be placed everywhere without being out of place. It can be programmed to perform several different tasks, from home automation to party enhancements without too much efforts and can be improved with more features as inside the sphere there is some unused space left.

Definitely one of my favourite projects!


  1. Hello Carlo,

    I am inspired by your Sphaera project and I am trying to recreate your setup, combining with some feautures I created myself already, like face recognition and TTS / Voice recognition. Do you have more information on your setup? Software used / scripts used etc...
    Would be very helpfull and educationla for me too.


    1. Thanks for your interest!
      I started Sphaera using Node-red as it's a powerful and simple way to manage the system. Anyway now I prefer to use a standard web server (apache and php) with some python scripting.
      To communicate with python scripts (always running in background) and with other RPi in my home I'm using mqtt protocol (Sphaera is the server). I will write a post about mqtt and how to use it as it can be really powerful.
      In these days I'm a but busy with other things, so I do not have time to write frequent posts, but in a (not too distant) future I will write a more detailed description of my Sphaera configuration.

    2. Thanks Carlo,
      that is indeed interesting as I also use node-red and mqtt for some of my home automation, in combination with Domoticz. So it looks like we followed approximately the same path :-). looking forward for your descriptions on your Sphaera configuration.


  2. I really like your Home Automation system that is amazing. The manufacture process is wonderful. It's very useful for me to manufacture. Thank you for sharing such nice blog.

    Security system installation in Hamilton<