Through project study, you can learn the following:
The main features of the ESP-C3F-12FWIFI module selected in the project are as follows:
The project design system block diagram is shown below:
Figure 1 IoT clock hardware system block diagram
This circuit uses USB 5V for power supply, and uses an AMS1117-3.3V to step down the voltage to power the chip. The onboard CH340N program download circuit is used for program burning and serial port connection for ESP-C3-12F. It adds three buttons for manual timing function and two LEDs to indicate the power supply and networking status. The display circuit uses a MAX7219 chip. Drives two four-digit digital tubes to display hour, minute and second information; in order to ensure that the time continues to run even when the network is disconnected, a DS1302 clock chip is used to ensure that the time memory can be maintained in the case of power outage and network disconnection.
Figure 2 Schematic diagram of IoT clock design based on ESP-C3-12F
After reading this schematic diagram, do you understand the circuit diagram of each circuit module? If not, let's analyze how the circuit composed of this project is designed.
Figure 3 ESP-C3-12F main control circuit
When designing circuits using the ESP-C3-12F module, you need to pay attention to the following points:
(1) Pin 3 EN is the enable pin and needs to be pulled up. High level enables the chip to work. Connecting an external button to ground here can control the chip reset;
(2) By default, IO9 has been pulled up internally, and download mode can only be entered when IO9 is 0, so you can add a button behind IO9 to enter download mode;
(3) It is recommended to use LDO for power supply. If DC-DC is used, the ripple is required to be no more than 30mv.
In order to have a better interactive experience, the project designed 5 buttons and two LED lights.
Figure 4 LED and button circuit
The functions and IO connections of each device are as follows:
Device name |
Connect IO |
Function Description |
RST |
IO3 |
reset button |
DOWMLOAD |
IO9 |
Program download button |
KEY1, KEY2, KEY |
IO10, IO18, IO19 |
Time adjustment function button |
LED1 |
IO3 |
Chip enable status indicator light |
LED2 |
IO0 |
Network status indicator light |
The power supply part uses a Micro USB for power supply, and a toggle switch to control the power supply. The buck circuit uses a very classic AMS1117-3.3V chip, which only needs two 100nf filters to achieve good results!
Figure 5 Power circuit
The program download part is designed using Qinheng's CH340N. The circuit structure is simple and does not require an external crystal oscillator. When using 5V power supply, pin 8 does not need to be connected to the power supply; when using 3.3V, it needs to be connected to the power supply, so please pay attention to this!
Figure 6 USB to TTL circuit
The inside of the digital tube is actually composed of a dot matrix LED light. If each interface is connected to the microcontroller, a lot of IO resources will be wasted, so we need to design a driver circuit for the digital tube. There are many kinds of driver chips, such as 74HC595, TM1640, TM1650 and other common chips. The functions of various chips are similar. In this project, MAX7219 was selected to drive two four-digit digital tubes. The chip uses a 3-wire serial interface to transmit data with the microcontroller, and can easily control multiple LEDs. When selecting a digital tube, please note that this chip drives a common cathode LED and cannot be used to drive a common anode LED.
Figure 7 Digital tube drive circuit
In order to ensure that the device can continue to run time after being disconnected from the network, a clock circuit was designed using DS1302. The DS1302 circuit is simple, with a button battery that allows the device to continue running after power off, and uses a 32.768KHz crystal oscillator to provide an accurate clock source for the chip.
Figure 8 DS1302 clock circuit
Before performing schematic design, you need to create a project folder first, then create a schematic drawing in it, install the schematic content and modify the file name. The following issues need to be noted during the design process:
(1) Ensure that the circuit is correct. This is especially important. An incorrect schematic will generate an incorrect PCB, causing the circuit to not work properly;
(2) For specific circuit design, refer to the data manual provided by the manufacturer, and read the pin definitions thoroughly;
(3) When selecting devices, pay attention to whether the selected devices can be purchased, and consider factors such as price, size, and packaging;
(4) After the schematic design is completed, check the circuit connections again. You can use the network rules provided by EasyEDA to check. The most important thing is to confirm that each circuit is connected correctly;
(5) Finally, organize the schematic diagram and lay it out according to each module. Make the page neat and clean.
PCB design is very important. Whatever the PCB design is, it will be the same as the board we get. A good PCB design drawing is like a beautiful scenery that makes people stand up and admire it. How to design a beautiful PCB requires first of all a systematic understanding of the overall circuit being drawn, how the power is supplied, how the input and output human-computer interaction parts are displayed, how the components should be placed reasonably, etc. , before drawing the PCB, we should have a rough layout diagram in our mind. Then we can’t just draw on one side, and we can’t let the inspiration fade away. Quickly grab the mouse and start laying out the wiring.
The first step in PCB design: determine the shape
When designing a PCB, you need to first determine the shape you want to complete. Is your board going to be square, rectangular, round, or Spongebob-shaped? This requires selection based on the function of the circuit and your personal preferences.
Picture reference comes from: Student works of the Radio Association, School of Physics and Electronic Engineering, Chongqing Normal University, click to view the project
In this project, we combined the characteristics of two sets of four-digit digital tubes and designed a simple 85mm*40mm rounded rectangle as the PCB frame. We encourage everyone to use their creativity to design more fun and interesting shapes. The works come. (*❦ω❦)
After the shape is set, it is time to place the components inside the frame for layout. Several principles should be considered for device layout:
When laying out components, I am good at using the layout transfer function (shortcut key: CTRL+SHIFT+X) of the top menu bar selection tool in the Easy EDA schematic diagram to quickly classify and display components. The component layout reference of this project is as follows:
In this layout, the USB power input and switch are placed on the left side of the bottom layer of the PCB board. Two four-digit digital tubes are placed side by side on the top layer. Four buttons are arranged below. Two indicator LEDs are placed in the upper right corner. The battery holder is placed in the middle of the bottom layer to match the Two copper pillar interfaces are used for structural support of the entire circuit board. The remaining chips are placed on the bottom layer to make the clock display more beautiful.
A good component layout has completed more than half of the entire PCB design work, but the previous layout can only be a rough layout. In fact, it needs to be adjusted during the PCB routing, and it is adjusted while drawing until it is completed in our mind. Medium look. The following points need to be noted for PCB routing. More design points require us to continuously accumulate experience in design and improve our design and drawing capabilities.
(1) The power supply and signal wiring should be laid out according to the signal current flow direction and strictly according to the schematic design drawing. Even if they are all connected and no error is reported, the order must be considered, first through A, then B, and finally to C. , you cannot go directly from A to C to B. This is especially important when you are a beginner.
As shown in the figure, the power is input from the top of C1, passes through the capacitor C1, flows to the chip U1 for voltage reduction, and is output through C2, and the capacitor and the chip are required to be placed neatly close to each other.
(2) Pay attention to the line width setting during PCB routing. The power line should be slightly thicker than the signal line, which can be set to 30mil, and the conventional signal line should be set to 15mil. The line width cannot be set too thin, and the factory production process should be considered. The PCB production process of Jialichuang is shown in the figure below:
(3) During the actual wiring process, the pads connecting two identical networks are connected with wires. The wires should be given priority in straight lines, horizontally and vertically. The device layout can be adjusted to make the connection between the two points the shortest. If a straight line cannot be maintained Priority should be given to using 135° obtuse angle or arc routing to keep the design beautiful.
The above describes some issues that should be paid attention to when learning. I hope that everyone can continue to improve their design level in subsequent studies, communicate with each other when encountering problems, make progress together, and overcome difficulties together!
PCB trace reference diagram
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