Automate and monitor the physical systems in your home

Relays and Sensors

The project requires both low-voltage and high-voltage relays. The low-voltage relays, acquired on eBay, are solidly built and mount to DIN rails. For high voltages, the Opto 22 120 D series relays have a footprint compatible with relays from other manufacturers and are small, well tested, and reasonably priced (Figure 2).

Figure 2: An Opto 22 solid state relay and a Senva current sensor.

They also pass international safety standards, which can help you sleep at night, and can be controlled with small currents and digital logic levels – a good fit for this application.

Motion sensors for lighting and current sensors (see the "Current Sensors" box) are easily found on the web and in retail stores. The Senva C-1200 current switches chosen for this project are compact and don't require high-voltage connections. The doughnut switch has just two open/close signaling terminals – that's it. The high-voltage wires in a three- or four-way switch pass through the center of the doughnut, and, using electromagnetic induction, the sensor powers itself and does the signaling.

Current Sensors

Current sensors solve a ticklish problem: Some circuits have three-way and four-way switches. These kinds of switches show up when a device is controlled from two or more locations. A common three-way switching application is two switches that control one light. If someone says, "Turn on the light," you have to look at the light, see if it is on or off, and then decide whether or not to flip the switch. A control system is no different. If you tell the system to turn on a four-way switch, it needs to know whether the load is on or off before taking action. Current sensors make this possible.

Block Diagrams

Once the system was defined and the important hardware components identified, we created block diagrams to show all the hardware components and wires. Additionally, the diagrams identified all the virtual devices and wires supplied by the Virtual Wiring system. Much like real devices, Virtual Wiring devices are connected by wires – virtual wires, that is.

From among the many handy devices supplied by Virtual Wiring, we chose state machines, logic blocks, emailers, alarms, and timers. The state machines provide sequencing; logic blocks allow you to generate on/off-type functions from collections of inputs; emailers let you control the system by text and email; and timers turn lights and devices on and off. Virtual Wiring also has virtual Arduino devices, which give the Virtual Wiring system access to an Arduino's pins and pin functions.

In the end, the system had three Virtual Wiring systems running on three Pis: Pi1 had two Arduinos (Ruggeduinos 1 and 2; Figure 3), and Pi2 and Pi3 each had one Arduino (Ruggeduinos 3 and 4).

Figure 3: A block diagram showing Pi1 devices and some of the devices connected through Ruggeduino 1.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Automated plant watering with Arduino

    House plants are fairly self-sufficient, but they do need certain care from people to survive. With a few Arduino sensors and a little programming, you can take the guesswork out of watering your plants.

  • Digital – Analog – Mechanical

    As innovative companies consistently push the envelope of progress, antiquated hardware nearly two years old falls by the wayside. We take an old iPad, an Arduino Mega, and various other materials to create an in-dash climate control app.

  • Connecting a weather station to your Arduino

    After losing one weather station to tropical winds, the author reboots and designs a PCB that connects to an Arduino and monitors weather instruments.

  • A new way of no-solder prototyping

    The Grove system's standardized connector and multitude of devices allow quick and easy project prototyping with your favorite small-board computers.

  • Making your projects more reliable

    A watchdog timer is a great way of improving reliability for little cost in small, inexpensive computers such as the Raspberry Pi and Arduino.