Skip to content
If this is your first visit, please click here to learn about shipping and delivery.
If this is your first visit, please touch here to learn about shipping and delivery.
Small SMD LED packs with 0603, 0805 and 1206 options

Dim a 1206 LED Smoothly: PWM Current, Low-Brightness Steps and Measurement

A small LED can be uncomfortably bright in a dark enclosure even when it looks ordinary on the workbench. Pulse-width modulation, or PWM, lets a controller adjust an indicator's average output without changing its resistor every time the lighting conditions change. Making that adjustment feel smooth requires more than counting from zero to maximum.

The PMD Way packs of small SMD LEDs include a 1206 option, listed as 3.2 × 1.6 mm. Select the intended package and colour before designing the footprint. Package size does not determine forward voltage, permitted current or optical brightness.

Set a safe on-current first

PWM repeatedly switches the LED between on and off. During the on portion, the LED still needs current limiting. Use an appropriately calculated series resistor or a suitable constant-current driver, and check the LED's current rating and the driver's limits.

Do not choose an excessive on-current because the average duty cycle will be small. Pulse-current ratings, where provided, have conditions involving pulse width, repetition, temperature and duty cycle. Without those conditions for the actual component, keep the on-current within a suitable continuous-current limit.

For an illustrative resistor-driven circuit, a 3.3 V source, 2 V LED drop and negligible driver drop would require about 650 Ω for 2 mA. An available nearby value may be suitable after checking supply tolerance, minimum forward voltage and the output's actual high or low voltage. The example is a calculation method, not a universal resistor value for a 1206 LED.

Separate duty cycle from frequency

Duty cycle is the fraction of a PWM period during which the LED conducts. Frequency is how often the period repeats. For ideal rectangular current pulses of 4 mA, a 25% duty cycle gives approximately 1 mA average current. The LED still experiences 4 mA while on.

Texas Instruments' application report on PWM dimming distinguishes true on/off current modulation from drivers that convert a PWM command into an analogue current setting. Check how your chosen driver behaves: a PWM input does not always mean that the LED current itself has the same rectangular waveform.

At a hypothetical 1 kHz PWM frequency, the period is 1 ms. A 10% on-time is 100 µs. Increasing frequency makes each pulse shorter at the same duty cycle, which can expose switching delays that were unimportant at lower frequencies.

Choose a supported output and understand its polarity

Arduino's official PWM output guide lists supported pins and discusses resolution. The available pins, timer behaviour and configuration depend on the board and its software core. Do not assume every pin supports PWM or that every Arduino uses the same frequency.

If the GPIO sources current into an LED connected towards ground, a high output normally corresponds to light on. If a compatible arrangement sinks current from an LED towards the pin, a low output corresponds to light on. An external driver may introduce another inversion. Verify this with a slow test before implementing a brightness slider.

Check the exact GPIO current limits, combined limits and voltage compatibility. For multiple indicators or higher current, use an appropriate driver instead of assuming the microcontroller can supply the entire load directly.

Expect the darkest settings to be the hardest

An ideal timer with 256 equal time slots has a duty-cycle step of about 0.39%. That can be a large visible change near darkness, even though it seems small near full output. The first non-zero setting may already be brighter than the desired night-time level.

At 1 kHz, one of those 256 time slots lasts approximately 3.9 µs. A driver that cannot establish the intended current within such a pulse will not produce the ideal average output. Increasing the numerical resolution in software does not create additional hardware timing precision.

Possible improvements include a lower hardware on-current, a timer with suitable additional resolution, or a dedicated driver with documented low-level dimming performance. Assess frequency and resolution together. Simply increasing one can reduce what is available from the other on a particular timer.

Use a brightness curve deliberately

Equal changes in duty cycle do not necessarily look like equal changes in brightness. Analog Devices' gamma-correction application note explains using a lookup table to shape the relationship between a requested level and the PWM output.

For a simple experiment, let a user setting x range from zero to one and calculate duty cycle as x squared. Half of the control range then produces 25% duty rather than 50%. This is an illustrative curve, not a calibrated model of every observer, LED or viewing environment.

Try a few candidate curves in the final enclosure. Check whether low levels are useful, whether adjacent settings are distinguishable and whether the maximum remains appropriate. Keep a true off setting separate if rounding or the timer's endpoint behaviour leaves a faint glow.

Measure the waveform that the LED receives

For a low-voltage bench circuit, measure voltage across the series resistor to infer current, using probe connections appropriate to the instrument and circuit grounding. Do not attach an earth-referenced oscilloscope ground clip to an arbitrary point. A current waveform is more informative than a meter reading that only shows an average.

Check the on-current, period, pulse width and transitions at full output, a mid-level and the smallest useful non-zero level. Confirm that software activity elsewhere does not disturb the PWM. Libraries using the same timer or peripheral can change behaviour unexpectedly.

Inspect appearance while moving your eyes or the object naturally, and test the actual camera if the indicator will be filmed. Camera bands can depend on exposure and shutter behaviour; one clean recording does not establish universal flicker performance.

Record an electrical and visual acceptance test

Save the resistor value, measured on-current, PWM pin, timer settings, brightness table and library versions with the project. Repeat the low-level test after changing board type or software core.

When comparing parts from the 1206 SMD LED collection, evaluate them at the same controlled current and viewing conditions. A well-designed dimmer combines a safe electrical pulse with enough low-end control to make the indicator useful in its real environment.

Previous article Battery Power for Arduino Projects: Voltage Range, Runtime and Regulator Heat