Proximity Sensor with sound buzzer

Hey guys,

I have been spending the past few hours searching the web for a tutorial on how to connect up a Proximity sensor onto an arduino board so that when I move my hand closer to the sensor it sets off the buzzer. So when my hand is in front of the sensor the buzzer will go off and when there is nothing in front of the sensor the buzzer stays off.
Would anyone happen to know of any tutorials I can go to or would you guys know how to do it, its for a university project.
Any help would be greatly appreciated.

Thanks! :slight_smile:

i did it before using a parallax sensor: Digitalduino: PIR sensor and RGB LED indicators

Thank you for the reply.
So with that code, am I able just to replace the LED's in the circuit with a buzzer so that when it senses movement the Buzzer will be on HIGH and when there is no movement the buzzer will be on LOW?

i updated the post with the original code i based it off of. where it says digitalWrite(ledPin, LOW); or digitalWrite(ledPin, HIGH); is where you also want to set your buzzer LOW or HIGH