I can’t really remember when I actually started working on it. I probably slowly drifted into developing the whole thing. 3 years ago, when I applied for my current job as a webdev, I was asked how I’d build a device that sends a mail whenever a specific door is opened. After a few hours of tinkering with an Arduino Uno and some kitchen foil I actually built a quite similar device: instead of a mail it posted a status update on Twitter (interesting tidbit: when I shut it down, it had 5 followers).
At that point, I thought about extending the idea: Maybe make my flat speak with some kind of TTS magic? Maybe do some other cool stuff?
Unfortunately though I didn’t know anything about electronics or more complex programming besides sticking together some Arduino modules or controlling some stuff over a network.
Fortunately though, not knowing much about how to achieve a goal has never been a problem for me.
Fast forward a year and a half: By now I’ve learned a lot about webdev. At that point I built some mediocre websites in my freetime, one being a site called bloxapi. The code was okay-ish. I didn’t use a framework and built it from scratch, resulting in a hardly extendable codebase. The concept of the page was simple: The user could create and edit so called blocks, which were nothing but fields the user could read from or write via HTTP requests by using a key. Simple, but effective. The plan was to use the blocks to store data like the current temperature or if a door is open by simply updating them via a request to bloxapi. So I went ahead and built a monstrosity out of an Arduino Uno, an ethernet shield, a ton of wires, a breadboard, some reed switches and a DHT11 (that’s a temperature and humidity sensor). It looked like I mercilessly ripped it out of some other device and stitched it together with some junk, but it worked. Automatical updates of the temperature in my room and the current state of my doors / window kept coming to bloxapi, which were then again read by an Arch server I setup on an Odroid using Festival to text-to-speech some message whenever both the window and the door are open.
Finally, more than a year after having the idea vague idea of building a speaking flat, it finally worked.
It got boring though pretty quickly. Bloxapi only could be used to store and read data, which by itself was fine, but I wanted to manage all smarthome related stuff on a single page at some point. The hardware was a pain as well. I didn’t really know what I was doing, so I ended up with a mess. I took everything down and went back to the drawing board.
Fast forward another half year. I gained a lot more webdev related experience and decided to start building a framework that I can use to more quickly build my projects. I started with some basic features like database and HTML abstraction and added other features as I kept developing the new smarthome system. Slowly I devised a plan on how everything should work: Take the data storage from bloxapi, add some event management, add some ways to actually do something on events (TTS, reddit, twitter, mail, some hardware) and wrap it all up in a nice and tidy package hosted on the previously mentioned Arch server.
Also, my ignorance about electronics wasn’t acceptable. This was something I planned to get into for quite some time, so I ordered a ton of electronics accessoires like a lab power supply, resistors, capacitors and what not as well as a bunch of ESP8266s (a big upgrade from Arduino + Ethernet shield) to start developing more into the embedded device direction. The ESP8266 is just a really tiny microcontroller with built in WiFi and some GPIOs, also compatible with the Arduino IDE.
I quickly got sick of stitching stuff together on breadboards, so I designed my first circuit with an ESP, a voltage regulator and a circuit that automatically puts the ESP into flash mode whenever the device is connected via serial. A quick Google search later, I found a tutorial on how to design a PCB. I pulled some feedback from reddit, designed a second version and finally ordered my first own device from OSHPark!
This happened at the beginning of this year. Since then I went through quite a few iterations of different boards for different purposes, each being a bit better designed than the previous one. A few weeks ago I finally started to use my first dedicated device 24/7. It’s, again, a temperature / humidity logger, but this time in the size of a USB stick. Neat and tidy.
All of this is fed into my data and event management system, which at this point doesn’t do anything interesting yet.
What’s next? Further boards are on their way, including devices dedicated to a number keypad, an RFID reader and a reed switch. They should arrive in a few weeks. Once I assembled them, they’ll be used to expand the current system.
After that I intend to buy a few official smarthome products, mainly lamps. I don’t really want to try building a high voltage device which could result in me being electrocuted or my flat burning down, so I prefer keeping the big stuff to the professionals and instead only implement their API to control the devices via my event management.