CHAN, Dennis (Reckitt Benckiser, Room B 11/F, Tower C, Peace Square,Shenghe Road, Nancheng District,Dongguan City, Guangdong 9, 52300, CN)
JIN, Wu (Reckitt Benckiser, Room C 11/F, Tower C, Peace Square,Shenghe Road, Nancheng District,Dongguan City, Guangdong 9, 52300, CN)
THOMAS, David (Paradigm Engineering Design Ltd, Barn 4 Steward Barns,Moretonhampstead,Newton Abbot, Devon TQ13 8SD, GB)
TYSON, Larry (Paradigm Engineering Design Ltd, Barn 4 Steward Barns,Moretonhampstead,Newton Abbot, Devon TQ13 8SD, GB)
WALSH, Steve (20 Knights Way, Camberley, Surrey GU15 1EQ, GB)
BUTLER, Martin (Reckitt Benckiser, Suite 2905-8 29th floor,Shui On Center,6-8 Harbour Road, Wan Chai Hong Kong, CN)
CHAN, Dennis (Reckitt Benckiser, Room B 11/F, Tower C, Peace Square,Shenghe Road, Nancheng District,Dongguan City, Guangdong 9, 52300, CN)
JIN, Wu (Reckitt Benckiser, Room C 11/F, Tower C, Peace Square,Shenghe Road, Nancheng District,Dongguan City, Guangdong 9, 52300, CN)
THOMAS, David (Paradigm Engineering Design Ltd, Barn 4 Steward Barns,Moretonhampstead,Newton Abbot, Devon TQ13 8SD, GB)
TYSON, Larry (Paradigm Engineering Design Ltd, Barn 4 Steward Barns,Moretonhampstead,Newton Abbot, Devon TQ13 8SD, GB)
WALSH, Steve (20 Knights Way, Camberley, Surrey GU15 1EQ, GB)
| Claims 1. A circuit for detecting a change in light intensity, comprising: a voltage source with a positive terminal and a negative terminal; an analogue to digital converter, the analogue to digital converter comprising: a phototransistor operable to receive incident light, said phototransistor having a collector and an emitter, the collector connected to the positive terminal of the voltage source; a capacitor having a first terminal connected to the emitter of the phototransistor, and a second terminal connected to the negative terminal of the voltage source, wherein charging of said capacitor is dependent upon the light incident on said phototransistor; and a microcontroller having a first terminal connected to the first terminal of the capacitor; wherein the microcontroller is operable to monitor light intensity incident on the phototransistor, and to compare changes in said light intensity with a profile pre- stored in said microcontroller. 2. A Gircuit according to claim 1 , wherein the analogue to digital converter is a single slope analogue to digital converter. 3. A circuit according to claim 1 or claim 2, wherein the first terminal of the capacitor is connected directly to the emitter of the phototransistor. 4. A circuit according to any one of claims 1 to 3, wherein capacitor charging time is inversely proportional to the analogue incident light falling on the phototransistor. 5. A circuit according to claim 4, wherein the microcontroller includes a clock used to increment a counter within the microcontroller, the microcontroller being operable to determine the time taken for the capacitor to charge from a first voltage to a second voltage. 6. A circuit according to claim 5, wherein the first input terminal of microcontroller is operable to reset the capacitor to the first voltage after the second voltage is reached. 7. A circuit according to claim 6, further comprising: a means for outputting a signal indicating that the capacitor has charged to the second voltage, wherein the microcontroller includes a second input terminal operable to receive the signal, and, based on the signal, is operable to: stop incrementing the counter and determine the time taken for the capacitor to charge from the first voltage to the second voltage, and reset the capacitor to the first voltage via the first input terminal, and restart incrementing the counter. 8. A circuit according to claim 7, wherein the means comprises a voltage reference and a comparator, the voltage reference and the comparator comprising: a first transistor having a base terminal and an emitter terminal, the base terminal connected to the first terminal of the capacitor, and the emitter terminal connected to the negative terminal of the voltage source; a first resistor having a first terminal connected to a collector terminal of the first transistor, and second terminal connected to the positive terminal of the voltage source; and an output terminal connected between the collector terminal of the first transistor and the second input terminal of the microcontroller, the output terminal outputting the signal. 9. A circuit according to claim 6, wherein the first input terminal of the microcontroller is further operable to detect when the capacitor has charged to the second voltage, and subsequently operable to: stop incrementing the counter and determine the time taken for the capacitor to charge from the first voltage to the second voltage, and reset the capacitor to the first voltage via the first input terminal, and restart incrementing the counter. 10. A circuit according to any preceding claim, further comprising a light emitter drive current circuit operable to provide said light to the phototransistor. 11. A circuit according to claim 10, wherein the light emitter drive current circuit comprises: a second voltage source having a positive terminal and a negative terminal; a second transistor having a base, a collector and an emitter, wherein the base is connected to a positive terminal of the second voltage source via a first diode and a second diode connected in series, and the emitter is connected to the positive terminal of the voltage source via a second resistor; a light emitting diode having a first terminal connected to the collector of the second transistor and a second terminal connected to the negative terminal of the voltage source; and a third resistor connected between the positive terminal of the second voltage source and the first terminal of the light emitting diode. 12, A circuit according to claim 11, wherein the combination of the first and second diodes, the second transistor, and the second resistor act as a constant current source, and the third resistor acts as a variable current source. 13. A circuit according to claim 1 , wherein the first voltage source and the second voltage source are provided by the same battery. 14. A circuit for detecting a change in light intensity, comprising: means to detect incident light and to output a light intensity profile thereof; and means for comparing said light intensity profile with a pre-stored light intensity profile. 15. A circuit according to claim 14, wherein the pre-stored intensity profile includes a set of pre-stored threshold parameters, and the means of comparing compares parametric values of said light intensity profile with the set of pre-stored thresholds parameters. 16. A spray system, comprising: a housing adapted to receive a refill of fluid therein and having an aperture suitable for permitting, in use, the spraying of the fluid from the refill therethrough; and a detection circuit for determining whether a received refill is genuine, wherein the detection circuit is operable to measure a variable light intensity signal reflected from the refill, and to compare the measured reflected variable light intensity signal with a pre-stored profile to determine whether the refill is genuine. 17. A spray system according to claim 16, wherein the detection circuit is a circuit according to any one of claims 1 to 15. 18. A spray system according to claim 16 or claim 17, wherein the refill includes a spray bead having a first position and a second position, wherein in moving the spray- head from the first position to the second position fluid is caused to exit the refill via the spray head, and wherein the detection circuit is operable to determine whether the refill is genuine when the spray head is caused to move from the first position to the second position. 19. A spray system according to any one of claims 16 to 18, wherein the detection circuit Is configured to determine whether the refill is genuine when the refill is activated. 20. A spray system according to any of claims 6 to 19, wherein the detection circuit is operable to detect ambient light levels within the housing. 21. A spray system according to claim 20, wherein if the detected ambient light level is above a threshold level, the function of the detection circuit is temporarily disabled. 22. A spray system according to claim 16 or claim 17, wherein if a non-genuine refill is detected the activation of the refill is inhibited. 23. A circuit substantially as described herein with reference to the accompanying drawings. 24. A spray system substantially as described herein with reference to the accompanying drawings. |
Field of the Invention
The present invention relates to circuit for detecting a change in fight intensity, and a spray system including a detection circuit for determining whether a refill is genuine.
Background
Conventional spray devices for spraying fragrances, deodorising agents and sanitising fluids into a room generally consist of a device containing a removable source of fluid. The removable source of fluid, or refill, once depleted may be replaced instead of replacing the entire device. Techniques are know for determining whether a refill, once inserted into the device, is a genuine refill that is suitable for the particular spray device. One technique for detecting whether a refill is genuine essentially includes providing a white plastic nozzle of a genuine refill marked with one or more black stripes. These stripes are detected by an opto-electronic sensor located in the spray device. During the operating stroke of the nozzle of the refill, the stripes traverse a detection field of the opto-electronic sensor. A variable output is obtained from the opto- electronic sensor corresponding to the white and black areas of the nozzle. Subsequent signal processing performed by a microcontroller enables detection of a genuine or valid refill or detection of a non-genuine refill.
A convenient and commonly used opto-electronic sensor consists of an infra-red emitting LED mounted parallel to a phototransistor in a single package. Devices of this kind are primarily intended to detect the presence or absence of a reflective object. If a reflective object is present within the detection range of the device the infra-red radiation emitted by the LED is reflected back towards the phototransistor element of the device. A corresponding signal becomes available from the phototransistor such that the presence of a reflective object may be detected. Such a device is referred to as an opto-reflective sensor. However, such opto-reflective sensors have limitations. A first limitation of such opto-reflective sensors is that neither the beam of infra-red light emitted by the LED, nor the detection field of the phototransistor, is well focussed so that discrimination of smalf regions of reflectivity within a given target is poor. Moreover, as the distance between the opto-reflective sensor and the target nozzle increases, there is a corresponding reduction in the ability of the sensor to make a useful discrimination between black and white regions of the nozzle.
It might be assumed that when the sensor is aligned with a white (reflective) region of the nozzle the phototransistor would conduct. Conversely, it may be assumed that when the sensor is aligned with a black (non-reflective) region of the nozzle, the phototransistor would not conduct (giving a zero reading). In practice however, because of the opto-reflective sensor focus limitations, when the opto-reflective sensor is entirely aligned with a white region of the nozzle good conduction of the phototransistor is obtained, but when the opto-reflective sensor is entirely aligned with a black striped region of the nozzle, conduction of the phototransistor is reduced but not to a zero level. The reason for this is that the black striped region of the nozzle is comparatively small, so that in reality the opto-reflective sensor is responsive to both the black region and to an area of the white region surrounding the black region. This undesirable effect becomes worse as the distance between the opto-reflective sensor and the target nozzle is increased, so that greater areas of the surrounding white region are included in the detection field of the opto-reflective sensor. Because of mechanical limitations inherent in many products* substantial unwanted lateral movement of the nozzle occurs during actuation, which results in a considerable degradation of the signal obtained from the opto-reflective sensor. A second limitation of opto-reflective sensors is that device to device variation exists with respect to phototransistor gain. For a given set of optical conditions existing between the opto-reflective sensor and the target nozzle, variations in phototransistor gain will result in different levels of phototransistor conduction. A third limitation of oplo-reflective sensors i that the phototransistor is nul uiily sensitive to infra-red radiation emitted from the LED, but it is also sensitive to ambient light generally. The typical plastic housing of the product cannot be made entirely opaque, and because physical apertures cannot be eliminated from the product design, the resultant ingress of ambient light will have an unwanted effect on opto-reflective sensor operation. This will further degrade the system performance, particularly under high ambient light conditions. umrW of the Invention
According to a first aspect of the present invention, there is provided a circuit for detecting a change in light intensify. The circuit comprising: a voltage source with a positive terminal and a negative terminal: an analogue to digital converter, the analogue to digital converter comprising: a phototransistor operable to receive incident light, the phototransistor having a collector and an emitter, the collector connected to the positive terminal of the voltage source; a capacitor having a first terminal connected to the emitter of the phototransistor, and a second terminal connected to the negative terminal of the voltage source, wherein charging of the capacitor is dependent upon the light incident on the phototransistor; and a microcontroller having a first terminal connected to the first terminal of the capacitor. The microcontroller is operable to monitor light intensity incident on the phototransistor, and to compare changes in the light intensity with a profile pre-stored in the microcontroller. As a result of the above circuit, a digitized version of the light incident upon the phototransistor Is obtained, which can then be easily compared with a pre-stored profile within the microcontroller.
In a preferred embodiment the analogue to digital converter is a single slope analogue to digital converter. Additionally the capacitor charging time is inversely proportional to the analogue incident light falling on the phototransistor. With this circuit a low cost analogue to digital converter is provided having a low component count. In a preferred embodiment the first terminal of the capacitor is connected directly to the emitter of the phototransistor. Since the charging current to the capacitor is substantially independent of the voltage across the collector and emitter of the phototransistor, rising capacitor Voltage does not result in a reduction of capacitor charging current, or the behavior of the phototransistor.
In the above circuit, the microcontroller preferably includes a clock used to increment a counter within the microcontroller. The microcontroller is operable to determine the time take for the capacitor to charge from a first voltage to a second voltage. The first input terminal of microcontroller is preferably operable to reset the capacitor to the first voltage after the second voltage is reached.
Preferably the circuit further comprises: a means for outputting a signal indicating that the capacitor has charged to the second voltage, wherein the microcontroller includes a second input terminal operable to receive the signal, and, based on the signal, is operaWe to: stop incrementing the counter and determine the time taken for the capacitor to charge from the first voltage to the second voltage, and reset the capacitor to the first voltage via the first input terminal, and restart incrementing the counter.
Preferably the means comprises a voltage reference and a comparator, the voltage reference and the comparator comprising: a first transistor having a base terminal and an emitter terminal, the base terminal connected to the first terminal of the capacitor, and the emitter terminal connected to the negative terminal of the voltage source; a first resistor having a first terminal connected to a collector terminal of the first transistor, and second terminal connected to the positive terminal of the voltage source; and an output terminal connected between the collector terminal of the first transistor and the second input terminal of the microcontroller, the output terminal outputting the signal.
With this circuit the following features are obtained: 1.) capacitor charging time inversely proportional to the analogue incident light; 2) means for setting the capacitor to the first voltage; 3) means for detecting when the capacitor has charged to the second voltage; and 4) an accurate timi g means for measuring the time taken for the capacitor to charge from the first voltage to the second voltage. Accordingly, using a simple low cost circuit construction, an analogue to digital converter system is realised that results in a direct digitisation of the light levels incident upon the phototransistor.
In a preferred embodiment the first input terminal of the microcontroller is further operable to detect when the capacitor has charged to the second voltage, and subsequently operable to: stop incrementing the counter and determine the time taken for the capacitor to charge from the first voltage to the second voltage, and reset the capacitor to the first voltage via the first input terminal, and restart incrementing the counter. In this arrangement the microcontroller is able to determine when the capacitor has reached the second voltage without the use of the separate comparator. This reduces the required number of circuit components, and thus reduces cost.
Preferably the circuit further comprises a light emitter drive current circuit operable to provide the light to the phototransistor. The light emitter drive current circuit comprises: a second voltage source having a positive terminal and a negative terminal; a second transistor having a base, a collector and an emitter, wherein the base is connected to a positive terminal of the second voltage source via a first diode and a second diode connected in series, and the emitter is connected to the positive terminal of the voltage source via a second resistor; a light emitting diode having a first terminal connected to the collector of the second transistor and a second terminal connected to the negative terminal of the voltage source; and a third resistor connected between the positive terminal of the second voltage source and the first terminal of the light emitting diode.
In the light emitter circuit, preferably the combination of the first and second diodes, the second transistor, and the second resistor act as a constant current source, and the third resistor acts as a variable current source. Preferably the light emitter is provided with current from both the constant current source and the variable current source. Accordingly, as the voltage of the voltage source varies the light output of the light emitter is able to vary also. This ensures that the overall gain of the circuit remains constant over a range of supply voltages, and so avoids false measurements of the reflected light. Preferably t e first voltage source and the second voltage source are provided by the same battery. This provides for a compact, portable arrangement in which the battery may be easily replaced by a user once depleted. According to a second aspect of the present invention, there is provided a circuit for detecting a change in light intensity, comprising: means to detect incident light and to output a light intensity profile thereof; and means for comparing the light intensity profile with a pre-stored light intensity profile. Preferably the pre-stored intensity profile includes a set of pre-stored threshold parameters, and the means of comparing compares parametric values of the tiyhl inlens,Uy piufile wilt) lite sel of pre-stored thresholds parameters.
According to a third aspect of the present invention, there is provided a spray system, comprising: a housing adapted to receive a refill of fluid therein and having an aperture suitable for permitting, in use, the spraying of the fluid from the refill therethrough; and a detection circuit for determining whether a received refill is genuine. The detection circuit is operable measure a variable light intensity signal reflected from the refill, and to compare the measured reflected variable light intensity signal with a pre-stored profile to determine whether the refill is genuine. With this system it is possible for a refill to be interrogated and a decision made as to whether the refill is genuine.
Preferably the detection circuit is a circuit according to the first or second above described aspects. Preferably the refill includes a spray head having a first position and a second position, wherein in moving the spray head from the first position to the second position fluid is caused to exit the refill via the spray head. The detection circuit is operable to determine whether the refill is genuine when the spray head is caused to move from the first position to the second position. The detection circuit is configured to determine whether the refill is genuine when the refill is activated.
In a preferred embodiment the detection circuit is operable to detect ambient light levels within the housing. If the detected ambient light level is above a threshold level, the function of the detection circuit is temporarily disabled. Preferably if a non- genuine refill is detected the activation of the refill is inhibited. With this arrangement, the possibility of falsely detecting a genuine refill as a non-genuine refill when high ambient light levels within the housing are present, is prevented.
Preferred embodiments of the invention wilt now be described, by way of example only, with reference to the accompanying drawings.
Brief Description of the Drawings
Figure 1 is a side elevation of a spray device with a refill loaded therein.
Figure 2 is a circuit diagram of a light detection circuit in accordance with a first embodiment.
Figure 3 is a circuit diagram of a light detection circuit in accordance with a second embodiment.
Figure 4 is a circuit diagram of a light emitter circuit in accordance with the second embodiment.
Figure 5 is an alternative circuit diagram of the light emitter circuit.
Detailed Description of the Preferred Embodiments
Figure 1 shows a side elevation of a spray device. The spray device includes a housing 10 which is operable to enclose a container 20, containing a fluid. Once the fluid within the container 20 is depleted through use, the container 20 may be removed from the housing 10, and a replacement (full) container located in its place. Such a container 20 is typically ί&πτ)θύ a refill, and will be referred to as such herein.
The housing 10 includes a removable portion (not shown) allowing the refill 20 to be unloaded, and a new refill to be loaded into the housing. In this example the refill 20 Is an aerosol spray canister and includes a spray head 40. However, the refill is not limited to such an aerosol spray canister, and any suitable refill may be used, for example a "pump spray" refill. An actuation means 50 is provided above the refill 20 and includes an arm 56 that is movable to apply a substantially downward pressure on the spray head 40 and cause actuation of the refill 20. During actuation of the refill 20, fluid held within the refill 20 is forced through the spray head 40 and exits the spray head 40 via nozzle 42.
The spray head 40 includes a pattern 45, which when the refill 20 is loaded within the housing is located opposite to a detection circuit 30. The pattern 45 may include one or more black bands. Preferably at least two black bands are provided. However, any means of providing a variation in reflectance (as the spray head 40 is moved up and down) may be used. For example, the spray head 40 maybe include one or more indentations or cut-outs.
The detection circuit 30 includes a light emitter circuit 60 and a light detection circuit 70. The light emitter circuit 60 is configured to emit light towards the pattern 45. The light emitter circuit 60 and the light detection circuit are positioned such that the light reflecting from the pattern 45 Is directed towards the light detection circuit 70. Preferably, the detection circuit 30 detects the reflected light from the pattern 45, either on the down stroke, the up stroke or both, of the spray head 40. Accordingly, the detection circuit 30 only operates during activation of the refill. This will ensure that the power consumption of the circuit 30 is not too high. In a preferred embodiment, the light detection circuit 70 includes an analogue to digital converter. The analogue to digital converter converts the analogue light reflected from the pattern 45 into a digital pattern signal (or light intensity profile), so that a relatively high resolution digitised image of the reflected light from the pattern 45 is obtained. In a preferred embodiment the analogue to digital converter used in the light detection circuit 70 is a "single slope analogue to digital converter". This particular type of converter is advantageous in that it is low cost, and requires low power. It is therefore particularly suited for battery operated situations, typically used in spray devices. However, the present invention is not limited to this particular type of analogue to digital converter, any other suitable digital to analogue converter may be used. Furthermore, the present invention is not limited to battery operation.
In a single slope analogue to digital converter a current is used to charge a capacitor of a known value from a first voltage to a second voltage. Usually the first voltage is zero volts, and the second voltage, also called a threshold voltage, is generally of the order of a few hundred mV. The current used to charge the capacitor corresponds in magnitude to the analogue signal to be converted. A counter (timing device) is used to measure the time taken for the capacitor to charge from the first voltage to the second voltage. Based on this time interval, the capacitor charging current and hence the input light signal is reduced to a digital value. If a suitable time interval is chosen to increment the counter, the counter value at the end of conversion will be a direct digital representation of the analogue input signal.
The digital pattern signal obtained from the analogue to digital converter is processed and compared to a pre-stored profile of a genuine refill. Such a processing and comparison operation may include comparing parametric values of the measured digital pattern signal (light intensity profile) with a set of pre-stored thresholds of those parameters. Such parameters may include, but are not limited to, signal peak to peak value, signal average value, the ratio of signal peak to peak to signal average value, the rate of change of signal value, and the number of zero crossings made by the signal. The pre-stored light intensity profilo (or pre-stored thresholds values of parametric values) may be established by a comprehensive test programme, or may be set/determined by the manufacturer. The light intensity profile may also be considered to be any of a light intensity waveform, a light intensity pattern, a light amplitude waveform or pattern, and a digital pattern. Any form of light intensity profile or pattern may be used, as long as it enables a comparison between a pre-stored light intensity profile and the measured light Intensity profile (digital pattern signal ).
If the measured digital pattern signal matches the pre-stored profile then the refill is judged to be genuine. However, if the digital pattern signal does not match the pre- stored profile, then the refill Is Judged to be non-genuine. In the event that a non- genuine refill is detected, operation of the spray device may be inhibited until the consumer installs a genuine refill.
In certain situations, excessive ambient light levels within the housing 10 may adversely affect the operation of the detection circuit 30. In order to address this, the light detection circuit 70 may be used to measure the ambient light level within the housing 10. This measurement may be made before spray head 40 actuation, and again when the spray head 40 is held at the bottom of the stroke. This will accommodate for differing amounts of light ingress that occur at different spray head positions. If the detected ambient light levels within the housing exceed a given threshold, then the function of the light detection circuit 70 (i.e. discrimination of the refill), may be temporarily disabled so that a genuine refill is not incorrectly determined as a non-genuine refill. The light emitter (contained in the light emitter circuit 60) is turned off during this measurement process so that the tight detection circuit 70 Is responsive only to the ambient light.
Specific embodiments of the light detection circuit 70, 70a, and the light emitter circuit 60, will now be described with reference the accompanying drawings.
First embodiment of .light detection circuit.
Figure 2 shows a circuit diagram of the light detection circuit 70 in accordance with a first embodiment The light detection circuit 70 includes a voltage/power source 100 having a positive terminal and a negative terminal, which is typically a battery (but is not so limited), a phototransistor 110, a capacitor 120, a bipolar transistor 130, a first resistor 140 and a microcontroller 150. A collector terminal of the phototransistor 110 is connected to the positive terminal of the voltage source 100, arid an emitter terminal of the phototransistor 0 is connected to a first terminal of the capacitor 120. A second terminal of the capacitor 20 is connected to the negative terminal of the voltage source 100. A collector terminal of the transistor 130 is connected to the positive terminal of the voltage source 100 via the first resistor 140, an emitter terminal of the transistor 130 is connected to the negative terminal of the voltage source 100, and a base terminal of the transistor 130 is connected to the first terminal of the capacitor 120. The collector terminal of the transistor 130 is also connected to a first port pin PIN1 of the microcontroller 1SQ, and the first terminal of the capacitor is also connected to a second port pin PIN2 of the microcontroller 50. The phototransistor 110, the capacitor 120, the bipolar transistor 130, the first resistor 140 and the microcontroller 150, act as a single slope analogue to digital converter.
The phototransistor 110. in conjunction with the voltage source 100, act as a current source providing a current proportional to the incident light falling on the phototransistor. The current is independent of the voltage existing between the collector and emitter terminals of the phototransistor 110. The current charges the capacitor 120, such that the rate of charging is directly proportional to the incident light falling on the phototransistor 110. In other words the charging time of the capacitor 120 is inversely proportional to the analogue incident light falling on the phototransistor 110.
As is shown in figure 2, the first terminal of the capacitor 120 is connected directly to the emitter of the phototransistor 110. Since the charging current to the capacitor 120 it* substantially Independent of the voltage across the collector and emitter of the phototransistor 110, rising capacitor voltage does not result in a reduction of capacitor charging current, or the behavior of the phototransistor 110.
The first resistor 140 and the transistor 130 act as a voltage reference and a comparator. A base current of the transistor 130 will flow when the capacitor 120 has charged to a threshold voltage (for example 600mV), and as soon as the transistor base current begins to flow a much larger collector current is established. By selection of an appropriate value of collector resistance (the resistor 140) a comparator function is realised. The comparator detects when the capacitor 120 has reached the threshold voltage, and outputs a signal indicating this to the first port pin PIN1 of the microcontroller 150.
The analogue to digital conversion process will now be described. Before any conversion is made, it is necessary for the capacitor 120 to be reset to the first voltage. This is achieved by the microcontroller 150 which has its second port pin PIN2 connected to the first terminal of the capacitor 120. The second port pin PIN2 is set low so as to discharge and reset the capacitor 120 to the first voltage. The microcontroller 150 includes a dock and this is used to increment a counter within the microcontroller†50. Once the capacitor 120 has been reset to the first voltage, the counter is started (start time), and the capacitor 120 is charged at a rate proportional to the incident light failing on the phototransistor 110. The microcontroller 150 continues to count whilst the capacitor 20 charges from the first voltage to the second voltage. Once the second voitage is reached the counter is stopped (stop time). Based on the difference between the start time and stop time of the counter, the microcontroller 150 is able to determine the time taken for the capacitor 120 to charge from the first voltage to the second voltage. Furthermore, once the second voltage is reached, the capacitor 120 is reset to the first voltage, and the counter is started again. Accordingly, the process is repeated. A suitable time interval is chosen to increment the counter such that the counter value at the end of the conversion will be a direct digital representation of the input analogue signal.
As discussed above, the combined voltage reference and comparator determine when the capacitor 120 has reached the second voltage (i.e. the threshold voltage discussed above), and output a signal to the first port pin PIN1 of the microcontroller 150 The first port PIN1 of the microcontroller 150 is configured as an input having a high impedance. When a signal is received at the first port PIN1 from the comparator, the microcontroller 50 knows that the capacitor 120 has reached the second voitage, and uses this as an indication that: the counter should be stopped; a comparison should be made between the counter start time and the counter stop time; the capacitor should be reset to the first voltage; and the counter should be restarted.
In the course of discharging of the capacitor 120. the light signal to the phototransistor 110 does not have to be terminated, as the charging/discharging current to the capacitor 120 is independent of the voltage across the phototransistor 110. The charging of capacitor 120 can start whenever appropriate, as soon as the discharging process is completed. Since the light signal to the phototransistor 110 does not need to be terminated while discharging the capacitor 120, any additional control of a light emitter, or the light incident onto the phototransistor 110, can be avoided.
The selection of the value of the capacitor 120, and/or the rate at which the counter within the microcontroller 150 is incremented, determines the conversion time (i.e. the time tor the capacitor 1 0 to charge from the first voltage to the second voltage). One complete conversion results in a sample of the light falling on the phototransistor 110. Given that the time for spray head 40 to travel the down stroke may be of the order of 100 ms, and the time for the upstroke may be of the order of 400 ms, conversion times in the range of 4 to 8 ms would allow for a number of samples to be measured of the light reflected from the pattern 45. The resulting plurality of samples will provide a high resolution digital pattern signal (light intensity profile) representation of the light reflected from the pattern 45.
Additionally, in order to keep the counter/timer inside microcontroller 150 within an 8- bit range (to suit a low cost microcontroller) conversion times of 4 to 8 ms are appropriate. In the described circuit a black target (i.e. the black band on the spray head 40) would return a conversion count value of around 255, whereas a reflective target (i.e. white spray head 40) would return a conversion count value in the 40-50 range.
The gain of the analogue to digital converter may be varied, so as to accommodate for different gains of the phototransistor 110, by varying the system reference voltage (voltage source 00), varying the light emitter brightness, or varying the conversion time. Such variations may be controlled by the microcontroller 150. However, the variations may be controlled in any other suitable manner. For example, another microcontroller may be provided.
It can be seen that light detection circuit 70 of this embodiment provides the following features:
1) capacitor charging time inversely proportional to the analogue incident light;
2) a means for setting the capacitor to the first voltage;
3) a means for detecting when the capacitor has charged to the second voltage; and
4) an accurate timing means for measuring the time taken for the capacitor to charge from the first voltage to the second voltage.
By use of a simple low cost circuit construction, an analogue to digital converter system may be realised that results in a direct digitisation of the light level incident upon the phototransistor 110. If the value of the capacitor 120 is chosen to be a relatively high value, the circuit 70 will have a high degree of immunity to electrical noise. Furthermore, because the current flowing through the phototransistor 110 is substantially independent of the voltage existing between its collector and emitter terminals, rising capacitor voltage (a voltage which subtracts from the phototransistor collector to emitter voltage) will not result in a reduction of capacitor charging current. Accordingly, the capacitor 120 will charge linearly at a rate dependent upon incident illumination, but independent of supply voltage. This circuit characteristic is ideally suited to battery operated devices. Second e bedment of light detection circuit-
Figure 3 shows a second embodiment of the light detection circuit 70a. The light detection circuit 70a differs from the light detection circuit 70 of the first embodiment by the omission of the resistor 140 and the bipolar transistor 130, and also in that only one microcontroller port pin is used.
In this embodiment the first terminal of the capacitor 220 is directly connected to the port pin PIN2a of the microcontroller 250. The port pin PIN2a of microcontroller 250 has a selectable configuration. For example, the port pin PlN2a may be configured as an output and as an input. Preferably, port pin PIN2a In one configuration has a Schmitt trigger characteristic.
Again the first terminal of the capacitor 220 is connected directly to the emitter of the phototransistor 220. Since the charging current to the capacitor 220 is substantially independent of the voltage across the collector and emitter of the phototransistor 210, rising capacitor voltage does not result in a reduction of capacitor charging current, or the behavior of the phototransistor 210.
To reset the capacitor 220 to the first voltage, the port pin Pi 2a is set to an output configuration having a low impedance so as to discharge the capacitor 220. To start the conversion, the port pin PIN2a is changed to an input configuration having a high impedance, and the capacitor begins to charge at a rate determined by the light level falling upon the phototransistor 210 (similarly as described in the first embodiment of the light detection circuit 70) As the capacitor charges, the voltage across the capacitor 220 will increase. Port pin PIN2a when configured as an input is operable to measure the voltage across the capacitor 220, and when the measured voltage reaches a certain threshold voltage (the second voltage), the end of conversion is indicated. The microcontroller 250 Is therefore able to determine the end of conversion, and, similarly as discussed in relation to the first embodiment, appropriate calculations within the microcontroller 250 permit the calculation of the time required for the capacitor 220 to charge from the first voltage to the second voltage, and also the resetting of the capacitor 220 to the first voltage. Accordingly, the function of microcontroller 250 of this embodiment is the same as the microcontroller 150 of the first embodiment, except that the microcontroller 250 of this embodiment includes a single port pin PIN2a that is able to both reset the capacitor 220 to the first voltage and also act as a comparator to determine when the capacitor 220 has reached the second voltage.
An advantage with this embodiment is that the component count of the circuit is reduced, leading to simpler circuit construction, thus lowering cost. However, a disadvantage with this embodiment is that the microcontroller 250 port pin PiN2a threshold voltage may be a function of the microcontroller 250 supply voltage (i.e. it may vary with supply voltage). As such, the analogue to digital converter performance (gain) will vary as an inverse function of battery voltage. This is particularly troublesome in a battery-operated system having no voltage regulation.
In order to solve this problem, a light emitter circuit 60 (a light emitter drive current circuit) may be used that modulates the drive current of the light emitter as a function of battery voltage. In such system, as the analogue to digital converter gain is reduced by the increased port pin PIN2a threshold voltage of the microcontroller 250 (caused by a high battery vdtage), the light emitter drive current is increased, thus increasing the phototransistor 210 current in order to maintain a given system gain. Accordingly, an increase in light emitter drive current is obtained as battery voltage is increased. Figure 4 shows a preferred embodiment of the light emitter circuit 60. The light emitter circuit 60 includes a voltage source 300 having a positive and negative termindl, a bipolar PNP transistor 370, a first diode 380, a second diode 385, a first resistor 390, a light emitter 360, and a second resistor 395. Preferably the light emitter 360 is an LEO (as is shown In figure 4), and more preferably an infra-red LED. However, any suitable light source may be used, for example a laser or an incandescent lamp. The bipolar PNP transistor 370 has a base terminal held at a constant reference voltage, derived from the forward voltage drop of the first diode 380 and second diode 385 connected in series between the base terminal and the positrve terminal ot the voltage source 300. An emitter terminal of the bipolar transistor 370 is connected to a positive terminal of a voltage supply 300 via the first resistor 390. A first terminal of the light emitter 360 is connected to a collector terminal of the transistor 370, and a second terminal of the light emitter 360 is connected to the negative terminal of the voltage source 300. The first terminal of the light source 360 is also connected to a first terminal of the second resistor 395 which has its second terminal connected to the positive terminal of the voltage source 300. The base terminal of the transistor 370 is connected to a terminal of a microcontroller 450. The fight emitter circuit operates as follows. A constant voltage is imposed across the transistor 370 emitter resistance (the first resistor 390), and so the transistor 370 emitter current is held constant irrespective of other circuit conditions. As the transistor 370 may be chosen to have a high gain, the transistor 370 base current may be made sufficiently small that its contribution to total emitter current may be neglected. Consequentially, the transistor 370 emitter and collector currents are essentially identical and constant. The light emitter 360 located in the transistor 370 collector circuit, acts as a load, and the load current is held constant irrespective of the supply voltage, provided that the supply voltage remains sufficiently high. Accordingly, the transistor 370, the first diode 380, the second diodes 385, and first resistor 390 act as a constant current source 400, for supplying current to the light emitter 360. The current from the emitter flows to the base and to the terminal of the microcontroller 450.
In order to counteract the variations in the supply voltage, the light emitter 360 is additionally provided with current from a variable current source 410 comprising the second resistor 395. The tight emitter 360 is therefore provided with current from both the constant current source 400 and the variable current source 410. The resulting light emitter 360 current is the sum of the first fixed current part and the second variable current part. By appropriate adjustment of the fixed and variable currents, the brightness of the tight emitter bay be controlled. Accordingly, the supply voltage modulation of the analogue to digital converter gain may be entirely compensated for by the corresponding variation in the light emitter drive current (i.e. the change in brightness of the light emitter 360). The overall system gain is thus held constant over a range of supply voltages. This embodiment is particularly suited to battery operation, as the system will remain operational over a wide range of battery voltages. Advantageously, the operation of the second embodiment of the iight detection circuit 70a, in cooperation with the light emitter circuit 60, provides for a very low component count, low cost circuit having almost ideal characteristics. These characteristics enable an accurate digitisation of the light failing on the phototransistor 210 to be made, whilst compensating for changes is a battery voltage supply. Even though the light emitter circuit 60 has been described in cooperation with the second embodiment of the light detection circuit 70a, it may be used with the light detection circuit 70 of the first embodiment. Although separate voltage sources have been discussed in relation to the light emitter circuit 60 and the light detection circuit, the voltage source 100/200 of the light detection circuit 70/70a and the voltage source 300 of the light emitter circuit 60 may be provided by the same battery. This allows for simple construction of the spray housing and allows the voltage sources (battery) to be easily changed by a user once depleted.
Although a separate microcontroller 450 is provided for the light emitter 60, it may instead share the same microcontroller 150 or 250 of the light detection circuit 70 or light detection circuit 70a.
In the embodiments discussed above, a gross-difference identification approach is used for the analogue to digital conversion. Specifically, the voltage arising from capacitor 220 charging (in the order of V) is used directly for digital conversion (or code judging). This is accurate and reliable as long as the input port of the microcontroller 250 is of a Schmitt trigger type structure (see Figure 3). In the case of a non-Schmitt trigger type input port microcontroller 150 is used, oniy a single bipolar transistor 130 is needed to convert the capacitor 120 signal to an appropriate digital level (see Figure 2). Since the charging process is relatively long (a few milliseconds per charging process), an effective low pass filtering effect is built-into the process. As such no further software filtering is required thereafter.
It should be understood that although the above light detection circuits have been discussed, the present invention is not limited to these particular circuit topologies in any way. Any other circuit topology may be used so long as it provides for a relatively high quality digital pattern signal representing the light reflected from the pattern 45 located on the spray head 40. The same is equally true for the light emitter circuit 60. For example, figure 5 shows an alternative topology of a light emitter circuit using modulated current control.
Although the present invention has been described in terms of preferred embodiments, it will be appreciable that various modifications and alterations might be made by those skilled in the art without departing from the scope of the invention. The invention should therefore be measured in terms of the claims which follow.
