Sean,

Might I suggest that you use a microcontroller instead of a sound card.
Choose a micro that has a built in timer.  What you need is a frequency
counter - that will give you the rpm.  You can sample the voltage at the
input of the ignition system.  This will give you a pulse everytime the
spark plug fires.  Convert the signal to TTL level and feed into your
micro's interrupt pin.  In your interrupt handler, increment a counter.
When the timer fires, you take note of the count and zero the counter.  The
rpm is then timer_frequency * counter * 60 / sparks_per_revolution.  You
probably want to set timer frequency to something low, eg. 1 - 2 Hz.
Another alternative is to use a digital PLL algorithm.

You can feed your rpm signal into the PC's serial port, at the speed of your
timer.  If you get a micro that has a built in serial output, all you need
to add is an RS232 buffer chip (eg. MAX232).

You could also go into Dick Smith and purchase a tachometer.  You should be
able to use the analogue bits to generate a signal that you can feed into
your frequency counter.

Regards,
Dennis.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Sean Cross
> Sent: Thursday, 23 September 1999 17:57
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Sampling sound
>
>
> I am wanting to read spark plug pulses so i can calculate rpm
> (and then add
> in accelration measured by a g sensor).
>
> The easiest way of doing this is via the microphone jack.
> Then I can find
> the peaks and do something with the information.  I could just record
> everything into a buffer and look for the peaks in semi real
> time but I need
> to be able to syncronise the data with other infomation (eg G sensor).
>
> How often I need to sample (and what the best process is) is
> something that
> will require experimentation.
>
> All help gratefully appreciated.
>
> Sean
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Alistair George
> > Sent: Thursday, 23 September 1999 08:24
> > To: Multiple recipients of list delphi
> > Subject: [DUG]: Sampling sound
> >
> >
> > > does anyone have any ideas/pointers on sampling sound.  I
> don't want to
> > > actually record sound, rather I want to get samples 100-200
> > times a second
> > > and then act on them immediately.
> > Depends a bit on what you want to do.
> > If you want the peaks I think the term is quantasize or similar.
> > There is a
> > WAV file 'normalizer' which is freeware which works on reducing or
> > increasing the overall level of the parsed WAV file for
> > consistent recording
> > levels. I am seeking the source code for this and if thats
> what you are
> > after let me know off the list.
> > Otherwise, if you want to look at millisecond 'frames' thats
> > another story.
> > There are several audio codes which demonstrate that as in VU
> > meters. If you
> > need ask me and I will send to you.
> > Alistair+
> >
> > ------------------------------------------------------------------
> > ---------
> >     New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> >
>
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to