Do it yourself: home automation

Tags: , , , ,
7 Comments »

For my new apartment I imagine some nice (or nerdy) infrastructure things. Since the apartment is currently building and I can decide how to do the wiring: we will get CAT7 Ethernet nearly everywhere for gigabit Ethernet. We will get a lot of power outlets, HDMI cables from the stereo to the TV and to a potential place for a projector and so on.

I was also looking into systems for home automation to control lights etc. using some commercial bus system like KNX. But all these systems are boring, expensive, inflexible and absolutely not the kind of system I was willing to invest a few thousand euros in. They advertise all that stuff as programmable and ultra flexible. But you need some expensive software and special adapters to reprogram your house. To save light configuration and recall them by a button you need some light-configuration-controller-hardware (at about 200 Euro) and a guy to program it. Non of the classical home automation systems can be controlled with an iPad.

So I decided to build something for my apartment by myself. In this first post of many I will show you my basic ideas and later I’m planning to publish hardware schematic and software source code for single modules and maybe for the whole thing.

The goal

  • Control every light in every room of my apartment
    • some will just turn on / off
    • some are dimmable
  • Controlled by the regular light switches
  • A “Turn everything off” switch at the main door
  • Connected to my local network (e.g. webservice)
  • My personal application on an iPad

optional (or later on):

  • Control the motor for the projection screen
  • Control light by timers
  • Send infrared signals to the stereo and the tv set
  • Connected to the phone line (e.g. turn off the music when the phone rings)
  • Receive data from wireless sensors
  • Add a sensor to the washing machine and remind me when it’s finished
  • much more

The basic concept

To control all this I will use some central microcontroller in my apartment. I decided to give the Microsoft Micro Framework a try. Since I’m already a .Net guy it should be pretty easy (and cool) to program my home in C#. I will use the FEZ Cobra board. A 72 MHz ARM device with 12 MB RAM. It is probably already too powerful for my usage but who cares. It comes with USB-Ports where you can connect keyboards, joysticks or cameras. It has a build in Ethernet port, a SD-Card slot a lot of I/O Ports and everything else you need. One could also connect a TFT touch screen. With this guy I have all the connectability I need and enough power to implement all crazy ideas in software.

In the walls I will get push buttons instead of regular on/off switches and a single cable will be used for each of this button to a central place where my project resists. This way the Cobra board can receive signals from all buttons.

To control the lights the cables will be put to these place too. Here I will use relais or dimmers controlled by the Cobra board. For some lights I will try RGB LEDs with DMX controllers (I will later explain what that exactly is).

A little bit more in detail

The key to all this is my custom wiring with a lot of more cables in the walls then usually. Since the apartment will be newly build I can get this wiring without big problems.

My push buttons will be powered only by 12V or 24V DC not 240V AC (the normal power in Europe). This way it is much easier to connect it to the Cobra board.

For controlling dimmers I will use dimmers with a control input of 0 to 10V. Again: it’s much easier to buy some working and proofed dimmers for the 240V high voltage and my DIY projects only controls it by a 10V signal. The same for switches: the Cobra board will drive some relais with 12V DC and the relais will switch the 240V AC line.

Maybe I will use for dimmers and other light controlling stuff the digital DMX512 protocol. This is used on stages to control all the light effects and seems pretty simple to implement on the hardware and software side.

For most of these functions I will create small hardware modules and connect them to the Cobra board. This way the completion of the whole project is much easier. Some of these modules will be connected to the I/O ports of the Cobra directly and some will use a I2C-Bus.

Some modules first

To get stared I created hardware prototypes for the first modules of the system. These modules can be used for the purpose I’m planning or for something totally different (at the end these are only input and output port controlled by a microcontroller). I will show you the different modules in upcoming posts. Once finished the major parts I believe I will extend the whole system step by step. But let’s start with:

  • I2C voltage converter
    • since the Cobra board uses 3,3V but all other modules will use 5V I need a simple voltage converter
  • I2C input module for push buttons
    • using optocouplers and an I2C-I/O-chip
  • I2C digital output modules
    • with an I2C-I/O-chip again and some drivers to power relais
  • I2C analog outputs
    • to create the control voltage for 0-10V dimmers.
  • DMX512 output

 

Within the next weeks I will start to write a post to each of these modules with detailed hardware and software explanations.

Developing R#-PlugIns with a little comfort?

Tags: , , , ,
No Comments »

I am playing around with R#-plugins these days. I have started off with this nice introduction. Unfortunately it silences about some problems that may occur to you in the beginning.

1) When trying to copy the given source code you’ll mention that all the classes are unknown to Visual Studio, because all a lot of references are missing. So far I have no clue about the R#-class-architecture. So I started .NET Reflector, open ALL the .dlls in the R#/bin-folder into Reflector and use the search to find the .dlls to reference in my project.

2) When you have your first R#-plugin ready you want to test it. To do so you have to copy the dll containing your plugin in the R#-plugin folder. You may want to do this in a post-build event like this:


copy $(TargetPath) "C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\PlugIns\WobTest"

When you build your project with this post-build event it fails. This doesn’t work for two reasons. First: Win 7 denies access to that folder. Second: after another start of Visual Studio R# has loaded the plugin so you can’t copy a newer version over it.

My solution to this is a .cmd that starts Visual Studio without R# (devenv /safemode). I run this .cmd as administrator.

Now at least I can debug my plugins by starting another instance of Visual Studio (not in safemode!)

This solution is not cool, because developing R#-plugin without using R# in the development-process sucks…. any ideas?

a better solution…

Some minutes after I published this post, Benjamin pointed me to this page. Forget about my lines to 2). You don’t need a silly .cmd run as administrator not a post-build event. All you need to do is to start your debugging Visual Studio the the command line option /ReSharper.Plugin followed by the path to your plugin-dll.

/ReSharper.Plugin "R:\sandbox\ReSharperPlugInTest\PublicGoesVirtual\PublicGoesVirtual\bin\Debug\PublicGoesVirtual.dll"

Cannot access VMware Server Web Access

Tags:
No Comments »

I’m running a VMware Server 2 on a Linux box and access this service via the VMware Server Web Interface at https://server-name:8333. This is a pretty usual way of interacting with VMware Server.

But suddenly I cannot access the website any more. Internet Explorer just said “Loading…” forever but nothing happened.

If the same happened to you try to switch Internet Explorer into Compatibility View and it may work again (it did on my machine).

a

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in