M-o-a-T bus
The MoaT bus
MoaT devices are small(ish) embedded computers.
They use the MoaTbus concept to talk to each other.
The problem
Wireless systems are impractical in larger or older houses.
- Mesh topology requires always-on RF receivers
- Batteries need frequent replacement or charging
- RF interference may cause annoying delays
- Thick wires shield RF transmissions
(Nevertheless, MoaTbus supports RF gateways, as one can't always string wires everywhere …)
Connecting devices via power lines is not recommended for multiple reasons:
- bulky power supplies on each device
- most uses are not isolated: capacitor-based mW-level power conversion would be highly unsafe
- data transfer on top of the power line is not trivial and not easily debugged
- signalling wires next to power wires require insulation
- air gaps required on circuit boards
- Last but not least, 230V is just plain dangerous.
Wired bus systems can be categorized as two-wire (signalling and power on the same line) or four-wire (balanced signalling or clock+data).
2-wire buses
The most common two-wire systems are 1wire and KNX.
1wire is not suitable because the protocol does not allow multi-master operation and its timing is too critical for reliable implementation.
KNX requires a dedicated bus power supply and a special interface IC; it's also somewhat slow (9600 baud) and not trivial to implement. On the other hand, it's very reliable, and the interface IC isn't too expensive and can supply 3.3V to the controller.
4-wire buses
Common 4-wire buses include I²C and CAN.
For home automation, CAN is a less than optimal choice:
- it's supposed to be a strict bus topology
- bus wires are supposed to be balanced twisted-pair
- messages are very short, requiring additional software effort
Thus, while CAN remains an option, MoaT initially focuses on low-speed I²C. There are driver ICs which boost I²C voltage and/or current levels so that using it becomes practical on long cables with high stray capacity. (Which of these to actually use is TBD.)
The solution
MoaTbus will work on top of multiple transports.
Buses
Serial
Not a bus, so there's no address assignment. However, packetization is required.
All bytes not sent as part of a packet are assumed to be console data. Packet data must be transmitted back-to-back.
For further details, see moat-serial.
I²C
Bus addresses are assigned by the master, based on free addresses found when bus scanning.
For further details, see moat-i2c.
KNX
MoaTbus uses the NCN5120 bus coupler. This IC supplies sufficient 3.3V power and implements the KNX data link.
For further details, see moat-knx.
Data layer
MoaTbus is a master/slave system. There is a provision for intermediate systems which can forward data with minimal internal state.
Slave systems do not talk directly to each other.
For further details, see moat-protocol.