
【 LC Electric race 】 Desktop electronic clock design based on Renesas
PRO【 LC Electric race 】 Desktop electronic clock design based on Renesas
License
:Public Domain
Description
1. Project Introduction
Based on the desktop electronic clock design of the R7FA2E1A72DFL chip, the time, temperature and other displays are carried out through the four-digit 0.56-inch common cathode digital tube, and the DHT11 temperature and humidity sensor is used to collect the ambient temperature and humidity, and the reset button, serial port circuit, and SWD download circuit are all drawn out for easy download and debugging.
2. Onboard resources
Fig.2-1 Front view of the desktop electronic clock resource
Fig.2-2 Illustration of the back of a desktop electronic clock resource
1. Main control chip: R7FA2E1A72DFL;
2. Power interface: TYPE-C, 2Pin plug-in;
3. LED: one power indicator, one charging status indicator;
4. Buttons: one reset button, one BOOT button, four function buttons;
5. Debugging interface: SWD download and debugging interface, serial port download and debugging interface, all use 2.54 pin header interface for extraction;
6. Peripherals: a 0.56-inch common cathode digital tube, a DHT11 temperature and humidity sensor, and a passive buzzer;
3. Advantages and characteristics
Fig.3-1 Dimensions of a desktop electronic clock board
1. The onboard appearance is small, and the size is only 70mm*35mm (2755.906mil*1377.953mil);
2. Complete download and debugging interfaces;
3. Using power switching circuit, power failure can also continue to work through lithium battery power supply;
4. The price is cheap and the function is perfect;
5. Use JLC high-quality PCB and genuine components to ensure product quality;
4. Circuit analysis
Fig.4-1 Schematic diagram of a desktop electronic clock
4.1. Power supply circuit
The power supply circuit is mainly composed of TYPE-C interface and power indicator, using 2Pin TYPE-C interface, simple and convenient, easy to solder, R1 as the current limiting resistance of the power indicator, LED1 as the power indicator, and the closing switch will light up for prompting.
Fig.4-2 Power input
4.2. Main control circuit
The main control microcomputer uses R7FA2E1A72DFL, the working voltage is between 1.6V and 5.5V, the maximum clock frequency is 48Mhz, and the maximum support is 128-KB FLASH, 16-KB SRAM, and 12-bit AD conversion controller. There is a crystal oscillator integrated inside the chip, which can eliminate the need for an external crystal oscillator, and at the same time integrate the touch function, so that the touch function can be realized without touching the chip.
Add a 100nf capacitor to the power input part for power filtering, and the VCL pin is used to stabilize the smooth capacitance of the internal power supply, so you need to connect the 4.7uf capacitor to the VSS pin.
Fig.4-3 Main control circuit
4.3. Reset circuit
Reset is also called restart, press the RST button, the RST pin of the main control is pulled low, the system enters the reset state, release the RST button, the RST pin of the main control returns to a high level, and the system re-works to complete the reset.
Fig.4-4 Reset circuit
4.4. Start mode selection circuit
When the BOOT1 button is not pressed, the BOOT pin is high, and the single-chip microcomputer enters the Single-chip mode, that is, the normal working mode, when the key is pressed, the BOOT pin is low, and the single-chip microcomputer enters the SCI-BOOT mode, that is, the program download mode, so we can control the single-chip microcomputer through this button to download the program or run normally.
Fig.4-5 Startup mode selection circuit
4.5. Touch control circuit
R7FA2E1A72DFL main control chip is with touch function, adding 560 ohms of damping capacitance and appropriate capacitance to the touch line to stabilize the touch signal, in fact, it is sensitive and accurate enough.
Fig.4-6 Touch control circuit
4.6. Independent key circuit
Four buttons are used for clock control or other functions.
Fig.4-7 Independent button circuit
4.7. DHT11 temperature and humidity sensor circuit
DHT11 temperature and humidity sensor is used to detect the ambient temperature and humidity, DHT11 is a single bus communication mode, a pull-up resistor needs to be connected to the bus, when the bus is idle, its state is high.
Fig.4-8 DHT11 temperature and humidity sensor circuit
4.8. Passive buzzer drive circuit
The negative pole of the passive buzzer is controlled by the NPN transistor, R7 is the current limiting resistor, and the function of R8 is to provide a reliable potential when the chip is just powered on or powered off to prevent interference, the electromagnetic passive buzzer here is an inductive load, and the D1 diode is added as a freewheeling diode to prevent burnout.
Fig.4-9 Passive buzzer driving circuit
4.9. Four-digit digital tube drive circuit
The 0.56-inch common cathode digital tube is used to display time, temperature and humidity and other information.
Fig.4-10 Four-digit digital tube driver circuit
4.10. Charging and discharging part of lithium battery
The first is the power switching circuit, through a P-channel mos, a pull-down resistor and a diode to form a power switching circuit, when the TYPE-C interface is connected, 5V comes, the G pole voltage of the MOS tube is 5V, after a 1N5819 Schottky diode, the VCC voltage is 4.4V, that is, the S pole 4.4V, does not meet the conduction conditions, the battery power supply can not pass. When the TYPE-C interface is disconnected, the G pole is lowered to low, and the S pole will have a voltage of nearly 3.5V or so due to the existence of the body diode, which meets the conditions, at this time, the MOS tube is turned on, and the battery will supply power to the subsequent circuit, due to the existence of the 1N5819 Schottky diode, the current will not be reversed.
The battery is charged through a TP5056 lithium battery charging chip. When the TYPE-C interface is connected, the lithium battery is charged at the same time to ensure sufficient power. LED2 is the charging status indicator, and R11 is the charging current feedback resistor. By changing the resistance value of R11, the overall charging current can be changed.
Fig.4-11 Charge-discharge circuit of a lithium battery
4.11. Serial port debugging interface
The serial port pin is led out through the 2.54*4P interface for serial port download and debugging.
Fig.4-12 Serial port debugging interface
4.12. SWD debugging interface
The SWD pin is pinned out through the 2.54*4P interface for SWD mode download and debugging.
Fig.4-13 SWD debugging interface
4.13. M3 copper pillar interface
Screw holes through four M3 are used to secure the board.
Fig.4-14 M3 copper pillar interface
5. Precautions
5.1. Attention should be paid to the following in drawing the schematic diagram:
1. Draw according to the division of module circuits, and indicate the circuit function;
2. Fill in the name and other information on the drawing attributes;
5.2. Attention should be paid to the procurement of materials:
1. Screen the materials in stock first, and then filter the price to buy;
2. Try to buy materials from the same warehouse, choose a warehouse close to it, and shorten the delivery time;
3. When you purchase multiple orders, you can save freight by binding orders;
5.3. Attention should be paid to the following in the PCB Layout:
1. The wiring is preferentially at a right angle, and the place that needs to be turned is mainly obtuse angle or arc;
2. Add silk screen logo and annotate the interface function;
3. JLCJLCJLCJLC designated custom silk screen printing can be hidden under the device, and the board is beautiful;
Fig.5-1 PCB layout reference diagram
Fig.5-2 PCB trace reference
5.4. Attention should be paid to the following:
1. When welding, you can click on the welding auxiliary tool in the toolbar of JLC EDA, and the real-time interaction is convenient for welding;
2. When soldering the top layer, it is recommended that the main control chip be soldered first to avoid other devices affecting soldering;
3. When welding the pin header, it can be used to hold up an empty plate or a hole plate to prevent oblique welding and affect the use;
4. The welding sequence should follow the principle from low to high to avoid affecting the welding of small devices;
Fig.6-3 Empty PCB - top layer
Fig. 6-4 Empty PCB - bottom layer
5.5. Attention should be paid to the following in debugging:
1. Before powering on and debugging, check whether there are problems such as virtual welding short circuit in welding, and only after checking that there is no error can the power-on test be carried out;
2. Use USB to TTL serial port burning tool to download the program to the single-chip microcomputer, the RXD of the USB to TTL cable is terminated to the TXD end of the single-chip microcomputer, and the TXD is terminated to the RXD end of the single-chip microcomputer;
Designed by 立创EDA课程案例推荐 (from OSHWHub)
Design Drawing


Comment