How many ways can you ramp an LED?

Article By : Bill Schweber

The "thought question" of how to slowly cycle an LED's intensity up and down leads to some interesting design ideas.

I was looking at the Brother ink-jet printer which I have had for a few years, and noticed that it has an unobtrusive green LED right above its soft on/off switch (Figure 1). This LED has an interesting duty cycle: it is off for about three seconds, then ramps up to full intensity over about one second, decays back to fully off also in about one second, and then goes dark as the cycle begins again (Figure 2). It repeats this cycling as long as the printer is nominally on and ready, whether it’s printing or in quiescent mode.

How many ways can you ramp an LED?

Figure 1 The barely visible green LED (at point of arrow) on this Brother printer goes on and off slowly to indicate the unit is ready even while in standby state. Source: Brother International Corp.

How many ways can you ramp an LED?

Figure 2 The ramp up/down timing cycle of the green LED is smooth and slow, with a five-second overall cycle. Source: Bill Schweber

As far as I can tell, the role of this LED is to indicate “I’m standing by and ready to print.” I suspect that the slow-rate ramping of the up/down glow is used instead hard on/off blinking, so it doesn’t scream to grab your attention; it’s just a “reassurance” type of signal.

The slow up/down ramping action of this indicator LED action made me wonder about a basic analog-circuitry question: how is the LED controlled by the printer? Since I have no access to the schematic or code, I could only speculate on the possible ways it is done. Keep in mind that this is a non-critical performance situation, as the intensity of the LED and its timing can probably vary by 10% or even 20% and that would still be OK.

Within a few minutes, I came up with several possibilities:

  1. The simplest way to drive the LED is from a voltage source through a current-limiting resistor (Figure 3). It’s not elegant, it’s not power-efficient, but it is cheap and works. A software-controlled voltage-output digital-to-analog converter (DAC) could source the needed voltage, and a small chunk of code could slew the DAC output for ramp cycle and timing. The modest inefficiency would not be an issue here given the small size of the resistor and LED and the fact that this is a line-powered unit.

How many ways can you ramp an LED?

Figure 3 Driving the LED from a controlled voltage source via a current limiting resistor is inelegant but works. Source: Bill Schweber

  1. A more technically “proper” way would be to use a DAC-controlled current source to drive the LED, again with some code to manage the DAC (Figure 4).

How many ways can you ramp an LED?

Figure 4 A true current source is a better approach for driving the LED. Source: Bill Schweber

  1. Another way might be to use a digital output (GPIO) bit from the system processor to pulse some charge into a small capacitor via a diode to ramp up the LED, and then have the capacitor discharge to supply current to the LED through a resistor. Figure 5 is an oversimplified circuit, and it may work better if the GPIO bit controls a transistor which turns the current flow from the system rail on and off. By sizing the resistor and capacitor time constants for the desired ramp up/down rates along with proper timing of the GPIO pulse duration and repetition rate, the desired LED action could be achieved.

How many ways can you ramp an LED?

Figure 5 This simplified schematic shows that it’s also possible to use the charging and discharging of a capacitor to ramp the LED drive up and down. Source: Bill Schweber

  1. Finally, the GPIO port implementing processor-controlled pulse-width modulation (PWM) could drive the LED via a current-limiting resistor (Figure 6). With control over both pulse width and spacing, visual integration by the user’s eye would create the desired perceived intensity.

How many ways can you ramp an LED?

Figure 6 A GPIO port providing PWM gives control over both pulse width and spacing, while the user’s eye visually integrates the sequence to create a continuous change in intensity. Source: Bill Schweber

Does the printer use one of these schemes? Again, I don’t and can’t know. But after further thinking about the issue, I realized that posing this question of “how would you do this?” is a reasonable thing to ask a prospective entry-level new hire for an analog-ish design role. It’s really a “thought” question more than a definitive one.

Even better, a follow-up question could be “what are the pros and cons of each approach?” In this way, even a prospect with only a little circuit experience could at least articulate a grasp of the basic design issues and associated tradeoffs; after all, that’s what much of real-world engineering design is really about.

What options do you see for a slow-ramping LED circuit? Are there similar questions you have used when interviewing someone for a junior-level design position related to basic circuitry?

 

This article was originally published on Planet Analog.

Bill Schweber is an electronics engineer who has written three textbooks on electronic communications systems, as well as hundreds of technical articles, opinion columns, and product features. In past roles, he worked as a technical website manager for multiple EE Times sites and as both Executive Editor and Analog Editor at EDN. At Analog Devices, he was in marketing communications; as a result, he has been on both sides of the technical PR function, presenting company products, stories, and messages to the media and also as the recipient of these. Prior to the marcom role at Analog, Bill was Associate Editor of its respected technical journal, and also worked in its product marketing and applications engineering groups. Before those roles, he was at Instron Corp., doing hands-on analog- and power-circuit design and systems integration for materials-testing machine controls. He has a BSEE from Columbia University and an MSEE from the University of Massachusetts, is a Registered Professional Engineer, and holds an Advanced Class amateur radio license. He has also planned, written, and presented online courses on a variety of engineering topics, including MOSFET basics, ADC selection, and driving LEDs.

 

Leave a comment