PDA

View Full Version : To interafce a sensor with computer (urgent)



imr_gaurav
05-06-2006, 10:09 PM
hi friends, can anybody tell me how can i control a sensor from a computer ?

The sensor will give the output as voltage signals which i have to interpret by the computer and accordingly, recieve its signals.So, what way can i do it?

for eg. i am using LVDT, a displacement transducer to measure the displacements, so its voltage signals have to be read by the comp..Can anybody help me in this reard.

Thanks for the help.

Vivek
05-07-2006, 01:54 AM
You have 3 options -

(1) interface an ADC to the Parallel Port of the PC
Two simple and common ADC chips are ADC0808, & 0804
search google for ADC parallel port -
read parallel port tutorials on this site and articles by searching this site.
Many have done this kind of interfacing - I think Bibin John (Yogi) also (maybe) posted a code in this site...
or look at following examples -
http://users.frii.com/katana/PPGII.html (google result)
and also google for parallel port tutorial
also -http://www.bilkent.edu.tr/~kimukin/phys580-labview/adc%20-%20connection.doc
and so on


(2) use a microcontroller + circuit to read the sensor analog input and send the data to PC via serial or parallel port.
serial is a wise thing..
but this option (2) might be a little advanced for you, considering the time/know how required.
there are many microcontrollers with built-in ADCs.
search google -
one example - http://www.iguanalabs.com/adc2051.htm
though i suggest u find a PIC/AVR based solution similar to above so you just have 2 chips in your circuit


(3) Use the Analog input (mic-in) of your sound-card to read Analog signals of your sensor -
will require extensive software search, and manybe development -
- may not be as flexible solution as (1) or (2)
- and you will still require, elaborate signal condition circuit to meet Vin(voltage) requirement of sound card + protection circuits
moreover sound-cards are band-width limited, so DC signals would be blocked - so might not be good option for your sensor

PS: Please devote some time and energy in -
a) framing your questions correctly (it appears that you dont need to "Control" your sensor - but to read from it.)
if you do need to "control" it too, then you do need some output pins to control - then option 2 maybe better.

b) searching on google and this forum beforehand

imr_gaurav
05-07-2006, 02:48 AM
thanks Vivek for the help.

My query was rightly stated ie. i have to both read and control my sensor by computer, the LVDT that i am using in my work.

yogi
05-07-2006, 06:06 PM
Vivek had given the right answer

If you are using parallel port for reading analog voltage with ADC, then see my book on parallel port

MY EXPERIENCE ON PARALLEL PORT INTERFACING

2) if you are using microcontroller with in-built ADC.
See my book on AVR microcontroller where I had given examples to interface AVR with serial port of computer and using internal ADC of AVR.

You can get both of the books from yahoo group-booksbybibin
http://groups.yahoo.com/group/booksbybibin/

Bibin John
www.bibinjohn.tk

imr_gaurav
05-08-2006, 11:10 PM
thanks a lot yogi for the books at ur yahoo group.

but its still not clear how series port differs from parallel port , can u enlighten?

yogi
08-03-2006, 03:14 AM
serial port transmit in serial port. i.e, only one bit at a time. So if you want to do the sensor interfacing with serial port of computer then u should require a microcontroller which is having serial port. See this
http://booksbybibin.14.forumer.com/viewtopic.php?t=122

While parallel port is just like a D flipflop(an 8-bit d flipflop). Serial port has only one Data Transmit Pin and one Data Receive Pin. But a parallel port has 8 bits. Suppose if I send 0x55 to data port of parallel port then D0,D2,D4,D6=1 rest all are low.

Here is the code for ADC0804 interfacing.
http://booksbybibin.14.forumer.com/viewtopic.php?t=47

identify ur computer ports(serial and parallel)
http://booksbybibin.14.forumer.com/viewtopic.php?t=52

TEMPERATURE MEASUREMENT USING PARALLEL PORT(LM35+ADC)-http://booksbybibin.14.forumer.com/viewtopic.php?t=63

Bibin John
www.bibinjohn.tk