Note: The hardware of this project is being updated. Those who want to do it can wait for the latest version of PCB. The following project introduction is for the current version. The latest version address can be viewed on my homepage: )
This project is a universal infrared remote control based on ESP8266
and STC89C52
. It can control infrared home appliances through the Alibaba Cloud platform web interface, and can DS18B20
obtain the current indoor temperature for display through and the working status can WS2812B
be displayed through .
This project selects a single-chip microcomputer to modulate and read STC89C52
infrared signals , and then sends the temperature through the serial port. After the network is configured , it is connected to the Alibaba Cloud platform. Then the temperature data is uploaded regularly and the remote control information sent by the control page is received. Then the corresponding data is sent through the serial port control. infrared remote control signal. When the system is waiting for the network distribution, the network distribution is successful, and the remote control signal is transmitted, the status can be indicated through , and the indicator light can be turned off on the control page.DS18B20
ESP8266
ESP8266
STC89C52
WS2812B
Because the hardware part is relatively simple and the schematic part has been divided according to functions, the circuit introduction here is relatively simple and does not include the corresponding maps.
STC89C521
In addition to the chip, the minimum system circuit only has a 12Mhz crystal oscillator and two capacitors connected externally, which leads to a serial port for program burning.
ESP8266
The smallest system is also relatively simple, requiring only two resistors and one capacitor. The module model uses ESP-12F
two buttons for reset and programming, and also leads to a serial port for easy programming.
The 3.3V power supply chip chosen has AMS1117
a simple circuit and is mainly used to supply power to ESP8266
, WS2812B
and serial port level conversion circuits. It is equipped with an LED indicator light to observe whether the output is normal.
The infrared diodes are driven by current sinking. Each diode is connected in series with a 1K current limiting resistor. When using, pay attention to the size of the current to avoid damage to the microcontroller.
DS18B20
The power supply is 5V, just pull a 4.7K resistor on the data pin when using it.
WS2812B
Mainly used to indicate system status, the power supply is 3.3V, and the signal pin is connected to ESP8266
pin 11.
STC89C52
The serial port voltage is 5V and ESP8266
the serial port voltage is 3.3V, so they need to pass a level conversion circuit during serial communication to prevent ESP8266
problems due to excessive voltage.
Acrylic material was selected for the design of the shell, and the shell drawings were drawn using Lichuang EDA. The project address is as follows:
IoT infrared remote control shell
Use the Easy EDA editor to open the drawing of the shell, click File - Export - DXF, select only the wires in the pop-up window, and then click Export. The exported files can be sent to Taobao stores for processing or cut by yourself. The thickness of acrylic is about 2MM, and the thickness of PCB is 1MM. The upper and lower shells are connected using M2 studs, and the stud sizes are M2.0*8+5 M2.0*5+5 respectively.
WS2812B
It is not lit because the LED power indicator light next to it is too bright. If it is fully turned on, it will not be clear when taking pictures. . .Currently, there are only two control interfaces for air conditioners and TVs. Because Alibaba Cloud IOT studio
only has web visualization development left, we will first make a web interface to test the functions of the device, and will later develop an app to control the device.
The picture below is a picture of the web control interface. The indoor temperature and outdoor temperature are displayed at the top of the air-conditioning interface. The air-conditioning setting buttons are at the bottom. The left side of the TV interface is the basic TV remote control button, and the table on the right side can hold TV program lists.
STC89C52
the circuit could not work due to welding reasons. Due to time constraints, I could not purchase another chip, so I connected the driving pin of the infrared diode to the IR diode through a flying wire ESP8266
.STC89C52
the capacity of a single IO port. Therefore, only 3 diodes were welded during actual welding. Although the number of diodes was Reduced but still large infrared signal coverage.arduino
the IRremote.h
library. The decoding was successful when decoding the TV remote control. However, when decoding the air conditioner remote control, the remote control signal reception was incomplete due to program problems. Because the air conditioner remote control of a certain brand The signal is divided into two segments and connected through a 20ms low level in the middle. However, because the 20ms time is too long, only the first half of the signal can be received. Although I later found the format of the remote control signal online, there were still problems during debugging. I had to wait until the logic analyzer arrived before adding the air conditioner remote control function.STC89C52
, but due to welding problems, it was later switched ESP8266
to . However STC89C52
, I only added NEC
the signal modulation of the protocol. After switching to , ESP8266
I found that there is a ready-made library for signal modulation, so the second version will be cancelled STC89C52
.STC89C52
the circuit, and the modulation of the infrared remote control signal ESP8266
is completed through.DHT11
sensor, cancel DS18B20
, and add humidity display on the control interface.ESP8266
automatic download circuit to facilitate program update.Android app
, the web interface is no longer used for control.Because there are exams after school starts, project updates will be slow. The latest version of the program is basically written, and the hardware part will be updated in time.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet