0
\$\begingroup\$

Using a PIC, I got a signal oscillating around 2.5V +-[0,2.5]V approximately. This is intended to generate a simple sound through a small speaker.

The speaker, unfortunately works with 0V +-[0,2]V, and I expect the direct usage of 0-5V not resulting in the same sound (or even breaking the speaker). Consequently, I would need to displace the ground to 2.5 for the speaker.

schematic

simulate this circuit – Schematic created using CircuitLab

Could someone indicate me the direction for a solution?


Current status:

I did not managed to go very far,

  • Using opamp, but they mostly threat the input voltage, so a negative voltage source is required. I should probably reminder how they work in case it is the solution.
  • Splitting the voltage with resistors, but that did not convinced me due to attenuation.
  • I finally looked for some LM317 to generate a ground at 2.5V; However, I am not sure if it would work when the wave provide "negative" values.
\$\endgroup\$
1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Use an LM4865 enter image description here

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Nice circuit! Is the BC547B/BC557B adequate for this circuit? \$\endgroup\$ – Adrian Maire Dec 13 '16 at 7:44
  • 1
    \$\begingroup\$ If OA delivers 10mA then for 4V into 4 Ohms or 1000mA then a gain of >>100 is marginally OK with those \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Dec 13 '16 at 21:13
  • \$\begingroup\$ It seem to me that U2 on your diagram goes saturated (The positive wave is cut at the top. To solve it, I added a resistor to ground from the + input of U2. Could you check/confirm it please? \$\endgroup\$ – Adrian Maire Jan 11 '17 at 16:04
  • \$\begingroup\$ There will be saturation in both NPN and PNP drivers that cannot be avoided as well as the Op Amp of choice. Using two in differential extends the power to one output. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jan 11 '17 at 16:44
  • \$\begingroup\$ ... unless very low RdsOn MOSFETs are used. Then crossover +-Vgs must be controlled with a deadband that is quickly passed thru. In Motor bridges the deadband is saturated and defined by dead-time in us. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jan 11 '17 at 16:44
3
\$\begingroup\$

Place a capacitor in series with your signal to remove the DC offset. Maybe 10µF non-polarised. You can then use a voltage divider (or potentiometer) as an attenuator.

schematic

simulate this circuit – Schematic created using CircuitLab

Note that driving a speaker direct is not recommended (and may not even work properly). Instead you should use some form of power amplifier to provide the current the speaker needs.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Beat me by 19 seconds! \$\endgroup\$ – vofa Dec 12 '16 at 16:13
  • \$\begingroup\$ :P I draw faster ;) \$\endgroup\$ – Majenko Dec 12 '16 at 16:14
  • \$\begingroup\$ It will be now difficult to choose a "winner" :-D \$\endgroup\$ – Adrian Maire Dec 12 '16 at 16:18
  • \$\begingroup\$ Just curious - any particular reason for using a non-polarised cap as there seems to be DC bias across it? \$\endgroup\$ – JIm Dearden Dec 12 '16 at 16:34
  • \$\begingroup\$ @JImDearden Because there is AC going through it. Once you remove the DC bias you are left with AC which has no polarity. \$\endgroup\$ – Majenko Dec 12 '16 at 16:35
2
\$\begingroup\$

Your output signal is 0-5V, or 2.5VDC +/- 2.5VAC.

You can remove the DC content of a signal by passing it through an AC coupling capacitor. You can attenuate by using a voltage divider. The size of these components will depend on the frequency response desired. C1 will tend to be large (in the uF range). This tool can help you size the components: http://sim.okawa-denshi.jp/en/CRhikeisan.htm

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

If you're just making "beep" sounds, there's no need to use a fancy circuit.

The easiest to use are the piezoelectric transducers. You can probably drive it directly with the PIC digital output pin, or user 1 transistor at the most. Take a look at the datasheet for this part I randomly picked.

http://www.digikey.com/product-detail/en/tdk-corporation/PS1240P02BT/445-2525-3-ND/935924

Piezoelectric transducers are resonant at high frequency so you'll need to use several kHz.

If you want to drive a real speaker and just make beeps but at wide frequency range, then you can just use a simple push-pull circuit with a large coupling cap.

Push-pull schematic

The simulation shows the circuit driving roughly 180 milliWatts into an 8 Ohm speaker at 500 Hz. I hope that helps. -Vince

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

There are so many circuits to drive a speaker. The link here describes multiple ways of achieving your goal.

LM386 is widely used as an audio amplifier in hobby projects and interfacing circuits are easily available.

Depending on the power output requirement, suitable audio amplifier can be chosen. The LM386 can easily drive a 8 ohm speaker. The gain can be adjusted easily by proper biasing.

Another bunch of good solutions are here.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.