Ok so I've been messing around with this for a few days now. The basic circuit creates a 0-5v PWM signal at 10KHz, 50% Duty-Cycle (as a light alarm using an LED as the sensor/trigger) and sends it to a little buzzer/speaker. This works. But rather than just following the beginner guides and copy-pasting everything I wanted to try to modify the circuit. I thought I'd amplify it and make it sound like a louder alarm. I have several speakers laying around, I believe all are 8ohm - Various sizes/wattages.
Attached is the original circuit, followed by my modification using a MOSFET (13N06L - it's all I had laying around) NOTE: the MOSFET has a built in diode from source to drain.
I DID get this set up (with the addition of blindly adding resistors to the input/output) to make noise at the detection of light. It just wasn't very loud at all and didn't sound like a clean tone like the small buzzer. I noticed the MOSFET data sheet puts the threshold voltage between 1V/2.5V (min/max).
Conclusion: One possibility (besides fundamentally failing at this circuit) to the problem that I thought about was the threshold voltage could only be picking up the square wave between 1-2.5V leaving only 1.5V out of 5V operating range.
I have several other components laying around from scrap circuit boards (resistors, caps, NPN/PNP transistors, etc) so If anyone has another suggestion for what I'm trying to achieve here I would appreciate it.
Your wiring of the buzzer is wrong. In your diagram the parallel FET shortens the buzzer, so that either the FET or the regulator or the power source may die sooner or later. Put the buzzer between the regulator and the FET (in series, not in parallel).
Hi, thanks for responding! I realized my mistake shortly after posting. I'm not sure if I had actually wired it like that before or just made the mistake drawing the diagram from memory but I continued playing around (part of which is doing what you said).
I got it working but I'm wondering if I can get it sounding better and louder or if the PWM is limited as an audio tone generator. Either way when I get back home I'll provide an updated diagram and maybe a short YouTube video for you all to hear it.
Is the LED supposed to pull the gate of the NPN low when light shines on it? Seems the emitter & collector should be swapped then. And there should be a pullup on the base to turn it on.
For the speaker - put a cap in series with the regulator output. When then transistor is off, current will flow thru the cap moving the speaker voice coil one direction. When the transistor is on, it will discharge the cap and move the voice coil the other direction.
With 9V/8ohm = 1.125A. P=I^2 * R = 10.125W, will be pretty loud if your regulator can output that much and your speaker doesn't burn up first.
Checking the specs on the MOSFET https://www.fairchildsemi.com/datasheets/FQ/FQP13N06L.pdf
specs show performance at 6.8A, so you might want to put a resistor in series with the MOSFET so you're not just shorting out the regulator.
Hey CrossRoads, thanks for the help. The LED applies bias to the transistor and when the arduino see's that the Emitter is >0 then it signals the arduino to apply 5v PWM 10KHz signal from PWM Pin 5.
Thank you for the calculations, do you have a suggestion on the value of the regulator-to-MOSFET resistor?
As of now the system is working! I'm sure the noise could be cleaner but I'm not sure if that is a limitation on PWM square-wave vs A/C sign wave. I found that having a capacitor in series from Rd to the speaker causes no output. In fact, having now taken out both capacitors I find no change in the output (other than having a cap in series of Rd causes no output)
6.7VDC drop across Rd, this seems excessive - but what do I know I'm pretty new to this.
0.7VAC drop across Rd with speaker ON
175mA on the MOSFET side.
1.47VDC drop across speaker
.175VAC drop across speaker when ON
.335VDC drop across drain to ground when speaker ON
.860VAC drop across drain to ground when speaker ON
270 ohm Ard to gate
Here's what I used in my fencing scoring machines.
The switch at the top lets the 68 ohms be in series or parallel as a high/low volume control.
Still very loud tho.
Hi,
Please post a new response instead of updating your original post.
Anyone with a similar problem/query to yours will not be able to follow the thread from start to finish.
If the start and finish are in the same spot it will be impossible to work out where and how the solution was obtained.
Arduino pin to Gate.
1.2K keeps the MOSFET off when there's no input signal (Arduino in reset state, IO pins floating).
10K would likely have been sufficient, I only had 1.2K on hand when I built them tho.