Go Down

Topic: Reading A Frequency (Read 7832 times) previous topic - next topic

sigilwig444

I do have an advanced starter kit, and am proficient in Arduino C... Where I struggle is with wiring things, and that's why I'm asking for your help... I should hopefully be able to work on this project this week and should be able to finish the project based off of the knowledge you guys gave me... Also, what do you mean by tutorial examples? If you mean tutorial examples on the Arduino website, I've done plenty of those, but if you have any examples on audio projects, I'd love to try some out!

Grumpy_Mike

Quote
but if you have any examples on audio projects, I'd love to try some out!
Check out:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Shield.html
and the many other projects on the website.

For even more check out my new book at:-
http://www.apress.com/9781484217207

sigilwig444

Sorry, we had a bit of a misunderstanding... I was looking at the fritzing image, and you were giving me instructions on how to change the schematic... I really wasn't that dumb I guess...  :smiley-lol:

Anyhow, I entirely took apart my project today, and started from scratch with the schematic, I put it all together just like they said in the instructable, and I'm getting something, I get random numbers, sometimes 0 hz, sometimes 4 hz, sometimes 12820 hz, it's pretty unpredictable. If I print the value directly from the analog port, it sometimes is 1024, sometimes is 0, and sometimes hovers right around 512 just as you said. It almost seems something like a bad connection? Anyhow, I'll include a frizzing image that I drew of this project today, and you can compare it to the schematic and check that I read the schematic correctly. Any help that anyone can give is appreciated.

You can find the fritzing image here.

Grumpy_Mike

I don't appreciate being sent to a site that Bombards you with pop up windows about being a lucky winner.

Why use two batteries?
If you have to use two then you need a common ground between the two.

Did you not get the point about Instructables being crap and you should only read them if you are smarter than the author, which is not hard. Never use that site to try and learn stuff, it is just sooooo bad.

sigilwig444

I don't appreciate being sent to a site that Bombards you with pop up windows about being a lucky winner.

Why use two batteries?
If you have to use two then you need a common ground between the two.

Did you not get the point about Instructables being crap and you should only read them if you are smarter than the author, which is not hard. Never use that site to try and learn stuff, it is just sooooo bad.
Sorry about the website, it's just an easy way to post an image...

I also thought that you meant that the person I hired of fiverr was crap, not the
Instructable

Anyhow, I see the point with the two batteries, and I'll fix that, but is there anything else I can try? Or should I just start back at the post where you told me to remove C2, add a capacitor and resistors at the audio input just like the Arduino audio input, etc.

Thanks!

Grumpy_Mike

The easiest way to post a picture is to attach it to the post. Use reply and not the quick reply and then there is a triangle for additional options, this allows you to attach an image to the post.

In that diagram you just posted you need to connect the two black leads of the batteries together.

That was not the circuit I commented on previously.

sigilwig444

Alright cool, I'll try that.

sigilwig444

Alright this is what my circuit looks like now... I'm not sure if you wanted me to keep both batteries or remove one so I removed one... I now just get entirely random readings between 10 and 1000 hz... I just wish I knew what I was doing wrong...  :smiley-sad:


Grumpy_Mike

You have not got a common ground between your battery and the Arduino. Wire th black wire of the battery to ground of the Arduino.

sigilwig444

You have not got a common ground between your battery and the Arduino. Wire th black wire of the battery to ground of the Arduino.
Like this? Still does't work...


Grumpy_Mike

Quote
Like this?
Yes.

Quote
Still does't work
Then either:-
1) This is not how you have it. Please post a good photograph showing the wiring.
2) It is the wrong circuit anyway.

Now we need to stop messing about with Fritzing crap and you need to post a real schematic. You need to identify that square blob in the middle and post a link to it. I am not convinced what those two resistors are doing on the right hand side. Showing a schematic will allow me to see what your circuit actually is. Without a schematic I am having to convert that physical layout diagram into a schematic in my head, which is not easy and I am probably missing something because of it.

Grumpy_Mike

The other option is that it is indeed working and you are misinterpreting what you see as a result. If you are just speaking into a microphone it will look like you get random frequency readings. To get a constant reading you need to apply a constant frequency as close to a sin wave as possible. Whistling into the microphone is best apart from playing a single note from a flute.

sigilwig444

Alright, so I don't have time at the moment to work on a schematic, but once I do get it done, I'll go ahead and post it here for you to take a look at.

And about the frequency, I am playing a frequency directly from my phone speaker, so it is a solid frequency, so I'm pretty sure that's not the problem.

Grumpy_Mike

Yes but what are you playing into it?
Phones use a dual tone system for calling so you won't be able to measure that with your code.

sigilwig444

#29
Jan 12, 2016, 06:58 am Last Edit: Jan 12, 2016, 07:06 am by sigilwig444
Yes but what are you playing into it?
Ok, so I'm not 100% sure what your question is, but I'll tell you what I know... i downloaded an app from the app store that's a guitar tuning app, when you touch the string you want to tune, it plays the note (presumably recorded from a piano). Here's the app.

Go Up