Home > Basic Circuits >Analog Circuits > Current source design based on AT89C51

Current source design based on AT89C51

Source: InternetPublisher:石榴姐 Keywords: Current source design power circuit Updated: 2023/11/03

 introduction

Constant current source is an important part of analog circuits, which can be used as bias, control or drive circuits. The traditional current mirror circuit changes the characteristics of the constant current source by adjusting the size of the bias resistor. Simply changing the size of the variable resistor manually is difficult to achieve precise control in some situations that require nonlinearity, high precision, and fast response, and it cannot be used in power consumption. strike a balance between performance and performance. In addition, traditional current sources are easily affected by factors such as temperature and power supply voltage. The use of microprocessors can overcome the above shortcomings, perform automatic control and manual monitoring, and greatly improve the accuracy and response speed of the system. This article introduces the constant current source circuit controlled by AT89C51, which has the advantages of simple external circuit, low interference, and low price. This system is a digital voltage-controlled current source that can achieve nonlinear control and has broad application prospects in automatic adjustment and precise control. System Overview

This system consists of a single-chip microcomputer, a small keyboard, a DAC, and a voltage-controlled current source. The ATMALAT89C51 chip is used in the design, which has 4 input and output ports, namely P0, P1, P2, and P3. The following only takes the P1 port as an example to illustrate the system principle. Input a value from 0 to 255 from the 4×4 small keyboard. The microcontroller gets the key code from the P0 port to identify it and convert it into a digital signal. It outputs the corresponding 8-bit control code at the P1 port and converts it into an analog signal through an 8-bit DAC. Voltage. This voltage then passes through the voltage-controlled current source to achieve constant current.

When the system requires higher accuracy, the control code can be latched by adding latches and analog switches, and a higher-digit DAC can be used.

  Basic hardware components

Design of Voltage Controlled Current Source

A linear power supply is used in the design, and the controlled source can be implemented with an operational amplifier, as shown in Figure 1. This current source is not affected by Vcc and Vee and maintains a good linear relationship even when Vcc and Vee are asymmetric.

 

 

 

In the circuit in Figure 1, the non-inverting terminal voltage U3 is equal to the inverting terminal voltage U2, then:

 

The total current I0 flowing through the load is:

 

Since R3R4+R5, R1=R2, finally we get:

    
 
The current Iout is a quantity independent of the load, and its magnitude depends on the input voltage Vin. It can be seen that it has controlled constant current characteristics.
The voltage controlled current source circuit has the following characteristics:

1. When Vin>Vcc, Vin has no control effect on the current source, which is determined by the inherent characteristics of the op amp itself. If you want to increase the adjustment range, you must increase the Vcc and Vee of the op amp.

2. The value of R5 is related to the current size, but it is not the linear relationship given by equation (4). When R5 decreases to a certain value (such as R5=50 Ω), the maximum current of the voltage-controlled constant current source reaches the maximum load current (when Vin=Vcc, Iout=Iout,max), and the dynamic range of Iout will become smaller. . Every time R5 is reduced by half, the dynamic range is reduced by half. When R5=0Ω, the current of the voltage-controlled constant current source is the maximum load current (Iout,max) and does not change with the input voltage Vin.

3. R1 affects the initial current of the constant current source (that is, when Vin=0V). When R1=1MΩ, the initial current is 0mA; R1=1.6MΩ, the initial current is 6.2mA; when R1=1.9MΩ, the initial current is 6.2mA. The current is 14.2mA. Therefore, in order to avoid zero drift, R1 should be around 1MΩ.

4. R4 also affects the size of the initial current. When R4>1MΩ, R1 plays the main regulatory role.

5. The change of R3 affects the adjustment range. For example, when R3=300KΩ, the adjustable voltage is 5V~10V.

The current size of the triode VCCS is directly related to the operating bias voltage. When Vcc changes, the current flowing into the load resistor will change accordingly, and its output resistance will be smaller. These factors make the operating characteristics of VCCS worse. Since the volt-ampere characteristics of each triode are not exactly the same, and their amplification factor β is not exactly the same, the parameters of the triode will also change with temperature, resulting in a greater difference in the final constant current characteristics. In addition, when the current is relatively large, the power consumption of the triode is very large, making the circuit inefficient and easily burning out the triode.

This system uses an operational amplifier to build a VCCS. Since the operational amplifier has a differential pair input, it can suppress common-mode signals and has a good suppression effect on temperature drift, which is beneficial to reducing interference. In addition, the operating current of the constant current source has nothing to do with Vcc and Vee, but is only related to the resistance of the resistor that forms the feedback with it. The difference in amplification of the operational amplifier will not affect its final constant current characteristics and has good stability.


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号