Note: * is a required field,
please fill it in during the registration stage↓
* 1. Project function introduction
This design is a smart desk lamp based on N32G430C8L7. The functions include 1. Switching the desk lamp, 2. Adjusting the light brightness.
The brightness adjustment part uses the current feedback method to make the dimming more layered. This design has a voltage acquisition circuit, which calculates the power of the desk lamp through the collected voltage and current to prevent the power of the desk lamp from exceeding the preset value and ensure the life of the desk lamp.
*2. Project attributes:
Original and public for the first time
* 3. Open source agreement
GPL 3.0,
please fill in during the competition stage↓
*4. Hardware part
1. Light board part:
Sample 4 150ma warm yellow lamp beads
2. Control board
current source circuit
N32G430 minimum system
INA180 current detection circuit
power acquisition circuit
encoder circuit
nmos switch circuit
*5. Software part:
Compilation environment keil 5.37
Burning method: Use DAPLINK to burn online directly in keil software
Bottom driver:
PWM -- nmos switch circuit control
ADC dual channel --- One channel collects the out of INA180, and one channel collects the voltage after the power supply voltage divider resistor
EXTI --- Encoder knob
GPIO --- Encoder button
Application layer logic: When
powered on for the first time,
the encoder button detection is scheduled every 20ms to determine whether it is pressed. The first time it is pressed, the light is turned off, and the next time it is pressed, the light is turned on. When the light is turned off, the current brightness value will be saved, and the brightness before turning off will be restored when the light is turned on next time.
100ms scheduling power supply voltage detection
10ms scheduling current monitoring
20ms scheduling to obtain encoder direction, positive brightness increases, reverse decreases
10ms scheduling pid algorithm, use the calculated current value feedback to adjust the pwm duty
cycle 100ms scheduling power detection,
*6, BOM list
*7, competition LOGO verification

* 8, demonstrate your project and record it as a video upload