Summary of the invention
To the shortcomings and deficiencies of prior art, the purpose of the utility model is to provide a kind of model car based on the AVR single-chip microcomputer to use direction-control apparatus.To solve the direction control problem of model car, promptly gather road information through information acquisition unit, then after automatic control unit is handled, steering controling signal sent to turn to driver element.Thereby reach the self-sustaining tracking of model car, control the purpose that turns to automatically.
In order to realize above-mentioned technical purpose, the utility model adopts following technical solution:
A kind of model car based on the AVR single-chip microcomputer is used direction-control apparatus; It is characterized in that; Comprise at least five infrared photoelectric sensors, single-chip microcomputer and steering-engine, said at least five infrared photoelectric sensors are connected with single-chip microcomputer respectively, and said steering-engine is connected with single-chip microcomputer through full-bridge circuit.
The other technologies of the utility model are characterized as:
Said model car based on the AVR single-chip microcomputer comprises seven infrared photoelectric sensors with direction-control apparatus, and these seven infrared photoelectric sensors are connected with single-chip microcomputer respectively.
The ATMEGA16 single-chip microcomputer that said single-chip microcomputer adopts Atmel company to produce.
Said infrared photoelectric sensor adopts the reflective infrared photoelectric sensor of SPI-315.
The pavement of road information that the device of the utility model is gathered according to infrared photoelectric sensor, the judgment models car is in straight way or bend, is kept straight on through steering-engine control model car by single-chip microcomputer, turns left or right-hand rotation.This device has the advantages that circuit is simple, response is sensitive, the degree of accuracy is high, cost is low.
The specific embodiment
Embodiment:
The model car based on the AVR single-chip microcomputer of this embodiment is used direction-control apparatus; Comprise ATMEGA16 single-chip microcomputer and steering-engine that seven reflective infrared photoelectric sensors of SPI-315, Atmel company produce; Said seven infrared photoelectric sensors are connected with single-chip microcomputer respectively; Said steering-engine is connected with single-chip microcomputer through full-bridge circuit, and whole device is supplied power by the 5V power supply that the electric remote control model car carries; The circuit connecting mode of concrete installation site and the whole device of each electronic device on electrical remote control vehicle is following:
Seven reflective infrared photoelectric sensors of SPI-315 are so that " one " the font arrangement mode is installed on the front portion of model car, and these seven infrared photoelectric sensors can be gathered pavement of road information in real time, and the information that collects is transferred to single-chip microcomputer after amplifying shaping; Described seven infrared photoelectric sensors are respectively first infrared photoelectric sensor, second infrared photoelectric sensor, the 3rd infrared photoelectric sensor, the outer photoelectric sensor of quatre, the 5th infrared photoelectric sensor, the 6th infrared photoelectric sensor, the 7th infrared photoelectric sensor; For better gathering pavement of road information; Wherein the distance between the outer photoelectric sensor of the 3rd infrared photoelectric sensor and quatre and outer photoelectric sensor of quatre and the 5th infrared photoelectric sensor is 20mm; Distance between second infrared photoelectric sensor and the 3rd infrared photoelectric sensor and the 5th infrared photoelectric sensor and the 6th infrared photoelectric sensor is 25mm, and the distance between first infrared photoelectric sensor and second infrared photoelectric sensor and the 6th infrared photoelectric sensor and the 7th infrared photoelectric sensor is 27mm; Also include three 10K adjustable resistances and two LM324 in the device, three 10K adjustable resistances are respectively: first adjustable resistance, second adjustable resistance and the 3rd adjustable resistance; Two LM324 are respectively: a LM324 and the 2nd LM324, and first infrared photoelectric sensor is connected with a LM324 through first adjustable resistance; Second infrared photoelectric sensor is connected with a LM324 through first adjustable resistance; The 3rd infrared photoelectric sensor is connected with a LM324 through second adjustable resistance; The outer photoelectric sensor of quatre is connected with a LM324 through second adjustable resistance; The 5th infrared photoelectric sensor is connected with the 2nd LM324 through second adjustable resistance; The 6th infrared photoelectric sensor is connected with the 2nd LM324 through the 3rd adjustable resistance; The 7th infrared photoelectric sensor is connected with the 2nd LM324 through the 3rd adjustable resistance; The output of two LM324 is connected with single-chip microcomputer;
With reference to Fig. 2, the positive pole 2 and the negative pole 1 of the transmitting terminal of each infrared photoelectric sensor connects respectively+5V and ground, and the positive pole 3 of receiving terminal connects+5V, and negative pole 8 is connected with the input voltage pin 6 of LM324; The output 9 of adjustable resistance is connected with the comparative voltage pin of LM324, and the output voltage pin of LM324 is connected with the PD mouth of single-chip microcomputer, and anodal pin and negative pole pin connect respectively+5v and ground.The continual infrared ray of launching of transmitting terminal meeting of infrared photoelectric sensor, when infrared ray ran into different reflecting surfaces, receiving terminal just can receive the infrared ray that reflects of varying number.When the color on road road surface was white, the infrared ray that receiving terminal receives was more, and then the resistance of sensor internal is just less; The voltage of output is just bigger; Make the voltage of LM324 the 6th pin greater than the comparative voltage of the 5th pin, after amplifying shaping, the 7th pin output low level.Otherwise, when the color on road road surface is black, the 7th pin output high level.
With reference to Fig. 3, full-bridge circuit comprises 8050 triode T1,8050 triode T2,9013 triode T3,9013 triode T4,8550 triode T5 and 8550 triode T6; Wherein: the base stage 1 of T1, receiving pole 2 and emitter stage 3 respectively with the emitter stage 3 of the emitter stage 3 of T3, T5, be connected; The base stage 1 of T2, receiving pole 2 and emitter stage 3 respectively with the emitter stage 3 of the emitter stage 3 of T4, T6, be connected; The base stage 1 of T3 is connected with the PB1 mouth of single-chip microcomputer, the base stage 1 of T6 respectively with receiving pole 2; The base stage 1 of T4 is connected with the PB3 mouth of single-chip microcomputer, the base stage 1 of T5 respectively with receiving pole 2; The base stage 1 of T5 and receiving pole 2 respectively with the receiving pole 2 of T4 ,+5V is connected; The receiving pole 2 of T6 is connected with+5V;
The positive pole of the direct current generator in the steering-engine is connected with the emitter stage 3 of the receiving pole of T1 2 and T5, and negative pole is connected with the receiving pole 2 of T2 and the emitter stage 3 of T6.
When single-chip microcomputer signal end PB3 mouth output high level signal, triode T4, T5, T2 conducting make the sense of current of process in the steering-engine for from left to right.On the contrary, when single-chip microcomputer signal port PB1 output high level signal, triode T3, T1, T6 conducting make the sense of current of process in the steering-engine for from right to left.
With reference to Fig. 4; The AVR single chip computer AT MEGA16 that Atmel company produces; It can be real-time the pavement of road information that sent of each infrared sensor of reception, and these information are handled fast and accurately, the control signal after will handling then sends steering-engine to.No. 10 pins of single-chip microcomputer link to each other with positive source, and No. 31 pin links to each other with power cathode; The PD0-PD6 port connects 7 reflective infrared electro sensings of SPI-315 successively; The PB1 port is a steering-engine left rotaring signal end, and PB3 is a steering-engine right turn signal end; When first infrared photoelectric sensor; When second infrared photoelectric sensor or the 3rd infrared photoelectric sensor detect black; The output of the one LM324 is respectively to PD0, PD1 or PD2 pin input high level, Single-chip Controlling PB1 pin output this moment high level; Steering-engine turns left, thus model car just turn left to; When the quatre outer sensor detected black, the output of a LM324 was to PD3 pin input high level, this moment Single-chip Controlling PB1 and PB2 pin output low level, steering-engine does not turn to; When the 5th infrared photoelectric sensor; When the 6th infrared photoelectric sensor or the 7th infrared photoelectric sensor detect black; The output of the 2nd LM324 is respectively to PD4, PD5 or PD6 pin input high level, Single-chip Controlling PB3 pin output this moment high level; Steering-engine is turned right, model car just turn right to; Steering-engine is installed on the front-wheel of model car; And be connected with the PB2 pin with the PB1 of single-chip microcomputer in being installed on car through full-bridge circuit; The control signal of the reception single-chip microcomputer output that full-bridge circuit ability wherein is real-time, then turning to according to the steering-engine on the control signal driving model car front-wheel; Thereby the Automatic Track Finding of implementation model car is controlled it automatically according to pavement of road information and is turned to.