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. 苹果笔记本MacBookPro 的新手使用技巧

    Mac 系统的桌面 Mac 的桌面是一个很炫的3D, 背景是一张“星空”图 Dock:  在桌面的下方,有一排图标, 这个叫Dock, 用来快速启动程序, 进入文件夹, 它同时还可以停靠正在运行的程序 ...

  2. Linux创建ftp并设置权限以及忘记ftp帐号(密码)修改

    忘记ftp密码修改方法: 1.登录服务器 cd  /etc/vsftpdcat ftpusers找到对应的ftp用户名 (如果用户名也忘记了 那么 cd /etc 然后cat passwd 查看用户和 ...

  3. openssh升级步骤

    1下载openssh最新版本 2 configure ./configure --prefix= /ssh先配置一下 再在本地安装. make &makeinstall 3 按照/ssh包含内 ...

  4. JS模块化规范AMD之RequireJS

    1.基本操作 加载 JavaScript 文件(入口文件) RequireJS以一个相对于baseUrl的地址来加载所有的代码 <script data-main="scripts/m ...

  5. IEEEXtreme 10.0 - Goldbach's Second Conjecture

    这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Goldbach's Second Conjecture 题目来源 第10届IEEE极限编程大赛 https ...

  6. Linux下rsync的用法

    一.rsync的概述 rsync是类unix系统下的数据镜像备份工具,从软件的命名上就可以看出来了——remote sync.rsync是Linux系统下的文件同步和数据传输工具,它采用“rsync” ...

  7. 04 java 基础:数据类型

    java 数据类型:基本类型与引用类型 基本类型:数值型,其中数值型分为整型.浮点型,整型包括 byte.short .int.long ,默认为 int 类型.浮点类型分为单精度.双精度,分为 fl ...

  8. 【交叉染色法判断二分图】Claw Decomposition UVA - 11396

    题目链接:https://cn.vjudge.net/contest/209473#problem/C 先谈一下二分图相关: 一个图是二分图的充分必要条件: 该图对应无向图的所有回路必定是偶环(构成该 ...

  9. C# 找出实现某个接口的所有类

    该方法只能找实现某个接口的类,不能找继承某个抽象类的子类 var types = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(a => ...

  10. 非洲top10人口大国2017年的人口、预期寿命、三大主粮进口量、92/08/17年的饥饿指数