基于STM32的简易自动电阻测量仪(软件设计)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
宜宾职业技术学院
毕业设计
基于STM32的简易自动电阻测量仪(软件设计)
系部电子信息工程系
专业名称电子信息工程技术
班级电子1091班
姓名尹小东
学号 2 0 0 9 1 1 1 6 6
指导教师王伯黎
2011 年 11 月 10 日
摘要--------------------------------------------------- 2 1、方案论证与选择 --------------------------------------- 4
1.1核心控制芯片------------------------------------------------- 4 1.2档位切换模块------------------------------------------------- 4 1.3ADC采样电路------------------------------------------------- 5 1.4显示模块----------------------------------------------------- 5 1.5键盘控制电路------------------------------------------------- 5
2、系统设计 --------------------------------------------- 6
2.1系统总体思路------------------------------------------------- 6 2.2系统硬件模块设计--------------------------------------------- 7
2.2.1电源电路设计--------------------------------------------- 7
2.2.2恒压源电路设计------------------------------------------- 8
2.2.3档位切换电路设计----------------------------------------- 8
2.2.4电压跟随电路设计----------------------------------------- 9
2.2.5电机驱动电路设计---------------------------------------- 10 2.3软件设计---------------------------------------------------- 11
3、系统测试 -------------------------------------------- 12
4、设计总结 -------------------------------------------- 13 参考文献----------------------------------------------- 13 附录--------------------------------------------------- 14
附录1主要元件清单 --------------------------------------------- 14 附录2产品实物图片 --------------------------------------------- 14
本系统由闭环恒压源电路、闭环测量电路、电机驱动电路三大部分构成。其中一路DAC、恒压电路、电压跟随电路、一路12位ADC构成闭环恒压源电路;档位切换电路、电压跟随电路、虚拟触摸键盘、一路12位ADC构成闭环测量电路;L298N驱动电路、步进电机、4.7KΩ旋转式单圈电位器构成自动测量和显示电位器阻值随旋转角度变化曲线的辅助装置。
恒压源所输出的5V电压,通过档位切换电路,加到由TLC2202构成的电压跟随电路上输出来,送回单片机,经过单片机内部的一路12位ADC处理后,通过程序运算,得出被测电阻的阻值,并在3.2寸的TFT–LCD上显示出来。
单片机给驱动电路输入相应的指令,去控制步进电机,来旋转电位器得到不同的电阻值,通过已经做好的测量装置送给单片机处理后在屏幕上显示出阻值变化的曲线。
经测试,100Ω档时误差为0.08%,1KΩ档时误差为0.04%,10KΩ档时误差为0.07%,1MΩ档时误差为0.09%,电路具备自动换挡功能。通过键盘输入的要求的阻值和误差后,屏幕能显示出被测电阻阻值,并显示出该电阻是否符合筛选要求。电机旋转电位器所得到的阻值变化曲线,也能在屏幕上显示出来,精准度为0.09573%。全部测量符合要求。
关键词:闭环恒压;闭环测量;档位切换;自动测量
The system is composed of closed loop constant pressure source circuit, the closed-loop measurement circuit, drive circuit constitute three most of the motor. Among them all the way, constant pressure circuit, DAC voltage circuit, all the way with 12 of the closed loop constant pressure source ADC constitute circuit; The gear switching circuit, voltage followed circuit, virtual touch keyboard, and 12 of the ADC constitute a closed loop all measurement circuit; L298N drive circuit, step motor, 4.7 K Ω rotary lap potentiometer automatic measurement and display a potentiometer resistance curve with rotation Angle of auxiliary devices.
Constant pressure source output 5 V voltage, through the gear switching circuit, add to the TLC2202 consists of the following output voltage circuit, back to the microcontroller, single chip internal all the way after the treatment and 12 of the ADC, through the program operation, and concludes that the measured resistance of the resistance, and in 3.2 inch TFT-LCD displayed.
Single chip microcomputer to drive circuit input the corresponding instruction, to control the stepping motor, to rotate the potentiometer get different resistance, through the measurement device has been ready to deal with in single chip after showed on the screen of the curve of the resistance changes.
By test, 100 Ω file error is 0.08% when, 1 K Ω file error is 0.04% when, 10 K Ω file er ror is 0.07% when, 1 M Ω file error is 0.09% when, circuit with automatic shift function. Through the keyboard input requirements of the resistance and error, and the screen can show the measured resistance tolerance, and shows that the resistance is in accordance with the screening requirements. Motor rotation from the potentiometer resistance changes curve, also can be in the screen, the accuracy of 0.09573%. All measurements meets the requirement.
Keywords: closed loop constant pressure; The closed-loop measurement; Switch gear; Automatic measurement