PDA

View Full Version : Any suggestions for op-amps using the sound command



jessey
- 6th November 2006, 09:12
Hello,

Would anyone know of a good op-amp that would offer reasonable amplification and volume control for a pic chip? I've been playing around with the sound command and have a small 8 ohm speaker connected to a LM386N-1 amplifier and it gives a surprisingly good sound but I can't seem to get any kind of volume control. I found the schematics for the 386 in an old Radio Shack book and wired it as per their instructions, I've included the schematics here if someone could have a look and possibly offer any solutions to get the volume control working.

If anyone knows of a good op-amp that's proven to work well with the pic chips sound command then I'd surely appreciate any information that could be provided.

Thanks
jessey

Melanie
- 6th November 2006, 09:23
I assume your 10K pot is a LOG pot and not a LIN pot? If it isn't, change it (to a LOG pot - remember your ear isn't a linear device) and you'll find the volume control might then work.

Pins 1 and 8 are unused in your schematic, but they set the gain of the op-Amp. Try adding a 1K2 and 10uF connected in series between these two pins and you'll get a surprising increase in gain.

The Datasheet for the op-amp provides a whole heap of examples at the back. The LM386 you have is a good, cheap, no-frills, minimal component count Audio device for playing with.

jessey
- 6th November 2006, 10:37
Hi Melanie,

You hit the nail right on the head. Thanks for pointing that out to me, I was using the same linear pots that I use for my Lcd's contrast control and not a logarithmic one. I'll also do as you suggested and increase the gain of the op-amp with a capacitor & resistor in series with pins 1 and 8. I'll have to be careful that I don't blow my ear drum's out now!

Thanks Again
jessey

jessey
- 10th November 2006, 04:55
Hi Melanie,

I didn't notice any real increase in volume with the resistor & capacitor in series with pins 1 and 8? What I do notice is a light ticking (almost like a white noise) sound that seems to always be there. Actually I had that noise there before I added the resistor/capacitor but is was ever so slight. The clicking sound seems to get a little louder when I press the push button to leave the mainloop of my program and enter the set-up mode which is strange? I downloaded the datasheet for the 386 but I couldn't find any helpful hints that would suggest anything (at least that I could understand) to alleviate the problem. I found a log pot and it does work good to lower the volume..... thanks.

I have my sound circuit sharing a bread board & the same power supply with 2 other pic projects and that could be part of the problem.

I just finished soldering all the components for the sound circuit (except for the 386 amplifier circuit) on a pre-manufactured circuit board and my Lcd and the program is functioning good. Before I add the 386 I thought I'd seek a little advice. According to the 386 datasheet I can operate the 386 on up to 15V, so do you think it would be a good idea to add a 7812 voltage regulator to run the 386? Also I remember reading in the archives that you like to run your Lcd's on a separate 7805 in some instances which I thought I might do too if you think it would be warranted.

Any input would be greatly appreciated.

Thanks
jessey

Melanie
- 10th November 2006, 08:37
The ticking noise is probably amplified from the supply line. Try running the 386 from a separate supply on your breadboard and see if it eradicates it. Either that, or it's the PIC program polling the port you've got the Audio connected to, put a scope on the Audio line and see if it's clean or if you've got a pulse on it.

If it's just a Doorbell or Alarm, then the Audio Amp probably wouldn't warrant it's own regulator as long as your supply doesn't exceed it's maximum rating.

As for the LCD. It's 5v Supply can be the same as that for the PIC because it draws minimum current at best, but the exception is the BACKLIGHT for any LCD. I tend to supply that seperately because unless you've got one of the new style white LED sort, the LED array is usually very power hungry. Even then I rarely regulate it to any extent. The exception being if you have a supply line which is going to vary considerably under load (eg lots of Relays switching on and off), then if the Backlight isn't regulated, you'll notice a change in the light levels as the unregulated supply goes up and down under differing loads.