magnetic sensor to PC interface

Hi All - I found this newsgroup and was wondering if anyone could help me. I'd like to connect a magnetic sensor (bicycle computer) directly to my computer through one of the ports without a power supply.

Basically the reed switch will have a current induced in it so I'm thinking I'd ideally like the circuit to be passive with minimal external circuitry.

I have a pic of a basic circuit I found but don't know how it works and I don't know how to post it. Basically it has a connection to pin

4 through a 4.7kohm resistor a direct connection to pin 6 and a ground through pin 20. If you tell me how to post a pic I can show the diagram.

Can anyone make suggestions about circuit design - can I feed the wires directly into my parallel/serial port?

I'm also trying to write a program in VB6 to read the input, but not having much luck.

I'd really appreciate any help anyone could give me. Thanks Pete

Reply to
pete_tomson
Loading thread data ...

Are you mounting a computer on your bike?

It will not have enough power to run a micro. The best way is to get power from USB, whether you interface to it or not.

You need to amp the signal.

4.7K to VCC and 100s ohms between op amp ouput and port.

Probably not.

Depends on the OS as well.

Reply to
linnix

Reed switches dont work by having currents induced in them, they are just switches, unless you mean its a coil ?

if its a read switch you can connect it from RTS to CTS on your serial port. you would need a suitable program to set and read RTS/CTS. you can access these signals through msdos with the mode command. this will probably work but wont be that fast or imune to spurious signals.

You might be able to connect it to a game port too, these are after al designed to interface to joysticks wich have switches.

Colin =^.^=

Reply to
colin

port.

signals.

Working off of Colin's suggestion, you could write a program in VB that would set RTSEnable, then in OnComm comEvCTS add value 1 to a variable. Read that variable every second to give pulses per second. The rest is just math, depending upon what you want to do. Use your micro switch to loop RTS to CTS on each contact closure.

Reply to
scada

The bike computer, or the sensor?

The sensor on a bike computer requires power. However, that's not the end of the world...

If I understand you right, they are using pin 6 (DSR) but pin 20 is not ground, but is DTR. Somthing is wrong...

Reply to
PeterD

No - I want to use my laptop as a bike computer/speedo. The bike is mounted on a frame for working out indoors.

The micro will read the inputs from the wheel switch and display the speed.

How do I add an op-amp?

As things stand today I have a basic program that reads toggles in pin6 but the wires feed directly in with no resistors aside from the

4.7k on pin4. I don't understand what's happening in the circuit or whether it's safe. If I add a resistor on pin6 my program can't detect any changes in pin6. Why?

How does this sound? The circuit is fed from from the PC through pin4 through the resistor (4.7k) and when the switch closes it toggles the state of pin6. If I add a resistor to pin6 there is not enough voltage to change the state of pin6 - hence the need for an op-amp. Am I close here?

Pete

Reply to
pete_tomson

Ok - yea. According to the diagram pin20 is DTR, pin4 (with 4.7kOhm) is RTS and pin6 is DSR. Can you give me a dummies explanation of what's happening?

What's DTR, RTS and DSR? Is it safe? Where's the power coming from? Thanks Pete

Reply to
pete_tomson

DTR - Data Terminal Ready RTS - Ready to Send DSR - Data Set Ready

Depending on which side of the cable you are, DSR is "I am ready to communicate" and DTR is "The other side is ready to communicate". One is an input, the other is an output. So... The computer raises the appropriate signal (DTR or DSR) and the other end raises the other.

So if your computer raises DTR, then the reed switch in the sensor is connected to DSR, then DSR will be raised whenever DTR is raised (IOW it gets its power from DTR).

WHich is which depends on which side of the communications you are on, but you don't have to care!

I bet this explanation is as clear as mud...

Reply to
PeterD

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.