£okì has asked for the wisdom of the Perl Monks concerning the following question:

Ok, is there any module out there for perl that will read analog signal information from a port (I don't care what port). I've got an anometer that I'm pretty sure just sends a blip every cycle and I'd love to interface it. I'm just not sure about how to connect one to the other. Advice, recommendations, and ridicule welcome.

Replies are listed 'Best First'.
Re: Analog (not the webstats) Input
by gri6507 (Deacon) on Oct 11, 2004 at 17:11 UTC
    If the anometer just sends a blip every cycle (clock cycle?), then isn't it a digital signal? Could you use an RS-232 port to listen to this signal? Or if the signal level is not high enough (RS-232 is 10V), then could you build a simple amplifier circuit and add a MAX-232 chip and then use a serial port? Just a few ideas.
      Hmm, all very interesting. The digital/blip signal would almost work but there's more to it. (there is layers of info that isn't just blips unfortunatly) I was using that as an example. I know about the voltage issues, I won't blow my circut as these are non powered devices, I'll have to get them power (different issue, I'll figure that much out) but I won't blow my board luckily. The max-232 chip is where I was originally starting. I have a friend who's pretty good with circut boards and soddering so. . .
Re: Analog (not the webstats) Input
by kvale (Monsignor) on Oct 11, 2004 at 17:07 UTC
    On the hardware end, all analog input ports are not the same. Different interfaces require different voltages, currents and assumed sampling rates. So the first thing to do is to check your anemometer manual for specs, lest you fry your port.

    If it is compatible, the mic input of a sound card may be easiest. Use whatever program you want to record a wav file and use perl to drive the recording program and analyze the wav file(s).

    I don't know of any perl modules that drive sound cards directly, but if you have the card specs, it seems that one could cook up the correct ioctl calls. Using a third party program is probably easier, however.

    -Mark

Re: Analog (not the webstats) Input
by jonnybe (Scribe) on Oct 11, 2004 at 16:36 UTC
    I'm not sure which module to use (not a game programmer) but the game port on a PC uses analog input.

    Jon