PDA

View Full Version : Discussion resistance to IO(computer)


vener
Jan 12, 2007, 08:18 AM
Please refer to post thirteen.

mmormota
Jan 12, 2007, 10:48 AM
The practical solution is a small uC with a/d, like a PIC12C675. It has a built-in 10 bit a/d, serial port, internal oscillator. The uC converts the voltage to numbers, and sends it to the PC through the serial port.

jeffs555
Jan 12, 2007, 03:00 PM
Here is a crazy idea. If it is a pure resistance(ie no significant L or C), you could do it with the sound card. Just output a constant tone, then feed the headphone output thru a resistor to your LDR, and use one of the free sound card scope programs to read the voltage on the audio input.

PS It would require a full-duplex sound card.

Malc C
Jan 12, 2007, 04:52 PM
The practical solution is a small uC with a/d, like a PIC12C675. It has a built-in 10 bit a/d, serial port, internal oscillator. The uC converts the voltage to numbers, and sends it to the PC through the serial port.


I might be wrong, but I'm sure there is no such thing as a 12C675. There is a 12F675 which has A/D but there is no mention of RS232 in the datasheet, or there's the 16C745 USB chip which has 8 bit A/D

mem
Jan 12, 2007, 05:18 PM
I might be wrong, but I'm sure there is no such thing as a 12C675. There is a 12F675 which has A/D but there is no mention of RS232 in the datasheet, or there's the 16C745 USB chip which has 8 bit A/DYou can do serial communication on a 12F675 using bit banging. Asm and C source code for the PIC should be easy to find in google

mmormota
Jan 12, 2007, 06:46 PM
I might be wrong, but I'm sure there is no such thing as a 12C675. There is a 12F675 which has A/D but there is no mention of RS232 in the datasheet, or there's the 16C745 USB chip which has 8 bit A/D

You are right, no usart, my mistake. Sorry.
However, the 675 is applicable without the usart, with bit-banging.

Malc C
Jan 13, 2007, 10:14 AM
well I suppose you could use a MAX chip to handle the comms, something like

http://www.best-microcontroller-projects.com/image-files/servo-controller.png

vener
Jan 13, 2007, 11:13 AM
hmm,will this work?a monostable(<is that correct?) 555 circuit with a trigger for the LDR.
soruce:http://www.kpsec.freeuk.com/555timer.htm#monostable
I forgot to mention that the comp should only detects 1/0 aka yes or No

Malc C
Jan 13, 2007, 01:05 PM
can you actually describe what it is you want to do. Your first post you wanted to measure the resistance, now you simply want to detect if the light is on or off.. If you want to simply use logic levels, then there are lots of schematicsout there that use the PC printer port which may be what you are looking for

vener
Jan 14, 2007, 10:14 AM
I wanted to measure the resistance of an LDR(ligth dependent resistors) so in directly i am asking how to read resistance/voltage without using a gameport.Is a A/D needed?

EDIT:abstraction,in short its logic

look at the 1st post.

Malc C
Jan 14, 2007, 11:50 AM
look at the 1st post.

Yes I did


I wanted to measure the resistance of an LDR(ligth dependent resistors) so in directly i am asking how to read resistance/voltage without using a gameport.Is a A/D needed?

So you wanted to measure the value of the LDR or the change of voltage as it changes depending on the light level.... but then you posted


.. should only detects 1/0 aka yes or No


So now you are only looking for a logic change of state ie on or off and not a range as would be the case in your first statement... This prompted my question asking for more information on exactly what it is you are trying to do.

In responce to that you simply point me to your first post - what a :censored:

And you expect people to try and help you !!

mem
Jan 14, 2007, 01:00 PM
Vener, If you actually do want help, re-word your question so it is clearer what you are trying to achieve.

vener
Jan 15, 2007, 02:32 AM
My apologies to everyone,I am not really good at explaining nor electronics.
As in the picture in the 1st post, the LDR is pointed by a laser pointer.
my idea is when something goes through the laser light is blocked therefore increasing the resistance.Which will activates a signal to the computer and vice versa.Because I am not really sure what will the resistance be,so i said measure resistance.

mem
Jan 15, 2007, 08:10 AM
As in the picture in the 1st post, the LDR is pointed by a laser pointer.
my idea is when something goes through the laser light is blocked therefore increasing the resistance.Which will activates a signal to the computer and vice versa.Because I am not really sure what will the resistance be,so i said measure resistance.Vener, it is still not clear what you are trying to achieve.

If you are trying to make something like an optical tachometer, then the suggestion in post #3 to look into using a sound card is a good place to start. Sound card, frequency, measurement, and oscilloscope are some keywords to try in google.

If you are trying to detect infrequent changes in the light path, like an RC vehicle lap counter, then you could also look into interfacing with a PCs parallel or serial port status lines.

Explaining the problem you are trying to solve would go a long way toward making it easier for the people here to help you.

Malc C
Jan 15, 2007, 08:42 AM
Generalisation here as I (like the rest of us) have no idea what you want to do

1) - You don't actually need to measure the resistance from an LDR. Normally an LDR is used to vary something else, such as voltage or (when used with a capacitor) the timing of a pulse. You normally monitor these and then do something when a condition is reached, eg if the voltage rises above X then do Y.

2) - Whatever it is you are trying to do will need some additional circuitry or some software if directly using the PC's parallel port.

3) - When requesting assistance you need to describe (or provide a schematic or drawing) in some detail what it is you are trying to build or achieve. It may well be that someone has already done what you want and knows where to point you in that direction.

xorcise
Jan 16, 2007, 08:39 PM
To measure resistance under variable conditions, such as a light sensitive resistive device, you need a constant current source (known value) and then measure the voltage drop across the device. Resistance is directly proportional to the voltage drop for a fixed current....Ohm's Law.

The voltage drop can be read with a PIC (or other microcontroller) ADC and the value sent via USART or USB to a PC to be interpreted as a resistance value.