Hack My House: Raspberry Pi as Infrastructure


I finally had my own house. It was a repossession, and I bought it for a song. What was supposed to be a quick remodel quickly turned into the removal of most of the drywall in the house. There was a silver lining on this cloud of drywall dust and loose insulation. Rather than constantly retro-fitting cabling and gadgets in as needed, I could install everything ahead of time. A blank canvas, when the size of a house, can overwhelm a hacker. I’ve spent hours thinking through the infrastructure of my house, and many times I’ve wished for a guide written from a hacker’s perspective. This is that guide, or at least the start of it.

What do you want your smart house to do? And what do you want to be able to do in your smart house? For example, I wanted to be able to upgrade my cheap 120 V welder to a beefier 240 V model, so adding a 240 V plug in the garage was a must. As a bonus, that same 240 V circuit could be used for charging an electric car, if ever one is parked there.

“Ethernet everywhere” was my mantra. Try to imagine everywhere you might want to plug in a desktop, a laptop, an access point, or even a VoIP phone. I decided I wanted at least two Ethernet drops to each room, and tried to imagine the furniture layout in order to put them in convenient places.

The problem is that not everything uses Ethernet. I wanted temperature sensors, magnetic switches on the doors– Oh, and tie into the HVAC control, and maybe a webcam or a motion detector. Add in LEDs and relays for controlling lights, and it becomes obvious that a better solution is needed.

Pi Boxes

I’ve always been fond of the Raspberry Pi– It has USB, GPIO, and i2c, among other interfaces. An Instructable by [peter_3d] gave me the burst of inspiration I needed. A 3-gang electric box is the perfect size for a Raspberry pi. The newest version of the Pi, the Pi 3 b+ has support for a PoE hat, which we’ve recently covered.

In each room of the house, I’ve mounted an electric box in the ceiling, as well as on the wall of the central hallway. To each box, a single Ethernet cable runs back to a central point in the room destined to be my home office. Each Pi will sit on a 3-wide blank plate. From each of these points, I can eventually mount a thermal and humidity sensor, a webcam, a motion detector, or any number of other sensors. The unit in the hallway wall will get the full touchscreen treatment.

A smart, PoE capable switch will power this web, and a flask instance providing a RESTful interface will allow pulling the data back to a central controller, as well as pushing commands back to the nodes. [Matt Richardson] was part of the inspiration, and has a very good primer on the subject. A central web interface can then track temperatures, control the heater and air conditioner, and monitor doors opening and closing.

One of my longstanding complaints about the Raspberry Pi is that power instability kills SD cards. Starting with version 3, the Pi supports booting over a network without an SD card. Rather than running to each device for maintenance (fsck the sdcard), all the file-systems can live on a central server, and are mounted over NFS. There is enough to the process of setting up PXE boot for the Raspberry Pi, it deserves a dedicated article.

I have further plans for my house, and the Raspberry Pi is an excellent platform to expand upon in the future. Next time, we’ll talk more about structured cabling, security cameras, and whatever else you want to hear about. Let me know below!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *