The lattice array code recognition device of concentrated drink capsule
Technical field
The present invention relates to a kind of lattice array code recognition device of concentrated drink capsule, belong to sensor technology and household electrical appliance technical field.
Background technology
Common water dispenser can only provide normal-temperature water, hot water, frozen water; Common beverage machine can only provide the beverage of several fixedly kinds, such as cola, Sprite, coffee etc.; Though and the beverage merchandiser kind increases to some extent, kind also is a relative fixed, and limited.Also have, coffee machine, Soda water machine are confined on a certain beverage especially.These devices all can not satisfy the various tastes among the crowd.
Therefore, design a kind of multifunctional beverage machine, its core concept is to be packaged into unified capsule after beverage is concentrated, and capsule is near cylindrical, and the bottom is printed with the some horizontal and vertical parity check code of expression beverage types.The multifunctional beverage machine utilizes its lattice array code recognition device to read the code value of capsule, thereby determine beverage types, utilize special device that beverage concentrate is extruded from capsule then, and according to the beverage types of discerning, with different speed and different ratios, dissolve soda water, frozen water or hot water etc. so just realize supplying the beverage of a large amount of kinds.
Existing bar codes technique, very ripe, use also very general, but the technical difficulty of identification is bigger, and hardware cost is high especially, is unfavorable for the popularization of product.
Summary of the invention
The objective of the invention is in order to overcome weak point of the prior art, adopt the some horizontal and vertical parity check code of the method identification concentrated drink capsule that detects the infrared external reflection energy intensity,, realized the circuit devcie minimum number by meticulous circuit design and algorithm design, cost is low, the target of reliable operation.
The technical solution adopted for the present invention to solve the technical problems is:
The lattice array code recognition device of concentrated drink capsule, comprise screw mandrel, lead screw motor and electronic identification device, described lead screw motor is connected with described screw mandrel, can drive described screw mandrel and move ahead or retreat, described electronic identification device is arranged on described screw mandrel front end, on-fixed connects, and can follow described screw mandrel and seesaw and do not rotate described electronic identification device, comprise
-can carry out the single-chip microcomputer of data acquisition and Processing Algorithm;
-with the analog multichannel switch that described single-chip microcomputer is connected, be used to export the infrared emission control signal and the input infrared received signal;
-infrared emission the array that is connected with described analog multichannel switch is used to launch infrared signal;
-infrared the receiving array that is connected with described analog multichannel switch is used to receive infrared signal;
-with the infrared signal treatment circuit that described analog multichannel switch is connected with single-chip microcomputer, be used for infrared signal is carried out amplification filtering;
-touch-switch the S1 that is connected with described single-chip microcomputer is arranged on the front end of described electronic identification device, is used to control the distance of described electronic identification device and concentrated drink capsule;
Also comprise, be arranged on data acquisition and Processing Algorithm in the described single-chip microcomputer.
Described analog multichannel switch, X passage is set, Y passage and resistance R 1, described X passage comprises common port and at least two X passage ports of X passage, described Y passage, common port and at least two Y access ports of comprising the Y passage, described resistance R 1, one end connects power supply VCC, one end connects the common port of described X passage, and the common port of described Y passage connects described infrared signal treatment circuit.
The X passage port of described analog multichannel switch is connected with described infrared emission array; The Y access port of described analog multichannel switch is connected with described infrared receiving array.
Described analog multichannel switch, conducting or disconnection by described X passage of described Single-chip Controlling and Y passage, and the common port that described X passage is set is connected with certain port of described X passage port, and the common port that described Y passage is set is connected with certain port of described Y access port.
Described infrared emission array, resistance R 2 and at least two groups triode and infrared transmitting tube arranged side by side are set, the collector of described triode links to each other with the negative electrode of described infrared transmitting tube, the anode of described infrared transmitting tube interconnects, and connect described resistance R 2, described resistance R 2 other ends connect described power supply VCC, the grounded emitter of described triode, and the base stage of described triode connects the X passage port of described analog multichannel switch.
Described infrared receiving array is provided with at least two infrared receiving tubes arranged side by side, and the negative electrode of described infrared receiving tube connects described power supply VCC, and anode connects the Y access port of described analog multichannel switch.
Described infrared signal treatment circuit comprises, resistance R 4 is connected the Y passage common port of described analog multichannel switch with resistance R 3, described resistance R 3 other end ground connection, described resistance R 4 other ends connect the in-phase input end of first operational amplifier (9), and the inverting input of described first operational amplifier (9) connects output terminal; The delivery outlet of described first operational amplifier (9) connects the in-phase input end of second operational amplifier (10), the inverting input of described second operational amplifier (10) connects resistance R 5, resistance R 6 and capacitor C 1, described resistance R 5 other end ground connection, the other end of described resistance R 6 and capacitor C 1 is connected the output terminal of described second operational amplifier (10), the output terminal of described second operational amplifier (10) connects resistance R 7, and described resistance R 7 other ends connect the AD port of single-chip microcomputer.
Also comprise the some horizontal and vertical parity check code that is printed on described concentrated drink capsule bottom, be used to identify dissimilar beverages, described some horizontal and vertical parity check code is arranged to black and white, and on the circumferencial direction of described concentrated drink capsule bottom, be provided with at least two, minimum one of black sign indicating number.
Described data acquisition and Processing Algorithm comprise following step:
(1), described lead screw motor drives described screw mandrel and advances, the bottom near described concentrated drink capsule detects described touch-switch S1 closure up to described single-chip microcomputer;
(2), described lead screw motor drives described screw mandrel slow astern set a distance;
(3), described single-chip microcomputer common port that described X passage is set is connected with first port x 0 of described X passage port, the common port of the Y passage simultaneously is connected with the first port Y0 of described Y access port, make the 1st triode Q1 conducting, the 1st infrared transmitting tube D1 work, the 5th infrared receiving tube D5 received signal, signal is delivered to described infrared signal treatment circuit and is carried out amplification filtering through described analog multichannel switch, carry out the AD sampling by described single-chip microcomputer, acquired signal is V0; Equally, described single-chip microcomputer is provided with the 2nd triode Q2 conducting, the 2nd infrared transmitting tube D2 work, and the 6th infrared receiving tube D6 received signal, acquired signal is V1; Equally, described single-chip microcomputer is provided with the 3rd triode Q3 conducting, the 3rd infrared transmitting tube D3 work, and the 7th infrared receiving tube D7 received signal, acquired signal is V2; Equally, described single-chip microcomputer is provided with the 4th triode Q4 conducting, the 4th infrared transmitting tube D4 work, and the 8th infrared receiving tube D8 received signal, acquired signal is V3;
(4), described single-chip microcomputer carries out data processing, getting minimum value MIN is V0, V1, V2, the minimum value among the V3, getting maximal value MAX is V0, V1, V2, the maximal value among the V3, AVG=(MAX+MIN)/2 then averages;
(5), further, ask for the code value d0 of described some horizontal and vertical parity check code, d1, d2, d3: if V0>AVG, d0=1 then, otherwise d0=0; If V1>AVG, d1=1 then, otherwise d1=0; If V2>AVG, d2=1 then, otherwise d2=0; If V3>AVG, d3=1 then, otherwise d3=0.
Implementing good effect of the present invention is: 1, by meticulous circuit design and algorithm design, realized that circuit quantity is minimum, cost is low; 2, reliable operation, antijamming capability is strong.
Description of drawings
Fig. 1 is the structural representation of the lattice array code recognition device of concentrated drink capsule;
Fig. 2 is the system chart of the lattice array code recognition device of concentrated drink capsule;
Fig. 3 is the single chip circuit schematic diagram of the lattice array code recognition device of concentrated drink capsule;
Fig. 4 is analog multichannel switch, the infrared emission array of the lattice array code recognition device of concentrated drink capsule, the circuit theory diagrams of infrared receiving array;
Fig. 5 is the infrared signal treatment circuit schematic diagram of the lattice array code recognition device of concentrated drink capsule;
Fig. 6 is the truth table of analog multichannel switch of the lattice array code recognition device of concentrated drink capsule;
Embodiment
Now the invention will be further described in conjunction with the accompanying drawings:
With reference to Fig. 1-6, the lattice array code recognition device of concentrated drink capsule comprises electronic identification device 1, screw mandrel 2, lead screw motor 3.Described lead screw motor 3 is connected with described screw mandrel 2, can drive described screw mandrel 2 and move ahead or retreat, and described electronic identification device 1 is arranged on described screw mandrel 2 front ends, and on-fixed connects, and can follow described screw mandrel 2 and seesaw and do not rotate.
Described electronic identification device 1, comprise the single-chip microcomputer 4 that to carry out data acquisition and Processing Algorithm, the analog multichannel switch 5 that is connected with described single-chip microcomputer 4, be used to export infrared emission control signal and the infrared received signal of input, the infrared emission array 6 that is connected with described analog multichannel switch 5, be used to launch infrared signal, the infrared receiving array 7 that is connected with described analog multichannel switch 5, be used to receive infrared signal, the infrared signal treatment circuit 8 that is connected with single-chip microcomputer 4 with described analog multichannel switch 5, be used for infrared signal is carried out amplification filtering, with the touch-switch S1 that described single-chip microcomputer 4 is connected, be arranged on the front end of described electronic identification device 1, be used to control the distance of described electronic identification device 1 and concentrated drink capsule, also comprise, be arranged on data acquisition and Processing Algorithm in the described single-chip microcomputer 4.
Described analog multichannel switch 5 is provided with X passage, Y passage and resistance R 1.Wherein, described X passage comprises common port XCOM and four X passage ports of X passage, X0, X1, X2, X3; Described Y passage comprises common port YCOM and four Y access ports of Y passage, Y0, Y1, Y2, Y3.Described resistance R 1, one end connects power supply VCC, and an end connects the common port XCOM of described X passage, and the common port YCOM of described Y passage connects described infrared signal treatment circuit 8.The forbidding of described analog multichannel switch 5 holds INH to connect the P1 port of described single-chip microcomputer 4, and the channel selecting port-A port and the B port of described analog multichannel switch 5 connect the P2 port and the P3 port of described single-chip microcomputer 4 respectively.The conducting or the disconnection of described single-chip microcomputer 4 described X passages of control and Y passage, and the common port XCOM that described X passage is set is connected with certain port of described X passage port, and the common port YCOM that described Y passage is set is connected with certain port of described Y access port.Described analog multichannel switch 5 can be selected the chip CD4052B of Texas Instrument, as the device of implementing.
Institute is shown in Figure 6, and when described single-chip microcomputer 4 was provided with INH=1 by the P1 port, described X passage and Y passage were all closed; When described single-chip microcomputer 4 is provided with INH=0 by the P1 port, described P2 port, P3 port are provided with the A port and the B port of described analog multichannel switch 5, select described X passage port x 0, X1, X2, X3 and Y access port Y0, Y1, Y2, Y3 are connected with the common port XCOM of described X passage and the common port YCOM of Y passage respectively.
The X passage port of described analog multichannel switch 5 is connected with described infrared emission array 6, and the Y access port of described analog multichannel switch 5 is connected with described infrared receiving array.
Described infrared emission array 6 is used to launch infrared signal.Described infrared emission circuit 6, adopt circuit as shown in Figure 4, four groups of triodes arranged side by side and infrared transmitting tube are set, the collector of described triode links to each other with the negative electrode of described infrared transmitting tube, the anode of described infrared transmitting tube interconnects, and connects resistance R 2, and described resistance R 2 other ends connect described power supply VCC, the grounded emitter of described triode, base stage connect the X passage port of described analog multichannel switch 5.Because infrared transmitting tube is not worked simultaneously, so shared described resistance R 2, can reduce number of devices like this, and the common port XCOM that the base resistance of triode also is placed on the X passage of described analog multichannel switch 5 uses jointly, also reduced the quantity of device.Triode can select 9013 as the device of implementing.
Described infrared receiving array 7 is used to receive infrared signal.Described infrared receiving array 7 adopts circuit as shown in Figure 4, and four infrared receiving tubes arranged side by side are set, and negative electrode connects described power supply VCC, and anode connects the Y access port of described analog multichannel switch 5.Described infrared receiving array 7 is not a complete circuit, and the stake resistance that lacks is arranged on the Y passage common port YCOM of described analog multichannel switch 5, can reduce the quantity of device like this.
Described infrared signal treatment circuit 8 is used for infrared signal is carried out amplification filtering.Described infrared signal treatment circuit 8, adopt circuit as described in Figure 5, comprise that resistance R 3 is connected the Y passage common port YCOM of described analog multichannel switch 5 with resistance R 4, described resistance R 3 other end ground connection, described resistance R 4 other ends connect the in-phase input end of first operational amplifier 9, and the inverting input of described first operational amplifier 9 connects output terminal; The delivery outlet of described first operational amplifier 9 connects the in-phase input end of second operational amplifier 10, the inverting input of described second operational amplifier 10 connects resistance R 5, resistance R 6 and capacitor C 1, described resistance R 5 other end ground connection, described resistance R 6 is connected the output terminal of described second operational amplifier 10 with the other end of capacitor C 1, the output terminal of described second operational amplifier 10 connects resistance R 7, and described resistance R 7 other ends connect the AD port of described single-chip microcomputer 4.
Described touch-switch S1 is arranged on the front end of described electronic identification device 1, is used to control the distance with described concentrated drink capsule.Described touch-switch S1 one end ground connection, the other end connects the P4 port and the resistance R 8 of described single-chip microcomputer 4, and described resistance R 8 other ends connect described power supply VCC.
Also comprise, be printed on the some horizontal and vertical parity check code of described concentrated drink capsule bottom, be used to identify dissimilar beverages, described some horizontal and vertical parity check code is arranged to black and white, is provided with four on the circumferencial direction of described concentrated drink capsule bottom, maximum three of black sign indicating number, minimum one, maximum three of white sign indicating number, minimum one.
Described data acquisition and Processing Algorithm comprise following step:
(1), described lead screw motor 3 drives described screw mandrel 2 and advances, the bottom near described concentrated drink capsule detects described touch-switch S1 closure up to described single-chip microcomputer 4;
(2), described lead screw motor 3 drives described screw mandrel 2 slow astern set a distances;
(3), described single-chip microcomputer 4 common port XCOM that described X passage is set is connected with first port x 0 of described X passage port, the common port YCOM of the Y passage simultaneously is connected with the first port Y0 of described Y access port, make the 1st triode Q1 conducting, the 1st infrared transmitting tube D1 work, the 5th infrared receiving tube D5 received signal, signal is through described analog multichannel switch 5, deliver to described infrared signal treatment circuit 8 and carry out amplification filtering, carry out the AD sampling by described single-chip microcomputer 4, acquired signal is V0; Equally, described single-chip microcomputer 4 is provided with the 2nd triode Q2 conducting, the 2nd infrared transmitting tube D2 work, and the 6th infrared receiving tube D6 received signal, acquired signal is V1; Equally, described single-chip microcomputer 4 is provided with the 3rd triode Q3 conducting, the 3rd infrared transmitting tube D3 work, and the 7th infrared receiving tube D7 received signal, acquired signal is V2; Equally, described single-chip microcomputer 4 is provided with the 4th triode Q4 conducting, the 4th infrared transmitting tube D4 work, and the 8th infrared receiving tube D8 received signal, acquired signal is V3;
(4), described single-chip microcomputer carries out data processing, getting minimum value MIN is V0, V1, V2, the minimum value among the V3, getting maximal value MAX is V0, V1, V2, the maximal value among the V3, AVG=(MAX+MIN)/2 then averages;
(5), further, ask for the code value d0 of described some horizontal and vertical parity check code, d1, d2, d3: if V0>AVG, d0=1 then, otherwise d0=0; If V1>AVG, d1=1 then, otherwise d1=0; If V2>AVG, d2=1 then, otherwise d2=0; If V3>AVG, d3=1 then, otherwise d3=0.
Through described data acquisition and Processing Algorithm, described single-chip microcomputer 4 has obtained the kind of beverage concentrate, carries out the program corresponding with the beverage concentrate kind then and carries out beverage and produce.