Anth's Computer Cave

AAIMI Home Automation Tutorial Hub

Use the buttons below to read all of the AAIMI Home Automation tutorials.

AAIMI Home Automation Prototype Hardware Overview.

13th February, 2018

Today I will give an overview of the prototype home-automation hardware we've built so far to test the AAIMI Home Automation system. I'll also tell you about some new hardware concepts.

The AAIMI Home Automation base station and two satellite units. Picture: Anthony Hartup
Four AAIMI prototype satellite units. Picture: Anthony Hartup.

Remember this is "prototype" hardware. We've built our own devices from old junk to inexpensively test and refine the AAIMI system, and to demonstrate the variety of hardware AAIMI can work with.

The various 5V sensors and 12V devices, etc, are safe to build and operate.

Some of the other devices detailed below, however, interact with 240V mains power. Do not attempt to build these 240V devices unless you understand the risks.

The actual AAIMI Home Automation system will use mostly retail, WIFI-enabled hardware for switching 240V power.


Components

Two of the primary components you need are a Raspberry Pi computer and an Arduino micro-controller. These will run the programs required to use AAIMI Room Control.

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. Picture: Anthony Hartup.
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
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 home-automation satellite
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.


Temperature sensor

You can make your own analog sensors or use DHT11 and DHT22 digital sensors.

A home-made temperature sensor. Picture: Anthony Hartup.
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.

Click here to see how to build a cheap and effective temperature sensor..

Digital DHT sensors are a little more expensive, but they also measure humitidy.

A home-made temperature sensor.

The DHT11 pictured above costs four or five bucks, while the more accurate DHT22 costs around nine bucks.

There is a good DHT how-to over at Circuit Basics


Light Sensor

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.

Click here for the full tutorial to build a cheap and easy light-sensor.


Movement Sensor

A movement-sensor used in the room-control satellites.

We're buying cheap PIR movement sensors available on Ebay for less-than two bucks, but they work well. They have a wide field and decent range.

Click here for a tutorial on using a movement-sensor with a Raspberry Pi.


RFID card reader

An RFID card reader

These RFID card readers are great for arming and disarming alarm systems, and they're suprisingly easy to use.

You can use just about any old RFID cards or keyrings you already have. I use my public transport card as a spare card for my security system.

Click here to see an example of these readers in use.


Relays for lights and power points

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

Options

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.

We are adding support for retail options like the Phillips Hue system and the Wemo switches and light globes , but they are not our preferred option.

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.

Our gadgets

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.

This home-made relay circuit design is unchanged from the first series. These use relays salvaged from old TVs. Click here for a tutorial on building a relay circuit to control AC power outlets and lights


A retail relay board.

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

There is a basic tutorial on connecting these relays here


Relay Driver

The relay driver takes 3.3V from the Raspberry Pi's GPIO pins and switches 5V or 12V to activate the relay.

A relay-driver board used in the room-control satellites.

Our latest design can drive seven relays. Click here to learn how to build a relay-driver circuit using a ULN2003 transistor array.

A heavy-duty relay-driver board . Diagram created using CircuitDraw.

We also have a tutorial for a heavy-duty relay-driver that can also drive other devices like motors and LED lighting. Click here to learn how to build a relay-driver circuit or uni-directional motor controller.


Air quality sensors

A prototype safety sensor for the AAIMI Home Automation project. Picture: Anthony Hartup

These are the newest hardware addition. I'm using MQ-2 sensors and they work well.

Click here for a tutorial on using a smoke and gas sensor with Arduino.


Base station and power supply unit(PSU)

A prototype home-automation base station. Picture: Anthony Hartup
A prototype home-automation base station.

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.

Click here to read about the new base station build..


Cables

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.


Connection diagram

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 connection diagram for the AAIMI Home Automation system. Picture: Anthony Hartup.
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

Wireless satellites

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.

This hardware is working well, we just need to finish the code. Click here to read about the build.


Previous: New AAIMI Features

Next: Download and set up AAIMI.


_____________________________________________


Comments

Leave a comment on this article