Saturday, June 24, 2017

AC Controller: ESP8266 WiFi Relay


Long time no write... been busy... but I am back...
This June we had a huge rise of temperatures and I suffered my crappy AC thermostat, which does not seem to measure temperature correctly and has no programability. I needed some fix for that. I could have bought a new thermostat, but that would have been very easy. So I decided to get myself an esp8266 board with a relay so that I could switch my AC on an off. I already have a nice wifi thermostat to control my boiler and the company making that one (netatmo) is nice enough to provide an SDK to access the thermostat data, so my plan is to try to use that as input to this ESP8266 board to turn on and off the AC. Here goes my journey to try to achieve such goal...

I first bought the ESP8266 board with a relay pictured above these lines. On ebay. Less than 9 euros delivered. It was my first go at ESP8266, but I had read that you could use the Arduino IDE to program them, so what could go wrong?

I had to solder the 3 pin serial port and the 2 pin boot mode selector, other than that the board was ready to be used. As for setting up the Arduino IDE, everything seems well explained here: https://github.com/esp8266/Arduino

Install Arduino IDE (1.8.3 in my case)
Open Preferences window (File->Preferences).
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
Select the Generic ESP8266 board
Select the device used for serial connection (you need a 3V3 232 adapter)
I opened the Blink Sketch and replaced the GPIO used with number 2, which corresponds to the blue LED mounted on the ESP8266 board. Verify, Upload and got a blinking LED... ready to start the real work

No comments:

Post a Comment