Wednesday 11 July 2018

microcontroller - Help in designing a speaker driven by an LM386


I'm trying to design a circuit which produces a 17KHz pure sine wave from a speaker using the following components:



  • PIC16F1783 (microcontroller with DAC)


  • an LM386 amplifier and an 8-Ohm 1W speaker.


The power supply to the LM386 is 9v.


Since I have many constraints I'm not quiet sure about how to do it. I'm able to create the correct values in the DAC but then I'm not quite sure how to feed the LM386.



  • It says that the minimum gain is 20, does that mean I have to create a voltage divider before I feed the the amplifier? (1v*20=20 > 9v).

  • Is the network (0.05uF,10Ohm) at the LM386 output described in the typical application in the datasheet necessary?

  • Can the amplifier deal with 17Khz?

  • Should I put a decoupling capacitor in the output?

  • Should I put another resistor, or is the 8-Ohm speaker enough?



As you can see I'm pretty lost :( thanks for the help!



Answer



First, you WILL need to put a divider, or an amplifier with a gain of .05 before the LM386.


The minimum parts schematic you reference in the datasheet will work for you. The part has a DC offset of Vcc/2 at the output. The purpose of that matching network is two-fold. First, it keeps the DC contained to the output pin, away from the speaker. The second function is matching. Follow that schematic and you should be fine. The only thing to add that isn't on the schematic is a decoupling capacitor at the power pin. If you don't add one, you will get some very weird artifacts at the output.


The part will do 17 kHz easily, and can go out over 100 kHz.


I would try to find 12V to power it though. The part was originally designed for automotive use.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...