I'm currently building something where based on the distance of an object a vibrating motor needs to vibrate stronger or weaker. I already know how to get the distance but how can I change the current or resistance in order to weaken or strengthen the vibration
Depends on what you mean by "buzzer".
Provide the specifications or datasheet of the "buzzer", an archaic term from the previous century often misapplied to all sorts of devices.
THIS is a buzzer:
This is a piezoelectric transducer, often erroneously called a buzzer, no matter what the package says.
How are turning the buzzer on now ?
ezra_reiss:
I'm currently building something where based on the distance of an object a buzzer needs to buzz stronger or weaker. I already know how to get the distance but how can I change the current or resistance in order to weaken or strengthen the vibration
Imagine, if you will, that a second was broken up into 10 parts. If the buzzer was only on for 1/10th of a second, how 'loud' do you think the sound will be?
If the buzzer was on for 3/10th of a second will the buzzer sound 'louder' then the button that was on for a 10th of a second?
If the buzzer was on for 7/10th of a second will the buzzer sound 'louder' then the button that was on for 3/10th of a second?
Explore how others have used PWM to control LED's.
Idaho- that is loudness; the OP was asking about volume. Though, for his purpose, it probably doesn't matter.
How loud is a cubic meter of sound?
could you use a PWM output to modulate the power to the buzzer?
Also here.
Out.