蓝猫淘气

[Training Camp_Advanced Class] IoT Infrared Remote Control

 
Overview

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: )

Function introduction

This project is a universal infrared remote control based on ESP8266and STC89C52. It can control infrared home appliances through the Alibaba Cloud platform web interface, and can DS18B20obtain the current indoor temperature for display through and the working status can WS2812Bbe displayed through .

This project selects a single-chip microcomputer to modulate and read STC89C52infrared 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.DS18B20ESP8266ESP8266STC89C52WS2812B

Hardware introduction

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.

STC89C52 minimum system

STC89C521In 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 Minimal System

ESP8266The smallest system is also relatively simple, requiring only two resistors and one capacitor. The module model uses ESP-12Ftwo buttons for reset and programming, and also leads to a serial port for easy programming.

3.3V power circuit

The 3.3V power supply chip chosen has AMS1117a simple circuit and is mainly used to supply power to ESP8266, WS2812Band serial port level conversion circuits. It is equipped with an LED indicator light to observe whether the output is normal.

Infrared diode drive circuit

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 circuit

DS18B20The power supply is 5V, just pull a 4.7K resistor on the data pin when using it.

WS2812B circuit

WS2812BMainly used to indicate system status, the power supply is 3.3V, and the signal pin is connected to ESP8266pin 11.

Serial port level conversion circuit

STC89C52The serial port voltage is 5V and ESP8266the serial port voltage is 3.3V, so they need to pass a level conversion circuit during serial communication to prevent ESP8266problems due to excessive voltage.

Shell design

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

QQ screenshot 20200824031911.png 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.

Actual pictures and functional demonstrations

Let me show you two 3D previews of Lichuang EDA first.

QQ screenshot 20200824032639.png

QQ screenshot 20200824032714.png

This is a picture when the power is on. The reason for the flying wire will be explained later. WS2812BIt 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. . .

IMG_996820200818152013.JPG

The demonstration video has been uploaded to the attachment.

Control interface display

Currently, there are only two control interfaces for air conditioners and TVs. Because Alibaba Cloud IOT studioonly 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.

QQ screenshot 20200824034436.png

QQ screenshot 20200824034455.png

QQ screenshot 20200824035104.png

Design issues and follow-up plans

design issues

  • During the actual welding, STC89C52the 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.
  • When driving infrared diodes, current sink driving is used. There were 6 infrared diodes in the initial PCB design. After proofing, it was found that the sink current was too large and exceeded STC89C52the 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.
  • The USB data cable interface reserved during the design of the casing is relatively small, so the data cable cannot be plugged in, so the side of the casing with the USB port cannot be installed. Now the size of the casing has been modified and can be used directly.
  • What takes the longest time is the encoding and decoding of infrared signals. The decoding part is completed using arduinothe IRremote.hlibrary. 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.
  • Infrared encoding was first used STC89C52, but due to welding problems, it was later switched ESP8266to . However STC89C52, I only added NECthe signal modulation of the protocol. After switching to , ESP8266I found that there is a ready-made library for signal modulation, so the second version will be cancelled STC89C52.

Follow-up plan

  • Cancel STC89C52the circuit, and the modulation of the infrared remote control signal ESP8266is completed through.
  • Adding an infrared receiving diode enables learning of infrared remote control signals.
  • Add DHT11sensor, cancel DS18B20, and add humidity display on the control interface.
  • Added ESP8266automatic download circuit to facilitate program update.
  • The case and PCB dimensions are the same as the first version.
  • When developing a supporting package Android app, the web interface is no longer used for control.
  • Cancel the 3.3V power indicator light (it is too bright and affects the observation of the status indicator light).

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.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-22 12:30:57

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号