Physics-related: a electromagnetic buzzer that receives two or more PWM waves of different frequencies #12273
-
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 8 replies
-
Not quite sure what you mean here. Do you mean:
Yes. If you have a mobile phone then you do indeed have the equipment! Have a look at for example https://phyphox.org/ -- it includes some good tools for doing analysis with the phone's microphone.
Yes, absolutely. Look up the datasheet for your buzzer, it will have a frequency response curve. |
Beta Was this translation helpful? Give feedback.
-
Two pins, respectively generate two PWMs with different frequencies, output to the same buzzer. |
Beta Was this translation helpful? Give feedback.
-
You must not connect two output pins together. If you want to PWM pins drive one buzzer, you have to decouple the outputs, e.g. with diodes and/or resistors. And, as Jimmo told, a simple buzzer is like a speaker, but with a very small frequency range. There are also buzzers which just need power to generate a tone. They have an internal frequency generation circuit. If you apply a (low) frequency PWM to these, you may get some strange noise. |
Beta Was this translation helpful? Give feedback.
-
1.) Yes, but you have to mix those signals and prevent the feedback of the signal back to the outputs. The harmonics are, for example, the whirring of electric drives. 3.) We don't hear all frequencies the same "loudness". I think it's called psychoacoustic. |
Beta Was this translation helpful? Give feedback.
-
I tried searching for "audio mixer" and found it to be extremely expensive. I thought, why don't I use one more buzzer, hahaha. 😄 Multichannel is cheaper than "audio mixer". Thank you all. @sosi-deadeye @jimmo @robert-hh @anotherjesse |
Beta Was this translation helpful? Give feedback.
-
Alternatively, you can achieve a polyphonic sound effect from a single PWM output using square-wave frequencies overlaid on a very fast PWM 'carrier' signal (for example: 4000AD | PROTODOME, generated on an ATMega microcontroller feeding a single pin). Whether we have the hardware facilities to do this on various MicroPython platforms, I don't know, as it requires extremely precise PWM control. |
Beta Was this translation helpful? Give feedback.
Not quite sure what you mean here. Do you mean:
a) You are generating a signal made of some combination of two PWM signals at different frequencies?
b) You generate a signal at one frequency, then another at another frequency?
Yes. If you have a mobile phone then you do indeed have the equipment! Have a look at for example https://phyphox.org/ -- it includes some good tools for doing analysis with the phone's microphone.
Ye…