博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Microcontroller measures resistance without an ADC
阅读量:7111 次
发布时间:2019-06-28

本文共 2103 字,大约阅读时间需要 7 分钟。

Sensors automate most of the processes in industry. Most of these sensors, such as those for ammonia gas, temperature, and the like, are resistive devices in which electrical resistance changes—mostly nonlinearly—as the surrounding conditions change. The sensors’ resistances may vary from 1 mΩ to 10 MΩ. 

 illustrates a circuit for resistance measurement. The circuit uses an eight-pin AVR microcontroller, a Tiny13V from , for the controller. The Tiny13V works over a supply-voltage range of 1.8 to 5.5V.

This design implements an equivalent oscillator based on the principle of an astable multivibrator in the Tiny13 ().

The oscillator has no stable states, and the signal keeps oscillating between two quasistable states. This oscillator produces a frequency that depends on the value of the resistor. As resistance increases, frequency decreases, and you can easily measure this frequency to yield the value of the resistance.

The resistance you want to measure connects between any two general-purpose I/O pins of the microcontroller, and a capacitor, C1, of known value connects across the other general-purpose I/O pin. Note that PB0 and PB1 are always in different states to implement a NOT gate. PB2 measures a high or a low across resistor R1.

Initially, PB0 is high, PB1 is low, and there is a high-impedance state at PB2. As a result, the capacitor starts charging with time-constant RC. Note that the capacitor initially acts as a short, and PB2 senses a high. As the capacitor charges, the voltage across the resistor decreases, and, when PB2 detects a low, PB1 goes high and PB0 goes low.

Next, as the capacitor discharges, the potential across the resistor builds up, and, when PB2 detects a high, PB0 goes high and PB1 goes low. In this fashion, measuring the frequency or half the number of toggles of PB0 in a second gives an inverse relation of resistance, R1 (in ), with frequency, f: R1=k/f, where k is a proportionality constant. The result travels to a PC through a serial RS-232 interface. Because the Tiny13 has no UART, a  and the program for measuring resistance are available.

转载地址:http://oilhl.baihongyu.com/

你可能感兴趣的文章
Eclipse中使用javap运行配置详解
查看>>
Android应用Design Support Library完全使用实例
查看>>
java历史集合类对比
查看>>
每天一个linux命令(34):kill命令
查看>>
记录sql语句的执行记录,用于分析
查看>>
HDU--3829--Cat VS Dog【最大点独立集】
查看>>
第十一章 非对称加密算法--DH
查看>>
特级教师总结的教育之33条(ZZ)
查看>>
AESwithJCE http://www.coderanch.com/how-to/content/AES_v1.html
查看>>
基于keepalived搭建MySQL的高可用集群
查看>>
linux磁盘空间查询
查看>>
autofs自动挂载
查看>>
手把手教你DIY一个春运迁徙图(一)
查看>>
mysql编码问题
查看>>
Python split()方法
查看>>
arcgis api for js入门开发系列九热力图效果
查看>>
BZOJ 2716: [Violet 3]天使玩偶 [CDQ分治]
查看>>
Python如何输出包含在对象中的中文字符?
查看>>
.NET Core项目从xproj+project.json向csproj迁移简介
查看>>
Tomcat指定特定JDK版本
查看>>