Close
0%
0%

Aurai - retrofit dumb air conditioners

Helping traditional air conditioners join the Internet of Things.

Similar projects worth following
I love being to control my home from afar. However, air conditioners have been pretty slow to join the party, Aurai allows any AC that has a remote control to be controlled digitally via a modern web interface.

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

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 »

  • Interface & data logging

    Thomas R08/20/2014 at 05:37 0 comments

    The interface is now hooked up! I also got data logging working for humidity & temperature - something I was not expecting to get done by the Aug 20th deadline. I also rewrote large parts of the node.js app to make it way more reliable.

    I did some simple range tests & am very impressed. With the spoke at one end of my house and the hub at the other, there are very few packets that fail - meanwhile, my wifi signal struggles to reach that far.

  • User interface

    Thomas R08/18/2014 at 06:02 0 comments

    I've finished the first mock of the web-based user interface. I used font-awesome for the icons.

  • We have data link!

    Thomas R08/17/2014 at 22:53 0 comments

    I now have firmware for both the hub and spoke. The hub can tell the spoke to power on the AC (which it does!) or ask the spoke for a status report. Right now, this report only includes the current humidity. This is a landmark, though. I have the air conditioner being controlled over a radio link. Yay! 

  • NRF24 radio lessons learned

    Thomas R08/16/2014 at 21:11 0 comments

    I finally have ping firmware running on the hub & spoke breadboards that can talk to each other. This was a painful process. I ended up having to refer to a third party library for a couple gotchas but the core of the pain was missing that I had typo'd one operating to be a register WRITE than a register READ.

    The IR LED for the spoke is on pin 5 (OC2B). OC2A is pin 17 (MISO). I found that whenever I had the timer set up, the SPI hardware would always read a low on MISO (verified this with a logic analyzer) - even if I had cleared COM2A0:1 "OC2A set to normal operation". Resolved this by basically cleaning up *all* timer code once the IR is sent. In a future, I'll move the IR LED off this timer - maybe to OC0A (pin 12). I wish I knew why this was happening, though.

    EDIT: I actually found a forum post that describes exactly the behaviour I am seeing, but on ATxMega32E5. Atmel told this person that it is a hardware flaw in the device. I'm unsure if the same truth applies to my situation, but the symptoms are identical.

  • Power snafu

    Thomas R08/15/2014 at 05:22 0 comments

    I realized I put a LM3490 3.3v LDO on the board rather than a LM3940. The 3490 is a smaller SOT-23 device delivering 100ma of current. The 3940 is a SOT-223 device delivering up to 1a. I'll have to figure out a way of putting the larger regulator on the spoke board (maybe using header pins as stilts?).

    Luckily, the hub board hasn't been sent to the fab house yet. And it looks like it's time for rev 2 of the spoke board.

  • rev1 again

    Thomas R08/12/2014 at 01:01 0 comments

    Since rev1 never even went to the fab house, I ... revised it.

    * Dropped the ATM2501 EEPROM from the spoke schematic

    * Using a real regulator IC rather than a divider for the radio power

    * Using a resistor array for the status LEDs and IR LED

    In other news, I have submitted to Oshpark!

  • rev1 spoke pcb!

    Thomas R08/11/2014 at 05:51 0 comments

    I have completed the first revision of the PCB for the Spoke. I switched a lot of pins along the way in order to simplify routing - I need to update my breadboard version, confirm it all works, then submit this to Oshpark!

  • Codin'

    Thomas R08/10/2014 at 16:52 0 comments

    I've started serious work on the code for the Spoke. Currently "done", and on Github.

    * SPI framework

    * AT25M01 SPI EEPROM

    * DHT11 temp/humidity sensor

    * Serial IO for debugging

    Today, my aim is to get IR Output working. This will involve using one of the AVR timers in CTC mode to generate the 38khz carrier wave, then modulating that.

    Remaining drivers to be written are for the NRF24L01+ radios and the ENC28J60 ethernet interface. I've saved the hardest for last.

    UPDATE:

    I got IR send working. I spent most of the time trying to get the CTC mode of Timer2 working - I didn't realize that even if you're outputting to OC2B, you still set the overflow value in OCR2A.

    Also wrote some test functions that will be optimized out if they're not used.

    Here's the implementation: https://github.com/rixth/aurai/blob/cef81dd1febec0986922c590f0a62e921f61ded1/firmware/spoke/src/IRSend.cpp

  • Schematic Bits

    Thomas R08/07/2014 at 02:24 0 comments

    Now that I've started drawing the schematics for the receiver, I've noticed that I don't have parts for all of them. It seems like I'll have to make a part for the AT25M01 EEPROM. The initial rev of the schematic is also going to use a female header socket for the DHT-11, and 5x2 pins to connect to the NRF24L01 radio.

    I've never made parts in EAGLE before, but it seems like Sparkfun have a pretty good tutorial.

  • Breadboard rebuild

    Thomas R08/06/2014 at 22:35 0 comments

    I tore down the breadboard today and rebuilt on smaller 30 row units. I also got an order of ATMega328Ps today too so I prototyped the controller board too (which really, it just the AVR + radio + eeprom).

    Didn't hook up the ethernet breakout yet - this part of the project really worries me because it's not the oft-used Wiznet chipset, documentation for this one is a little thinner.

    I'm starting on the schematics. Follow along on Github.

View all 13 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates