Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LM386 Instability Issue

Status
Not open for further replies.
Hi all. A while ago I started looking into designing a heterodyne bat detector circuit. I posted a thread on here to ask for advice. So for reference you can find this thread here:

https://www.electro-tech-online.com...sducer-for-bat-detector-project.126293/page-2

Since then I've made some progress and I nearly have a working prototype ready, at least I think I do. It's all on a breadboard at the moment as I'm constantly fiddling with it. The main reason I'm starting a new thread is because I have an issue that I can't resolve. I'm not experienced with practical electronics, but I have fairly recently begun enjoying it as a hobby. So this may be a fairly common problem, I'm not sure.

Basically the circuit I have at the moment is a MEMS microphone (with decent ultrasound performance), a voltage-controlled oscillator (square wave) set to 45kHz, a double balanced mixer IC, low pass filter and a LM386 audio amp feeding headphones. I've uploaded a simplified schematic of this; the microphone circuitry is replaced with a 40kHz sinusoidal signal, and I've not included the 10k linear pots to control the amplitude of the two inputs to the mixer IC, and the input to the LM386. I've also used a 40kHz piezo ultrasound emitter to create a simple transmitter circuit that I'm using to generate a nice clean sinusoid on the receiver circuit.

Before I get to my main issue, I have a question about the output of the mixer IC. With reference to the attached scope screenshot "3. Filter Output.bmp", channel 1 (yellow) is the receiver signal (attenuated to approx. 250mVpp), channel 2 (green) is the square wave oscillator (also attenuated to approx. 250mVpp), channel 3 (blue) is the direct output of the mixer IC, and channel 4 (pink) is that signal after filtering. I'm fairly concerned with how the signal on channel 3 looks. I'm expecting a signal of approx. 5kHz (difference between receiver 40kHz and oscillator 45kHz), which you can just about see in that waveform. Having measured the low freq component it is indeed 5kHz. But clearly something isn't right with that signal. The mixer claims to be double balanced, which means neither of the input signals should be present on the output, but clearly the square wave is dominating that signal! The filter clears it up nicely, but it could be better - surely the mixer output has gone wrong somewhere?

The filtered signal then goes to the LM386, and my main issue relates to this audio amplification stage. With the headphones disconnected, everything seems okay (to me at least). In reference to the scope screenshot "4a. Without Headphones.bmp", channels 1 and 2 are as before, channel 4 is the filter output signal, and channel 3 is that signal after LM386 amplification. There's a fair bit of noise there but the signal is more or less a 5kHz sine wave. Now when I connect up a pair of headphones, the LM386 output goes a bit wild. This can be seen from screenshot "4b. With Headphones.bmp" - I don't even know how to describe it, it looks like some kind of high frequency oscillation but of a periodic nature. You can see that the distortion is somehow feeding back right through the circuit, as you can see it's present on the mixer input pins. Perhaps it's something to do with the power supply (which is just a 9V battery, by the way, with 0.1uF decoupling cap). Don't know how to troubleshoot this really. Using the pot on the LM386 input, I've varied the input voltage and this behaviour is consistent right down to almost zero input voltage, although the periodic bursts become less frequent and the audible pitch from the headphones (horrible sound!) reduces significantly. I've also varied the square wave oscillator frequency from DC and up, and the distortion remains present throughout (varying in burst frequency and pitch etc.) except for above approx. 85kHz where it stops. I've also played with the transmitter frequency, and it remains more or less throughout, except for portions of spectrum where the signal amplitude drops to close to zero (frequency response of the transmitter and receiver are both fairly erratic so this happens at a number of points over the spectrum).

So, any ideas on this one? Any help or advice is appreciated :)
 

Attachments

  • Schematic.jpg
    Schematic.jpg
    174.1 KB · Views: 784
  • 4a. Without Headphones.bmp
    1.2 MB · Views: 402
  • 3. Filter Output.bmp
    1.2 MB · Views: 527
  • 4b. With Headphones.bmp
    1.2 MB · Views: 343
The schematic (such as it is) shows a pretty well complete disregard for supply decoupling, which will certainly tend to give stability problems.

Also, building it on breadboard could well be troublesome, and could be another source of instability.
 
How many times do people say the circuit that is built on a breadboard is not stable and/or it oscillates??
The LM386 works well up to the RADIO frequency of 300kHz. A few pF passes the signal.

A breadboard is for DC and very low frequencies (blinking LEDs) because it has capacitance between its rows of contacts and between its wires that are all over the place. Also its rows of contacts and wires are antennas that pick up mains hum and all kinds of interference.
Its ground connections are poor because the contacts have resistance.

Use a compact stripboard layout (its parts are soldered to the strips and the strips are cut short) or a pcb instead. Also maybe the circuit should be enclosed in a grounded metal case.
 
Boo-hoo. All the bats here are gone.
My city government put larvacide in all the ponds and drains that stopped the mosquitoes so now they and the bats went to your place.
 
I agree with the above comments on breadboards and decoupling.

Regarding the mixer output not being what you expect, this could be due to you using just one of the mixer outputs.
To get the full benefit of the double balanced mixer, you need to take a balanced output as well.
At RF, this would be done with a transformer. At AF you could probably use a differential amplifier.

JimB
 
I Can't get your 3 BMP Files to open.

TRY THESE:

Their should be a C3 Directly across Pins 6 & 4 of the LM486 and Another one Across Pins 8 & 3 of your Oscillator.

You may also have a Ground Loop Problem.
Try using a "Common Point Ground", Instead of the normal "Buss Bar" Ground.

Additionally a 100uf Cap from Pin 7 to ground of the LM386 Might help.
 
Last edited:
Here is an Explaination of Common point Grounds verses Buss Grounds.
 

Attachments

  • Common-Point-Ground.PNG
    Common-Point-Ground.PNG
    3.9 KB · Views: 345
Guys, thanks for the responses - I work a long way from home so I will have to wait until the weekend to give these suggestions a try.

With regard to the power supply decoupling, do you suggest using a larger capacitance than the 0.1uF I have there currently? I'm using the 0.1uF since that was what was on one the IC datasheets, I forget which now.

So breadboard is no good for AC circuits - good to know. How does one prototype an AC circuit like this then? I have some perforated prototyping board left over from a previous project, perhaps I'll try that - solder up the joints and cut the legs short etc. Not sure if the IC legs will fit into the board though. Would that be better/worse/no different to using the stripboard mentioned?

Regarding the differential output, I will look into this and give it a go if I don't see a good enough improvement from the ideas mentioned above. Same goes for the extra cap across IC pins - by C3 do you mean a 0.1uF as in my schematic? I'll try to common the ground points on the perf board also.

Thanks for the help guys. This must be bread and butter to you but I do appreciate it! When I get a chance to try these suggestions I'll report back with my findings.
 
Yes C3 as in 0.1 uf.
Or larger if you want.

You Might also try using a Seperate 9 Volt battery for the LM386.
It Might save you from needing a Common Point Ground layout.

Even a Breadbord can be done with "CLOSE TO" Common Point Grounds.
Keep Grounds just 1 Breadboard Hole apart.
So to created the Lowest Resistance between Points.

Need Help, You can Email me Direct.
Or if you want to talk, Possibly send me your phone number.
(The USA and Canada are FREE for me.)
 
A single decoupling cap over by your power input is not enough. You need a separate cap on each component, located very close to the supply pins of each component.
 
I gave up with breadboards when one of my first projects didn't work. Then I started using Veroboard (stripboard) that has parallel perforated strips of copper that form half of a pcb and the parts and a few short jumper wires form the other half of the pcb. I made millions of circuits like that and many were prototypes that performed perfectly and looked good so they were sold as the final product. The copper strips are cut to whatever length is required so that the same strip can be used for many parts of the circuit making the circuit board very compact. Each perforated hole that is used has only one wire soldered to it.

Here is a photo of one of my stripboard projects:
 

Attachments

  • Sound Level Indicator 002.jpg
    Sound Level Indicator 002.jpg
    47.1 KB · Views: 546
Aaah I see - well that's probably a big contributor to the problem. Currently I have the decoupling cap physically right next to the battery wires on the breadboard, thought that would do the job. I'll try using a larger cap and I'll place one directly across the supply pins of each IC. Judging by the screenshot in the original post, do we think the problem is likely to be insufficient supply decoupling? Is that what an unstable oscillation might look like?

Same issue with the grounding points, I've got them spread out all over the (2x) ground rail on the breadboard. I'll bunch them up nice and close.

I've not used stripboard before, although as I mentioned I do have some prototyping board left over from a previous project, which is basically the same except this stuff intentionally doesn't have any copper traces in it - it's just the perforated holes in FR4 material or something similar. So with conventional stripboard, you solder each component leg onto the copper in each hole? And then break strips and wire up as required? I'll buy some - looks useful.
 
Hey guys. I've migrated my circuit (attached with various changes) over onto stripboard and added supply decoupling caps for each IC (and increased their capacitance), and it now remains stable when I plug in headphones or a loudspeaker. So thanks for the help so far.

Two things. One - when I adjust the volume pot on the input to the LM386, the frequency of the mixer output changes significantly, sweeping right through the audible range. I have the Rx receiving 40kHz and the square wave LO set to 45kHz, so I should be seeing approx 5kHz difference signal. This is more or less what I get out of the mixer, but when I vary the pot this frequency changes wildly. The pot is only supposed to kill the voltage into the amp in order to provide volume control, and is not supposed to have any influence on the frequency. I also noticed that the square wave LO also varies slightly in frequency, but not as much. I've tried a few things but I don't know what the issue is here - any ideas?

The second thing is a bit weird, to me anyway. I noticed that when I have a scope probe ground clip hooked up to the ground rail of my circuit, and I touch the wire at the input to the amp, I can hear an AM radio station from the loudspeaker (BBC 5 Live; 693kHz, 909kHz, 990kHz (not sure which one)). This is really puzzling me! I understand that my skin is acting as an antenna to pick up the signal, and that the return path is established by clipping the probes mains earth referenced ground clip to the circuit, but this is after the mixer and just simply at the input to an amp, so I'm wondering how the AM is being demodulated. The station remains actually quite well tuned regardless of how I tune my LO, so something else entirely must be happening. I've no idea, but it's very intriguing - hope someone can shed some light on this!

Cheers
 

Attachments

  • Schematic.jpg
    Schematic.jpg
    224 KB · Views: 462
Maybe you have the volume control pins connected backwards so they short the output of the mixer instead of dividing the signal?
Any amplifier like the LM386 that has lots of voltage gain will demodulate a strong local AM radio station when its input has an antenna and the circuit has an earth ground.
 
Have checked, and the pins are wired correctly. Perhaps I need more resistance to properly load the output? Is 10k enough? Or perhaps I need to buffer / isolate the output - the datasheet shows many circuits using a transformer to balance the signal. Since I'm not matching impedances and just coupling directly, would I just need a simple 1:1 line transformer for this? What products would you suggest, perhaps something like this?

https://uk.rs-online.com/web/p/telecom-transformers/7156920/
https://uk.rs-online.com/web/p/telecom-transformers/2106245/
 
:p
I gave up with breadboards when one of my first projects didn't work. Then I started using Veroboard (stripboard) that has parallel perforated strips of copper that form half of a pcb and the parts and a few short jumper wires form the other half of the pcb. I made millions of circuits like that and many were prototypes that performed perfectly and looked good so they were sold as the final product. The copper strips are cut to whatever length is required so that the same strip can be used for many parts of the circuit making the circuit board very compact. Each perforated hole that is used has only one wire soldered to it.

Here is a photo of one of my stripboard projects:


Sorry AG but we need to see the solder side:p:cool:
 
Okay having been on Google for a while, I've learned that the 4046 PLL chip I'm using to generate my square wave oscillator is relatively sensitive to any variations in the power supply, and its output frequency will vary in response to variations on the supply line. This would then cause the output of the mixer to vary too, of course. So I would say that's the issue - it's just hooked straight up to the battery, with a decoupling cap. I will try using a voltage regulator to stabilise the supply.

I'm also now thinking that the square wave is a problem in itself. It's harmonics must be interfering with the 'detection' of the circuit - at say 15kHz the 3rd harmonic 45kHz would mix with the ultrasound signal at 40kHz giving the same result (albeit less power) as if the square wave fundamental was at 45kHz. Plus, I think the heavy distortion on the output of the mixer (as seen in screenshots from the first post) may also be due to the square wave oscillator. In hours of researching the NE612/SA612 I haven't seen any circuit that uses a square wave - all sinusoids. So I'm going to bin the 4046 and try to get a sinusoidal LO instead.

Ideally I'd like to use the oscillator built into the SA612. The datasheet gives a few oscillator circuits. My required frequency range is approximately 20kHz to 100kHz or more, so I can't use a crystal oscillator. The other examples are Colpitts L/C Tank Oscillator and Hartley L/C Tank Oscillator - could I use these circuits, or variations thereof, to achieve the tuneable range I need?
 
It is difficult to make an adjustable frequency sinewave oscillator:
1) A bubba oscillator has good level control but needs 4 resistors or 4 capacitors changed at the same time.
2) A phase-shift oscillator has fair level control but needs 3 resistors or capacitors changed at the same time.
3) A Wien Bridge oscillator needs clipping diodes or a Jfet AGC circuit for level control and needs 2 resistors or capacitors changed at the same time.
4) LC oscillators need an AGC circuit for level control but only the L or the C needs to be changed to change the frequency.
 
Status
Not open for further replies.

Latest threads

Back
Top