Introduction

Author: Lloyd D. Clark, Ph.D., Microchip Technology Inc.

It is sometimes preferable to drive an electronic component, for example, a light-emitting diode (LED), with constant current and not constant voltage. A microcontroller (MCU) containing the Analog Signal Conditioning (OPAMP) peripheral can be used to implement a constant-current driver using just one external resistor. The OPAMP peripheral also provides the ability to adjust the current setting under firmware control.