当前位置:网站首页>Measure the voltage with analog input (taking Arduino as an example, the range is about 1KV)
Measure the voltage with analog input (taking Arduino as an example, the range is about 1KV)
2022-07-08 01:14:00 【Silicon organism】
Statement : I am a freshman majoring in Vehicle Engineering , The technical level of posting is not high , And this method has long been shared , This post only shares one experience , Please do not carry out some dangerous operations according to the content of this post , In case of accident , Nothing to do with me !
Premise of instructions :
arduino Of A0、A1、、 The waiting port is the analog signal input port ,arduino The board is measured A0 The potential of the mouth A0 Port data , The range of pressure measurement is 0~5V, The resulting value is 0~1023. When measuring potential with analog input , The negative pole of the tested object shall be connected with GND Connect , Otherwise, it cannot be measured , And a series of wrong values are generated due to floating .
The core idea :
1、arduino Read voltage function of analog input .
2、 Resistance partial voltage of series resistor .
3、 The analog input value is calculated to obtain the voltage value .
example :
The left side is the serial port monitor output value , On the right is the measured value of voltmeter .
The design of this example is 0~1030V Measuring circuit of measuring range .
Circuit diagram :
Just look at the picture on the left , The right side is a little messy .
Because the resistance is often not as accurate as the value measured by the mark or multimeter , therefore , The design of the circuit should be flexible . We can connect a variable resistor in series on the circuit to adjust the test accuracy . There is another way to adjust the accuracy , That is, modify some parameters in the calculation program , The value in this example has been debugged like this .
About the choice of variable resistance , Total value of personal suggestions 10k Ohmic , At the time of calculation , It can be calculated by making the large partial voltage resistance take a value slightly smaller than the actual value , After that, it is compensated by sliding rheostat . such as 47k resistance , Value for 45k Calculate , If it is not enough, it can be compensated by adjusting the value resistance .
Calculation :
We know that the resistance partial voltage ratio of the series resistance is directly proportional to the resistance specific range , So we can calculate our original 5v How many times has the range been enlarged .
Be careful : We mentioned earlier that the resistance of electronic components is not completely accurate , So there is a problem in the value of resistance , Subsequently, the variable resistance and adjustment value will be used to calibrate , So this is a rough calculation .
Program :
If only one voltage is measured , The procedure is very simple , But when designing other projects , If you want to measure the voltage somewhere , This method can be used .
void setup() {
pinMode(A0,INPUT); // Make A0 For analog input
Serial.begin(9600);
}
void loop() {
int i =analogRead(A0); // Make A0 Port readout voltage , But this is 0~1023 The number of .
float V=0.00;
Serial.print(" i=");
Serial.print(i); // Efferent i Size .
V=i*(5.00/1023.00)*206.00; //206.00 Is the magnification of the test voltage ( Adjust according to the actual situation , The original number is 205.55)
Serial.print(" V="); Serial.println(V); // Outgoing voltage V Size
delay(100);
}
This procedure will A0 Oral value i And the final calculation result V Output to computer , among i*(5.00/1023.00) It's to make A0 Mouth measured 0~1023 The number of becomes the actual measured voltage ( This operation can also be used map Function mapping implementation ). after , Multiply 206.00( Magnification ) You can get the voltage at the pressure measuring end V.
calibration :
It is also mentioned repeatedly above , We leave elastic space in circuit design . Here is a brief description of the specific operation :
1, Using variable resistance . After connecting the circuit , Adjust the variable resistance to 0, Then the pressure measuring end is connected to the measured object , At the same time, the measured object is connected to a finished voltmeter ,arduino Connecting to a computer , And turn on the serial monitor . Observe the value of the finished voltmeter and the... Returned from the serial port monitor V value . Adjust the variable resistance repeatedly , Until the two readings are basically consistent . Try more groups .
2,( It's not necessary ) If the adjustment through variable resistance is still not calibrated , You can modify the multiple we calculated above .
Final , We can make arduino Calculate the exact value , however , Definitely not 100% accurate . The following figure shows some of my pressure measurement results .
The first group
The second group
The third group
边栏推荐
- Scheme selection and scheme design of multifunctional docking station for type C to VGA HDMI audio and video launched by ange in Taiwan | scheme selection and scheme explanation of usb-c to VGA HDMI c
- letcode43:字符串相乘
- [necessary for R & D personnel] how to make your own dataset and display it.
- Marubeni official website applet configuration tutorial is coming (with detailed steps)
- The combination of relay and led small night light realizes the control of small night light cycle on and off
- On the concept and application of filtering in radar signal processing
- What does interface testing test?
- Several frequently used OCR document scanning tools | no watermark | avoid IQ tax
- 英雄联盟胜负预测--简易肯德基上校
- Continued from the previous design
猜你喜欢
Know how to get the traffic password
Chapter VIII integrated learning
y59.第三章 Kubernetes从入门到精通 -- 持续集成与部署(三二)
letcode43:字符串相乘
6.Dropout应用
Cve-2022-28346: Django SQL injection vulnerability
10.CNN应用于手写数字识别
Complete model training routine
Led serial communication
Recommend a document management tool mendely Reference Manager
随机推荐
Y59. Chapter III kubernetes from entry to proficiency - continuous integration and deployment (III, II)
133. 克隆图
Multi purpose signal modulation generation system based on environmental optical signal detection and user-defined signal rules
[go record] start go language from scratch -- make an oscilloscope with go language (I) go language foundation
1. Linear regression
AI zhetianchuan ml novice decision tree
4.交叉熵
Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description
Capstone/cs5210 chip | cs5210 design scheme | cs5210 design data
[deep learning] AI one click to change the sky
Ag9310 for type-C docking station scheme circuit design method | ag9310 for type-C audio and video converter scheme circuit design reference
Share a latex online editor | with latex common templates
2.非线性回归
11. Recurrent neural network RNN
9. Introduction to convolutional neural network
13.模型的保存和載入
1.线性回归
Analysis of 8 classic C language pointer written test questions
3.MNIST数据集分类
FOFA-攻防挑战记录