Click to See Complete Forum and Search --> : Reading from Hardware??
Virtual24
May 20th, 2002, 03:54 PM
Ok, i know this is kind of a longshot, but i'll go ahead and ask... I want to try to rig up something so that my computer can read from 1 or more variable resistors (like a volume switch on a radio) through an USB or serial cable. I am clueless about 2 things... Mostly, how do i get the computer to look through the serial or usb and read the current going through the variable resistor. The second is problably more for a electronics forum (lol) but while i'm at it, does anyone have any ideas or experience on making home-made hardware devices for computers to read from. Well, thanx for your help...
HarryW
May 20th, 2002, 06:12 PM
Are you using some kind of specially made serial-interfaced board with the inputs all sorted out already and you just want to read from the serial port? Or are you looking to create the whole thing yourself including the serial interface?
If you have some kind of 3rd party serial-interfaced board for playing around with electronics, I would say look at the documentation for the product. There is probably an API for it.
If you want to make the whole thing from scratch, or you can't find any kind of API, I would suggest you read up on the serial interface and how to read/write to/from it. There are probably libraries out there that abstract it out a bit and make life easier with a higher-level API, if you look around a bit.
If it helps, I think the standard serial interface's code is RS232. That might help if you're searching.
phinds
May 20th, 2002, 06:57 PM
your ports will not read a resistor setting directly, regardless of whether you are using a USB, a standard serial port, or the parallel port. That's because they all read digital signals and you're looking to generate an analog signal. You'll have to convert the analog serial into digial. A parallel analog-to-digital converter is your best bet, then you can read it from the parallel port. It is conceptually trivial, but if you don't know what you're doing, it will make you pull your hair out.
Virtual24
May 20th, 2002, 08:17 PM
Is there any type of connection on your computer that is analog? The line-In port maybe?
Virtual24
May 20th, 2002, 09:59 PM
Also, i have thought of buying an ADC from radioshack or something... would that work?, and if it would, what would i need?
KingDavid
May 21st, 2002, 12:03 AM
Dial up Modems are analog. Midi or Joystick might be analog.
HarryW
May 21st, 2002, 01:56 PM
Modems are DACs, they're digital as far as the computer is concerned but they communicate over an analogue telephone line. The word 'modem' is like 'codec' (coder decoder) derived from 'modulator demodulator', which mean to convert from digital to analogue and from analogue to digital.
The standard line-in on a sound card is analogue. I think most old game controllers (like joysticks) are analogue too.
PunchyTheClown
May 22nd, 2002, 01:52 PM
Everything passing through your computer it digital. You'll have to use an A/D converter and seperate it into different channels... the more channels the closer you are to analog.
jeeno
Sep 5th, 2002, 03:16 AM
see example a/d conveter
http://www.iguanalabs.com/:rolleyes: :rolleyes:
<ABX
Sep 8th, 2002, 06:47 PM
Maybe take a look at this
USB link (http://links.epanorama.net/links/project_pc.html#usb)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.