The hardware
Aurai comprises of two hardware components. The first is the base (or "hub") station which connects to the network over a wired ethernet connection. The second component, referred to as the "spoke", contains the infrared transmitter to talk to the AC and environmental monitoring sensors. The two units communicate with each other over a wireless connection.
This two-piece construction allows the larger control unit to be hidden away, while the transmitter can sit inconspicuously on a shelf. I have ordered a Solidoodle Press, which should hopefully arrive in time that I can print nice cases for both the hub & spoke.
The hub & spokes both have ATMega328P's at their hearts - I used this because they're ubiquitous and I wasn't sure how much I/O I'd need. If the final revision allows, these may become 14-pin ATTinys.
For the wireless connectivity, I eventually settled on the NRF24L01+ 2.4hgz transceivers made by Nordic Semiconductor. This was primarily a choice driven by price, and availability of existing literature online. Additionally, low-power usage is possible if I wanted to make the spokes battery powered.
The first hub prototype will forego the ethernet connection (and associated web server) in the interest of simplicity - rather it will be connected to a computer and communicate over serial with a node.js-based server which will serve the interface. In latter revision, the hardware itself will expose a REST API and potentially also host the web interface.
The software
I have found that many home automation software packages have atrocious interfaces. Leveraging my "real job" skills as a front-end engineer, the system will have a modern, mobile-compatible web interface.
The firmware
The hub & spoke will communicate using a series of simple commands over the radio link. The hub should be able to ask the spoke for current environmental data, or to turn on the AC, set target temperature, etc. The spoke firmware will have to contain an state machine to keep track of the air conditioner's state, as some commands are not always valid (ie. you can't set the target temperature when the AC mode is set to "fan only").
The hub has a large (2mb) flash IC on it that will allow it to store the large strings needed for HTTP handing and the associated resources. It will also hold a circular buffer of environmental measurements from the last 24 hours (transferred wirelessly from the spoke).
Eventually, I would like to have multiple spokes, potentially controlling other devices - though this goal is far down the road.
Graphical representation of the system
Current status: what's working
- Two-way communication between hub & spoke
- Remote control of the air conditioner
- Environmental monitoring of the spoke's environment (for temperature and humidity)
- Logging the last few hours of environmental data, and displaying the trend in the interface
Current status: what's not working
- Ethernet connectivity. Right now, a node.js app on a computer is serving the UI and talking to the hub over serial. The spoke does not have to be connected to a computer.
- Physical case. The project is still on a breadboard - though PCBs have been designed & ordered for the spoke. A 3D printer is on the way to print cases.
Open-source usage
- avr-libc (Modified BSD) & pin-defines (GPLv2) in the firmware.
- FontAwesome (MIT) for icon fonts on the interface.
- Wolfgang Kuehn's dew.js for dew point calculation (Apache License).
- node.js (MIT) & express.js (MIT) to serve the user interface.
- avrdude (GPLv2) for programming
Aurai's code & hardware is licensed under the GPLv2.
Prototype video
Concept video
Bill of Materials
For the spoke:
U1 ATMEGA328P U2 DHT11 humidity sensor U3 NRF24L01+ breakout board IC1 7805TV 5v regulator IC2 LM3940 5v to 3.3v LDO regulator LED1 Green LED LED2 Yellow LED LED3 Red LED LED4 IR LED Passives: R1 330 ohm 4-way resistor array R7 5k ohm resistor C1 0.33uF capacitor C2 0.1uF capacitor C3 22pF capacitor C4 0.47uF capacitor C5 33uF capacitor J1 6-pin...Read more »