The Raspberry Pi is a tiny single-board computer that runs a full Linux operating system, and features dozens of input/output pins that connect to devices. The Raspberry Pi 3 costs US$35, or about $50 in Australia. There are also cheaper versions. My system runs on an older B+ model that sells for around US$20, but you are probably better off buying the Raspberry Pi 3, especially if you wish to run a display using HDMI.
The Arduino is a micro-controller that unlike the Pi, runs only a basic operating system. It features similar input/output pins to the Pi, but it also has other pins the Pi lacks, in particular, analog-to-digital inputs. This means it can easily read analog sensors. The Raspberry Pi can only read digital sensors. I am using UNO boards, because that is what I had, but you should look at the Arduino Mega instead. The Mega features sixteen analog-to-digital pins compared to the UNO's six. For light and temperature monitoring you need two A/D pins for each room. Add another pin for each smoke sensor, and you soon run out of pins on the UNO. A Mega will give you seven rooms with smoke detectors in two of them.
A Raspberry Pi and an Arduino micro-controller.
The rest of the components can be bought cheaply from Ebay, but we have instead made most of them ourselves.
We've built the individual components into all-in-one satellites.
Two AAIMI satellite units, one with a power outlet and one built-in to a lamp base. Picture: Anthony Hartup.
Each of our prototypes contains a light-sensor, a movement-sensor, temperature sensor and a relay. Some of them are equipped with a power point to connect a lamp, others are actually contained in lamps.
A mini satellite
We have managed to shrink the satellites, utilizing the casings from old power-timers. The unit pictured above has the same sensors and relays as the large satellites, but takes up less room.
It would be nice if we could buy a reasonably priced retail equivalent to these satellites, but nothing I have seen combines all of the sensors these contain. For instance, you might find WIFI light globes that have a movement sensor built in, but they don't have the light-sensors. This means you'll need another product for that, which will probably work on a completely different platform. After that you would need to add a temperature sensor from another company.
These home-made satellites have everything in one unit, and they all talk the same language on the same platform. They do present some interesting regulatory questions, however.
I would strongly recommend using 12V lights instead of the 240V lamps pictured in this article. LED strips can be a good alternative.
I'll go into more detail later in the article.
Let's have a look at the individual components, both our cave gadgets, and their retail equivalents if available.
You can make your own analog sensors or use DHT11 and DHT22 digital sensors.
An analog temperature-sensor. Diagram created with CircuitDraw.
The analog temperature sensors are simple, cheap and effective. It uses a thermistor along with a standard resistor to return a voltage that varies with temperature. I've built a few with themistors salvaged from broken electrical appliances, or you can buy them for about twenty cents each.
A light sensor used in the room-control satellites. Diagram created using CircuitDraw.
The light-sensor uses a standard resistor and a light-dependent resistor (LDR) in a voltage divider circuit and returns a voltage level to the Arduino that varies evenly with the light levels in a room.
A relay uses a small electrical signal from a computer or micro-controller to activate higher voltage/current appliances and devices. Depending on your micro-controller and the type of relay, you may also need a relay driver in between
We've used some portable 240V AC devices in our examples, but we recommend you look at 12V options where possible. In some regions it is perfectly legal to do your own 5V and 12V wiring to activate sensors and relays, but it will generally be illegal to connect your own 240V wiring. You should consult an electrician if you wish to build any of these AC devices into your home.
12V LED strips
One option is to look for a DIY 12V lighting solution you can safely install yourself. Plug the provided power supply directly to your wall plug and place your relays in line with the 12V outputs.
You can do some great things with LED strips these days. You can buy them in rolls and divide them yourself, or you can buy pre-wired sections.
Cheap 12V LED light from ebay
There are also many 12V LED globes available. The globes pictured above cost less than three bucks. You'll need to research the power requirements and a suitable power supply to run lights like these.
A Phillips Hue hub and globes (left) and a Wemo hub and globes (right).
For starters, they all have third-party privacy considerations. You need to sign-up with the companies and use their applications to configure the devices. You also have no control over the background communications these devices have with their makers now, and into the future. All this goes against our aim to create an independent platform that doesn't share your data with strangers.
They are also really expensive. The three-globe Hue kit pictured above-left costs around $280 in Australia, while the two-globe Wemo kit on the right will set you back about $130. That's at-least $65 per room. One bonus with these systems, though, is that they are dimmable and they can change colors. That may justify the price for some people.
I'm hoping to get my hands on some of these soon so I can build a direct way to drive them, but the initial methods will use third-party apps like IFTTT via web requests.
What we have done for software testing purposes so far is use a combination of home-made and cheap ebay relays, but I don't think your electrician will wish to fit them for you. All our units have been portable so far.
A salvaged relay used in the room-control satellites. Diagram created using CircuitDraw.
You can also use these retail boards. They only cost a couple of bucks and if you are only using a few you may get away with activating them directly from the Arduino. This could negate the need for a relay-driver.
They connect and operate differently to the units we've made.
While these are a retail device, there is a chance they do not meet regulations in your region, so once again you would need to talk to an electrician about the legal angle. You should, however be able to legally connect them to drive 12V lighting
You'll need a base station to hold your power supply, Raspberry Pi, Arduino and relay-drivers. I have just built a new unit using the case from an old VCR.
For our prototype base-stations we have used PSUs from other appliances, like LCD TVs. These provide DC voltage combinations of 5V, 12V and 24V, which is everything required, but once again you may wish to go for a retail PSU. That would be a must if you also planned to have an electrician connect your DC wiring as well as the AC.
We are using Cat5 Ethernet cable because it has enough wires to connect any of the satellite configurations we plan to build. A full satellite with light-sensor, movement-sensor, temperature-sensor and 12V relay uses seven wires. This leaves a wire free for any sensor we may develop next
We are using speaker-style spring-loaded plugs to connect cables to the base station. I plan to color-code these to match the color on the Cat5 wires to avoid costly errors.
The diagram below shows an example of the connections for three satellites tailored to the code for AAIMI Room Control. It features Raspberry Pi-operated 12V relays via a relay driver.
The complete connection diagram for the AAIMI home-automation system showing three satellites connected. Diagram created using CircuitDraw.
To see a larger image, right-click and select open in new tab or save the image to your computer for future reference.
To add a smoke and gas-sensor you would need to leave out the temperature sensor on the third satellite. This is because the Arduino Uno only features six analog-to-digital pins. You could also get a larger Arduino board. The Mega has 16 A/D pins.
To drive some, or all, of the relays off the Arduino pins instead, simply connect the cables from the right-hand side of the relay-driver (shown in orange above) to your desired pins on the Arduino instead of the Raspberry Pi. I'll put an Arduino diagram here soon.
Hardware on the test-bench now
We have built a prototype wireless satellite to minimize cables and create secondary-control areas in places like garages and hard-to-reach sections of your property.
The wireless satellite contains the same sensors and relays as their cabled counterparts. Instead of a messy cable running to your base station, they use RF24 radio modules to communicate data and instructions.
They can also be configured to act as a sub-base-station so you can attach and operate other cabled satellites.
The system communicates with these wireless units via the primary Arduino on the main base-station. I think I can run up to five of these sub-stations, expanding the entire system to dozens of satellites.
Each sub-station would need to be near a wall power-outlet, but will require no direct connection to the main system.