Design of digital optical power meter based on ATmega16

Publisher:睿智之光Latest update time:2011-04-11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
Digital optical power meter is a portable instrument controlled by a single-chip microcomputer that can measure the strength of optical signals. It is an important instrument used in laying fiber-optic communication trunk lines, equipment maintenance, scientific research and production. However, traditional optical power meters have problems such as low measurement accuracy, narrow measurement range and poor portability. In view of this situation, a universal portable optical power meter controlled by an AVR single-chip microcomputer has been developed. It has the characteristics of automatic range conversion, high measurement accuracy, strong versatility and easy portability. It is very suitable for use in the fields of optical information and optical communication.

1 System Principle
Optical power is the work done by light per unit time. The digital optical power meter consists of a microprocessor, a photodetector, an I/V converter, automatic range conversion, an A/D converter, a liquid crystal display and other parts. Its system principle is shown in Figure 1.


The microprocessor uses the AVR series ATmega16 microcontroller, which is a low-power 8-bit CMOS microcontroller based on the enhanced AVR RISC structure. In terms of peripherals, it has a programmable UART and a watchdog timer independent of the on-chip oscillator and other resources, supports the SPI interface, and allows ATmega16 to perform high-speed synchronous data transmission with other peripherals or AVR microcontrollers.
The system uses silicon photocells as photodetectors, which are designed to convert light energy incident on its surface into electrical energy. Therefore, they can be used as photodetectors and photocells and are widely used as detectors for laboratory and field portable instruments. In this system, silicon photocells work in a zero-bias state.
The automatic range conversion part is completed by an operational amplifier and a multi-way selector switch CD4051. The feedback signal selects different ranges through CD4051, and performs automatic range conversion to output a suitable voltage signal.
The data acquisition part converts the analog voltage signal into a digital signal through the 16-bit precision A/D converter AD7705. The data is converted into optical power data after being processed by the AVR microcontroller ATmega16 and displayed on the 1602 LCD screen.
The digital optical power meter designed in this paper uses ATmega16 to control the overall operation of the system. Silicon photocells are used as photoelectric sensors, LM324 is used to amplify the signal, and the analog signal is converted into a digital signal through the 16-bit precision A/D converter AD7705. The signal feedback of the rough measurement data can enable the microcontroller to control CD4051 to select different ranges, so as to reselect the range and perform A/D conversion. Finally, the size of the optical power is displayed using a 1602 LCD.

2 Automatic range conversion
Achieve high-precision measurement. It is generally achieved by controlling the attenuation/amplification of the input signal. As far as the optical power meter is concerned, the input signal is generally small, so its range switching is basically the switching of the amplification factor. In this system, the automatic range conversion is mainly composed of the multi-channel switch CD4051 and the integrated operational amplifier LM324. The connection diagram of the two is shown in Figure 2.


CD4051 is a single 8-channel digitally controlled analog electronic switch with 3 binary control inputs A, B, C and INH inputs. 3 binary signals select one of the 8 channels and can connect the input to the output.
The data collected by the front end is converted into digital signals through the 16-bit precision A/D converter AD7705. The signal feedback of the rough measurement data can enable the PB4 and PB3 pins of the microcontroller to control CD4051 to select 4 different channels, corresponding to the multiples of different methods, to reselect the appropriate range and output the appropriate voltage signal for A/D conversion.

3 Data acquisition
Data acquisition is completed using the 16 b A/D converter device AD7705 (see Figure 3). AD7705 is a low-power 16-bit analog/digital converter launched by AD Company, suitable for measuring low-frequency analog signals. It is characterized by low power consumption, high precision, wide dynamic range, self-calibration, and is very suitable for industrial control and scientific research applications. Because it uses the SPI interface, it occupies fewer pins, so it is also convenient to control. The voltage signal collected by AD7705 communicates with ATmega16 through SPI interface to transmit data. ATmega16 acts as the host to control AD7705, and the I/O port resources used are MOSI, MOSI, SCK, SS and AD7705 communication. The analog voltage is converted into a digital signal, which is converted into optical power data after being processed by ATmega16 and displayed on the 1602 LCD screen.



4 Software Structure
ATmega16 controls the whole system. The channel selection of CD4051 is controlled by PB4 and PB3 states; AD7705 is operated and data is obtained through the SPI port; the display of 1602 LCD is controlled by writing commands and writing data. The software flow of the whole system is shown in Figure 4.
The range of this system is set to 4 levels, and the adjacent maximum voltage values ​​are 2 times. First, set the maximum range level, that is, select the first level for data sampling. If the sampling value is less than 128, select the fourth level for further amplification and conversion; when the sampling value is greater than 128 and less than 256, select the third level for amplification and conversion; when the sampling value is greater than 256 and less than 512, select the second level for amplification and conversion; when the sampling value is greater than 512 and less than 1 024, select the first level for amplification and conversion.

5 Data Analysis
The optical power meter was calibrated by the laboratory standard optical power meter. In order to reduce the error and correct the linearity of the system, the piecewise function method was used in data processing. It is mainly divided into 3 sections, and different correction coefficients are used in different stages. Table 1 is a system data comparison table. The standard in the table refers to the standard optical power meter, and the measured refers to the test optical power meter, and the unit is mW. It can be seen from the data that the error is small and can meet the general experimental needs of the laboratory.



6 Conclusion
This paper proposes a digital optical power meter system implementation scheme based on ATmega16. The analog/digital conversion element used is AD7705 analog-to-digital converter from AD company. The paper introduces the functions and specific implementation of automatic range conversion and data acquisition system in detail. The optical power meter has been used in the optoelectronic experiment teaching of this major as an auxiliary measuring instrument with good results.

Reference address:Design of digital optical power meter based on ATmega16

Previous article:High-precision digital control system for DC motor based on AVR
Next article:Design of bell ringer based on ATmage8

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号