[summary of the invention]
Technical problem to be solved by this invention is to provide the electrical characteristic of a kind of LED of utilization, excavating its specific function uses, solve people's user satisfaction, satisfy present client's the convenient serious hope of using, and fashion is good-looking, cost is low, control simple light-emitting diode (LED) sensing and controlling system.
Have a lot of special character during diode reverse biased.PN junction is under reverse-bias state, and its reverse current rises with the increase of intensity of illumination, and photodiode namely utilizes this characteristic to develop.
LED is a kind of diode, namely has the characteristic of diode.The structure of light-emitting diode and PN junction diode-like seemingly but at its PN junction place, can send specific light by a glass window on shell.To send light when passing to electric current, this is to emit the result of energy due to electronics and hole direct combination.Especially, since it can emit beam, it just can receive outside illumination certainly, therefore, can utilize this characteristic of LED that it is used as photodiode.
The present invention solves the problems of the technologies described above by the following technical programs: a kind of light-emitting diode (LED) sensing and controlling system, comprise light-emitting diode (LED) module, microcontroller, and controlled device, wherein light-emitting diode (LED) module and controlled device are by microprocessor controls work, light-emitting diode (LED) module is as the state of optical indicator indication controlled device, described light-emitting diode (LED) module is simultaneously as touch sensor, when touching light-emitting diode (LED) module, after microcontroller detects, carry out corresponding control logic judgement, and then control controlled device.
This invention can further be specially:
Wherein LED module comprises a light-emitting diode, the perhaps combination of a plurality of light-emitting diodes.
Described controlled device is energy supply control module, and described LED module comprises a common light-emitting diode.
Perhaps described controlled device is volume control module, and described LED module comprises a plurality of common light-emitting diodes, plural LED composition placed side by side LED progress bar.
Perhaps described controlled device is the time schedule control module, and described LED module comprises a plurality of common light-emitting diodes, plural LED composition placed side by side LED progress bar.
Perhaps described controlled device is the power adjustments device, and LED module comprises a plurality of common LED, and these a plurality of common LED form the power bar.
Under static state, MCU controls by the level of I/O pin, make LED be in reverse bias, LED can use as drag under back bias mode and substitute: the current source that electric current of a diodes in parallel is directly proportional to illumination, wherein diode is used the circuit equivalent of a junction capacitance junction resistance in parallel again, this junction capacitance is mainly the barrier capacitance of diode
LED keeps reverse bias as the course of work of optical indicator: LED, use two pins of MCU to charge to equivalent capacity, through after the regular hour, the MCU pin that the negative electrode of LED is corresponding is set to input state, at this moment the equivalent capacity bleed off electric charge that charges by VCC, logic level on the negative electrode pin of measurement equivalent capacity drops to from logical one the time T that logical zero expends, size by judgement T is judged environmental light intensity, if incident intensity is very large, the equivalent capacity bleed off is very fast, and namely the T value is very little; Otherwise if surround lighting is very weak, equivalent capacity bleed off process is very long, and corresponding T value is very large,
When using LED as touch sensor, its course of work remains by detection and shines the touch that light intensity on the LED lamp is come judgment object, and namely when having object to touch, the light intensity that shines on the LED lamp can change, detected no touch by measuring above-mentioned time T
Dynamically, when the MCU judgement has user's touch key-press, just carry out corresponding control logic judgement, and then control controlled device.
The advantage of light-emitting diode (LED) sensing and controlling system of the present invention is: utilize the characteristic of LED, carry out logical process by a series of processing, realize simple logic control.Thereby making LED have two functions concurrently, is at first to play the control function, also possesses in addition deixis, and cheap, saves cost, user satisfaction is high, fashion is good-looking.
[embodiment]
See also Fig. 1, light-emitting diode (LED) sensing and controlling system of the present invention comprises LED (light-emitting diode) module 10, MCU (microcontroller) 20, and controlled device 30.Wherein LED module 10 and controlled device 30 are controlled work by MCU20, and LED module 10 is not only as the optical indicator element that possesses deixis, simultaneously also as the touch sensor element of controlling the external logic state.Wherein LED module 10 can be a light-emitting diode, the perhaps combination of a plurality of light-emitting diodes, and controlled device 30 can be energy supply control module, volume control module, time schedule control module, perhaps power adjustments device.
Seeing also Fig. 2, is the first embodiment annexation block diagram of light-emitting diode (LED) sensing and controlling system of the present invention, and this LED module 10 as induction power switch, has concurrently and touches the function that receives induction and power supply status indication at this moment.
Common soft-touch type electric source switch mostly adopts following several form: button, touch-switch, self-lock switch, touch-screen etc., its power supply status indication all needs to configure in addition a display unit.Only need 1 LED when adopting this embodiment, wherein this LED both as the power supply status indication, also receives induction as touching.This light-emitting diode (LED) sensing and controlling system comprises a LED 12, MCU 20, and energy supply control module 32.In this embodiment namely, LED module 10 is only a common LED 12, and MCU 20 is the single-chip microcomputers with common I/O (I/O) function, and controlled device 30 is energy supply control modules 32.Energy supply control module 32 comprises a controllable electric power, ATX (Advanced Technology Extended, the expansion of senior branch art) power supply for example, and its work is controlled by MCU20 whether.
see also Fig. 3, the physical circuit figure of this embodiment, in this embodiment, MCU 20 is that model is the single-chip microcomputer of ATmega16, not shown energy supply control module 32 in Fig. 3, energy supply control module 32 is connected to two-way I/O (I/O) pin of MCU 20 by a power module socket 22, be pin one 9 (PC0), LED 12 is connected to the two-way I/O pin of MCU 20, concrete annexation is as described below: the anodic bonding of LED 12 is to the pin 36 (PA1 of MCU 20, ADC1), the negative electrode of LED 12 is connected to the pin 37 (PA0 of MCU20, ADC0).And the pin PA0 to PA7 of the MCU20 while is as the analog input end of ADC (analog sampling device).
The course of work of the present embodiment is as described below:
At first be under static state, MCU 20 controls by the level of I/O pin (PA0, PA1), makes LED12 be in reverse bias.LED 12 can use as drag under back bias mode and substitute: the current source that electric current of a diodes in parallel is directly proportional to illumination.And wherein diode can be again with the circuit equivalent of a junction capacitance junction resistance in parallel.This junction capacitance is mainly the barrier capacitance of diode.From circuit, barrier capacitance and junction resistance are in parallel, and during due to reverse bias, junction resistance is very large, although barrier capacitance is very little, its effect is very strong, and particularly impact is larger when high frequency.And junction resistance very little (200 Europe) during forward bias, although barrier capacitance is larger, its effect is smaller on the contrary comparatively speaking.Popular, during the LED back biased, incident ray is stronger, and the value of equivalent current source is larger, and simultaneously for equivalent capacity, the said current dumping after charging is faster.
LED 12 keeps reverse bias as the course of work of optical indicator: LED 12, uses two pins of MCU 20 to charge to equivalent capacity, and the negative electrode that is equivalent to equivalent capacity meets VCC (power supply), anode meets GND (signal ground).Through after the regular hour, MCU 20 pins that the negative electrode of LED 12 is corresponding are set to Input (input) state, at this moment the equivalent capacity bleed off electric charge that charges by VCC, logic level on the negative electrode pin of measurement equivalent capacity drops to from logical one the time T that logical zero expends, and judges environmental light intensity by the large I of judgement T.If incident intensity is very large, the equivalent capacity bleed off is very fast, and namely the T value is very little; Otherwise if surround lighting is very weak, equivalent capacity bleed off process is very long, and corresponding T value is very large.
What the above sketched is that LED 12 is as the principle of optical indicator.When using LED 12 as touch sensor, its course of work remains by detection and shines the touch that light intensity on LED 12 lamps is come judgment object, namely when having object to touch, the light intensity that shines on LED 12 lamps can change, therefore can detect no touch by measuring above-mentioned time T, Here it is utilizes LED as the basic principle of touch sensor.
Dynamically, when MCU 20 judgements have user's touch key-press, just carry out corresponding power control logic judgement, and then control energy supply control module 32.The power control logic determining program of MCU 20 includes the smothing filtering algorithm of light intensity, the interference that the employing adaptive algorithm is come anti-extraneous light intensity.
See also shown in Figure 4ly, be the smothing filtering algorithm flow chart of this embodiment, logical one drops to time T that logical zero expends and samples by ADC and obtain.By ADC number of samples equivalence T.This smothing filtering algorithm comprises the steps:
Step 102:MCU 20 controls by the level of I/O pin (PA0, PA1), makes LED 12 be in reverse bias, and LED 12 negative electrodes are the ADC0 input;
Step 104: program begins;
Does step 106:ADC complete? as complete, enter step 108 after counter 0+1, do not complete, enter step 112;
Step 108: judge whether less than the logical zero threshold values, if, enter step 110, if not, return to step 104;
Step 110: preserve counter 0 value, then enter step 112;
Step 112: quit a program.
See also shown in Figure 5ly, the adaptive algorithm flow chart for this embodiment comprises the steps:
Step 114: then input ADC counter 0 value enters step 116;
Step 116: program begins;
Step 118: subtract sampled value last time, if result less than or equal to 2, enters step 120, if result greater than 2, after counter 1 adds 1, enters step 122;
Step 120: be changed to counter 0 last time, then enter step 126;
Step 122: whether judge counter 1 greater than N, wherein N is a preset value, can adjust, if counter 1 greater than N, enters step 124, if not, directly enters step 126;
Step 124: put key flag bit, then enter step 126;
Step 126: quit a program.
Adopt simultaneously the mode of time-sharing multiplex, carry out the state indication of energy supply control module 32, and pass through the brightness of the driving Duty ratio control demonstration of adjustment LED 12.When energy supply control module 32 is opened, LED 12 the brightest demonstrations.When energy supply control module 32 is closed, after entering standby, LED 12 carries out glimmer and shows, reaches the impression of man-machine interaction preferably.This power supply status control flow comprises the steps: as shown in Figure 6
Step 128: then key flag bit set enter step 130;
Step 130: program begins;
Step 132: judge that current power supply opens? if, enter step 134, if not, enter step 136;
Step 134: then powered-down enters step 138;
Step 136: then opening power enters step 138;
Step 138: quit a program.
Seeing also Fig. 7, is the second embodiment annexation block diagram of light-emitting diode (LED) sensing and controlling system of the present invention.This LED module 10 as the induction type volume control switch, has the function of the control of induction type volume and display unit concurrently at this moment.
This light-emitting diode (LED) sensing and controlling system comprises a plurality of LED 14, MCU 20, and volume control module 34.In this embodiment namely, LED module 10 is a plurality of common LEDs 14, and MCU 20 is the single-chip microcomputers with common I/O (I/O) function, and controlled device 30 is volume control modules 34.
Described volume control module 34 comprises a power amplifier that volume is controlled, and perhaps volume control module 34 circuit itself are exactly the part of power amplifier, DVD circuit, and its volume is controlled by MCU 20.
See also Fig. 8, the physical circuit figure of this embodiment, in this embodiment, MCU 20 is that model is the single-chip microcomputer of ATmega16, not shown volume control module 34 in Fig. 8, volume control module 34 is connected to two-way I/O (I/O) pin of MCU 20 by a socket JP1, i.e. pin 9 (PD0, RXD) and pin one 0 (PD1, TXD), and a plurality of LED 14 are connected respectively to the two-way I/O pin of MCU 20.Be 8 LED in figure, certainly, also can be less than 8, perhaps greater than 8.
The course of work is as follows:
In this embodiment, LED is identical with the first above-mentioned embodiment as the principle of the work of optical indicator and touch sensor, does not repeat them here.The main distinction is that this embodiment is the application of a plurality of similar switches, in this embodiment with plural LED 14 composition placed side by side LED progress bar, each LED 14 is exactly a touch sensor, touch on the LED progress bar as the user when sliding, MCU 20 detects rear control volume control module 34, thereby controls the size variation of volume.And the size of volume is along with the determining positions of sliding, and the pointwise of can and then sliding lights LED 14, and when the user stopped sliding, volume just was fixed on the position that finger stops.Can greatly increase the comfort level that the user uses, satisfaction, the number of times of minimizing user key-press.This position is also arrived in LED indication simultaneously, the size of indication current volume.This embodiment can be used on the KTV planter with touch-screen, also can be used in power amplifier, the place that DVD etc. need, and do not need touch-screen.
The key sensor principle of this example is identical with example 1.Different places is that this example is a plurality of LED.When the user begins sternward LED direction when sliding from first LED, volume from large to small.Vice versa.
As shown in Figure 9, greatly routine by ditty with volume, the control program that comprises in MCU 20 is described, comprise the steps:
Step 202: enter step 204 after key flag bit, input key number;
Step 204: program begins;
Step 206: preserve current button number, then enter step 208;
Step 208: subtract button number last time, then with result and 0 relatively, if result greater than 0, enters step 210, if result less than 0, enters step 212, if result equals 0, enter step 214;
Step 210: volume increases, and then enters step 214;
Step 212: volume reduces, and then enters step 214;
Step 214: quit a program.
Seeing also Figure 10 and Figure 11, is the 3rd embodiment annexation block diagram and the physical circuit figure of light-emitting diode (LED) sensing and controlling system of the present invention.The operation principle of this embodiment and the second embodiment is identical, and only controlled device 30 becomes time schedule control module 36, and the variable quantity of namely controlling is time schedule.This time schedule control module 36 is used for controlling the time schedule of broadcast program.
Seeing also Figure 12 and Figure 13, is the 4th embodiment annexation block diagram and the physical circuit figure of light-emitting diode (LED) sensing and controlling system of the present invention.The operation principle of this embodiment and the second embodiment is identical, and only controlled device 30 becomes power adjustments device 38, and the variable quantity of namely controlling is power (firepower), and the power (firepower) that is applied in the household electrical appliances such as electric fan, microwave oven is regulated.
This light-emitting diode (LED) sensing and controlling system comprises a plurality of LED 16, MCU 20, power adjustments device 38.Be that LED module 10 is to comprise a plurality of common LED 16, these a plurality of common LED 16 form the power bar, MCU 20 is the single-chip microcomputers with PWM (pulse width modulation) function, ATmega16 for example, power adjustments device 38 comprises an electrical appliance that power is controlled, or power adjustments device 38 circuit itself are exactly the part of this electrical appliance circuit, and its watt level is controlled by MCU 20, is connected to MCU 20 by the socket JP1 in Figure 13.The course of work is as follows:
The principle of work is identical with the second above-mentioned embodiment, touches on LED power bar as the user when sliding, and MCU 20 detects rear power ratio control and regulates device 38, thereby controls the size variation of electrical appliance power.And the size of power is along with the determining positions of sliding, and the pointwise of can and then sliding lights power indicator light LED 14, and when the user stopped sliding, power or firepower just were fixed on the position that finger stops.Greatly increase the comfort level that the user uses, satisfaction, the number of times of minimizing user key-press.This position is also arrived in LED indication simultaneously, indicates current watt level.And program and the second embodiment that MCU 20 processes are identical.
In the various embodiments described above, the subject matter and the solution that run into when using LED to do touch sensor are as described below:
The first, the interference of environmental light intensity:
When doing touch sensor, guarantee that the environment light source conversion when no touch around LED is very little, and when having object to touch LED, the obviously variation of the intensity of illumination of (reaching LED transducer examination criteria) be arranged.Usually in the relatively-stationary application of environment for use, can pass through human intervention, adjust LED photoenvironment on every side, thereby reach the purpose that identification touches.And when using in uncertain environment, the problem that mainly can relate to has: 1, the environment of Client application is fixing; 2, the light transmission of the glass of product casing front (or plastics) plate.
For the 1st problem, directly use the unreliability that is certain to exist to a certain degree.A kind of solution is: increase the impact of some light sources, human intervention surround lighting in product.By adjusting LED light source on every side, LED is achieved the goal to the Reduced susceptibility of environment light source.Consider to use adaptive algorithm on software, reduce the interference of environment.
For the 2nd problem, need to adjust confirmation according to the structure of concrete application product, main relevant with the light transmission of material.The foundation of adjusting light transmission is that touch objects is blocked the LED lamp impact of light intensity change amount on vertical direction is wanted large, and the obviously variation of the intensity of illumination of (reaching LED transducer examination criteria) be arranged.
The second, the consistency of LED:
When a plurality of LED worked as photosensitive tube, its consistency was also important.Modern crafts can accomplish to satisfy general consistency, and the LED product is definite preferably by selecting.
Three, the life-span of LED under reverse-bias state:
Because LED has the reverse bias of being in work, its life-span is also important.The LED product is definite preferably by selecting.
Although more than described the specific embodiment of the present invention; but being familiar with those skilled in the art is to be understood that; our described specific embodiment is illustrative; rather than for the restriction to scope of the present invention; those of ordinary skill in the art are in modification and the variation of the equivalence of doing according to spirit of the present invention, all should be encompassed in the scope that claim of the present invention protects.