Can a COM port be used as a voltmeter?

Eteq

Member
Nov 11, 2000
43
0
0
Is it possible to use a regular serial port on a computer to read or transmit specific voltages? It's easy enough to set it to "on" or "off" (+/- 12 V), but I'm wondering if there's a way to directly read the voltage on the pins...?
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
Probably not. I doubt your OS has access to anything but the on/off states. Your sound input jacks, though...
 

f95toli

Golden Member
Nov 21, 2002
1,547
0
0
No, the COM ports are digital so there is no way to directly read a voltage.
But, Matthias99 pointed out you can use your spundcard.
 

PottedMeat

Lifer
Apr 17, 2002
12,365
475
126
but arent a soundcard's outputs AC coupled? so no DC voltage readings?

for a COM port you will need to use an A/D converter and something to format the output data into RS232 format like a MCU
 

Fandu

Golden Member
Oct 9, 1999
1,341
0
0
Why not just use a simple RC circuit? Tie the cap to a digital input and you have a simple ADC. It works because you know the time constant of the RC network, and you know (or can find out) the signaling voltage your com port needs, so measure the time from applying the analog signal to the time you read a change on your data pin and voila, you know the analog voltage.
 

huillam

Junior Member
Jun 17, 2004
16
0
0
If you were to use an RC circuit, wouldn't you need a separate "sync" signal to tell the machine when the input voltage was applied?

Also, I'm not sure how you could measure a voltage that was LESS than the threshold voltage for the data pin.
 

Fandu

Golden Member
Oct 9, 1999
1,341
0
0
Yea, you would need to sync it somehow, that's not terribly difficult though. You do have, what, 4? data lines to use with serial.

To measure voltages under the threshold, hmmm. I'm sure there is a simple way to do it, but I'm not coming up with any bulletproof ideas off the top of my head. I guess it would depend on what types of signals your trying to measure.

The RC idea came from someone (I think it was Hazer) over at BitTech using it on a PIC. He had pretty good results with the PIC, so I don't see why you couldn't do it with a serial port too.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
14
81
You could use an RC circuit - use a transistor driven by one of the serial port lines to short out the transistor.

The software switches off the transistor, then polls the input pin to see when it triggers. The time taken is the value.

Very crude, but for the cost of 3 components, it may well work - of course, serial ports work on + and - 12 V, but who knows where the threshold is. 0V, 3V, 5V, 10V ? Could be any of them, and is relatively unlikely to be the same from one model to the next.
 

Eteq

Member
Nov 11, 2000
43
0
0
I'm pretty sure its specified in the standard that the threshold is ~3V - you're right it's probably +/- 0.5 V or so, but the threshold should be around 3...
 

Mark R

Diamond Member
Oct 9, 1999
8,513
14
81
Originally posted by: glugglug
The microphone input IS a voltmeter.

Except it is AC coupled, so can only measure AC voltages.

DC will always measure as 0.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,284
3,905
75
Originally posted by: Mark R
Originally posted by: glugglug
The microphone input IS a voltmeter.

Except it is AC coupled, so can only measure AC voltages.

DC will always measure as 0.

I imagine you could oscillate the DC input with an oscillator circuit and a transistor. Then the sound card should read something proportional to the input voltage.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |