A sophisticated power electronics project combining digital control, embedded firmware, and precision PCB design
This project demonstrates the complete design and implementation of a 15W Constant Current / Constant Voltage (CCCV) Flyback Converter with full digital control via STM32L011 microcontroller. The system demonstrates expertise in power electronics, embedded systems, firmware development, and industrial automation.
Development of a production-grade power supply capable of:
- Wide Input Range: 230V AC compatibility (multi-national)
- Dual Output Modes: Automatic CCβCV switching for LED applications
- Digital Control: MCU-based regulation with Β±2% accuracy
- User Interface: Computer software for real-time output configuration and monitoring
- Industrial Features: Relay feedback contact, 4-stage dimming, external control, comprehensive protection
- Reliability: Production-ready firmware with error handling and EMC compliance
A complete power supply system consisting of:
- STM32L011 MCU: ARM Cortex-M0+ with integrated ADC and PWM capabilities
- Flyback Topology: Galvanically isolated 230V AC to variable DC output
- Digital Regulation: PWM-based feedback via digital isolator
- Communication: Serial UART interface for computer control
- Precise Measurement: ADC measurements for voltage and current
- KiCad PCB Design: 6 iterative versions from prototype to production (V1-V6)
- Comprehensive Testing: EMC compliance (CISPR 32 Class A), efficiency measurements, thermal characterization
- MCU: STM32L011 (ARM Cortex-M0+, 32KB Flash, 8KB RAM)
- Power Topology: Galvanically isolated Flyback Converter
- Input Stage: 230V AC rectification with EMI filter
- Output Control: PWM switching (MOSFET) with frequencies from 22-120kHz
- Measurement: 12-bit ADC (base resolution)
- Communication: UART interface
- Feedback Elements: Digital isolator, relay output for status indication
| Layer | Technology | Purpose |
|---|---|---|
| Application | C (STM32CubeIDE) | Digital control algorithm (PI/Cascade), state machine, command processing |
| Driver | LL-Driver (Low-Level) | Direct register access for GPIO, ADC, PWM, UART, DMA |
| Control Algorithm | PI / Cascaded Control Loop | Maintains stable CC/CV setpoints |
| Memory | EEPROM | Persistent configuration storage |
| Monitoring | MCU Tracer | Real-time debugging and performance metrics logging |
| Communication Protocol | Serial UART | Command interface for PC software integration |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PC Control Software (Serial Interface) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Configuration β Real-Time Monitoring β Logging β β
β β β’ Output V/I β β’ Voltage/Current β β’ Data Export β β
β β β’ Dimming β β’ Temperature β β’ Waveforms β β
β β β’ Limits β β’ Power Efficiency β β’ Events β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β UART
ββββββββββββββ΄βββββββββββββ
β β
βββββΌβββββββββββ ββββββββΌβββββββββ
β STM32L011 β β Power Stage β
β MCU β β & Sensing β
β β β β
β β’ ADC Sampl. β β β’ PWM Driver β
β β’ PI Control β β β’ MOSFET Gate β
β β’ PWM Gen. β β β’ Voltage FB β
β β’ UART Comm. β β β’ Current FB β
β β’ Protection β β β’ Temp Sense β
βββββ¬βββββββββββ΄βββββββ¬ββββββββββββββββ
β β
βββββΌββββββββββββββ¬ββββΌββββββββββ
β β β
βββββΌββ ββββββββββ βββΌββββ ββββββββΌβββ
βRelayβ βDimming β βGate β βFeedback β
βOut β βInput β βDrv β βDigital β
βββββββ ββββββββββ βββββββ β Isolatorβ
230V AC Input β Rectification β Flyback Transformer
β Secondary Output β Measurement β MCU Feedback β PWM Adjustment
The evolution from initial concept to market-ready product, demonstrating continuous refinement through 6 design iterations.
Challenge: Maintain voltage/current stability across the entire load range.
- Solution: Cascaded/PI control loop with 16kHz (62.5Β΅s) cycle time.
- Innovation: Software-based regulation enables dynamic adjustments and protection functions.
Challenge: Seamless CC/CV operation for diverse loads (LEDs, laboratory applications).
Constant Current Mode (CC):
- Fixed current output (programmable 0A - 1.2A)
- Automatic voltage limiting
- Ideal for LED strings
Constant Voltage Mode (CV):
- Fixed voltage output (programmable 10V - 60V)
- Current limiting for protection
- Standard laboratory power supply functionality
Technical Implementation:
- Software regulation automatically selects the most restrictive controller (voltage or current).
- Seamless transition without overshoot.
Challenge: Integration of analog control, digital MCU, high-voltage power stage, and protection circuits.
Solution: Integrated multi-layer PCB design with:
- Isolated Feedback: PWM transmission via digital isolator for safe control.
- Measurement Acquisition: Voltage and current measurement via shunt and differential amplifier.
- Relay Feedback: Status output for relay contact.
- Dimming Input: 4-stage external dimming.
Challenge: Creation of reliable, maintainable firmware for embedded power control.
Solution: Structured C codebase with:
- State Machine: Manages boot, regulation, fault detection, and shutdown.
- Safety Features: Overvoltage (OVP) and overcurrent protection (OCP), brownout detection, and watchdog.
- Monitoring System: "MCU Tracer" logs performance metrics for debugging and validation.
Six Production Iterations:
| Version | Focus | Status |
|---|---|---|
| V1-P | IC voltage supply prototype | β Learning phase |
| V1 | First Flyback LED converter | β Validated |
| V2-P | Enhanced design iteration | β Refined |
| V3-P | Further optimization | β Tested |
| V4-Release | Production candidate | β Manufacturing ready |
| V5 | Final Production | β Active |
| V6 | Next-generation planning | β In Production |
Design Improvements:
- Thermal management optimization (V1βV5)
- PCB layout for EMC compliance
- Component placement for manufacturing efficiency
- High-voltage isolation routing
| Category | Details |
|---|---|
| Input Voltage | 230V AC, RMS |
| Output Power | 15W |
| Output Modes | Constant Current (0A - 1.2A) / Constant Voltage (10V - 60V) |
| Accuracy | Β±2% (design target) |
| Isolation | Galvanic isolation via Flyback transformer |
| Communication | Serial UART |
| MCU | STM32L011 |
| ADC Resolution | 12-bit base, 14-bit with oversampling |
| PWM Frequency | 22kHz - 120kHz (depending on load) |
| Protection Features | OVP, OCP, OTP, UVP, short-circuit protection, no-load protection |
| Relay Output | Status contact |
| Dimming Control | 4-stage via external contacts |
| Efficiency | > 80% (typical) |
| Development Time | Bachelor thesis |
| Team Size | Dr. Michael Heidinger and Ans1S |
Real-Time Digital Control
- Control cycle at 16kHz (62.5Β΅s cycle time)
- DMA-based data transfer from ADC
- PWM resolution optimized via Farey sequence
- Multi-mode operation with automatic CC/CV transition
Precision Measurement & Feedback
- Current measurement via shunt resistor and differential amplifier
- Voltage measurement via voltage divider and differential amplifier
- ADC calibration and offset correction in firmware
- Thermal management
Embedded Communication Protocol
- ASCII-based UART commands
- Real-time telemetry streaming (voltage, current)
- Error reporting
Power Electronics Design
- Storage transformer dimensioning
- MOSFET selection and snubber design
- EMC compliance (CISPR 32) via EMI filtering
- Longevity through elimination of electrolytic capacitors
Why This Matters: The system demonstrates understanding of complete power supply designβfrom AC mains to regulated DC outputβcombining digital control with analog power electronics.
SPICE Simulation (LTspice):
- Flyback converter operation modeling
- Transient response analysis (load steps)
- Efficiency calculations
Power Flow Analysis (Plecs):
- System-level power distribution modeling
- Harmonic analysis for EMC prediction
- Thermal loss estimation
Results:
- β Output current ripple below 133mApp
- β Transient settling within design specification
- β EMC compliance validated
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 15W Flyback Converter Performance Data β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Constant Current Accuracy β Β±1.8% @ 1.2A setpoint β
β Constant Voltage Accuracy β Β±2.1% @ 48V setpoint β
β Load Transient Response β 45ms (design target) β
β Output Voltage Ripple β 85mV peak @ 1.2A CC β
β Output Current Ripple β < 133mA peak-to-peak @ 24Vβ
β Full-Load Efficiency β 82.5% @ 15W (target) β
β Thermal Steady-State (25Β°C) β +22.9Β°C (MOSFET @ 47.7Β°C) β
β Protection Response Time β < 2ms (software) β
β UART Command Latency β < 10ms (design target) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- β CISPR 32 Class A (conducted emissions)
- β EN 55015 Radiated Emissions (below limits)
- β EN 61000-4-2 ESD Immunity (Β±8kV contact)
- β EN 61000-4-4 Burst Immunity (2kV)
- β EN 61000-6-2 Industrial Immunity
- KiCad - PCB design and schematic capture (all 6 iterations)
- STM32CubeIDE - Embedded firmware development
- LTspice - Power electronics simulation
- Plecs - Energy system modeling
- STM32CubeMX - MCU peripheral configuration
- J-Link - SWD debugger for firmware upload & debugging
This project demonstrates comprehensive competencies in:
| Competency | Implementation |
|---|---|
| Power Electronics Design | Flyback topology, transformer dimensioning, MOSFET selection, thermal analysis |
| Digital Control Systems | PI/cascaded control loops, ADC sampling, PWM modulation |
| Embedded Firmware | STM32 LL drivers, interrupt handling, UART communication, DMA |
| PCB Design & Manufacturing | KiCad schematic & layout, layer stackup, EMC-compliant routing, 6+ design iterations |
| Testing & Validation | EMC compliance (CISPR 32), efficiency measurement, thermal characterization |
| System Integration | Combination of analog power, digital control, and communication |
| Problem Solving | Iterative refinement, simulation-driven design, experimental validation |
- Complete System Design: Not just firmware or just hardwareβfull integration from AC mains to regulated DC output.
- Production-Grade Quality: 6+ design iterations demonstrate mature engineering approach.
- Real-World Complexity: Mastery of galvanically isolated power conversion with digital feedback.
- Comprehensive Validation: Simulation, measurement, and EMC testing all documented.
- Scalability: Architecture supports future enhancements.
- Documentation: Mathematical models, technical datasheets, and detailed measurements included.
- Problem: Flyback converters tend to exhibit ripple and load-dependent variations.
- Solution: Tight digital PI control loop and careful hardware design (snubber).
- Learning: Digital control can effectively compensate for analog non-idealities.
- Problem: AC mains and isolated secondary side require careful routing.
- Solution: Proper creepage/clearance, separate ground planes, EMI filtering.
- Learning: EMC compliance must be designed in from the start.
- Problem: Watchdog timeouts or firmware crashes could damage the load.
- Solution: Redundant protection mechanisms (hardware OCP/OVP + software OVP/UVP), safe-state defaults.
- Learning: Mission-critical embedded systems require defensive programming.
- Problem: Limited PCB area with high power dissipation.
- Solution: Thermal measurements, optimal placement of power components (MOSFET, diode).
- Learning: Thermal design is integral to electrical design (hottest spot 47.7Β°C).
This project was developed in collaboration with:
- Dr. Michael Heidinger - Digital Power Systems (Project supervision and technical guidance)
- Prof. Dr. rer. nat. Uli Lemmer - Lichttechnisches Institut (LTI), Karlsruhe Institute of Technology (KIT) (Academic supervision and institutional support)
- Product Datasheet:
Datasheet/DIG-CCCV-15W_datasheet.pdf- Official technical specifications and operating guidelines




