Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading frequency of an audio signal from Android device

Status
Not open for further replies.

Yasserbn

New Member
I am doing a project that reads frequency of audio signals generated from Android device through the headset jack. The audio jack is connected to Atmega microcontroller as shown in the figure.!

Circuit2.png

I am using the analog comparator to compare between a reference voltage 2.61v and the audio signal (DC biased; AC + 2.5v). The audio signal range is 200mv p-p so after DC biasing it will be from 2.3 to 2.7. When the comparator input 1 passes 2.61 (reference volt), a timer starts to measure the frequency. But the problem is I am not getting a stable reading of frequency. For example, if the signal is 1000Hz, I read it between 4000 and 5000 Hz. The values always change. Sometimes the comparator outputs one for few microseconds even there is no audio signal (the output should be zero).!!

I think the problem is one of these:
1) The power supply has a high ripple so I cannot read low-level signals properly.
2) I should use a higher blocking capacitor C2 like 10uF instead of 100nF.
3) The 200 mv is in the range of noise signals, I should amplify it before read.
4) The voltage divider should use high values of resistors like 3MOhm as in the Hijack project.

What do you think.
 
There are a couple of connection problems with the phone jack.

1) You have your signal ground tied to pin 3, which is normally connected to the tip when a plug is removed, but gets disconnected when a plug is in place. So there is no gnd connection from the input when the plugged in.

2) Your signal input is tied to the ring terminal. This may or may not have a signal on it. If the signal generating app is mono, it will probably be on the tip, not the ring.

Change the ground connection to the sleeve terminal, pin 5, move the signal connection to the tip contact, pin 4.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top