Disclosure of Invention
The invention provides a visible light indoor positioning device based on illumination intensity to solve the technical problems in terms of positioning accuracy, safety and cost of the existing indoor positioning method.
The visible light indoor positioning device based on the illumination intensity is characterized by comprising an emitting device and a receiving device, wherein the emitting device comprises a first microprocessor, 5 LED driving circuits and 5 LEDs, and the receiving device comprises a second microprocessor, 5 measuring circuits and 5 phototriodes; the first microprocessor is connected with the 5 LED driving circuits, the 5 LED driving circuits are respectively connected with the 5 LEDs, the 5 phototriodes are respectively connected with the 5 measuring circuits, and the second microprocessor is connected with the 5 measuring circuits; the 5 LEDs are respectively placed on the roof of a room to be tested and distributed in a cross shape on the same horizontal plane, wherein four LEDs are positioned on four vertexes of the cross, and one LED is positioned at the cross of the cross.
Further, the first microprocessor is used for generating 5 different frequencies of PWM waves to be respectively input to the 5 LED driving circuits.
Further, the LED driving circuit is used for receiving the PWM wave generated by the first microprocessor to obtain a carrier wave signal and driving the LED to send an optical signal outwards at constant power.
Furthermore, the 5 LEDs are modulated by 5 LED driving circuits with 5 PWM waves of different frequencies, so that the phototriode and the measuring circuit can distinguish optical signals sent by different LEDs, and each of the 5 measuring circuits processes one of the 5 optical signals and filters out the other 4 optical signals.
Furthermore, the 5 phototriodes form a light receiving device, which is used for receiving the visible light signals emitted by the 5 LEDs and converting the visible light signals into electric signals.
Further, each of the 5 measuring circuits is composed of an instrument amplifier and a demodulation circuit; the instrument amplifier is used for receiving the electric signal, filtering and amplifying the electric signal; the demodulation circuit is used for receiving the electric signal amplified by the instrument amplifier and demodulating the electric signal, and the demodulated electric signal is output to the second microprocessor.
Further, the second microprocessor is used for receiving the electric signal demodulated by the demodulation circuit, obtaining a voltage U after A/D conversion, and obtaining the distance D from any one LED to the corresponding phototriode according to the voltage U; presetting 5 LEDsiThe coordinate of (i ═ 1,2,3,4,5) is (x)1,y1,z1)、(x2,y2,z2)、(x3,y3,z3)、(x4,y4,z4)、(x5,y5,z5) The height of the 5 LEDs from the ground is preset to be H, and H is equal to z1=z2=z3=z4=z5The 5 LEDs form 4 right triangles, each right triangle consists of a cross point and two vertexes, and the second processor calculates one of the triangles according to the following formula to obtain a positioning coordinate P1(x,y,z),
Wherein d is1Is P1Distance of a point to the first vertex of the right triangle, d2Is P1Distance of a point to the second vertex of the right triangle, d3Is P1And calculating the positioning coordinates of the other three triangles in the same way according to the distance from the point to the third vertex of the right triangle, and finally taking the average value of 4 coordinate values as the final positioning coordinate P of the light receiving device.
Further, the distance d is obtained by the formula
And (6) calculating.
Further, the method for determining the parameter k is to place an LED and the light receiving device on the same straight line, increase the distance between the two points by 0.1n each time from n, record the measured output voltage U and the distance d, average the data of m groups of data for each distance measurement, and finally use a formula according to the relation curve of the voltage U and the distance d
The coefficient k is obtained by using a least square method.
Compared with the existing indoor positioning method, the positioning precision of the device is high, the precision with the error smaller than 3cm can be achieved under the normal indoor environment of the test condition, 5 LEDs are adopted in the device to have the mutual compensation effect, and the precision is higher compared with 3 LEDs; compared with the visible light positioning technology based on the image sensor, the invention has the advantages of higher response speed, strong anti-interference capability, wide application range and lower manufacturing cost.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be further described with reference to the accompanying drawings.
The invention comprises a transmitting device and a receiving device, wherein the transmitting device comprises a first microprocessor, 5 LED driving circuits and 5 LEDs, and the receiving device comprises a second microprocessor, 5 measuring circuits and 5 phototriodes. As shown in fig. 1, the first microprocessor is connected to the 5 LED driving circuits, the 5 LED driving circuits are respectively connected to the 5 LEDs, the 5 phototransistors are respectively connected to the 5 measuring circuits, and the second microprocessor is connected to the 5 measuring circuits. The 5 phototriodes form a light receiving device. The first microprocessor can generate 5 different PWM waves to drive 5 LEDs to emit light for 5 LED driving circuits respectively, 5 phototriodes receive the light emitted by the 5 LEDs respectively, and the phototriodes convert optical signals into electric signals and then process the electric signals through the measuring circuit and the second microprocessor to obtain the positions of the 5 LED lamps relative to the phototriodes. 5 LEDs as emitting nodes respectively arranged at the center of the ceiling and the middle point of four edges of the ceilingThe two-dimensional array is distributed in a cross shape on the same horizontal plane, wherein four points are positioned at four peaks of the cross, and one point is positioned at the cross of the cross. The device model is shown in FIG. 2, and 5 emitting nodes of LEDs are providediThe coordinate of (i ═ 1,2,3,4,5) is (x)1,y1,z1)、(x2,y2,z2)、(x3,y3,z3)、(x4,y4,z4)、(x5,y5,z5) And the coordinate value is known, the height of the transmitting end from the ground is H (H ═ z)1=z2=z3=z4=z5) The whole indoor space is within the radiation range of the transmitting node, and the point P is the light receiving device.
When the position of the P point is positioned, a differential three-point positioning method is adopted, so that the influence of other factors (such as temperature) except illumination can be effectively eliminated. The 5 LEDs form 4 right-angled triangles which are L respectively1L2L3、L1L3L4、L1L4L5And L1L5L2In a triangle L1L2L3For example, other triangles and L1L2L3Similarly. Let P point coordinate be (x, y, z), P point to L1A distance of d1P to L2A distance of d2P to L3A distance of d3Then the three-point positioning equation is as follows
Wherein, the coordinate values of the three LEDs satisfy the following conditions:
solving the above equation set
The method for solving by using other three right-angled triangles is the same as the method described above, and the description is omitted. Then 4 coordinate values are calculated and averaged to obtain the position coordinate of the P point of the light receiving device
This is the final location coordinates.
When constant power P is supplied to the LED through the LED control circuit, the luminous power of the LED is determined by the fact that a part of electric energy is dissipated and the conversion efficiency is eta
Pt=ηP (1)
Since the LED has a small volume and can be regarded as an ideal point light source, the solid angle is 4 pi, which is a fixed value, and the luminous intensity is proportional to the luminous power, that is:
I=αPt (2)
wherein, I is luminous intensity, alpha is proportionality coefficient, and is related to the luminous material of the LED.
As can be seen from the first law of illumination, when a point light source is used for illumination, the illumination on the surface of an object perpendicular to the light is inversely proportional to the luminous intensity of the light source or proportional to the square of the distance from the illuminated surface to the light source. The receiving end adopts a phototriode, the size is small, and the phototriode can be approximated to a point, so the phototriode can be regarded as vertical irradiation, and the relationship between the illuminance E of the receiving end and the luminous intensity I of the transmitting end is as follows:
wherein d is the distance between the transmitting end and the receiving end, namely the distance between the LED and the light receiving device in the invention.
The receiving end can be regarded as an ideal point and is vertically irradiated by the transmitting end, so that the receiving power is in direct proportion to the illumination of the receiving end, the proportionality coefficient is set as beta, and the receiving power is set as PrThen, the receiving power and the receiving end illuminance have the following relationship:
Pr=βE (4)
emitter electrode of receiving end phototriodeCurrent output and light receiving power PrProportional ratio, the proportionality coefficient is gamma, and is related to the photosensitive material and the amplification coefficient of the phototriode, the output voltage of the measuring circuit is U, and the output voltage and the light receiving power meet the following requirements:
U=γPrR (5)
simultaneous formulas (1), (2), (3), (4) and (5) obtain the quantitative relation between the final output voltage and the distance between the transmitting end and the receiving end, namely:
for equation (6), when the model of the LED or the phototransistor is selected and the power of the driving circuit is constant, the molecular component is constant, and k is set, then equation (6) can be changed to:
after the model of equation (7) is obtained, it can be known that when the light emitting power (determined by the LED control circuit and the power supply) is constant, the voltage at the receiving end is inversely proportional to the square of the distance. Now the coefficient k needs to be determined, here using actual measurements. The sending end and the receiving end are placed on the same straight line, the distance between the two points is increased by 1cm from 10cm, the measured output voltage U and the measured distance d are recorded, and 150-200 groups of data are averaged for each distance measurement to reduce errors. And finally, obtaining a coefficient k by using a least square method by using a model of a formula (7) according to a relation curve of the voltage U and the distance d.
As shown in fig. 3, the LED driving circuit mainly includes an inverting proportional amplifying circuit and a CD4046 phase-locked loop modulating circuit. The inverse proportion amplifying circuit adopts OP2227 with high precision, low noise and high gain bandwidth product, and simultaneously adopts single power supply, the amplification factor can be adjusted by R4, and the central voltage V is output0It was 2.5V. 5 pins of CD40465 in the modulation circuit are grounded to make a Voltage Controlled Oscillator (VCO) in the modulation circuit work, and the center frequency f of 4-pin output0Determined by C4 and R7. PWM wave (duty ratio 50%) generated by single chip microcomputer via capacitorThe C7 is coupled to one end of R4, amplified by OP2227 and coupled to VCO control input end (pin 9) in CD4046 through C5, so that the carrier signal frequency f output by pin 4 istAt f0When the voltage of pin 9 is equal to V0Time ft=f0When the voltage of the pin 9 is maximum, ftMaximum, when the voltage of pin 9 is minimum, ftAnd minimum. The tape carrier signal sends an optical signal by driving the LED by TB 6612. Since the PWM wave generated by the first microprocessor is stable, a stable signal with carrier can be obtained, so that the LED sends out an optical signal with constant power. To ensure that the signals from different LEDs can be separated by the filter on the receiving device and that no interference (filtering out other PWM signals than the specified PWM signal) is caused between the signals, a carrier allocation technique may be used. 5 LEDs are modulated by 5 PWM waves with different frequencies through 5 LED driving circuits, so that the measuring circuit can distinguish optical signals sent by different LEDs, the phototriode and the measuring circuit can receive 1 appointed signal, and other 4 signals are filtered.
The measuring circuit of the device is designed as shown in fig. 4, the upper diagram is a circuit diagram of a phototriode, the lower diagram is a circuit diagram of the measuring circuit, and the measuring circuit mainly comprises an instrument amplifier and a CD4046 demodulation circuit. The phototriode receives visible light signals sent by the LED, converts the visible light signals into electric signals, and considers that the sensor is far away from the LED, the electric signals are weak and are mixed with various signals, the device adopts a primary band-pass filter with the center frequency corresponding to the carrier frequency of the LED driving circuit, most of noise is filtered, the electric signals in a required frequency band are amplified, the input end of the band-pass filter is connected with P10, and the output end of the band-pass filter is connected with P11. At this time, the low-power-consumption high-precision instrumentation amplifier INA128 is adopted to amplify the signals in the passband, and the amplification factor can be adjusted through R1. The INA128 is coupled to the band pass filter through C3. Because the received signal is very weak, the device further amplifies the signal output from the instrumentation amplifier by coupling the signal to an OP2227 inverse proportion amplifying circuit by C9, and the amplification factor can be adjusted by R7 and R10. The signal amplified by the first two stages passes through a signal input end 14 pin of a CD4046 coupled by a capacitor C10, and a CD4046 demodulation circuit locks the input signal, wherein the center frequency of the input signal is equal to the carrier frequency of a corresponding LED driving circuit and is controlled by R17 and C7 together. The centre frequency of the demodulation circuit is equal to the carrier frequency, which causes a different phase difference between the VCO output and the input signal in the CD4046, thereby generating a voltage variation at the VCO input corresponding to the frequency variation of the input signal, which is isolated by the source follower in the CD4046 and then outputs the demodulated signal at the demodulation output 10 of the CD 4046. And the demodulated signal is acquired through the AD of the singlechip to obtain the output voltage U of the measuring circuit. 5 phototriodes of the device need 5 sets of measuring circuits with center frequencies corresponding to the modulation center frequencies of the LED driving circuits, and respectively receive signals sent by 5 LEDs. Finally, the distances from the 5 LEDs to the receiving device are calculated by the formula (7), and the receiving device is positioned according to the algorithm.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.