I wanted to practice my embedded control skills, so I made a simple constant-current LED driver. I assembled the hardware based on SDG Electronics’ design and wrote a C code for current control. This code senses current through LED and keeps it at an average value of 350mA by modifying the duty cycle of a switching power MOSFET. I intended another analog input for dimming potentiometer, however it has not yet been implemented. I heavily relied on the material provided by Prof. Mark M. Budnik in his “Microcontrollers and C Programming Language (MSP430)” course. I have an Arduino on the board as well because I wanted to setup an SPI communication between the launchpad and arduino. I am postponing it for later, however.
Great course to learn Embedded C: https://www.udemy.com/course/mcu_msp430/
SDG Electronics tutorial on constant-current drivers: https://www.youtube.com/watch?v=JOqSCbm9G0c&t=606s