project with beep locator

hello. i want to make a arduino project which having data the distance of one item and depent of this measure it will change the frequency of beep tajt will sound. Can anyobe tell me if tried it ; and what sould i start; thank you

Your post tells me you want to make a circuit, which makes a beep sound when an object is detected and increases the frequency of beep as that objects move towards the circuit. Correct me if I'm wrong.

For this you will need Arduino Board Buzzer HC-SR04(Ultrasonic sensor/Sonar)

Ultrasonic sensor lets to play with proximity detection and it accurately measures the distance of object from it. It's interfacing is pretty simple you can find it in tutorial sections or anywhere on internet, they are very common. Next you'll need a buzzer.

Program will be quite simple, according to the values of sensors, play with If statement and adjust the frequency of beep sound using PWM or delay.

play with If statement and adjust the frequency of beep sound using PWM or delay.

There is also the tone() function. https://www.arduino.cc/en/Reference/Tone

groundfungus: There is also the tone() function. https://www.arduino.cc/en/Reference/Tone

Absolutely, tone() function can be used too. In a nutshell tone() function make use of both PWM and delay.

Hi itmakeyoysmile,

I really enjoy using ultrasonic sensors too, and have made several projects with them, including my Arduino RADAR

Nirs and GFungus provided some good advice that should get you started. Let us know if you need more help, and update this post with your project when it's done!

Pat

Nirs11: Absolutely, tone() function can be used too. In a nutshell tone() function make use of both PWM and delay.

Really?

You have the source of tone() - why not read it before typing nonsense?

AWOL:
Really?

You have the source of tone() - why not read it before typing nonsense?

Go read the reference page, you will easily infer how a tone() function works. If you have at least beginner level of programming skills you can come up with a similar source code. If source code is not provided that doesn’t mean it is equipped with some godly code which you can’t write.

Still, your statement is nonsense.

lg, couka

couka: Still, your statement is nonsense.

lg, couka

Alright, then you tell us how does a tone() function works, or you have read the source code and you know exactly how it works, so let us know.

Thank you all for email an for useful informations. i will try with all of advice you game me and if i will stuck i will inform you. unless if i will completed so will came again with good news.

thank you

Nirs11: Go read the reference page, you will easily infer how a tone() function works. If you have at least beginner level of programming skills you can come up with a similar source code. If source code is not provided that doesn't mean it is equipped with some godly code which you can't write.

I'll repeat - you have the source of tone(). Search it for the word "delay".

You won't find it.

And the abbreviation "PWM" appears only once (in a negative sense).

Please, think (and read) before posting.

AWOL: I'll repeat - you have the source of tone(). Search it for the word "delay".

You won't find it.

And the abbreviation "PWM" appears only once (in a negative sense).

Please, think (and read) before posting.

I'll repeat my words, read the reference and try to figure out the working. I did not tell you to search for abbreviations lol.

You said

Nirs11:
Absolutely, tone() function can be used too. In a nutshell tone() function make use of both PWM and delay.

You are wrong.
It will still be wrong, if you repeat it again.
It’s ok to not know something, it’s not ok to publish untruth.

lg, couka

And delay() ?

We try our level best to steer noobs away from delay ()

AWOL: We try our level best to steer noobs away from delay ()

What's so fundamentally bad about delay()?

lg, couka

It's a waste of time. Or, more accurately, it's a waste of instruction cycles.

It sure is, but if there's no work to do during that time I don't see a problem here.

lg, couka

I don't see a problem here, but then, I don't see any code here either, so who can tell?

It was meant as a question of priciple, but anyways... Sorry for offtopic.

lg, couka