電學(xué)中的測(cè)量技術(shù)涉及范圍非常廣,電流測(cè)量在電學(xué)計(jì)量中占有非常重要的位置。如何精確地進(jìn)行電流測(cè)量是精密測(cè)量的一大難題。傳統(tǒng)的電流檢測(cè)電路多采用運(yùn)算放大芯片與片外電流檢測(cè)電路相結(jié)合的方式,電路集成度很低,需要較多的接口和資源才能完成對(duì)電路的檢測(cè)。本文把所有電路部分都集成在一塊芯片上,包括檢測(cè)電阻,運(yùn)算放大器電路及模擬轉(zhuǎn)數(shù)字轉(zhuǎn)換電路,從而在電路內(nèi)部可以進(jìn)行電流檢測(cè),使電路更好的集成化。前置電路使用二級(jí)共源共柵結(jié)構(gòu)的運(yùn)算放大器,減小溝道長(zhǎng)度調(diào)制效應(yīng)造成的電流誤差。10位SAR ADC中采用電容驅(qū)動(dòng)能力強(qiáng)的傳輸門(mén)保證了模數(shù)轉(zhuǎn)化器的有效精度。比較器模塊采用再生鎖存器與遲滯比較器作為基礎(chǔ)單元組合解決精密測(cè)量的問(wèn)題。本設(shè)計(jì)可以作為嵌入芯片內(nèi)的一小部分而檢測(cè)芯片中的微小電流1mA~100mA,工作電壓在1.8v左右,電流檢測(cè)精度預(yù)期達(dá)到10uA的需求。The measurement technology in electricity involves a wide range,and current measurement plays a very important position in electrical measurement.How to accurately measure current is a big problem in precision measurement. The traditional current detecting circuit adopts the combination of the operational amplifier chip and theoff-chip current detecting circuit, The circuit integration is very low, and more interfaces and resources are needed tocomplete the circuit detection.This topic integrates all the circuit parts into one chip, including detection resistance, operational amplifier circuit andanalog to digital conversion circuit. Highly integrated circuit makes the external resources on the chip more intensive,so that current detection can be carried out inside the circuit, so that the circuit can be better integrated. Thefront-end circuit of this project uses two-stage cascade operational amplifier and cascade tube to reduce the currenterror caused by channel length modulation effect. In 10-bit SAR ADC, the transmission gate with strong capacitivedriving ability ensures the effective accuracy of the analog-to-digital converter. Comparator module uses regenerativelatch and hysteresis comparator as basic unit to solve the difficult problem of precision measurement. This topic can beused as a small part of the embedded chip to detect the micro-current in the chip 1 mA~100 mA, the working voltageis about 1.8v, and the current detection accuracy is expected to reach the requirement of 10 uA.
標(biāo)簽:
電流檢測(cè)
電路
運(yùn)算放大器
adc
上傳時(shí)間:
2022-04-03
上傳用戶:
電路連接
由于數(shù)碼管品種多樣,還有共陰共陽(yáng)的,下面我們使用一個(gè)數(shù)碼管段碼生成器(在文章結(jié)尾) 去解決不同數(shù)碼管的問(wèn)題:
本例作者利用手頭現(xiàn)有的一位不知品牌的共陽(yáng)數(shù)碼管:型號(hào)D5611 A/B,在Eagle 找了一個(gè) 類(lèi)似的型號(hào)SA56-11,引腳功能一樣可以直接代換。所以下面電路圖使用SA56-11 做引腳說(shuō)明。
注意:
1. 將數(shù)碼管的a~g 段,分別接到Arduino 的D0~D6 上面。如果你手上的數(shù)碼管未知的話,可以通過(guò)通電測(cè)量它哪個(gè)引腳對(duì)應(yīng)哪個(gè)字段,然后找出a~g 即可。
2. 分清共陰還是共陽(yáng)。共陰的話,接220Ω電阻到電源負(fù)極;共陽(yáng)的話,接220Ω電阻到電源+5v。
3. 220Ω電阻視數(shù)碼管實(shí)際工作亮度與手頭現(xiàn)有原件而定,不一定需要準(zhǔn)確。
4. 按下按鈕即停。
源代碼
由于我是按照段碼生成器默認(rèn)接法接的,所以不用修改段碼生成器了,直接在段碼生成器選擇共陽(yáng)極,再按“自動(dòng)”生成數(shù)組就搞定。
下面是源代碼,由于偷懶不用寫(xiě)循環(huán),使用了部分AVR 語(yǔ)句。
PORTD 這個(gè)是AVR 的端口輸出控制語(yǔ)句,8 位對(duì)應(yīng)D7~D0,PORTD=00001001 就是D3 和D0 是高電平。
PORTD = a;就是找出相應(yīng)的段碼輸出到D7~D0。
DDRD 這個(gè)是AVR 語(yǔ)句中控制引腳作為輸出/輸入的語(yǔ)句。DDRD = 0xFF;就是D0~D7 全部
作為輸出腳了。
ARDUINO CODECOPY
/*
Arduino 單數(shù)碼管骰子
Ansifa 2011-12-28
*/
//定義段碼表,表中十個(gè)元素由LED 段碼生成器生成,選擇了共陽(yáng)極。
inta[10] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90};
voidsetup()
{
DDRD = 0xFF; //AVR 定義PortD 的低七位全部用作輸出使用。即0xFF=B11111111對(duì)
應(yīng)D7~D0
pinMode(12, INPUT); //D12用來(lái)做骰子暫停的開(kāi)關(guān)
}
voidloop()
{
for(int i = 0; i < 10; i++)
{
//將段碼輸出PortD 的低7位,即Arduino 的引腳D0~D6,這樣需要取出PORTD 最高位,即
D7的狀態(tài),與段碼相加,之后再輸出。
PORTD = a[i];
delay(50); //延時(shí)50ms
while(digitalRead(12)) {} //如果D12引腳高電平,則在此死循環(huán),暫停LED 跑
動(dòng)
}
}
標(biāo)簽:
Arduino
10
數(shù)碼管
實(shí)驗(yàn)
上傳時(shí)間:
2013-10-15
上傳用戶:baitouyu