# Patent

## Title
Driver apparatus and method

## Abstract

A driver apparatus is provided for controlling a light source array comprising at least first and second light sources, the light source array used for illuminating a scan region on a target object, wherein light reflected from said target object is captured by a detector. The driver apparatus comprises a single integrated circuit comprising processing means for processing image data received from the detector, a switching array comprising at least first and second switches for switching the respective first and second light sources, and a current source for controlling the flow of current through the light sources. In this way the LED switching circuitry that controls an LED array is 15 placed on the same integrated circuit (i.e. monolithic circuit) as the analogue processing circuitry that processes the image data, with the current source controlling the flow of current through the LEDs in the LED array.

## Background
TECHNICAL FIELD
The present invention relates to a driver apparatus and method for driving light sources, and in particular, but not exclusively, to a RGB (Red, Blue, Green) LED Driver circuit that controls the current through light sources used for illuminating a target object, light from the target object being detected by a sensor, for example a CIS/CCD imaging sensor, as used in imaging apparatus such as optical imagers, i.e. scanners, and the like, and that is integrated on the same monolithic structure as analogue signal processing circuitry, commonly referred to as Analogue Front End (AFE) circuitry.
BACKGROUND
FIG. 1 shows a basic diagram of a state of the art LED driver circuit that is used, for example, in an image reading apparatus in conjunction with a CIS or CCD image sensor device. An LED array L1-L3 is coupled to switches S1-S3 and resistors R1-R3. The LED array L1-L3, switching circuit S1-S3, and resistors R1-R3 are arranged separately from the analogue front end (AFE) circuitry that is used to process image data received from the sensor device, such as a Photo Diode Array (PDA) for example.
In a colour image scanner, the LED array typically comprises Red (L1), Green (L2) and Blue (L3) LEDs. Light of each colour emitted from the respective LED illuminates a portion of a target object that is to be scanned, and the light reflected by the object is incident on a sensor device. Typically, the sensor device comprises an array of sensors arranged linearly as a line image sensor, each element of the sensor array comprising a photoelectric conversion element, such as a photodiode and a capacitor for each pixel, which converts incident light into a current which is accumulated as a charge on the capacitor. The respective charges accumulated on the respective capacitors are converted into respective voltages that are then output from the sensor array (PDA).
The voltages output from the PDA are converted by an Analogue to Digital Converter (ADC) into digital signals for subsequent processing during generation of the image of the target object being scanned.
The scanning of an image is usually performed using a line scanning operation. For colour images, each line is scanned by the Red, Green and Blue light sources. That is, the Red LED L1 is turned on to read one line in a scanning direction, thereby obtaining the Red component of that line. The Green LED L2 is then turned on to obtain the Green component of that line, followed by the Blue LED L3 being turned on to obtain the Blue component of that line. The LED array and sensor array are then typically moved on a carriage mechanism to align with the next line on the target object. Each LED L1-L3 is turned on by switching on the respective switch S1-S3, using respective switch control signals CS1-CS3 received from a switch controller logic circuit SC.
While one line is being scanned, image data received from the sensor array (PDA) relating to a previous line scan is read out serially and processed by the ADC.
The current flowing through each LED is defined by the current-voltage characteristics of the LED, by the resistance of the series resistor and by the voltage applied from the power supply, PSU, (the on-resistance of the switch usually being negligible).
In addition to each LED passing a respective constant current during illumination of the image, it is also known to use Pulse Width Modulation (PWM) control signals for controlling the illumination of each LED, such that the illumination or intensity of the LED can be controlled by controlling the duty-cycle and/or frequency of the PWM control signals. The current though the LED may be subject to wide variation due to tolerances of the power supply voltage and the (temperature-dependent) I-V characteristic of the LEDs.
The LED driver circuitry is separated from the analogue processing circuitry due to the fact that, if the switching circuitry were integrated on the same Integrated Circuit (IC) as the analogue processing circuitry, i.e. AFE, the switching circuitry would interfere with the accuracy of the ADC that is used during an image scanning process.
Such interference is caused by switching transients which occur when switching from one LED to another (e.g. from Red to Green), and/or when pulse width modulating a specific one of the LEDs (e.g. switching on and off a LED using PWM control signals). The transient signals are coupled primarily through the supply or return ground paths, and cause inaccuracies when performing an analogue to digital conversion. For example, when the analogue processing circuitry is processing data obtained from a previous scan line, transient signals generated during a current scan line will adversely affect such processing. The effect of transient current spikes is exacerbated by the inductance of bond wires connecting the integrated circuit substrate to the external (PCB) ground. Similar effects occur in both monolithic integrated circuits and, to a lesser extent, in hybrid integrated circuits.
FIGS. 2a-2d show the switch control signals CS1-CS3 and the supply current IS drawn from the power supply PSU in a “constant current” (i.e. non-PWM) mode. The ground current is substantially equal to the supply current.
FIG. 2d illustrates how the supply current IS drops and rises during a switchover from one LED to another in the circuit of FIG. 1, thereby causing unwanted transient signals that can affect the analogue to digital data processing.
FIGS. 2e-2h show the switch control signals CS1-CS3 and the supply current IS drawn from the power supply in PWM mode.
FIG. 2h illustrates how the supply current (IS) drops and rises during PWM control, and when changing from one LED to another in the circuit of FIG. 1, thereby causing unwanted transient signals that can affect the analogue-to-digital data processing.
It is an aim of the present invention to provide a driver apparatus in the form of an integrated circuit for driving a light source array that does not suffer from the disadvantages mentioned above, namely lack of accuracy in setting the LED currents and/or transients in the ground and supply currents which make it difficult to integrate the switches and the AFE on the same substrate or integrated circuit.
SUMMARY OF THE INVENTION
According to a first aspect of the invention, there is provided a driver apparatus for controlling a light source array comprising at least first and second light sources, the light source array used for illuminating a target object, wherein light reflected from said target object is captured by a detector; wherein the driver apparatus comprises a single integrated circuit comprising processing circuitry for processing image data received from the detector; a switching array comprising first and second switches for switching the respective first and second light sources; and a current source for controlling the flow of current through the light sources.
According to this aspect of the invention, the LED switching circuitry that controls an LED array is placed on the same integrated circuit (i.e. monolithic circuit) as the analogue processing circuitry that processes the image data, with a current source provided for controlling the flow of current through the LEDs in the LED array.
The current source has the advantage of avoiding rapid changes or slope discontinuities in the current flowing through the LEDs, which would otherwise cause unwanted transient signals.
Preferably, the current source may be configured to provide a predetermined current flow through a light source in relation to the switching means switching on or off a light source.
Alternatively, the current source may be programmable to provide a variable current flow through a light source in relation to the switching means switching on or off a light source.
Preferably, the current source is programmable to control the rate of change of current through a light source. For example, the current source may be programmable to control the rate of change of current such that the current is decreased in an S-shape waveform before a first switch is turned off, and increased in an S-shape waveform shortly after a second switch is turned on.
According to a further aspect of the invention, a shunt path comprising a switching device is provided in parallel with the LED array. The shut path has the advantage of enabling the switching sequence from one LED to another to be controlled such that a substantially constant current is drained from the supply (subject to any differences in the inherent current drawn by the Red, Green and Blue LEDs, respectively).
Preferably, the shunt path is controlled to be connected in parallel to the light source array and the switching array prior to the switching array switching from a first light source to a second light source, and wherein the shunt path is disconnected after the switching array has completed switching from the first light source to the second light source.
Preferably, the switching means in the shunt path is controlled using pulse width modulation, for indirectly controlling the intensity of a light source in the light source array.
According to a further aspect of the present invention, a second current source is provided in the shunt path.
Preferably, the switching means in the shunt path forms part of the second current source.
Preferably, the second current source comprises a capacitive element for controlling the flow of current in the shunt path.
According to a further aspect of the invention, a current detector is provided for monitoring the flow of current in the shunt path, the current detector being configured to limit the flow of current through a light source. This further aspect of the invention has the advantage of enabling the current flowing a light source to be controlled by monitoring the current in the shunt path rather than the path having the light source, thus enabling the maximum current to be controlled without potentially damaging the light source.
According to another aspect of the present invention, there is provided a method of controlling a light source array comprising at least first and second light sources, the light source array used for illuminating a scan region on an object, wherein light reflected from said object is captured by a detector. The method comprises the step of providing a processing circuit and a switching array on a single integrated circuit, wherein the processing circuit is adapted to process image data received from the detector, and wherein the switching array comprises at least first and second switches for switching the respective first and second light sources. The method further comprises the step of controlling the flow of current through the light sources using a current source.



BRIEF DESCRIPTION OF THE DRAWINGS
For a better understanding of the invention, and to show more clearly how it may be carried into effect, reference will now be made, by way of example only, to the following drawings in which:
FIG. 1 shows a basic block diagram of a prior art system;
FIGS. 2a-2h show the switch control signals and the current drawn in FIG. 1 when switching between LEDs in both constant current and PWM modes;
FIG. 3 shows a basic block conceptual diagram of the invention according to a first embodiment;
FIG. 4 shows the current drawn in the circuit of FIG. 2 when switching between LEDs;
FIG. 5 shows a basic block conceptual diagram of the invention according to a second embodiment;
FIG. 6 shows a flow diagram relating to the switching sequence of switches S1-S4 of FIG. 5;
FIGS. 7a to 7f are signal diagrams illustrating the switching sequence of switches S1-S4 of FIG. 5;
FIG. 8 shows a basic block conceptual diagram of the invention according to a third embodiment;
FIGS. 9a to 9f are signal diagrams illustrating the switching sequence of switches S1-S4 of FIG. 8, when switching between LEDs in constant current mode;
FIGS. 10a to 10i are signal diagrams illustrating the switching sequence of switches S1-S4 of FIG. 8, when switching between LEDs in PWM mode;
FIG. 11a provides a more detailed illustration of FIG. 8, and in particular of the first current source IS1;
FIG. 11b shows a further optional improvement to FIG. 11a; 
FIG. 12(a) illustrates a simplified example of the current source IS2 used in FIG. 8;
FIG. 12(b) illustrates an embodiment of an implementation of a switched maximum current (Imax) detection circuit;
FIG. 12(c) illustrates how the maximum current detection circuit of FIG. 12(b) can be switched off; and,
FIG. 12(d) illustrates a more detailed example of the current source IS2 described in FIGS. 8 and 12(a).



DESCRIPTION OF THE PREFERRED EMBODIMENTS
In the following description of the preferred embodiments an LED array is described as comprising three LEDs, i.e. Red, Green and Blue. However, it will be appreciated that the invention is equally applicable with an LED array comprising two or more LEDs. In a similar way, although the description of the preferred embodiments refers to the switching circuitry comprising three switching devices, one for each LED, the invention is equally applicable to an arrangement having two or more switching devices, one for each LED device. Aspects of the invention are also applicable to systems with only a single LED, e.g. in PWM mode.
Furthermore, although the invention is described in relation to the switching circuitry driving LEDs, the invention is also applicable with other light sources, not only visible light but non-visible light such as Ultra Violet (UV) and Infra Red (IR). Therefore, references to an LED or LED array in the preferred embodiments are intended to cover a light source or light source array more generally.
FIG. 3 illustrates a basic block conceptual diagram of the invention in its simplest form. An LED array comprises Red, Green and Blue LEDs L1, L2, L3. The invention relates to placing the LED switching circuitry S1, S2, S3 on the same monolithic structure, i.e integrated circuit, as the analogue front end circuitry (AFE), i.e. the analogue processing circuitry that processes the image data received from a sensor device. To reduce the problems associated with LED switching transients interfering with the ADC process, a current source IS1 is provided in the current path, preferably between the switches S1, S2, S3 and ground. The current source IS1 controls the flow of current through the LEDs L1, L2, or L3 according to the states of switches S1, S2, S3.
The provision of the current source IS1 enables the current flow through an LED (L1-L3) to be controlled, rather than being merely switched on and off as found with the prior art. The current through the LED is now defined by current source IS1, independently of the LED I-V characteristics or the supply voltage tolerance, so the LED current is as accurate as the accuracy of the current source. Adjustment of the current may be by direct adjustment of IS1 or by PWM modulation of IS1 and the switch signals.
The introduction of current source IS1 also enables the rate of change of current (di/dt) through an LED to be controlled, for example by reducing the initial rate of change of current. FIG. 4 shows the supply current IS drawn by the circuit during the operation of the embodiment of FIG. 3, when IS1 is decreased in an S-shape fashion before each switch S1, S2, or S3 is turned off, and increased in an S-shape fashion shortly after the next switch is turned on. As can be seen the current waveform IS has smoother S-shaped transitions than the current waveform IS of FIG. 2, thereby reducing unwanted transient signals. The ground return current waveform is similar. Such S-shape waveforms may be generated by known techniques.
Thus, it can be seen that in the first embodiment the LED switches (S1-S3) may be integrated on the same IC as the AFE processing circuitry, with the current source IS1 being provided to reduce the generation of unwanted transient signals.
FIG. 5 shows a basic block diagram of a second embodiment of the present invention.
In a similar manner to FIG. 3, an LED array comprises Red, Green and Blue LEDs L1, L2, L3. The LED switching circuitry S1, S2, S3 is placed on the same monolithic circuit as the analogue front end circuitry (AFE) that drives the switching circuitry. A current source IS1 is provided in the current path between the switches S1, S2, S3 and ground, for controlling the flow of current through the LEDs L1, L2, L3.
According to the second embodiment a shunt path 50 is provided. The shunt path 50 comprises a switching device S4. The shunt path 50 having the switching device S4 is provided in parallel with the LED array and switching circuitry. The problem relating to the LED switching transients interfering with the ADC is reduced because, as will be explained below, the shunt path 50 enables harmful transitions in the ground current flow to be reduced.
The following text describes the operation of the switching device S4 in the shunt path 50 for reducing transient signals when switching from one LED to another.
The shunt path 50 is enabled when switching device S4 is switched on. S4 is switched on in sequence with the operation of the LED switches S1-S3 as will be described in the following.
Referring to the flow chart of FIG. 6, assume S1 is switched on (i.e. S1 is closed), step 61, such that LED L1 is passing a current I1 from the positive supply VDD to ground GND via current source IS1.
During operation of a scanner, for example, once L1 has achieved its task (e.g. used to illuminate the object while the red component of one line of its image is generated), L1 has to be switched off by switching off S1 (i.e. opening S1), and S2 has to be switched on (closed) so that L2 passes its current I2 (thus enabling L2 to illuminate the object while the green component of one line of its image is generated).
According to this second embodiment, prior to switching off S1, switch S4 is switched on, i.e. closed (step 63) such the Node A, on the high side of the current source IS1, is coupled to the supply voltage VDD.
Switching on S4 has the effect of applying zero bias, or at least a much reduced bias, to the LED L1. In other words, S4 has the effect of steering the current away from the L1/S1 current path. The current I4 through S4 is limited by the current source IS1, so the total supply or ground current is still IS1.
Even though the LED L1 is effectively turned off, its associated switch S1 is still however closed, i.e. switched-on.
S1 can now be opened in step 65, i.e. switched-off, thereby removing the LED L1 from the circuit. The total supply or ground current is still IS1
Switch S2 is then closed, step 67, thereby connecting LED L2 to the circuit. Switch S4 remains closed during this switching between L1 and L2.
Once switch S2 has been closed, S4 can then be switched-off in step 69, i.e. opened, thereby allowing LED L2 to become forward biased such that a current I2 passes from the positive supply VDD to ground GND via current source IS1.
This sequence is performed in a similar manner when changing from LED L2 to another LED, for example L3, and so on.
It will therefore be realised that, rather than the power supply current IS having large switching current components being drawn in a disrupted, non-continuous manner from the power supply (i.e. corresponding to the currents I1, I2 & I3 being drawn by the respective LEDs during operation), the power supply current IS remains constant instead.
The circuit arrangement of FIG. 5 therefore performs differential current switching, such that current either flows through an LED (e.g. L1/S1) and the current source IS1, or through the shunt path 50 and the current source IS1.
Thus, it will be appreciated that the circuit of FIG. 5 enables a substantially constant current IS to be drawn from the supply, and the same substantially constant current to flow in the ground return path, which reduces or substantially eliminates the ADC interference problem associated with the switching transients, such that it is now possible that the ADC is capable of being integrated on the same IC as the LED switching array (S1-S3). Integrating the switches on the same IC as the processing circuitry has the effect of minimising the cost associated with such an application.
FIGS. 7a-7d provide a further illustration of the switching sequence of switches S1-S4 of FIG. 5. Prior to time t1 the LED L1 of FIG. 5 is being illuminated. In other words, switch S1 is turned-on (i.e. due to the corresponding switch control signal CS1 being high), while switches S2, S3 and S4 are turned-off (i.e. due to switch control signals CS2, CS3 and CS4 being low). The following operation is then performed in order to illuminate LED L2 in place of LED L1. First, at time t, the switch S4 is turned-on (i.e. by taking the switch control signal CS4 high). This causes the shunt path 50 of FIG. 5 to become operational. Next, at time t2 the LED L1 is removed from the circuit by turning off switch S1 (i.e. by taking the switch control signal CS1 low). It will be appreciated that the current IS drawn from the supply remains constant despite LED L1 being turned off, due to the effect of the shunt path 50 and current source IS1. At time t3 switch S2 is turned-on (i.e. by taking switch control signal CS2 high) such that LED L2 is connected to the circuit. Finally, at time t4 the shunt path is removed by turning off switch S4 (i.e. by taking the switch control signal CS4 low).
A similar procedure is performed when switching from LED L2 to LED L3, or from LED L3 to LED L1.
FIG. 7e illustrates the current IS drawn from the power supply of FIG. 5 when performing the switching operation described above. As can be seen, the current IS remains substantially constant.
In contrast, FIG. 7f illustrates what power supply current IS would be drawn from a power supply (or the corresponding ground return current) when performing a switching operation in a prior art arrangement as shown in FIG. 1, i.e. if the shunt path 50 were absent.
Although not shown in FIGS. 7a to 7f, it will be appreciated that the arrangement of FIG. 5 can also be used in a PWM mode of operation, whereby the respective switches are controlled by altering the duty-cycle and/or frequency of their control signals, for example toggling CS4 during a time when one of S1 to S3 are on.
It should be noted that it is preferable to switch Node A in a controlled manner so that the rate of change of voltage (dv/dt) at Node A is not excessive.
FIG. 8 shows a basic diagram of a third embodiment according to the present invention.
As with FIGS. 3 and 5, an LED array comprises Red, Green and Blue LEDs L1, L2, L3. The LED switching circuitry S1, S2, S3 may form part of the same monolithic circuit as the analogue front end circuitry (AFE) that processes the image data received from the photo sensors. To reduce the problem associated with LED switching transients interfering with the ADC process, a current source IS1 is provided in the current path between the switches S1, S2, S3 and ground, for controlling the flow of current through the LEDs L1, L2, L3. A differential current path 50 (or shunt path) having a switching device S4 is provided in parallel with the array of LEDs and corresponding switches S1-S3.
In addition, according to this embodiment, a second current source IS2 is provided in the shunt path 50. The second current source IS2 enables the switching of the shunt path 50 to be performed in a more controlled manner. As will be described in greater detail below in relation to FIGS. 12a to 12d, there will be capacitance Cp associated with Node A, either parasitic capacitances or possibly an actual additional capacitor.
The second current source IS2 is switched on by switching device S4 in sequence with the LED switches S1-S3 as was described above in connection with FIGS. 5, 6 and 7. The current drawn by the second current source IS2 may be configured to be a predetermined amount greater than the current IS drawn through the LED L1, for example 5% greater. For example, it may be configured so that it can be switched between say 105% of IS1 and 95% of IS1, for example by comprising a 95% current source and a 10% current source in parallel, separately switchable.
FIGS. 9a-9d illustrate the switching sequence of switches S1-S4 of FIG. 8. Referring to FIGS. 9a-d, just before switch S1 is switched off at time t2, current source IS2 is switched on via switch S4 at time t1 and draws a slightly larger current IS from the supply than the current IS previously drawn by LED L1 from current source IS1. The difference in current between IS2 and IS1 serves to charge up the capacitance Cp on node A, until node A has risen to the voltage compliance limit of current source IS2 and the output current of IS2 reduces to equal IS1. In other words, a slightly larger current IS equal to IS2 is drawn for a short time after time t1, as shown in FIG. 9e. The modulation of the ground return current is substantially the same as that of the supply current IS. It is noted that the difference between IS2 and IS1 flows as a displacement current though Cp while node A is changing voltage.
When switching from using one LED, for example L1, to using another LED, for example L2, as before, S1 can now be opened (switched off) at time t2 so as to isolate LED L1, and S2 can be closed at time t3 to connect LED L2. During this switching operation switch S4 remains closed.
Once switch S2 is closed, current source IS2 is reduced, to be less than IS1, and node A will decrease in voltage, at a rate determined by Cp and the difference between IS1 and IS2. Node A will decrease in voltage until LED L2 starts to take the difference current. Switch S4 can then be switched off at time t4, i.e. opened, thereby stopping the current flow through IS2 and fully forward biasing LED L2 such that LED L2 becomes illuminated and draws current from the supply driven by current source IS1.
This sequence is repeated when switching from LED L2 to another LED.
Thus, it can be seen that, rather than the power supply having a large switching current IS being drawn from it as shown in FIG. 9f (i.e. in a disrupted or non-continuous manner corresponding to the respective LED currents I1, I2, I3), the power supply has a much smoother or continuous current IS drawn from it (as shown in FIG. 9e). The ground current will be equal to the constant current source IS1 plus any brief transient currents charging Cp, so in this case the ground current will be IS1 plus or minus 5%, for example. The supply current modulation will be the same. In contrast, FIG. 9f illustrates what current ISPRIOR ART would be drawn in a prior art arrangement as shown in FIG. 1, i.e. if IS2 and S4 were absent. As shown in FIG. 9f, the current ISPRIOR ART drawn from the supply would switch between ISPRIOR ART and zero when switching from one LED to another.
The smaller switching current of the invention minimises the effect of switching transients such that the ADC is capable of being integrated on the same IC as the LED switching array and the IC can be placed on the scanner head. Such an integrated scheme has the effect of minimising the cost associated with such an application.
According to a further embodiment, the switches in the embodiment of FIG. 8 can be controlled using pulse width modulation (PWM) control signals. This could be achieved by toggling CS1 etc, but to reduce supply and ground current ripple, CS4 would need to be toggled in anti-phase. However, it is preferable to apply PWM to the shunt path. In other words, while switch S2 say is closed, switch S4 is controlled using a PWM control signal, thereby indirectly controlling the current I2 passing through LED L2 and therefore the average intensity of LED L2. FIGS. 10a to 10i show a PWM operation where L1 is run at 100% duty cycle, L2 at a small duty cycle and L3 at an intermediate duty cycle.
According to a further embodiment, to allow variation of the LED currents without PWM switching, the current source IS1 (and IS2) can be varied in magnitude, by a common amount for all LEDs or differently for each LED. In other words, the current sources IS1 and IS2 can be fixed (i.e. set to operate in a predetermined mode of operation), or programmable, such that the operation of the current source is variable. Further discussion of this aspect of the invention will be provided after discussing the features of the current source IS1 and the current source IS2 in greater detail.
FIG. 11a illustrates a more detailed example of a current source IS1 that may be used in the embodiments of FIGS. 3, 5 and 8.
Referring to FIG. 11a, a Current Reference Generator (CRG) basically sets the reference current Iref1 for the whole circuit.
A reference voltage Vref supplied to an input of an amplifier in the CRG is preferably a bandgap reference voltage, thus being very accurate and stable.
In this particular example of the CRG, Vref is applied to the input of amplifier A1. Feedback around amplifier A1 and transistor MN0 forces the voltage on node Pin to equal Vref, and thus sets the current through the resistor Rext. This current passes through MN0 to give the output current Iref1, equal to Vref/Rext.
“Pin” may represent an output pin on an IC. This allows a user to set the reference current Iref1 to a desired value by altering the value of an external resistor, Rext. The ability of a user to set Iref1 is preferable, since it relates to the type of LEDs (L1-L3) that are used, with different LEDs having different characteristics. Alternatively Rext may be integrated with A1, possibly trimmable or digitally programmable to allow adjustment.
Current Source IS1 comprises a series of controlled current sources MP2/MP3 that define the currents Iref2 and Iref3 that are mirrored versions of Iref1.
Current source IS1 comprises a variable current source, for example, a Current Digital-to-Analogue Converter (CDAC), which is made up of a series of 2N−1 NMOS transistor and switch arrangements: where N is an integer greater than 1. It should be noted that Iref2 & Iref3 set up the current sinking capabilities of the CDAC as will be described below.
Within the CDAC, each individual switch is controlled so as to allow its associated NMOS transistor to connect to node A, the low-side of switches S1-S4. It should be noted that the CDAC NMOS transistors MLSB, . . . , MMSB have W/L ratios that are binary-weighted such that the each successive transistor, when switched on, is capable of sinking twice as much current as its predecessor. This is denoted by the labels 1, 2, . . . 2N−1 close to each transistor MLSB, . . . , MMSB. Such an arrangement allows the current sunk by the CDAC to be accurately controlled over a wide range of current values.
As mentioned above, in operation the Red, Green and Blue LEDs L1-L3 may require different current values to pass through them. This is in part due to the different characteristics of the LEDs, and also in part due to the required brightness of each LED during a scanning operation. It should be noted that the brighter the LED is made the less the sampling (i.e. integration), and hence scanning, time is required which means that the scanner can operate quicker. Therefore, it is desirable to operate the LEDS at or near their maximum current ratings without damaging the LEDs.
In the circuit of FIG. 11a, the current Iref2 through MN1 is mirrored by MN2 and MLSB, . . . , MMSB. To maintain accuracy despite variation in the voltage of node A, amplifier A2 is introduced. The voltage on the inverting input of the A2 is that of node A and varies during operation. Negative feedback from the non-inverting input of A2 via the voltage inversion and gain introduced by MN1 causes the gate voltage of MN1 to settle out to that voltage necessary to sink the current Iref2 output from MP2. MN2 and MP3 are not essential, but are introduced to maintain feedback in the case where all the CDAC NMOS transistors (MLSB-MMSB) are turned off (i.e. zero output current).
Modern electronic systems, and scanners in particular, now operate at low supply voltages to reduce power consumption, power dissipation, and active and passive component cost. For low voltage applications, such as where VDD=5 v, the current source IS1 is therefore selected and designed such that the maximum possible voltage drop exists across the LEDs L1-L3, while the minimum possible voltage drop exists across the current source IS1.
Assuming the CDAC comprises 8 bits (N=8), there are then 256 discrete levels. (since 28=256) from zero to Imax3 in 255 steps, so each step (ILSB) is Imax3/255, where Imax3 is the maximum output current of the CDAC.
Assume that the maximum desired current through any one of the LEDs is Imax1 (allowing for tolerances in the LEDs). Then, allowing some margin, Imax3<Imax1.
IS2, for correct operation, is configured to be capable of sourcing a current Imax2 that is slightly greater, for reasons which will be apparent from the following description, than Imax3, such that:

Imax2>Imax3

It is preferable to set the W/L ratio of MN1 to be the same as that associated with the LSB NMOS transistor of the CDAC (as indicated by the number “1” just below the gate terminal). Therefore, MN1 sinks a current Iref2 that equals Imax3/255 which equals ILSB. It should be noted that Iref2 can be scaled such that it is larger or smaller than Iref1, and this can be achieved by the sizing of the transistor W/L ratios of transistors MP2 relative to transistor MP1. Also Iref2 can be scaled with respect to Imax3 by sizing MN1 relative to the CDAC NMOS transistors MLSB, . . . , MMSB.
Transistor MN2 is illustrated as having a parasitic Gate-Drain capacitance CGD. Such a capacitance exists in all of the NMOS transistors of the CDAC although they are not illustrated: such a parasitic capacitance is referred to as a Miller capacitance.
It should be noted that it is the combined Gate-Drain capacitance CGDTOT of all these capacitances (for MN2 and those NMOS transistors switched on in the CDAC and possibly input transistors of A2) that provides one mechanism for exacerbating the supply and ground current transients referred to earlier, giving rise to the requirement to render small the slew rates of node A as mentioned above in relation to FIG. 5.
Referring to FIG. 5, the effect CGDTOT has in the arrangement of FIG. 5 is that as the shunt path is enabled, i.e. as S4 switches-on, and connects the supply voltage VDD to the high sides of MN2 and the enabled CDAC NMOS transistors, there is a large dv/dt on node A. This is a.c. coupled through CGDTOT onto the gates of these transistors causing a spike in their currents, and these currents manifest as transients on the supply rails which will have an effect, to a greater or lesser effect depending on the value of CGDTOT, on the ADC.
A second effect, for example when using a current source IS1 as shown in FIG. 11a, is that the transient kick on the gates of MN2 and the other parallel NMOS transistors MLSB, . . . , MMSB disturbs the bias point set by amplifier A2. A2 will have only a finite bandwidth, so may take some time to settle out and re-establish the steady-state bias point. During this time the current output from the CDAC will deviate from the nominal. Hence, there is the need to control the slew rate of the voltage at Node A.
It should be noted that S4 illustrated in FIG. 5 may be, in a very basic version of the invention, implemented as a variable resistor, resistive controlled switch etc., such that it is switched on in a controlled manner so as to avoid these high rates of change of voltage dv/dt on Node A. Similarly for IS2 in the embodiment of FIG. 8.
Due to the requirement of having the maximum possible voltage drop across the LEDs, and the minimum voltage drop across the current source IS1, the circuit of FIG. 11a is susceptible to damage due to the high voltage at Node A of FIG. 5. This is because the high voltage of Node A causes the voltage on the gate of MN2 to rise due to Miller Capacitance effects, thus causing MN2 to turn on.
In view of this possibility, FIG. 11b shows a preferred improvement in which a cascode transistor is connected to the drain of MN2, thereby shielding MN2 from the voltage at Node A in FIG. 5. The cascode transistor is biased by a reference voltage Vbias that may, for example, be supplied by a current source arrangement as shown.
The cascode transistor illustrated in FIG. 11b and associated with MN2 is preferably used as the basis for the respective switches associated with each of the CDAC NMOS transistors (not illustrated). Each “cascode” switch in the CDAC is controlled independently by a control signal that biases its respective cascode switch. The advantage of utilising the cascode switches in the CDAC is that it helps to isolate the CDAC and the ground supply rail from transients.
As mentioned above, in low voltage applications, it is preferable to have the maximum possible voltage drop across each of the LEDs so as to maximise the current through the LEDs, which implies the minimum possible voltage drop across each of the switches S1-S3 and the current source IS1. It is noted that the on-resistance of the switches is substantially negligible hence the voltage drop is low in comparison to that associated with the current source IS1.
In order to minimise the voltage drop across current source IS1, there needs to be a low Drain-Source voltage drop across MN1 and as well as MN2 and the CDAC transistor and switch elements. However, to keep MN2 in its saturation region, thereby providing a good current source, the VDSsat of these transistors must be kept low.
The transconductance (gm) of an NMOS transistor is given approximately by:

gm=2.IDS/VDSsat 

Therefore, gm is inversely proportional to VDSsat and is therefore high for a low VDSsat.
Any mismatch in transistors MN1 & MN2 will result in an effective offset voltage at the gate terminal of MN2. Such an offset will, because of the high gain (gm) of MN2, result in errors. From the above formula, an effective gate voltage offset ΔV will give a fractional error ΔI in output current Iref3 compared to Iref2 where

ΔI/IDS=gm.ΔV/IDS=2.ΔV/VDSsat 

This is especially true when the transistors within the CDAC are switched in as they too have high transconductances like MN2 plus, they are binary-weighted and driven by the effective offset voltages of similar magnitude.
To achieve say 8-bit accuracy for say a 100 mV VDSsat of MN1 requires sub-millivolt offsets. The random manufacturing offset voltage of a MOS transistor may be reduced by increasing its gate area. But since the offset is only inversely proportional to the square root of its gate area: this leads to impractically large devices for MN1 and the CDAC devices. To overcome this, an aspect of the invention includes providing a second, more accurate, current source and calibrating the output of the first current source against this second current source. In this embodiment, IS2 comprises this second current source. IS2 has much more headroom, almost all of VDD, so can include devices with much greater VDSsat and hence much smaller area for the required accuracy.
To provide a more detailed explanation of the current source IS2, reference will now be made to FIGS. 12a to 12d in which:
FIG. 12a illustrates a simplified example of the current source IS2 used in FIG. 8.
FIG. 12b illustrates an embodiment of an implementation of a switched maximum current (Imax) detection circuit.
FIG. 12c illustrates how the maximum current detection circuit can be disabled.
FIG. 12d illustrates a more detailed example of the current source IS2 described in FIGS. 8 and 12a. 
Referring to FIG. 12d: transistors MP5, MN4 and MN5 constitute the current source IS3 in FIG. 12b; transistors MP4, MN3 and MN6 constitute the current source IS5 in FIG. 12b; and transistors MP10, MP11 and MN7 constitute the current source IS4 in FIG. 12b. 
Referring to FIG. 12d, transistor MP4 is driven from a suitable voltage, for example Node X of FIG. 11a, to deliver a current Iref4, another replica of Iref1. This is mirrored by transistors MN3 and MN6 and then mirrored again by transistors MP9 and MP8. Most of MP8's output current is then output via MP6 to provide an output current I4 to deliver the current Imax2 when the LEDs are shunted by current source IS2.
MP7 mirrors the current Imax 2 flowing through transistor MP6. It should be noted that the W/L ratio of MP7 may be, for example, 1/1000 of that of MP6. This means that the maximum current detector circuit diverts only a small fraction of MP8's output current, and only consumes minimal power when performing its current detection function.
MP5 is driven with the same gate voltage as MP4 to give another replica current Iref5, which is then mirrored via MN4 and MN5. MN5 is connected to MP7: the voltage at their common drain node will go high if MP7 carries more current than MN5 and low if MP7 carries less current than MN5. Since I(MP7) is a known fraction (say 1/1000) of I(MP8), this flags whether I(MP8) is less than or greater than some predetermined threshold, this predetermined threshold being determined mainly by the transistor size ratios of mirrors MP6:MP7, MN5:MN4, and the ratio of MP4, MP5 to say MP1 of FIG. 11a. 
The comparator Ca compares the voltage at this common drain node of transistors MP7 and MN5 with a reference voltage Vref. Thus if the maximum current flowing through MP8 exceeds the predetermined threshold then the comparator output signal ILEDmax is set so as to indicate this condition.
In operation, the output of MP6 is connected to the output of IS1 as shown and conducts the current I4. If IS1 is less than 14 (i.e IMP6) then node A will rise, until the source voltage of MP6, i.e. the drain voltage of MP8 has risen enough to take MP8 out of saturation into triode operation, i.e. past the output voltage compliance of MP8 regarded as a current source. MP7 will still output the same fraction of I4 (i.e. IMP6), so the comparator flags whether I(IS1) is less than or greater than the predetermined threshold of I4 (IMP6).
If however IS1 is greater than I4 (IMP6) then node A will fall until node A reaches the voltage compliance of IS1 when delivering I4 defined by MP8. The current through MP7 will then be high, so the comparator C4 will flag this. This “flag” signal ILEDmax can then be used to inhibit the turn-on of switches S1, . . . , S3 to prevent the IS1 current being steered to the LEDs, at least until the digital control to IS1 CDAC has been adjusted to decrease to a desired safe level, thereby protecting the LED.
In this implementation of IS2, its output current I4 is switched on and off by controlling the gate of MP8 using a switch S4*. (Note that S4* open corresponds to S4 being closed in previous diagrams, and vice versa.)
As discussed above, it is desirable to limit the voltage slew rate on node A. This is implemented with the aid of capacitor C and controlled charging currents from MN6 and MP11. Referring to FIG. 12b, it should be noted that the current IIS4 sourced by current source IS4 (MP11) is twice that of the current IIS5 sourced by current source IS5 (MN6) such that: when S4* is open, current source IS5 is sinking a current which pulls the gates of transistors MP8 and MP9, as well as the low-side of capacitor C towards ground. Transistors MP8 and MP9 turn on, at a rate influenced by the capacitor C, and MP8 mirrors a magnified version of the current flowing through transistor MP9. When S4* is closed current source IS4 effectively pulls the gates of transistors MP8 and MP9, as well as the low-side of capacitor C towards the supply VDD and transistors MP8 and MP9 turn off, at a rate influenced by the capacitor C, thereby gradually stopping the current (I4) flowing to current source IS1.
The capacitor C, which is a relatively large capacitor, connected between the common gate terminals of transistors MP8 and MP9 acts to delay the rise in the gate voltages of transistors MP8 and MP9 such that rather than these two transistors turning hard on in a relatively short period, the turn-on time of these transistors is relatively slower. This has the effect of reducing the rate of change of voltage dv/dt at Node A. It will be appreciated that the sizes of transistors employed and the value of the capacitor, together with the LED current values can be altered so as to produce the desired effect, i.e. a reduced dv/dt at Node A, accordingly.
Referring to FIG. 12(c), it is preferable to insert a switching mechanism, as illustrated by switches S5 and S6 into the maximum LED current circuitry (Imax Det.). By inserting these switches, the current that initially flows through the LED is indicative of the current flowing through the LED for the duration that it is conducting current such that the LED current monitoring can be disabled. S5 and S6 are driven by inverse signals such that when S5 is closed, S6 is open and vice-versa.
From the above it can be seen that the arrangement of the preferred current source shown in FIGS. 12b, 12c and 12d allows the current set for each of the LEDs to be measured: if it exceeds a maximum then the LED is not connected, so the LED is protected. This is active whenever the shunt current path is enabled, either when switching between LEDs or in the “off” time between pulses in PWM mode. This has the advantage of enabling the current to be monitored and controlled in the shunt path, rather than in the path actually containing an LED.
It should be noted that the W/L ratio of MP8 may be scaled if desired. For instance W/L for MP8 may be scaled to be 2N*1.2 times (i.e. for an 8 bit=256*1.2 times) that of MP9, to give a nominal IS2 scaled by 1.2 over IS1. Similarly W/L of say MN5 may be scaled to adjust the limit threshold.
In a further embodiment, rather than MP8 being a fixed size, it can be broken into a number, say 256 segments, and controlled digitally to act as a current DAC. Since it has more available headroom, it can be physically small. With MP8 CDAC set to the desired current, IS1 can be iterated until it is within an LSB of l(MP8) (strictly I4 (i.e. IMP6)). In this way the accuracy requirements and hence the physical size of the CDAC in IS1 can be kept within reasonable limits.
It will be appreciated that the embodiments described above offer the choice of PWM or absolute control of the LED current control. To control the brightness of illumination and so the imaging period, two techniques are therefore available, i.e. adjusting the absolute current or varying the on-time of a PWM control.
The current detect circuit for detecting a maximum LED current, enables scan time to be minimised, by maximising LED brightness. This is achieved by running the LED near it maximum current rating. To prevent damage to the LED while flowing in S3 the LED current is checked to be within the maximum current rating of the LED.
It is noted that, in the description of the above mentioned embodiments, it is assumed in FIG. 9e, for example, that LED L2 and LED L3 draw the same current as LED1, i.e. I1=I2=I3. It will be appreciated however that, in practice, the optimum operational current of each LED might be different. Also the operational currents may be required to be adjustable, perhaps to adjust the illumination of the object to match the sensitivity of a particular sensor or reflectance of the object.
It will also be appreciated that the current source IS1 in each of the embodiments can be configured to provide a predetermined current profile, and/or configured such that the current profile is variable (for example depending upon which of the LEDs L1-L3 is being switched). In other words, the current source IS1 can be fixed (i.e. set to operate in a predetermined mode of operation), or programmable, such that the operation of the current source is variable.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims or drawings. The word “comprising” does not exclude the presence of elements or steps other than those listed in a claim, “a” or “an” does not exclude a plurality, and a single element or other unit may fulfil the functions of several units recited in the claims. Any reference signs in the claims shall not be construed so as to limit their scope.

## Claims

1. A driver apparatus for controlling a light source array comprising at least first and second light sources, the light source array used for illuminating a target object, wherein light reflected from said target object is captured by a detector; the driver apparatus comprising a single integrated circuit, the single integrated circuit comprising:
processing circuitry for processing image data received from the detector; a switching array comprising at least first and second switches for switching the respective first and second light sources between on and off states; and a current source disposed between the switches and ground for controlling the flow of current through the light sources.

2. A driver apparatus as claimed in claim 1, wherein the current source is configured to provide a predetermined current flow through a light source in relation to a corresponding switch in the switching array switching on or off a light source.

3. A driver apparatus as claimed in claim 1, wherein the current source is programmable to provide a variable current flow through a light source in relation to a corresponding switch in the switching array switching on or off a light source.

4. A driver apparatus as claimed in claim 1, wherein the current source is programmable to control the rate of change of current through a light source.

5. A driver apparatus as claimed in claim 4, wherein the current source is programmable to control the rate of change of current such that the current is decreased in an S-shape waveform before a first switch is turned off, and increased in an S-shape waveform shortly after a second switch is turned on.

6. A driver apparatus as claimed in claim 1, further comprising a shunt path connected in parallel with the light source array and the switching array, the shunt path comprising a switch for selectively connecting and disconnecting the shunt path.

7. A driver apparatus as claimed claim 6, wherein the shunt path is controlled to be connected in parallel to the light source array and the switching array prior to the switching array switching from a first light source to a second light source, and wherein the shunt path is controlled to be disconnected after the switching array has completed switching from the first light source to the second light source.

8. A driver apparatus as claimed in claim 6, wherein the switching means in the shunt path is controlled using pulse width modulation, for controlling the intensity of a light source.

9. A driver apparatus as claimed in claim 6, further comprising a second current source provided in the shunt path.

10. A driver apparatus as claimed in claim 9, wherein the switching means in the shunt path forms part of the second current source.

11. A driver apparatus as claimed in claim 9, wherein the second current source comprises a capacitive element for controlling the rate of flow of current in the shunt path.

12. A driver apparatus as claimed in claim 9, further comprising a current detector for monitoring the flow of current in the shunt path.

13. A driver apparatus as claimed in claim 12, wherein the current detector is configured to limit the flow of current through a light source.

14. A driver apparatus as claimed in claim 13, wherein the current detector is selectively operable.

15. An electronic device comprising a driver apparatus as claimed in claim 1.

16. An image reading device comprising a driver apparatus as claimed in claim 1.

17. A scanning device comprising a driver apparatus as claimed in claim 1.

18. A method of controlling a light source array comprising at least first and second light sources, the light source array used for illuminating a scan region on a target object, wherein light reflected from said target object is captured by a detector; the method comprising the steps of:
providing a processing circuit and a switching array on a single integrated circuit, wherein the processing circuit is adapted to process image data received from the detector, and wherein the switching array comprises at least first and second switches for switching the respective first and second light sources between on and off states; and
controlling the flow of current through the light sources in accordance with the states of the switches using a current source disposed between the switches and ground.

19. A method as claimed in claim 18, wherein the step of controlling the flow of current using the current source comprises the step of providing a predetermined current flow through a light source in relation to a corresponding switch being operated.

20. A method as claimed in claim 18, wherein the step of controlling the flow of current using the current source comprises the step of providing a variable current flow through a light source in relation to a corresponding switch being operated.

21. A method as claimed in claim 18, wherein the step of controlling the flow of current using the current source comprises the step of controlling the rate of change of current through a light source.

22. A method as claimed in claim 21, wherein the step of controlling the rate of change of current comprises decreasing the current in an S-shape waveform before a first switch is turned off, and increasing the current in an S-shape waveform shortly after a second switch is turned on.

23. A method as claimed in claim 18, further comprising the step of selectively connecting a shunt path in parallel with the light source array and the switching array.

24. A method as claimed claim 23, wherein the shunt path is connected in parallel to the light source array and the switching array prior to the switching array being operated to switch from a first light source to a second light source, and wherein the shunt path is disconnected after the switching array has completed switching from the first light source to the second light source.

25. A method as claimed in claim 23, further comprising the step of controlling the switch in the shunt path using pulse width modulation.

26. A method as claimed in claim 18, further comprising the step of providing a second current source in the shunt path.

27. A method as claimed in claim 26, further comprising the step of controlling a rate of flow of current in the shunt path using a capacitive element of the second current source.

28. A method as claimed in claim 26, further comprising the step of providing a current detector for monitoring the flow of current in the shunt path.

29. A method as claimed in claim 28, further comprising the step of controlling the flow of current through a light source based on the flow of current monitored by the current detector in the shunt path.

30. A method as claimed in claim 28, wherein the current detector is selectively operable.