Interface a bike computer

Hi All - I need some help/advice. I'd like to connect a magnetic sensor (bicycle computer) directly to my computer through one of the ports without a power supply.

I found a circuit that connects the magnetic sensor directly to the parallel port but don't know how to test it. The magnetic reed switch I'm using should produce a passive current when my wheels are turning but is this enough to be detected through my parallel port?

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 ...

Sundry comments, most of them a bit negative, I'm sad to say:

VB6 won't read the printer port directly; it lacks the inp() and outp() functions of earlier Basics. (Have I got those function names quite right? Maybe not.)

By using a dynamic link library written in C, you can read the printer port in VB6-*if you're using W98 or earlier*. After that, Mr. Gates decided he didn't like you poking and peeking memory locations.

However, look on the web for "read printer port" and see what you find- some people have addressed the problem of writing and reading the port in XP,W200,NT and such. I have no experience of such stuff.

Are you dealing with a voltage source or contact closures? A voltage source going between 0 and 5 would be ideal: if it exceeds that, use a

4v7 zener to limit the range.

If it's a contact closure, beware contact bounce- I don't know what your switch does, but you might need to use software to get round it.

I'm unsure whether any of the input printer port lines float high with no connection. If they do, you can pull the line down to earth with your switch between the input and earth. Otherwise, you'd need some way of pulling up the input.

Here's a good source of printer port information:

formatting link

As for the serial port, VB6 Professional can use it *as a serial port*, but I don't know how I would use it to solve your problem.

Aaaargh. Wish I had something more positive to say.

-- Mit der Dummheit kämpfen Götter selbst vergebens.

Reply to
tersono

You might have a look at the Windmill software - it might be useful

David

pete snipped-for-privacy@hotmail.com wrote:

Reply to
quietguy

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.