The hardware part of this project is completely designed by Lichuang EDA. Jialichuang makes the boards and Lichuang Mall purchases materials. I am very grateful for the support of the Lichuang EDA team. Thumbs up for domestic EDA, come on! ! ! ! !
Project version notes on August 18, 2020
First let’s take a look at some pictures of Lichuang’s EDA renderings. The purple color is quite beautiful, but it’s a pity that Lichuang cannot produce purple boards.
This project uses the ESP8266 WIFI module as the main control, model ESP-12S (product number: C82898) or ESP12-F (product number: C82891), a cost-effective WIFI SoC module with rich information, which can be carried out using the Arduino platform development. ( PS: An Xinke held an event before and bought a lot of ESP-12F. I just took this opportunity to use it. )
ESP8266 minimum system circuit
The status of each pin during ESP8266 power-on (reference: esp8266 power-on pin initialization status problem )
GPIO pin | initialization state | initialization state |
GPIO0 |
pull up | H |
GPIO2 | pull up | H |
GPIO4 | drop down | L |
GPIO5 | drop down | L |
GPIO12 | pull up | H |
GPIO13 | pull up | H |
GPIO14 | pull up | H |
GPIO15 | pull up | H |
GPIO16 | Output set high | H |
When making the V0.1 version of the circuit, I did not find this problem with the initialization state. It was not until after the board was soldered and tested that I discovered the problem with the pull-up and pull-down of the port.
As a development board, it needs an onboard USB to TTL converter for firmware downloading and program debugging. The model is CH340C (product number: C84681), a national good core, strong and durable, and cheap. ( PS: I happen to have a WCH (Nanjing Qinheng) brand coupon in Lichuang Mall ). When ESP8266 downloads firmware, the startup mode needs to be switched to download mode. Here, a triode is used to build an automatic download circuit. The model is M8050 (product number: C541705). I have the materials on hand.
The power supply voltage of ESP8266 is 3V~3.6V, and the power supply current is >500mA. Here, AMS1117-3V3 is used to power the WIFI module. In order to ensure the stability of the WIFI module, a separate AMS1117-3.3 (product number: C347222) is used to power other peripherals. In order to avoid circuit current backflow, Schottky diodes 1N5819 (Product No.: C402219) and SMBJ40CA (Product No.: C340689) are added to the power input for protection. Jumper resistors are placed on both the input and output parts of the LDO. It is convenient to debug and troubleshoot the system, and the resettable fuse is used for overcurrent protection.
The temperature and humidity sensor used in this project is the DHT11 (product number: C117051) digital temperature and humidity sensor from Guangzhou Aosong Electronics. DHT11 digital temperature and humidity sensor is a temperature and humidity composite sensor with calibrated digital signal output. It applies dedicated digital module acquisition technology and temperature and humidity sensing technology to ensure that the product has extremely high reliability and excellent long-term stability. The sensor includes a capacitive humidity sensing element and an NTC temperature measuring element, and is connected to a high-performance 8-bit microcontroller. Therefore, this product has the advantages of excellent quality, ultra-fast response, strong anti-interference ability, ultra-long signal transmission distance, digital signal output, and precise calibration.
I have a WS2812 light ring on hand, with a total of 24 WS2812 lamp beads. I bought it and kept it for a long time, and it is just right for this project, as shown in the picture below, so I reserved a pin header interface here to facilitate connection with Dupont wire.
Some lamp beads only support 5V level signal control. The level signal of ESP8266 is 3V3, which requires a level conversion circuit. This project uses the NMOS tube model WST3400S (product number: C105164) to design a bidirectional level conversion circuit. . The control of WS2812 can be controlled by ordinary GPIO port or SPI MOSI port. Therefore, two control ports are left here to facilitate the selection of control mode. Just use the short-circuit cap to select the port.
For the relay here, I choose Y3U-SS-105LM (product number: C674571), which is a normally open relay with a coil voltage of 5V ( PS: I happened to have a Yuanze Relay brand coupon of 15 yuan in Lichuang Mall ), which is just right. A bit big. The relay drive requires special design. For reliability, the special chip NUD3105LT1G (product number: C14894) was selected . This drive circuit is high-level triggered. The pull-down resistor R15 ensures that the initial state is low level, ensuring that the relay will not close when the system is powered on to avoid misoperation. Because the GPIO4 port of ESP8266 is initialized to low level, the connection method in the figure below is more appropriate.
Note: The relay model I actually use here is a normally open relay, which does not have a normally closed contact. There are both normally open and normally closed on the drawing. This design on the drawing is only for convenience and compatibility with normally open and normally closed relays.
The picture below is the reference design circuit of NUD3124. The peripheral circuit is very simple.
When the control port is initialized to a high level , the above circuit is not very suitable. The following circuit is more suitable. The inverter SN74LVC1G04DBVR (product number: C434067) is used in this circuit.
When the GPIO of the MCU is initialized to high level, because it has passed through the inverter, the signal is low level, NUD3105 does not conduct, and the relay does not pull in; when the GPIO output is low level, it becomes high level after passing through the inverter. , NUD3105 is turned on and the relay is closed.
This is a conventional buzzer drive circuit, you can choose active or passive buzzer. This project chooses an electromagnetic passive buzzer, model YS-MBZ9042C03R16 (product number: C409836), none The source buzzer can control the frequency of sound.
This part of the circuit is mainly used for ADC acquisition, and a 1% resistor is used for sampling. Lead out a pin header for external resistive components.
This part is also the reference circuit given in the official ESP8266 series module user manual V1.3 of Essence
USB data lines should be differential lines and try not to have too many turns.
The power line must first pass through the capacitor before it can power devices such as chips and modules.
There are instructions on the placement of the antenna in the official ESP8266 series module user manual V1.3 of Essence .
The antenna is placed as shown in the figure below. The bottom of the antenna is hollowed out, and clear areas are set up on both sides. No copper is laid.
The relay part should not be laid with copper, and the wiring should be thickened. The wiring should be on the BOT layer. Windows can be set up. Tin can be piled up during welding to increase the current carrying capacity and avoid creepage of high-current parts. Slots should be set up between the pins.
1. Take a photo as a souvenir
2. Weld the power supply part first. After the power supply part is soldered, use a multimeter to check whether there is a short circuit. If there is no short circuit, power on and test. If both power indicator lights are on, it means the power supply part is normal.
3. There is no problem with the power supply. Solder the jumper resistor between CH340 and the power supply part.
4. After welding the CH340, connect it to the computer to see if the CH340 can be detected. The computer has recognized the CH340 device, which means the circuit is normal.
5. Next, weld the automatic download circuit and ESP8266 core module
6. Connect to the computer for testing. The program can be burned normally and the ESP8266 minimum system is normal.
7. Solder other components. The final board is as shown in the picture below.
8. Tin piling treatment on the window opening part
Note: This part of the picture uses version V0.1.
Development environment: Arduino1.8.13 official website address: https://www.arduino.cc/en/Main/Software
After the Arduino IDE is installed, create a new folder named portable in the installation root directory , as shown in the figure below.
After starting the Arduino IDE for the first time, the default path will automatically point to the portable folder, otherwise an Arduino15 folder will be created on the C drive to save the board SDK file.
After automating the Arduino IDE for the first time, some configuration files will be automatically loaded in the portable folder and ESP8266 board support will be added.
Development board manager loads platform index
The files in the configuration folder are as shown in the figure
SDK support package: ESP8266 SDK 2.7.4 open source project address: https://github.com/esp8266/Arduino/releases/tag/2.7.4
Recommended download address , this is the file I have compiled here, you can use the link directly: https://pan.baidu.com/s/1plqgOPmJfFymJHCdbGuh7w Extraction code: kf0e
Create a new packages folder in the portable folder and unzip the downloaded file, as shown in the figure
After starting the Aruino IDE, as shown in the figure below, the ESP8266 SDK is ready to use.
DHT11 software package: DHT-sensor-library project address: https://github.com/adafruit/DHT-sensor-library
It is recommended to install directly in the library manager, as shown in the figure below
WS2812 software package: Adafruit_NeoPixel project address: https://github.com/adafruit/Adafruit_NeoPixel
It is recommended to install directly in the library manager, as shown in the figure below
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