Projects / Ideas / Black Pill 16-bit PWM LED dimmer

Black Pill 16-bit PWM LED dimmer

IntermediateLightingIdeaReviewed
In short

How do you build a black Pill 16-bit PWM LED dimmer?

A Black Pill sets an LED brightness from a knob with a timer set to a 16-bit period for very fine steps at low light. The LED has a series resistor on a 3.3 V pin. You need STM32 Black Pill (STM32F411CEU6), ST-Link V2 programmer (clone), LED 5 mm red, Resistor 330 Ω, Potentiometer 10 kΩ and Breadboard 830 Tie Points.

Level
Intermediate
Time
About 150 min
Parts
6
An idea, not a guided build yet. Goal, parts and steps; no wiring, code or tests. Copy it to My Garage to plan it.
Goal

See why a longer timer period gives smoother dimming.

How to build it

  1. Set the timer period to 65535
  2. Read the knob with the ADC
  3. Map the reading to the compare value with a gamma curve
  4. Drive the LED through the resistor
  5. Compare 8-bit and 16-bit steps at low light

Related projects

Common questions

What parts do I need for the black Pill 16-bit PWM LED dimmer?

STM32 Black Pill (STM32F411CEU6), ST-Link V2 programmer (clone), LED 5 mm red, Resistor 330 Ω, Potentiometer 10 kΩ and Breadboard 830 Tie Points.

How long does the black Pill 16-bit PWM LED dimmer take to build?

About 150 minutes for a intermediate maker.