Go to Post Result: 44 volts through the DAP-1522. NOT FUN. - DtD [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 05-06-2008, 22:23
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Get Resistance from Analog In?

The analog input measures voltage; your task is to create a voltage proportional to the unknown resistance.

This assumes you really want to measure resistance, as opposed to some physical phenomenon that the resistance represents (such as the position of something). If the latter, calibrate manually (One end reads "47" on the analog input, the other end reads "984", so midpoint would be around 468 or so).

One way is to create a voltage divider and feed it with a known fixed voltage. If your unknown resistance can be narrowed down to a range, the reference resistance can be about equal to half the maximum value. So, from the +5v source, you go through the unknown resistance, then the known (reference) resistance, and end at Ground. Sense the analog voltage between the two resistances...5 volts (1023 counts) means zero resistance, and 2.5 volts (511 counts) means equal to reference, and 5/3 volts (about 341 counts) means twice the reference.

Another way (if the range of unknown resistance is very high, or completely unknown) is to create a constant current source and measure the voltage across the resistor - R=V/I, and if I is known and V is measured (make sure it doesn't exceed the analog input range, 5 volts on a 2008 RC) you can calculate R.

Hope that gets you started...

Don
__________________

I am N2IRZ - What's your callsign?

Last edited by DonRotolo : 06-06-2008 at 20:23. Reason: I got Ohm's Law wrong... (Ouch)
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
get distance from cmucam ModMan24 Programming 14 29-10-2010 17:51
Selecting bits from an analog input Spencer E. Programming 2 13-01-2008 09:06
C code to get information from CMUcam2 lrantisi Programming 5 20-03-2007 18:16
Programming Analog Input from 2004 Controller Danny Diaz Programming 8 30-01-2007 22:44
Resistance to Analog Input Value. Josh Hambright Electrical 12 15-04-2003 16:12


All times are GMT -5. The time now is 00:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi