Introduction: Esp8266 Universal AC IR Remote Web Server
This project is an Standalon Web IR remote control for common home Air Conditioners units based on esp8266 module With esp8266 IR library And aduffuit ssd 1306 library.
The code designed to work as a standalone unit.
So its means that no code is needed after flashing the code to microcontroller. In the First time you power up the AC IR Remote it will take 2 min until its open hotspot for WiFi setup then you can connect to that hotspot without any password.
When your device is connect to the AC IR Remote
You will see IP number on the OLED screen.
Type this IP into your browser address and enter to the WiFi Setup page Choose name for your AC Remote unit
Type in your WiFi router SSID Name and your Pass and press submit.
Now the AC IR remote will restart and will connect to your router automaticly in few seconds and you will see on the OLED screen The given name of the unit and a new IP address that connected to your router.
browse to that new IP address from any device That connected to your wifi router and enter to the AC IR Remote page
The AC IR Remote have the most common actions for any AC Unit:
ON/OFF
COOL/HEAT
FAN SPEED
NORMAL/TURBO
SWING
TEMP
The AC IR Remote Have 59 different manufacturers Protocols. Choose one protocol from the list by the manufacture of your AC unit and press SET.
Now you can control your ac unit from any place that connected to your wifi router with this IP.
The Ac IR remote unit is writing the states ofthe remote buttons to the EEPROM so it's remember all states when power go's off, execpt the ON/OFF state.
The AC IR Remote start allways in OFF mode in case the power go down to avoid starting the AC when power is back again.
Also if for any reason AC IR Remote lose WiFi connection it will try to connect again to your wifi hotspot forever.
if for some reason power go down and up again the AC IR Remote will try to connect to your wifi hotspot for 2 minutes.
In case its not find your router after 2 minutes it will open automatically the AC IR hotspot for WiFi setup.
That give enough time for your router to rise up in case that all the electricity go's down and comes Up.
Rota
.
Attachments
Supplies
AIR CONDITIONER UNIT
ESP8266
Oled screen ssd1306 128x6
IR LED
TRANSISTOR 2N2222
RESISTOR 470 OHM
VERA BOARD
HEADERS MALE/FEMALE
SOLDENIG WIRE
SOLDER IRON
Step 1: Schematics and Instructions
The schematic for this project is very simple
First Solder on a Vera board 2 rows of female header that wil feet to the esp8266 male headers and then place the other parts on top of the board and solder the connections between the parts on the buttom side of the board with lead wires.
Remember to Place the IR led in one end of the board facing out the board like any remote control.
And Follow the schematics when soldering the parts connections.
Step 2: Building the Circuit
1. Esp8266 3.3v pin connect to positive leg of the IR Led
2. Negativ leg of IR Led connect to the collector leg of the 2n2222.
3. Esp8266 D5 pin connect to the Base leg of the 2n2222 Through a 470 ohm resistor.
4. Emeter leg of the 2n2222 connect to esp8266. Gnd pin.
OLED SCREEN CONNECTION
1. Esp8266 3.3v pin connect to screen VDD pin
2. Esp8266 Gnd pin connect to screen Gnd pin
3. Esp8266 D1 pin connect to screen SCL pin
4 esp8266 D2 pin connect to screen SDA pin
Step 3: The Code
Before uploading the code make sure you install
The required libraries and add on in arduino IDE software
INSTALLING THE LIBRARIES
1 Install ESP8266 Add-on in Arduino IDE
2 install IRremoteESP8266 in Arduino IDE
https://github.com/crankyoldgit/IRremoteESP8266
2 install Adafruit_SSD1306 in Arduino IDE
https://github.com/adafruit/Adafruit_SSD1306
UPLOADING THE CODE
1.connect esp8266 to pc open arduino IDE and from menu set port to your esp8266 port.
2 from menu set borad type to NudeMCU 1.0
3 from arduino menu set CPU Frequency to 160mhz
4 from arduino menu set lwIP variant to V2Higher Bandwidth
5 Open the AC Remote.Ino
Code and compile it.
6 Flash code to esp8266.
Step 4: Using the AC Remote
After flashing the code the esp8266 will restart And will try to connect to a wifi network.
since its the first time we run the code the EEPROM is blank and the AC Remote cannot connect to any WiFi router.
Wait 2 minutes and the AC Remote.Will open automatically an independent Hotspot that called "AC IR Remote AP" And The Oled screen Will show "Wifi Setup" and the IP of this Hotspot.
Now you can connect to that hotspot from any device and open your browser.
In the browser address type in the IP and enter to the setup WiFi page.
Setup
1. Give A name to your device
2 Enter your wifi router said name
3 Enter your wifi router password
4 Press submit.
after pressing submit the AC IR Remote is set and will restart and will Connect to your route.
then you will see the device name you choose and a new IP on the Oled screen.
Connect any device to your wifi router Open the browser and type in the new IP into the browser address and enter to the AC Remote server page.
Keep that IP page in bookmark or favorites for fast access From any place that connected to your router.
choose any protocol by AC manufacture from the protocols list and press set button.
Now you can test the AC IR Remote actions with your AC unit.