# Best way to control AL8871Q dimming without microcontroller?

Am new to electronics and am planning to use the Diodes AL8871Q to drive a Cree XHP50/70 at 6V 4.8A.

Planing to have the driver as small as possible.

Looking at the data sheet, I can control the current with a pwm or dc. I would like to use a button to toggle between 2 current levels and wondering what is the simplest way without having to add alot more components to the foot print.

• use a push button toggle switch to switch between two current setting resistors. I suspect this might be the least of your problems - laying out a pcb for this device presents some challenges for newbies. – Kartman Feb 21 at 6:56

Apart from switching current-sense resistors for adjusting the output level as suggested by Kartman and Jasen, another good option is to use the CTRL pin since its intended use is brightness adjustment.

As stated in the datasheet, setting this pin's voltage between 0.125V and 1.25V will give a brightness level of 10% to 100%.

The REF pin outputs a regulated 1.25V reference voltage, and this voltage along with divider resistors can be used: simulate this circuit – Schematic created using CircuitLab

With the circuit above, the brightness level will be 50% when the SW1 switch is open. When it's closed, the brightness will be the full level.

Brightness level based on the resistor values can be calculated as follows:

$$\mathrm{ D_{percent} = \frac{R2}{R1+R2} \cdot 100 }$$

For example, selecting $$\\mathrm{R1 = 3\cdot R2}\$$ will give 25% of full brightness when the SW1 is open. R1 can be set to zero with SW1 for full brightness.

NOTE: Since the max output current of the REF pin is 1mA, the divider resistors should be in kiloOhms range.

• My intention of ‘current setting’ was as shown above rather than switch the actual sense resistor. Nevertheless, both methods achieve the same end. – Kartman Feb 21 at 13:36
• Thanks. Works great. Ended up biting the bullet and learnt how to use an Attiny85 – intosite Apr 15 at 3:13

as Kartman suggests switching the curren t sense resistor for a higher resistance will dim the LEDS

maybe install two resistors in parallel but have the switch in series with one of them. so you get onew resistor for dim or two in parallel for full brightness.

That is use bedlamp switch type of button that toggles between on and off. simulate this circuit – Schematic created using CircuitLab 