What do we ask our controllers to do?
Plenty, but not too much.
The good news is that a Raspberry Pi 3 Model B is not a simple controller; it’s an extremely capable computer on a small board and with a low price tag. Those two elements do bring along a few concerns that we would be foolish not to address.
The processor is a quad-core 64-bit beauty running at 1.2 GHz, but there were some compromises made to make the board more universally available. It can only support 100 Mbps Ethernet speeds, not the tenfold-faster Gigabit speeds of contemporary PCs. Its USB ports are the slower USB 2 standard, slower than USB 3 or USB C connections. It has only low-band WiFi. There is no safeguard against corrupting the micro-SD card that serves as its main local data storage facility. And it has only 1 GB of on-board RAM, with no possibility of expansion.
Working around Pi compromises
We address Ethernet bandwidth by trunking, combining 6-7 Raspberry Pi connections in 100 Mbps network switches then connecting those first, lowest-level switches upstream to Gigabit switches; we did the calculations and this supports the full system's actual data transport needs.
For preventing micro-SD card corruption, we are looking at hardware safeguards against sudden shutdowns of power to the boards despite several layers of backup power; we may or may not deploy them. The issue only happens when, during shutdown, final writes to the card cannot complete, which corrupts both the data being written (surmountable) and the file table on the card (fatal). Our workaround for that is to configure the cards as read-only, which means we can't use them as swap space (a virtual memory technique that makes the 1 GB of RAM on the board look bigger to programs). Interrupting power while reading from the card does no harm.
But fitting everything we have to do into 1 GB of memory is more difficult than it sounds. The standard operating system distribution (version of Linux) for the Raspberry Pi, called Raspbian, occupies more than 2/3 of that space, meaning what remains is all we have for both the programs we want to run and for the supporting libraries they need. We can attack both ends of that challenge.
The Raspberry Pi is designed to run programs in the Python language, which means a Python interpreter has to be involved. It is designed to present a user interface (like Windows, but more primitive). We can run headless, which means without a user interface. And we can do our programming in C++.
One nice thing about Linux-derived operating systems is that they can be modified, leaving out elements that are unnecessary for particular applications (like ours). We believe we can trim the O/S back to 300 MB or maybe less, affording a lot more elbow room in RAM. Programs written in C++ (a compiled language) occupy a lot less memory than those written in interpretive languages, and they run faster.
We have one more trick available: divide and conquer. During prototyping, if we find any board being overworked, we can add another slice of Pi to help get the job done - that’s one benefit to working with computers that are, at this writing, just $35.
Thermal maps to heating, cooling and lighting
Our fairly detailed thermal map of the house serves several roles. It has very accurate information about where warm bodies are right now. Its database has a wealth of information about patterns of occupancy and vacancy. That makes it easy to both anticipate and adapt the comfort (heating and cooling) systems and the lighting, the sue of ceiling fans and so on. Using a fireplace won't trick a thermostat into thinking the whole house is that warm. Placing people or pets is useful information.
So are background temperatures, especially when we can also take them in the ventilation ducts, the attic and the crawl space. If there is a leak or other problem with the ventilation, that will spot it faster than a throng of thermometers.
Garage and driveway
Two classes of vehicles can drive in or out of the driveway: those associated with a garage space (known cars) and everybody else. If there is an occupant present in the house, a controller will sound a brief alert to the entry of any other than known vehicles. When a known vehicle enters the driveway, the system will confirm that its garage space is empty, turn on the exterior lights and open the garage door. It monitors the known car's approach and turns on interior lights, then monitors its entry into the garage space and signals it when to stop. At that point, it unlocks the deadbolt to the house. If the driver leaves the car running (as would be the case if it's a fast trip in to pick up a needed item), the garage door remains open and the deadbolt remains unlocked until the car exits the driveway; exterior lights remain on only when they are needed for light (not just for demarcation). If the driver turns the engine off, the exterior lights turn off while the interior lights remain on and the garage door open for about 2 minutes; the controller also initiates an e-mail message to the drivers of known cars that are not present to indicate that you made it home OK.
Starting from the garage side, whether or not you push its button, the garage door will always open when you start the car. If you just pull into the driveway (to do a little work on the car, for example, or to wash it), the garage door remains open and the deadbolt to the house remains unlocked. If you then reenter the house, the behaviors will be just like arriving home. If you head off somewhere, as soon as the system detects you at the apron and heading away, the deadbolt on the door to the house will again lock, the garage door will close and all the lights will turn off.
When the house detects a fire, a scramble of activity follows. A controller places a landline phone call to the local fire department, reciting the street address, what was detected (smoke, fire or both) and how many people are home. The deadbolts all unlock and the surveillance cameras watching the doors go into full-time record mode. The natural gas feed to the house is shut off just past its first tap, which feeds the backup generator. All fans in the house are turned off and all of the vent registers shut. And the vanity panel at the front door changes from showing the house number to showing a floor plan of the house complete with the locations of every adult, child, infant or pet inside.
Visitors and deliveries
The house knows about mail and package deliveries (from sensors in the mailbox and at the front door) and also knows when people approach the front door, and triggers subtle doorbell-like alert tones as these things happen, as well as exerting some influence over surveillance system decisions to record relevant cameras.
Lawns and gardens
Controllers analyze data from multiple soil moisture sensors and from weather resources to impact the scheduling of lawn watering.
© Copyright 2016, 2017 and 2018 Newstips, Lord Martin Winston and J2J Corporation; all rights reserved
This site needs a larger screen and is not optimized for phone or tablet viewing