Sound Processing with PIC

Thread Starter

lasania

Joined Jan 5, 2013
4
Hey guys,

I'm currently doing a project to get a sound from a mechanical watch (with a contact mic) to calculate the bpm and lag/lead per day. I've done it with a pc writing a code in Matlab.

I need general suggestions. Can it be done with a PIC 16f877a? I don't need much accuracy.

What I have in mind is this, contact mic>filter>amp>pic adc>computation. All I need to do is really just measure peak to peak time so that I can approximate beat error. Any ideas? It would really help me.
 

ErnieM

Joined Apr 24, 2011
8,377
I'd toss the ADC and just amplify the analog signal till it becomes a digital one. A little simpler to implement on the PIC side and just as accurate.

Short term it may jitter some but long term it will have the same accuracy as the watch.
 

Dodgydave

Joined Jun 22, 2012
11,303
I would amplify the signal with an op amp, convert it into a square wave and count the time between pulses, you don't need an adc.
 

Thread Starter

lasania

Joined Jan 5, 2013
4
Currently I've changed to arduino. I'm using it with a oscilloscope on my comp to see online analog input. Mic gets the heart beat, but it is unable to get watch ticking with opamp.

I've then tried to use a pocket amplifier (marshall brand), just getting the voltage output from its speaker out. But can't get the ticking signal, only noise.
 

thatoneguy

Joined Feb 19, 2009
6,359
If it is on a bench, what "heartbeat" is the element picking up?

You may need to play with mounting schemes, such as upside down and right side up so one side of piezo element is fixed, and the other end is connected to watch?

Fixing one or the other in place will reduce avenues of noise.
 

Thread Starter

lasania

Joined Jan 5, 2013
4
We fixed it by salvaging and using Marshall amplifier's amplifying circuit. Just connected our piezo mic to that circuit and matched the output impedance by adding high resistances to Arduino's analog input. Now we can see the distinctive signal. Although it's noisy, little computation will make it better.
 
Top