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

Figure 1 illustrates a circuit for resistance measurement. The circuit uses an eight-pin AVR microcontroller, a Tiny13V from Atmel, 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 (Figure 2).

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 Figure 1), 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 software UART program and the program for measuring resistance are available.

Microcontroller measures resistance without an ADC的更多相关文章

  1. [转]A Guide To using IMU (Accelerometer and Gyroscope Devices) in Embedded Applications.

    原文地址http://www.starlino.com/imu_guide.html Introduction There’s now a FRENCH translation of this art ...

  2. Create a DAC from a microcontroller's ADC

    Few microcontrollers include a DAC. Although you can easily find an inexpensive DAC to control from ...

  3. ADC分类及参数

    ADC分类 直接转换模拟数字转换器(Direct-conversion ADC),或称Flash模拟数字转换器(Flash ADC) 循续渐近式模拟数字转换器(Successive approxima ...

  4. USB ISP(ICSP) Open Programmer < PWM ADC HV PID >

    http://sourceforge.net/projects/openprogrammer/?source=navbar Open Programmer http://openprog.alterv ...

  5. Voltage Translation for Analog to Digital Interface ADC

    Voltage Translation for Analog to Digital Interface 孕龙逻辑分析仪 ZeroPlus Logic Analyzer How to modify an ...

  6. ADC and DAC Analog Filters for Data Conversion

    Figure 3-7 shows a block diagram of a DSP system, as the sampling theorem dictates it should be. Bef ...

  7. Driving proportional valves from microcontroller

    Driving proportional valves from microcontroller I am looking to drive a current regulated proportio ...

  8. AN2820 Driving bipolar stepper motors using a medium-density STM32F103xx microcontroller

    AN2820 Driving bipolar stepper motors using a medium-density STM32F103xx microcontroller Introductio ...

  9. PID DC/DC Converter Controller Using a PICmicro Microcontroller

    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011794 ...

随机推荐

  1. Firefox缓存文件夹位置设置及清除缓存方法

    地址栏敲入: about:config, 新建一个"browser.cache.disk.parent_directory", 并设置为你要的缓存文件夹, 例如:  "F ...

  2. LightOJ 1414 February 29(闰年统计+容斥原理)

    题目链接:https://vjudge.net/contest/28079#problem/R 题目大意:给你分别给你两个日期(第二个日期大于等于第一个日期),闰年的2月29日称为闰日,让你求两个日期 ...

  3. 当想把html element里面的text提取出来可以试着用正则

    var a='123<span>456</span><span class="active">789</span>'; a.repl ...

  4. python基础(12)--初识Socket

    socket: 网络上的两个程序通过一个双向的通信连接实现数据的交换,这个连接的一端称为一个socket. Socket的英文原义是“孔”或“插座”.作为BSD UNIX的进程通信机制,取后一种意思. ...

  5. Linux下突然不识别无线网卡

    昨天还能用wifi的Linux,今天进去后发现没有了wifi的图标,ifconfig也不显示无线网卡.怎么办? 出现这种情况,肯定是上次关机之前做了一些操作导致的.我遇到过的一个情况是:Fedora2 ...

  6. Eclipse的SVN插件与本地SVN客户端关联不上

    问题:当我们用SVN客户端把代码更新到本地,并导入到eclipse之后,却发现我们的SVN插件并没有起作用(没有代码入库.修改等小图标的显示,也没有check in,update等功能菜单).如果我们 ...

  7. BOM知识整理

    1.窗口位置: 1-1.window,screenLeft获取窗口距离屏幕左边的距离 1-2.window.screenTop获取窗口距离屏幕顶端的距离 1-3.window.screenX和wind ...

  8. Python并发编程-线程锁

    互斥锁-Lock #多线程中虽然有GIL,但是还是有可能产生数据不安全,故还需加锁 from threading import Lock, Thread #互斥锁 import time def ea ...

  9. LongAdder & AtomicInteger

    JDK8 推荐  LongAdder替代 AtomicInteger, AtomicInteger内部是实现使用 (网友使用jad反编译源码 参考 http://ifeve.com/enhanced- ...

  10. DP 题集 1

    关于 DP 的一些题目 参考资料 [Tutorial] Non-trivial DP Tricks and Techniques DP Rain and Umbrellas Mr. Kitayuta, ...