This design takes MSP430F149 as the control core, uses the amplifier LM324 as a comparator to compare the light intensity of the photoresistor, controls the decelerated stepper motor, and adjusts the up and down, left and right rotation of the laser pointer to achieve the purpose of accurately tracking the light source. The system uses LM317 to adjust the voltage to realize the adjustment of the LED current within a certain range, uses the ADC inside the MSP430F149 to collect the voltage signal amplified by the OPA335, calculates the current value, and uses 12864 liquid crystal for real-time Display. After testing, the laser pointer can accurately track the light source.

Abstract: This design takes MSP430F149 as the control core, uses the amplifier LM324 as a comparator to compare the light intensity of the photoresistor, controls the decelerated stepper motor, and adjusts the up and down, left and right rotation of the laser pointer to achieve the purpose of accurately tracking the light source. The system uses LM317 to adjust the voltage to realize the adjustment of the LED current within a certain range, uses the ADC inside the MSP430F149 to collect the voltage signal amplified by the OPA335, calculates the current value, and uses 12864 liquid crystal for real-time display. After testing, the laser pointer can accurately track the light source.

1 Demonstration of the system scheme

1.1 Selection and demonstration of each module scheme of the system

(1) Motor drive module. The L298 drive chip is used to form a drive circuit, which can control the direction of the motor through the high and low levels output by the control center, and can directly control the speed of the motor through PWM waves. The circuit is relatively simple to simple, easy to implement, has strong driving ability and anti-interference ability, and is cost-effective.

(2) LED lamp current regulation and light source detection module. The transmitting end uses a DC regulated power supply to light up the white LED, and the voltage at both ends of the white LED is adjusted to adjust the current to adjust the brightness.

(3) LED current detection module. A 0.1Ω resistor is connected in series with the lower end of the LED, and the other end of the resistor is grounded. The OPA335 precision amplifier is used to amplify the voltage drop of the 0.1Ω resistor, and then AD sampling is performed to measure and calculate the current flowing through the LED.

1.2 System Composition

This system uses two pieces of TI’s MSP430F149 microcontroller as the control core of the sending part and the receiving part, respectively, to complete the functions of signal sending and receiving, current detection, motor control, keyboard input and liquid crystal display. MSP430F149 microcontroller is rich in internal resources, integrates A/D module, does not need to expand pins, circuit design and production are simple, and power consumption is low.

The peripheral circuit module includes: a motor drive module, an LED control module, a current detection module, a light signal transmitting and receiving module and a liquid crystal Display module.

Design of Point Light Source Tracking System Based on MSP430F149

2 Theoretical analysis and hardware circuit design

2.1 LED control and current detection circuit

The LED changes the current by adjusting the voltage across the LED, so as to realize the adjustment of the brightness. The LED control circuit can be divided by voltage, and the LED is connected in series with a 1OΩ resistor to divide the voltage of the LED, and the voltage of the series circuit can be adjusted to adjust the voltage. current, which controls the brightness of the LED. Has been calculated:

Design of Point Light Source Tracking System Based on MSP430F149

That is, the maximum power of a 10Ω resistor is nearly 1.6W. Therefore, the 10Ω resistor uses a 3W power resistor.

The voltage adjustment adopts LM317, and its output voltage range is:

Design of Point Light Source Tracking System Based on MSP430F149

That is, the adjustable range is 4.0 V to 8.4 V, and the converted current is:

Design of Point Light Source Tracking System Based on MSP430F149

That is, the current range can reach 80-440 mA, which can meet the adjustment requirements in the range of 150-350 mA.

The current detection module converts the current by measuring the voltage across the known resistance in the circuit. Since the resistance of the resistance used to measure the voltage should be as small as possible, the power resistance of 0.1Ω is selected, and the equivalent resistance of the amplifier in parallel can be ignored. After calculation, the voltage drop across the 0.1 Ω resistor is between 0.008 V and 0.042 V, the voltage value is very small, and it needs to go through a first-stage voltage amplifier circuit. Since the maximum value of the internal reference voltage of the AD sampling of the microcontroller is 3.3 V, the amplified voltage value is within 3.3 V.

Design of Point Light Source Tracking System Based on MSP430F149

The voltage amplification adopts TI’s rail-to-rail operational amplifier 0PA335. This operational amplifier has good voltage amplification performance and is powered by a single power supply. The amplified DC signal is not attenuated, and the connection is proportional to the same phase. The output of 0PA335 is connected to the analog signal input terminal P6.0 of the single-chip microcomputer for AD sampling. The circuit is shown in Figure 2.

Design of Point Light Source Tracking System Based on MSP430F149
Figure 2 Current regulation and detection circuit

2.3 Motor drive circuit

Due to the use of stepper motor, the current is large.

After measurement, when powered by 7V, the current of the motor is 1.4A, and when powered by 5V, the current is 0.9A. The system is powered by a 7.2V dry battery, and the motor driver chip needs to be able to withstand a large current. Therefore, L298 is used as the motor drive, which can withstand a large enough current.

2.4 Detection light source circuit

The main principle of detecting the light source circuit is to detect the resistance change of the photoresistor, thereby causing the voltage change, and the single-chip microcomputer controls the rotation of the motor by identifying different voltage signals. This design also adopts the method of sleeve black tube to improve the accuracy.

The LM324 is used as a voltage comparator. The reverse input terminal of LM324 divides the voltage of the power supply in half through two equal resistors as the input voltage of the reverse input terminal. The principle of voltage division is also used at the same input terminal, and the upper terminal is connected to the photosensitive The lower end is connected to a 100K sliding varistor to adjust the sensitivity of the photoresistor. The circuit is shown in Figure 3.

Design of Point Light Source Tracking System Based on MSP430F149
Figure 3 Detection light source circuit

3 Control algorithm and software design

The system software is mainly divided into three parts: detection of light source, detection and display of current, and stepper motor control. The algorithm design also revolves around these three aspects.

3.1 Control algorithm

Use 4 photoresistors in the horizontal direction to find and track the light source, connect the photoresistor to the comparator in series with the sliding rheostat, and connect it to the input end of LM324. The single-chip microcomputer judges the specific position of the light source through the level change.

When no light is detected, both comparators output a low level, when one detects light, the output of the comparator connected to it becomes a high level, when both comparators output a high level , indicating that the light source is between two photoresistors at this time, the center of the light source has been detected at this time, and the control motor stops.

When the light source is tracking, it is realized by judging the state of the two comparators in the horizontal direction. When the output of the comparator on the left is high level and the output of the right side is low level, it indicates that the light source moves to the left and controls the stepper motor to move to the left. In the same way, the motor can be controlled to move to the right. When both comparator outputs are high, the light source is in the center and does not need to be moved. When both comparators output low level, no light source is detected, and the scan is re-scanned at this time.

When the laser pointer is aligned with the light source, the light source bracket is moved 60 cm along the straight line LM smoothly and slowly (within 15 seconds), the laser pointer can continuously track and point to the light source, and the decelerated stepper motor used in the system can subdivide a circle For 4096 steps, the distance traveled by each pulse is approximately:

Design of Point Light Source Tracking System Based on MSP430F149

Each pulse is stepped by 3.07 mm, enabling continuous tracking of the light source. To move the light source support along the straight line LM smoothly and slowly (within 15 seconds) for 60cm, the laser pointer can continuously track and point to the light source. When moving along the straight line, the vertical height of the light source will change. The vertical direction detection method is similar to the horizontal direction. Orientation detection tracking, thus enabling full in-plane tracking.

3.2 Software Design Flowchart

Design of Point Light Source Tracking System Based on MSP430F149
Figure 4 Flowchart of MCU 2
Design of Point Light Source Tracking System Based on MSP430F149
Figure 5 Flowchart of MCU 1

The Links:   LM150X08-TL03 EP4CE115F29I7N