srox7QkRmf

#The 8th Lichuang Electronic Competition#Desktop electronic clock

 
Overview


Project function introduction:
Desktop electronic clock design based on R7FA2E1A72DFL chip, using four 0.56-inch common cathode digital tube to display time, temperature and humidity, using DHT11 temperature and humidity sensor to collect ambient temperature and humidity, reset button, serial port circuit, SWD download circuit are all led out for easy download and debugging.
 
1. Onboard resources
Figure 1-1 Front view of desktop electronic clock PCB resources
Figure 1-2 Back view of desktop electronic clock PCB resources
1. Main control chip: R7FA2E1A72DFL;
2. Power interface: TYPE-C;
3. LED: power indicator;
4. Buttons: a reset button, a BOOT switch, and four function buttons. The four function buttons are all 6*6*12 buttons, which are directly led out of the shell for easy use;
5. Debug interface: SWD download debug interface and serial port download debug interface are both led out with a 1.25mm 1x4P connector;
6. Peripherals: a 0.56-inch four-digit common cathode digital tube, a DHT11 temperature and humidity sensor, and a SMD passive buzzer;
 
2. Advantages and characteristics
Figure 2-1 Dimensions of desktop electronic clock board
1. The onboard appearance is small, with a size of only 62.992mm*32.004mm);
2. Complete download and debugging interfaces;
3. Low price and complete functions;
4. Place the components on the back and use the vertical TYPE-C interface to keep the front of the PCB clean and tidy;
5. Use Jiali Chuang's high-quality PCB and genuine components to ensure product quality;
III. Circuit Analysis
Figure 3-1 Schematic diagram of desktop electronic clock
3.1. Power supply
  circuit The power supply circuit is mainly composed of TYPE-C interface and power indicator light. It uses a 6-pin vertical TYPE-C interface and is placed on the back of the PCB. R1 is used as the current limiting resistor of the power indicator light, and LED1 is used as the power indicator light. When the switch is closed, it will light up for prompting.
Figure 3-2 Power input part
3.2. Main
      control circuit The main control microcontroller uses R7FA2E1A72DFL, with an operating voltage between 1.6V and 5.5V, a maximum clock frequency of 48Mhz, and a maximum support of 128-KB FLASH, 16-KB SRAM, and a 12-bit AD conversion controller. The chip has an integrated crystal oscillator (an external crystal oscillator can be used for more accurate timing), and an integrated touch function, which can be realized without a touch chip.
      Add a 100nf capacitor to the power input part for power filtering. The VCL pin is used to stabilize the smoothing capacitor of the internal power supply. This pin needs to be connected to a 4.7uf capacitor to the VSS pin.
Figure 3-3 Main control circuit part
3.3, reset circuit
      Reset is also called restart. Press the SW2 button, the RES pin of the main control is pulled low, the system enters the reset state, release the RSW2 button, the RES pin of the main control returns to a high level, the system resumes the working state, and the reset is completed.
Figure 3-4 Reset circuit part
3.4, startup mode selection circuit
      When the switch is turned on to 2-3, the MD pin is high, and the microcontroller enters the Single-chip mode, that is, the normal working mode. When it is switched to 1-2, the MD pin is low, and the microcontroller enters the SCI-BOOT mode, that is, the program download mode, so we can control the microcontroller to download the program or run normally through this switch.
 Figure 3-5 Startup mode selection circuit
3.5, touch control circuit
      R7FA2E1A72DFL main control chip has touch function. Add 560 ohm damping capacitor and appropriate capacitor to stabilize touch signal on touch line. It is sensitive and accurate enough. Touch pin is used to control the temperature and humidity switching display of clock.
Figure 3-6 Touch control circuit
3.6, independent key circuit
      uses four keys as clock control, among which sw4 key controls the time modification switching key of clock, sw5 key controls time increase, sw6 key controls time reduction, and sw7 key has the same effect as touch pin, and is used as time and temperature and humidity switching.
 Figure 3-7 Independent key circuit
 
3.7, DHT11 temperature and humidity sensor circuit
      uses DHT11 temperature and humidity sensor to detect environmental temperature and humidity. DHT11 is a single bus communication mode, and needs to connect a pull-up resistor to the bus. When the bus is idle, its state is high level.
Figure 3-8 DHT11 temperature and humidity sensor circuit
3.8. Passive buzzer drive circuit
      The negative pole of the passive buzzer is controlled by the NPN transistor. R5 is a current limiting resistor. The function of R6 is to provide a reliable potential when the chip is just powered on or off to prevent interference. The electromagnetic passive buzzer here is an inductive load. The D1 diode is added as a freewheeling diode to prevent burning.
Figure 3-9 Passive buzzer drive circuit
3.9. Four-digit digital tube drive circuit
      uses a 0.56-inch four-digit common cathode digital tube to display time, temperature and humidity information. When switched to temperature display, the first two digits of the digital tube are displayed as "P1", and when switched to humidity display, the first two digits of the digital tube are displayed as "P2". The last two digits are the corresponding temperature and humidity values.
 Figure 3-10 Four-digit digital tube drive circuit
3.10. Serial port debugging interface
      The serial port pins are brought out through a 1.25mm 1x4P connector for serial port download and debugging.
Figure 3-11 Serial port debugging interface
3.11. SWD debugging interface
      leads out the SWD pin through the 1.25mm 1x4P connector for downloading and debugging in SWD mode. 
Figure 3-12 SWD debugging interface
 
3.12. M2 copper pillar interface
      uses four M2 screw holes to fix the board and the shell. The M2 screws are M2*16mm flat head self-tapping screws.
Figure 3-13 M2 copper pillar interface
 
 
IV. Precautions
 
4.1. When drawing the schematic diagram, pay attention to the following:
1. Draw according to the module circuit division and indicate the circuit function;
2. Fill in the name and other information in the drawing attributes;
3. Pay attention to the DRC check of the schematic diagram to ensure that the pins are effectively connected;
4. The wire connection of the network should not exceed the pad;
5. Do not overlap the network logo and symbol to affect the appearance.
6. Unused pins should be marked with non-link logos and should not be left hanging.
 
4.2. When purchasing materials, pay attention to the following:
1. First filter the materials in stock, and then filter the price sorting for purchase;
2. Try to purchase materials from the same warehouse and choose nearby warehouses to shorten delivery time.
3. Panel printing can be bundled with components for shipment to save shipping costs. Remember to make a note when placing an order that you want to bundle the shipment, and wait until the binding is successful before picking the goods.
 
4.3、Note in PCB Layout:
1. Routing should be horizontal and vertical first, and obtuse angles or arcs are preferred where turning is required;
2. Add silk screen logo and annotate the interface function;
3. Silk screen should not be placed on pads;
4. Power lines should preferably pass through capacitors before connecting to chip pins;
5. When routing from pads, try to follow the direction of pads and do not route out from the middle;
6. Vias should not be placed on pads as much as possible (hole-in-pad process costs money);
7. Touch pins are more sensitive, so touch routing should not pass through holes to reduce interference;
8. When placing components, be careful not to stack them together to affect actual welding;
9. Add solid filling to the touch pad part to reduce interference caused by the surrounding;
10. Note that the size of the silk screen should not be too small, and the recommended size should not be less than 1.2mm;
11. JLCJLCJLCJLC designated custom silk screen can be hidden under the device, and the finished board is beautiful;
Figure 4-1 PCB layout reference figure
Figure 4-2 PCB routing reference figure
4.4, attention should be paid during welding:
1. When welding, you can click the welding auxiliary tool in the toolbar of Jiali Chuang EDA, and the real-time interaction facilitates welding;
2. When welding the top layer, it is recommended to weld the main control chip first to avoid other devices affecting the welding;
3. When welding the plug-in, you can use an empty board or a perforated board to support it to prevent oblique welding and affect the use;
4. The welding sequence should follow the principle of from low to high to avoid affecting the welding of small devices;
Figure 4-3 PCB empty board-top layer
Figure 4-4 PCB empty board-bottom layer
4.5, attention should be paid during debugging:
1. Before power-on debugging, check whether there are problems such as cold soldering and short circuit in welding. Only after checking that there are no problems can you power on the test;
2. Use the USB to TTL serial port burning tool to download the program to the microcontroller, and the RXD end of the USB to TTL line is connected to the TXD end of the microcontroller, and the TXD end is connected to the RXD end of the microcontroller;
 
V. Software burning
1. Prepare the CH340USB to TTL downloader and the 1.25mm 1x4P male Dupont line;
2. Connect the TXD pin of the downloader to the RXD pin of the circuit board with a Dupont line, and connect the RXD pin of the downloader to the TXD pin of the circuit board with a Dupont line. Connect the 5V power pin to the 5V pin, and the GND ground pin to the GND;
3. Use Renesas Flash Programmer to burn the software;
4. Due to the size limit of the attached file upload, the download link of the burning software is released here, and everyone can download and use Renesas Flash Programmer (Programming GUI) | Renesas
5. After the burning is completed, the key switch needs to be pressed and held to trigger the flashing to adjust the time;
 
select the correct operating system to download and use.
When using the software for the first time to burn, select New Project.
Create a new project to set specific parameters.
Select the path where the RA2E1_clock.hex burning file is located.
If an error message is prompted, turn on the BOOT switch during burning, and press and hold the reset button. Click Burn and the dialog box appears, then release the reset button.
Burn successfully prompts, turn off the BOOT switch after successful burning, and press the reset button again for the clock to display normally.
 
6. 3D Shell Preview
1. The 3D shells are all printed with 3D Monkey's Black-photosensitive resin material, with good molding effect and uniform black appearance.
 
 
6-1_3D Shell Preview Figure
7. Actual Preview Figure
7-1 Actual Front Preview Figure
7-2 Actual Back Preview Figure
 
7-3 Actual Time Display Preview Figure
7-4 Actual Temperature Display Preview Figure
7-5 Actual Humidity Display Preview Figure
8. Subsequent Upgrade Optimization Direction
1. Since the timing error of the crystal oscillator directly using the MCU is very large, it can be directly connected to ESP_8266 through the serial port for networking time synchronization in the later stage;
2. Due to the use of the shell wrapping, the temperature of the digital tube will be inside the shell, which will affect the accurate measurement of the temperature sensor DHT11. At present, the actual error can be modified in the software to make the temperature display correct;
3: The buzzer is not configured yet, and the buzzer and alarm functions will be added later;
4: The touch pin cannot be used outside the shell, and the debugger needs to be used to re-debug the touch pin;
 
 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-21 01:35:50

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号