Current source design based on AT89C51

Publisher:数据小巨人Latest update time:2023-10-04 Source: elecfansKeywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Current source design based on AT89C51

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

Current source design based on AT89C51

The total current I0 flowing through the load is:

Current source design based on AT89C51

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

Current source design based on AT89C51


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 working 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.


Keywords:AT89C51 Reference address:Current source design based on AT89C51

Previous article:51 Microcontroller Programming Development (1) C Language Basics 1
Next article:How to use Keil to verify how many bytes a microcontroller variable occupies

Recommended ReadingLatest update time:2024-11-23 18:07

AT89C51 single-chip microcomputer water lamp C language program and detailed explanation (literacy tutorial)
AT89C51 microcontroller is a microcontroller that we must learn when we study microcontrollers. It is also a textbook for microcontrollers. The following is a method for writing a running light that is suitable for beginners. First, draw a simulation diagram in proteus to facilitate the simulation program Let's wr
[Microcontroller]
AT89C51 single-chip microcomputer water lamp C language program and detailed explanation (literacy tutorial)
Design of a fast charger for electric bicycle based on AT89C51
1. Introduction Electric bicycles are favored by many users because of their pollution-free, noise-free, light and beautiful features. However, their limitations are also exposed in use, such as the battery running out halfway, and the battery life will gradually shorten as the use time increases. This paper a
[Power Management]
Design of a fast charger for electric bicycle based on AT89C51
Design of MP3 Solution Based on Single Chip Microcomputer AT89C51SND1C
As people's requirements for portable music players increase, MP3 players have won the favor of music lovers with their small size and good sound quality. At first, MP3 files could only be played by computers. With the development of the Internet, MP3 players were produced. With people's further understanding of MP3
[Microcontroller]
Design of MP3 Solution Based on Single Chip Microcomputer AT89C51SND1C
Design of CAN Bus Intelligent Node Based on AT89C51 Single Chip Microcomputer
Controller Area Network (CAN) is a fieldbus with international standards and high cost performance. CAN was first introduced by Bosch in 1986 and is a multi-host local network originally used for communication of modern automotive microcontrollers to achieve information exchange between various electronic control de
[Microcontroller]
Design of CAN Bus Intelligent Node Based on AT89C51 Single Chip Microcomputer
How to modify the AT89C51 programmer with RTL8139
  I wanted to play with 89C51, but I didn’t have a programmer, so I wanted to make my own programmer. I found a lot of self-made information. Most of them used 89C51 for control logic, which required a programmer to make. The circuits are generally more complicated (the most ez ones also require 30 components), and th
[Microcontroller]
How to modify the AT89C51 programmer with RTL8139
Design and Principle Analysis of Remote Control Alarm System Based on AT89c51 Single Chip Microcomputer
1 Introduction      Due to the rapid economic development, people's living standards have been greatly improved, and the pace of life is getting faster and faster. Therefore, home appliance remote control and family safety are also needed and valued by people. The remote control and alarm device of electrical applianc
[Microcontroller]
Design and Principle Analysis of Remote Control Alarm System Based on AT89c51 Single Chip Microcomputer
C source program of frequency meter based on AT89C51 single chip microcomputer and main functions of frequency meter
    This article is a C source program for a frequency meter based on the AT89C51 microcontroller. The main functions of this frequency meter are as follows:       1. Test functionality       It indicates all the test functions of the digital frequency meter, generally including frequency measurement, period , cumu
[Microcontroller]
C source program of frequency meter based on AT89C51 single chip microcomputer and main functions of frequency meter
AT89C51 instant water heater program
Instantaneous water heater program MCU AT89C51 XAL 12MHz //#pragma SRC  #include reg51.h   #include intrins.h   #include math.h   void delay(unsigned int); //Delay function void display(void); //display functionunsigned  char keysCAN(void); //key scan processing functionvoid  heatCTRl(void); //heating control function
[Microcontroller]

Recommended posts

What does the clamp circuit in a charge pump mean?
Thepicturebelowshowsthechargepumpcircuitinachip.VSistheinputvoltageofthechip,andVCPisthechargepumpoutputpin.WhatdoestheClampinCirruitmean?Idon'tquiteunderstand. WhatistheVSvoltage?WhatistheVCPvol
小太阳yy Switching Power Supply Study Group
DS660 not only supports SWP interface, but also supports NFC multi-protocol
TherehasbeensomethingnewintheNFCfieldrecently.Inordertopromotethedeeperdevelopmentofthenationaldigitalcurrency,DS660notonlyintegratesmultipleNFCprotocols,butalsosupportstheSWPinterface(SIMcard),directlyblocki
15816861002 RF/Wirelessly
OMRON EE-SPX613 working principle and action signal indicator
Ihavejustpurchasedanewdevice,whichcontainsaliquidlevelsensorofOMRONEE-SPX613.Idon'tunderstandwhetherthesensorisintheonoroffstatewhenthesignalindicatorlightisonoroff;andwhatistheminimumlightintensityrequir
UUC Sensor
How to send and receive FPGA data in the general mode of TM4c129 EPI bus
Thespecificconfigurationoftm4c129EPIbusgeneralmodeisasfollows: voidEPI_Init() { SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);//使能EPI模块 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); SysCtlPeripheralEnable(SYSCTL_PERIPH_
wzllonglong Microcontroller MCU
"The Great Chip" Reading Activity 5 New Materials
Intheever-evolvingchipindustry,carbon-basedchipsbasedoncarbonmaterialssuchascarbonnanotubesandgrapheneareincreasinglyattractingattention.Carbon-basedchipsrefertochipsmadewithcarbonmaterialsasthesubstrate.Thesecarbon
还没吃饭 Integrated technical exchanges
The last episode of the Q&A series on "Time Analysis of Embedded Software": Functional Safety, ISO 26262 and Prospects
Spreadtheflowers,thisistheendofthebook.Let'stakealookatthelastfewpagesandseewhatyouwanttodiscuss~ Dearreadersof"TimeAnalysisofEmbeddedSoftware"(@luyism,@changjianze1,@digitalxiaoye,@hehung,@qinyunti
nmg Automotive Electronics
Latest Microcontroller Articles
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号