## This project won the first prize in the 5th Zhejiang Sci-Tech University Undergraduate Electronic Design Competition
#### Team number: ZSTU011
#### Team members: Mao Xiaoyu, Hu Yuchen, Yang Feiyu
#### Instructor: Jin Hai
## Related projects
#### [STM32F103RCT6 master control](https://oshwhub.com/ZSTU-EDC-5th/zhe-jiang-li-gong-dian-sai-stm32f103rct6)
#### [MC34063 boost module](https ://oshwhub.com/ZSTU-EDC-5th/zhe-jiang-li-gong-dian-sai-mc34063)
## "School-Level Electronic Design Competition" Design Summary Report
#### **Zhejiang Sci-Tech University Electronic Design Topic H of the competition school competition: LED flash power supply**
###### **Project description: This project contains a **** boost module circuit based on ****MC34063 voltage stabilizing chip**
* of MC34063 Input and output characteristics: The output voltage of the module is adjustable, Vout=1.25*(1+R2/R1). In this project, R2 is replaced by a 500K sliding rheostat, and R1 uses a 47K resistor.
*The actual measured output voltage range is X~15.2V, and X is approximately the input voltage.
* In the question, when the input voltage is 3.6V, the maximum output power is about 4W, and 3W is the most stable.
- - -
#### **Design Report**
###### **1. Question Requirements**
Task description: Design and produce an LED flash power supply. The core of this power supply is a DC-DC stabilized current power converter, which converts the battery's power into a constant current output to drive high-brightness white LEDs. The power supply has two modes: continuous output and pulsating output, and has output voltage limiting protection and alarm functions.
* 1. Basic requirements
* (1) Input voltage 3.0V~3.6V.
* (2) The output current in continuous output mode can be set to three levels: 100, 150, and 200mA. The maximum output voltage is not less than 10V, and the minimum output voltage is 0V (output short circuit).
* (3) Within the specified input voltage and output voltage range, the relative error of the output current is less than 2%.
* (4) When the equivalent DC load resistance is too large, the output voltage limit value will not be higher than 10.5V and an alarm will occur.
* (5) When the output current is 200mA and the output voltage is 10V, the efficiency is not less than 80%.
* (6) Make a homemade LED flash for demonstration.
* 2. Features
* (1) It has a pulsating output mode, the output duty cycle is 1/3, and the relative error is less than 2%.
* (2) The output current peak value can be set to three levels: 300, 450, and 600mA. The relative error is less than 5%, and the intermittent current is less than 1mA.
* (3) The pulse period can be set to three levels: 10, 30, and 100ms. The relative error is less than 2%. The rise time and fall time are not more than 100 μs. The current overshoot is not more than 10%.
* (4) The number of output pulses can be set to 1 to 5 and a continuous pulse train (for testing), and a pulse train is output every time the start button is pressed.
* (5) Others.
###### **2. Overall scheme design**
The system consists of four parts: DC-DC power boost circuit, constant current circuit, control circuit and alarm circuit. The system structure block diagram is shown in the figure below. The DC-DC power boost circuit is composed of MC34063 voltage stabilizing chip circuit, which is the protagonist of this project; the constant current circuit is composed of a linear voltage-controlled stable current source circuit; the control circuit uses STM32F103RCT6 as the control core, which includes matrix button control, DAC , OLED display and other functions; the alarm circuit is composed of a triode, a buzzer, and an operational amplifier chip OP07. It will alarm when the system reaches certain conditions. By boosting the input voltage and then transferring it to the load, the current through the load is kept at a stable value through the constant current circuit, and the alarm circuit is always connected. When the load resistance is too large and the voltage at both ends of the load is greater than the given value, the buzzer Call the police.
![system.png]

###### **3. Boost module circuit**
* Option 1: Using the XL6009T voltage regulator chip, the XL6009T input current can reach 4A. According to power conservation, the final input current in this question needs Reaching about 2A, XL6009T can meet the requirements.
* Option 2: Use the MC34063 voltage stabilizing chip. The MC34063 voltage stabilizing chip can arbitrarily change the output voltage by modifying the ratio of the external resistor. The input current of MC34063 can reach about 1.1A, which meets the requirements.
Plan analysis: After testing and comparing the two plans, it was found that the high heating power of the XL6009T voltage stabilizing circuit resulted in low efficiency of the entire circuit and failed to meet the question requirements, so it was not selected. The MC34063 chip has high efficiency and can meet the requirements of the question, so option two is chosen.
![34063.png]

###### **4. Constant current circuit module**
* Scheme 1: Connect multiple sets of switches and resistors in parallel, and use the different switching states of the multiple sets of switches to achieve multiple sets of different current values . In this way, as long as the number of switches is large enough, control of multiple currents can be achieved.
* Option 2: Use MOS tubes to build a BUCK circuit using appropriate capacitors, inductors, resistors and diodes. Use the PWM output of the microcontroller to control the duty cycle of the switch of the MOS tube. According to the equivalent circuit when the MOS tube is turned on and off The freewheeling and discharging are used to achieve constant voltage output, and then connected in series with a sampling resistor of appropriate value to achieve constant current output.
* Option 3: Connect a MOS tube to the output end of the operational amplifier, use the "virtual short" principle of the operational amplifier, give the reference voltage from the DA of the microcontroller, input the operational amplifier through the resistor divider to put the MOS tube in the linear zone, and control the sampling resistor The voltage at both ends is a constant value, and the sampling resistor is used to achieve constant current. The schematic diagram is shown below.
Plan analysis: According to the requirements of the question, the voltage at both ends of the load needs to be a square wave with a duty cycle of 1/3. Therefore, Plan 1 is always a DC value and cannot meet the requirements, so it is not selected. After experiments, it was found that the second option is a constant voltage circuit, which achieves a constant current effect by connecting it in series with the sampling resistor, and the greater interference of the MOS tube will have an impact on the accuracy of the circuit, while the third option uses an op amp, and the circuit is easy to To reach a constant current state and change the constant current value by simply changing the DA output of the microcontroller, it is relatively simple and stable, so option three is chosen.

###### **5. Alarm circuit module**
* Option 1: According to the rated voltage requirements, an op amp circuit is used to drive the triode to break. This solution is a pure hardware circuit. By comparing the size of the positive and negative input pins of the op amp circuit, when the positive input is greater than the negative input, the positive voltage is output to drive the transistor to conduct and the buzzer sounds. When the negative input is greater than the positive input, a negative voltage is output, the transistor is turned off, and the buzzer sounds. The instrument does not sound.
* Option 2: Use the microcontroller AD to sample the voltage at both ends of the load. When the voltage at both ends of the load exceeds the rated value, the microcontroller drives the buzzer to alarm, meeting the question requirements.
Plan analysis: Plan 1 is a pure hardware circuit, which requires high accuracy and can complete the questions well. The hardware circuit is simple and easy to build. The second option is a pure software method, which uses AD sampling to obtain voltage value alarms. Since there are errors in AD sampling, it is difficult to ensure the accuracy requirements, so it is not adopted. To sum up, the first option is the alarm circuit.
![warning.png]

- - -
##### Physical circuit diagram:
![03.jpg]

![Main circuit preview.jpg]