M-o-a-T devices
The MoaT device
MoaT devices are small(ish) embedded computers.
They use the MoaTbus concept to talk to each other.
The problem
Decentralized home automation requires small systems which don't need much power or communication bandwidth. The main commercial contender in this space is EIB/KNX, which is not at all ideal for hobbyists:
- no open source
- no open hardware
- A two-wire bus (comms and power on the same wire) requires a specialized power supply
- 9600 baud is not enough for some use cases
The solution
MoaT devices are based on STM-32 CPUs. These are available in a variety of memory sizes and pinouts.
These CPUs run a Mecrisp Forth interpreter/compiler. Thus, each node can be individually programmed without requiring off-line compilation and firmware upload once the basic bus interface is up.
The physical link will be slowed-down I²C in a multi-master, (almost-)sender-only configuration. Inexpensive ICs are available that support hardening the bus sufficiently for longer distances, by using higher voltage or current levels. See the MoaTbus page for details.
Background
The initial plan is to implement a variety of low-cost, high-hackability home monitoring and automation ideas.
Hardware Features
- room monitoring (motion detector, temperature,, light level …)
- Exterior door and windor monitoring
- Interior door monitoring (reed switches)
- Heating control
- Smoke detection
- Indoor and outdoor light switches
High-level control
Lights
Motion detectors by themselves are stupid. The delay before they actually turn on the light is annoying and some uses don't work well (e.g. you're on the sofa reading, so you need to wave your arm every two minutes to keep the light on).
Thus, the basic idea is that if you are in room A, and open the door to room B, the light in room B should turn on even before the motion detector in room B realizes that I'm in there. Also, presence monitoring should detect the difference between you being in a room but not moving, and you having left (movement in an adjacent room, a connecting door opening).
Lights should turn off whenever the ambient light is strong enough. However, it should still be possible to turn the light (back) on manually.
Fire
Smoke detectors are essential, but not audible when you're above the first floor (or not at home at all) and the alarm goes off in the basement.
In addition, smoke detectors have batteries that can go flat and need periodic checks.
Intelligent detectors with external power supply cost €30, except if you want to network them (then it's more like €80). A "real" smoke detection system is even more expensive.
Thus, the idea is to develop a reasonably inexpensive MoaTdev circuit board that can be plugged into such a detector. Fortunately, the Gira Dual's protocol has been reverse-engineered.
Using this system to wake up your teenage son by triggering a secondary alarm in his room is possible, but not recommended.
Heating
A basic radiator thermostat controls the opening of the radiator's valve based on how warm the air next to the radiator is (and the setting on it). Ideally that setting corresponds to one set temperature; however, since the flow of heat depends on the temperature of the walls, adhering to that set point depends on correct temperature of the circulating water, which is usually controlled by an outside thermometer.
However, I'm living in an old house with thick but non-insulated walls. Wall temperature depends on the average outside temperature and sunlight during the last week. Thus the thermostat is almost always somewhat off and needs to be adjusted.
Second, since the walls aren't insulated, to save energy the water temperature needs to be as low as possible. The central heating doesn't know how high that is, and the individual thermostat needs to adjust the valve's position accordingly.
Third, my water contains too much lime, which tends to choke up the valves, and enough air to plug up some pipe or other.
Thus, the basic idea is:
- an intelligent thermostat receives a target temperature via the MoaTbus.
- It also periodically reads or receives the room temperature, either by directly-connected thermometers or remotely.
- It also reads the radiator's input and output water temperature.
- Based on that, the controller implements a PID algorithm that controls the valve.
- The valve position is reported on the bus.
- The central heating's target temperature is adjusted dynamically, so that the maximum valve position is at 80% or so.
- If rooms don't get warm or the input temperature is too low, report an error so that somebody can investigate the problem before people start freezing.