It's time to fire up the soldering iron and assemble some electronics.
Front Lights module is supposed to be mounted in front of the board and provide light, so that others can see me after dark (and I can see what's in front of me as well, cool).
My idea for this module is to create closed-loop current control system using buck coverter and MCU.
The MCU would measure the current flowing through the LEDs and adjust PWM duty cycle to achieve required current. I hoped that maybe I'd be able to implement model predictive control (MPC) (using DMC - Dynamic Matrix Control). Of course predictive algorithm would be an overkill in this application, but would be a pretty nice educational excercise.
So far I've assembled the circuit and tested it in open loop mode (no current measurement, just setting pre-programmed PWM duty cycle).
Code is available on GitHub: https://github.com/Lukaszm94/Eboard_FrontLights
Currently open-loop brightness control is implemented, as well as blinking modes. Now I need to modify Control Unit software, so that front lights brightness and blinking mode can be changed via mobile app.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.