Proximity sensor with time delay buzzer

Hi all, I am new here and want to connect proximity sensor with Arduino Uno along with a buzzer (85-90dB). Once the proximity sensor stays on / triggered continuously for 10 sec, then the buzzer should be turned on/active until the proximity sensor is active.

How can I program the whole system and which parts to purchase?

Thanks in advance.

Welcome to the forum

You started a topic in the Uncategorised category of the forum

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

The code depends on which sensor you use and we don't know that.

Off course I am not asking for the whole code Instead I just want to have an idea if there is a function for time delay like if proximity sensor is one for 10 sec then from the 11th second the buzzer should start ringing.

The list of parts being used in this project are as follows:
(1x) Arduino UNO
(1x) Breadboard
(1x) 6V DC Buzzer
(1x) HC-SR04 Ultrasonic Sensor
Jumper Wires

I have a code which simply buzz when the object is in the range of sensor (15CM), but how can I turn the buzzer on after the Sensor continuously detect any object for more then 10 sec (or any specific time) and till the object is in front. Suggest a function and use of it. thanks.

When the switch goes HIGH, start a 10 second millis timer, if the switch is still HIGH when the timer expires, turn the buzzer on. How long do you want the buzzer to buzz after that?

I was able to program it and it's all good now. On a second note, how can I use this 5V output to trigger a higher dB buzzer (12-24VDC) instead of 80-85 dB buzzer (5v).

That's what I did. On a second note, how can I use this 5V output to trigger a higher dB buzzer (12-24VDC) instead of 80-85 dB buzzer (5v).

Depending on the buzzer current, use a low side NPN transistor or MOSFET switch.
Here's a drawing, replace "M" with buzzer.

NPNMot-2

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.