Designing a simple Standby circuit  [solved] - Page 1
Forum section: electronics / projects

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 19, 2020, 07:19:37 pm
content: So I want to design a simple standby circuit for an amplifire. When audio signal is applied (min 20mv ptp) a Mosfet should turn on, when the signal is gone after ~10 minutes the Mosfet should turn off. What would be the easiest/best way to do this?

author: Lasherž
author_rank: Contributor
timestamp: August 19, 2020, 08:33:44 pm
content: What you're describing is very similar to how signal sensing line out converters work. You may wish to start by reading some patents such as from the audiocontrol lc2i series which has this circuit. Perhaps you'll be able to adjust the sensitivity low enough, as those work from a much larger source in the 500mW-5W range.Sorry I couldn't be of more direct help, I've still got a lot to learn about these circuits myself.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 20, 2020, 07:40:08 am
content: Thats a Device i can buy. And wouldnt help me much, there must be a simple solution for it. The Main problem is the 10min. How do I make a time delay (10mins) when no signal is applied. Maybe a timer?

author: OneGeekGuy
author_rank: Regular Contributor
timestamp: August 20, 2020, 08:02:23 am
content: If the problem is the time....With 555 you could do 10min timer, could you apply a small button battery to power this NE555, and charge it while the device is working?BR

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 08:33:44 am
content: Quote from: Michaelaudio on August 20, 2020, 07:40:08 amYep. I already suggested to you in one of your previous topics a CMOS4060counter/timer, which can easily be used for time intervals of seconds to hours. Configure its oscillator as a low frequency RC one. You want 9.1Hz for a 15 minute delay at the Q13 output, so try a 100nF capacitor and a 470K resistor. Drive its reset pin (MR 12) with the de-glitched output of your signal sensing circuit, and connect the chosen output back to its oscillator input (RS 11) via a diode, anode to the output, so it stops its own clock when the chosen output goes high at the end of its timing period.To test it quickly, temporarily connect a LED + series resistor to its Q3 output, and it should flash once every 1 2/4 seconds. Take the output (and stopping diode) from Q9 instead of Q13 and it should time-out in just under a minute.@OneGeekGuy: He's already run into problems with long interval single stage RC timers, so lets not go down the 555 road!

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 20, 2020, 09:35:05 am
content: Thanks Ian, I will try that as soon as I have the ic. If i understood it correct, the 4060 will gow low when a signal is applied and go low after (what ever i choose). What would be a good input sage for the audio signal? I have thought of just simply amplifying the audio signal to a verry high value, then go into the cd4060.

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 12:47:18 pm
content: When you reset a 4060, it starts off with all Qn outputs low. They go high in a binary sequence some time later as it counts. Q0 to Q2 and Q10 aren't brought out to pins.As a test, if you were to connect LEDs (+ series resistors) to pins Q3 to Q9, tie MR low and provide the RC clock components discussed earlier you'd see it count from 0 to 127 in binary, one count for every 16 clock cycles.The reset (MR) pin is active high, and it would need to reach 70% of Vdd to guarantee a reset. That's a job for a comparator. Two sections of a quad OPAMP could be used to buffer, amplify and filter both channels, the third section could be used to combine the channels and amplify and filter it further to feed a charge pump, and the final stage would be used as a comparator with lets say 1% hysteresis, to compare it with the desired (adjustable) threshold, and its output used to directly reset the 4060.As the charge pumped is proportional to the input frequency, you'd want to roll off the response of the first two OPAMPs at 6dB/octave in the pass band to maintain a constant sensitivity from lets say 100Hz to 10KHz, and above 10KHz use the third section to roll it off at an additional 6dB/octave

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 20, 2020, 02:57:51 pm
content: Why do I need a Charge pump? Do I need a neg. voltage?

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 03:16:06 pm
content: Nope. However a charge pump is a convenient way of integrating signal events over time so your amp doesn't come out of standby on occasional brief transient noise e.g. EMI from a heating appliance switching. It also responds to pea-to-peak amplitude, ignoring DC bias so its easier to use than many other peak detectors. e.g. an OPAMP based precision full wave rectifier, peak detector and comparator would use a quad OPAMP without any gain in front of it. You'd still need at least another two OPAMPS to amplify the inputs to a reasonable working level and buffer them so they can be combined without crosstalk.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 20, 2020, 05:38:09 pm
content: So this is how I understood it. I let it roll off at 20khz not 10khz. Which voltages should the comparator compare?

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 06:14:04 pm
content: You'll need to reduce the input coupling capacitors C4,C5 for some LF rolloff. Try for -3B at 70Hz. Also I'd implement the HF rolloff as a small capacitor in parallel with R5, and for more drive to the charge pump reduce R8 to 100 ohms. Reduce C2 to 10nF or increase C3 to 1uF to increase the number of cycles the charge pump takes to build up its output voltage. Fit a 100K bleed resistor across C3. Reverse D1 and D2 for a positive output so you can run the OPAMPs single supply for level compatibility with the 4060 and wire OPAMP 2B as a comparator with its -in fed by a potential divider between Gnd and Vcc giving a small adjustable positive threshold. Try a 10K preset for the lower resistor and a 100K fixed upper resistor. Feed the voltage on C3 to the +in via a 10K resistor and try a positive feedback resistor of a few Meg for a little hysteresis. If you give it too much hysteresis, it will trigger but wont reset as the voltage swing from the charge pump wont be very big unless you add additional amplification in front of IC2A.Also D1 must be reversed. Q13 starts off low after MR, so the way you've got it, the 4060 oscillator will never start. I assume the top end of R2 is going to your P-MOSFET gate.

author: Renate
author_rank: Super Contributor
timestamp: August 20, 2020, 06:40:01 pm
content: And hope that your input isn't out-of-phase stereo...

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 07:28:50 pm
content: Yep. If you need to detect out of phase stereo reliably, the only good way forward is to duplicate the OPAMP gain/filter stage and the charge pump coupling cap and diodes, pumping into the same integration cap. I'm not convinced there is enough gain there - if you want to be able to detect a signal that's 40dB down on nominal consumer line level of -10dBV, you'll have under 9mv peak to peak at the input to work with. Ideally the charge pump should have several volts of drive, and a total gain of 400 would IMHO be excessive for a single OPAMP.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 20, 2020, 07:51:13 pm
content: "you can run the OPAMPs single supply for level compatibility with the 4060"- what do u mean exactly?- why do I need to detector out of Phase Signals?- when I remove R5 the op would be on infinity gain, wouldnt this be reliable? (What means IMHO?)So if I got this right: My signal is amplified to a square wave, that goes into the Charge pump where it is doubled (in germany this circuit is called "voltage doubler" ) then goes into the comparator which Puts out a high and resets the 4060 so there is no clock. When no signal is applied, the comparator Puts out a low (like ~2V) and the 4060 counts till there is a high on Q13 which will take like 10mins. Right?

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 08:03:10 pm
content: What are the supply rails in that part of the circuit? The40664060is ratedfor operationat up to 15V supply, Abs.Max. 18V. The OPAMP driving it *should* have the same supply rails as the 4066 if you want to have to avoid clamping the 4066 input. It would be different if you were using a real comparator as their output stages often run off different rails to the main part of the chip for ease of adaption to various logic levels.Running OPAMP2A open loop risks excessive noise sensitivity and you'll have the devils own job stopping it killing all gain by railing due to input offset voltage, and if you provide a DC feedback path so it doesn't rail, it will probably oscillate.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 20, 2020, 08:17:13 pm
content: 4066?? U mean 4060? Datasheet for the 4060 says absolute max 20V so I guess 18 should be fine? But sure i can make 15 too.So then ill add another op after the First one with a high amplification and will run the op supply at 18 (or15v).

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 08:22:06 pm
content: Sorry 4060. I don't think an analog switch would help us!First you need to decide the minimum input signal level to trigger on, then you can do the design properly.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 21, 2020, 08:20:39 am
content: I wanna trigger it around 20mv ptp, this should work

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 22, 2020, 01:48:27 pm
content: So this is how it looks now.

author: Ian.M
author_rank: Super Contributor
timestamp: August 22, 2020, 02:53:34 pm
content: Looks reasonably sane apart from the power to the comparator stage which *MUST* use the same supply rails as the 4060, and the choice of an 18V regulator. Most 4000 series CMOS is only rated up to 18V and the tolerance of a LM7818 is +/-4% so worst case you could be feeding it 18.7V which is out of spec. Can you live with a 15V rail? If so use LM7815, if not use an adjustable regulator carefully set to 17.5V.Have you simmed it yet?

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 23, 2020, 05:17:27 pm
content: The datasheet says 20V max but yea better be safe with 15V, so ill change that. Not yet, ill put it on a breadboard as soon as I have the cd4060 (2-3 days) bc I never worked with Ltspice

author: Ian.M
author_rank: Super Contributor
timestamp: August 23, 2020, 05:38:17 pm
content: Quote from: Michaelaudio on August 23, 2020, 05:17:27 pm*Good*.Absolute Maximum and normal operating Maximum limits are rarely the same. The former is the highest <whatever> that the part is expected to survive. The latter is the highest <whatever> for normal operation, including continuous use if permitted. Above the normal operating Maximum limits, there is an increasing risk of malfunctions that may only be curable by power-cycling or power off and cool-down, and the long-term reliability will decrease the closer you push the Absolute Maximum limits.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 30, 2020, 01:11:06 pm
content: Okay so after the breadboard testing, I soldered everything together on a the board it works somehow but there is 1 problem. The connetion via the diode from Q13 to the osc Pin is the problem. When I temove the diode Q4 is jumping and osc is oscilating when no signal is applied. When signal is applie Q4 stays low. I guess (if it would work) if Q13 is high, then via the diode on the osc Pin is a high too and Q13 would stay high till a signal is applied right? So I my case if the diode is connected the osc Pin just stays high (~3.5v) i dont know how I can fix this .

author: Renate
author_rank: Super Contributor
timestamp: August 30, 2020, 02:43:28 pm
content: Quote from: Michaelaudio on August 30, 2020, 01:11:06 pmHuh? What's the power supply for the 4060? is it 15 V or 5 V or 3.3 V?You can't whack in a 15 V reset into CMOS running on 5 V.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 30, 2020, 06:09:06 pm
content: Psu is 15V the osc Pin stays high at 3.5v when the diode is connected, thats what I mean.

author: Renate
author_rank: Super Contributor
timestamp: August 30, 2020, 06:59:03 pm
content: Well, then you're loading down Q13 too much with what you're driving (which isn't on the schematic anymore).

author: Ian.M
author_rank: Super Contributor
timestamp: August 30, 2020, 07:35:12 pm
content: Quote from: Michaelaudio on August 30, 2020, 01:11:06 pmI'd bet the diode's too leaky. The 470K resistor I suggested for the oscillator isn't providing enough current to overcome the diode leakage. Try a different diode with a leakage current under 1uA. If that doesn't do the job you'll have to change the timing components to maintain the same time constant, but reduce the resistance. I suggest 100K and 470nF or worst case: 47K and 1uF low leakage non-electrolytic (and if ceramic, not high-K).There's a small chance its surface leakage round the 4060's osc circuit traces. To have the best chance of removing all flux-bourne ionic surface contamination, clean that area of the board thoroughly with flux remover then hot water with a tiny trace of detergent, rinse with distilled or deionised water, shake off as much water as possible, then rinse with dry IPA. Again shake off, air dry till no IPA is visible then dry at 95 deg C for an hour, or longer if at a lower temperature.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 30, 2020, 07:57:45 pm
content: If you're dealing with a digital signal (S/PDIF or HDMI), a much better way is to check for the presence of a valid input signal.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 30, 2020, 08:05:27 pm
content: So the problem occours as soon is i plug the psu in. (Nothing connected to Q13 ecept the diode that goes into the osc pin). There is a short high peek on Q13 when I plug psu in. Are u sure it is the leakage? What is cousing the oscilator to work? It works wonderfull without the diode, so I guess when Q13 would be high , a high signal on the osc pin will stop it to oscilate?The board is all clean, always do it after solderingIts just an analog audio signal

author: Ian.M
author_rank: Super Contributor
timestamp: August 30, 2020, 08:59:45 pm
content: That's the idea - a high on the Q13 output, via the diode drags RS (oscillator/clock input) high stopping the oscillator. When the 4060 is reset, that high goes away, the diode is reverse biassed and the oscillator restarts.I expect its the diode leakage current that's the problem - other circuits I've seen that used a diode in the same way to stop them mostly operated at a higher clock frequency so had lower value timing and input resistors. You could tell for certain by disconnecting the diode anode from Q13. It will then run with Q4 pulsing with a 50% duty cycle squarewave at 1/16 of the oscillator frequency. If you aren't getting a good squarewave or its way off frequency, something else is wrong. Now ground the diode anode. If the oscillator stops, you've proved the diode leakage current is too high. N.B. glass package diodes are light sensitive and their photo-current (leakage) can become quite significant in bright ambient light. For your sanity, use a black epoxy package small signal silicon diode, not a glass package one, not a Schottky one and not a power diode.Unfortunately I don't think I've got any 4000 series 4060s in stock here, so I cant breadboard it alongside you.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: August 31, 2020, 08:06:05 pm
content: Okay so I replaced the diode, seems to work now! Will do a final Check tomorrow.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 01, 2020, 07:34:46 pm
content: It seems to work now. But there is one thing id like to change somehow. For the comparator im u sing a lm393 with pull up resistor. When signal is applied, the output is nearly the same as the signal on (+) input, it just jumps higher and lower (just as the audio signal, but in dc ofc) and is max ~ 5V why doesnt it stay at 15V constantly bc + input is higher than -? When I apply 15V at the + input then it goes to 15V on the output, as it should be. Thats a strange behaviour..

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 04, 2020, 09:10:01 am
content: So the beeing resistor after the Charge pump seems to take the voltage of the Charge pump down. I guess the Resistor is there to be a load for the Charge pump ?

author: Ian.M
author_rank: Super Contributor
timestamp: September 05, 2020, 11:53:25 pm
content: Quote from: merport on September 05, 2020, 09:46:36 pmThank you for participating and specifically for drawing a schematic. Too many newbies dont, and need every connection of their project/problem teased out of them with a'clue by four'!Not to rain on your parade, but we'd all already rejected long period simple RC timers, because the electrolytic capacitor leakage current is far too unpredictable, and the very high timing resistance is asking for trouble with board surface leakage, if there are any contaminates in the atmosphere. As its in a domestic environment and cant sensibly be hermetically sealed, surface contamination is inevitable.It may work on your bench today. but warm it up a bit and the period is likely to increase by an order of magnitude. Leave it unpowered for several months and the AlO2dielectric film may well degrade to the point where it doesn't time out until the circuit's been running for enough hours or even days to reform the capacitor. Use it a few years (or under six months if there's a smoker in the household) and its likely to stop working altogether due to board surface leakage.In days of yore, before cheap low pin count MCUs long period timing was a sufficient problem that there was a special chip, the XR-2240, second sourced from several manufacturers which was a sort of hybrid of the functions of a 555 and a 4040 or similar counter. See the sim I developed of it back in 2016 in a fit of extreme boredom!https://www.eevblog.com/forum/projects/ltspice-simulation-madness-xr-2240ua2240lm2240-programmable-counter-timer/

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 06, 2020, 04:36:05 pm
content: @Ian M. Do u have a conclusion for the strange comparator behavior?

author: Ian.M
author_rank: Super Contributor
timestamp: September 06, 2020, 05:34:37 pm
content: Nope. You'd have to capture the signal on the comparator input with a known input applied e.g a 400Hz sinewave using a scope and post it, before I'd venture to speculate what's going wrong.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 08, 2020, 08:10:12 am
content: So the higher Voltage is the input on the lm393 (+) (-) is Set to 400mV. Lower voltage ( just a short line on the right, couse its flickering and im not able to trigger it, so the output is flickering)is the output (all Set to 5V/div), put a 200hz sind wave in at max vol on my Phone. why isnt it just a high at 15V on the output?? It a comparator it should be just 0 or 1

author: Ian.M
author_rank: Super Contributor
timestamp: September 08, 2020, 08:47:12 am
content: Ah, the joys of *OLD* CRT scopes. I assume its either single channel or you don't have a second probe if its actually got two. Try turning the scope brightness down a bit to see if that gives you a sharper trace in photos.What were the timebase settings? Can you confirm it was DC coupled and also where was Y axis zero set? (i.e. with the input disconnected and grounded, what was the position of the trace on the screen?)You've already stated the Y amp is set to 5V/div.I assume we are still working from your most recent schematic:The first picture doesn't really tell us much due to the triggering problems, but the second has a curious sawtooth, fast rising with a slow decay which appears to be about 1V pk-pk amplitude, (you'd need to re-measure it on AC coupled, 0.5V/div to get a more accurate reading of its amplitude). So far, I'm suspecting that's the charge pump working, but I wont know for certain till you post the timebase settings, and where the Y zero was. Measure its (DC) voltage on a DMM to confirm the average level.Also please try a higher input frequency and see if the behavior is any different. Somewhere around 1KHz would be a good test.

author: TurboTom
author_rank: Super Contributor
timestamp: September 08, 2020, 10:36:35 am
content: You may consider using a PIC16F1765. It contains the opamp and a 10bit ADC so you could program the "dead band" and also the time that the output stays active after it's been triggered. You may also program it to make it insensitive for sporadic (noise) signals. This way, the hardware will be a no-brainer but you've got to get a little into microcontroller programming (if you aren't already), but a small project like that may be an ideal entry into this.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 08, 2020, 01:09:17 pm
content: It was DC triggered and X is at 0 for no input ofc. Time setting was around 1ms. Yea the input (+) is connected to the Charge pump. I have to update the schematic (Used as I said a lm393 for the comparator with a pull up on the outpu)t But what I dont understand is why the output isnt at 15V when the +Input is higher than the (-) input. I connected 15V to the (+) Pin and then it jumps on 15V at the output, but why not with this signal ?

author: Ian.M
author_rank: Super Contributor
timestamp: September 08, 2020, 01:41:28 pm
content: Quote from: Michaelaudio on September 08, 2020, 01:09:17 pmDid you mean that the zero input trace was lined up with the bottom line of your scope's graticule, or did you mean lined up with the center line of the graticule? There's no 'of course' as its standard practice to zero on the graticule line that allows the waveform to best fit on the screen at the highest (calibrated) Y amplifier gain possible without going off-screen. I have an old dual channel CRO scope and on it commonly zero Y1 on the centerline and Y2 one line up from the bottom of the graticule, which, as its graticule is only six divisions high, works well for 3.3V logic signals at 0.2V/div with a x10 probe, allowing me to see overshoot and undershoot clearly without the traces (usually) crossing each other.ALM393should be working OK, and should let its (open collector) output go high when +In is higher than -In as its common mode signal range includes ground. Try disconnecting the signal and instead connecting +in to a 100K pot between +18V and Ground so you can see what happens as you vary the +In voltage down near the threshold voltage on -In, set by the R10, R11 divider.N.B. the top end of that divider should be fed from the regulated +18V rail not the +24V rail.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 08, 2020, 05:34:22 pm
content: Default setting is X achsis on the middle lineSettings: 5V/div, 1ms/divThe line at 5V is the output when on the input (+) is 15V, there is a lil "hill" (u can see it on the 2.5V pic) running from left to rightSecond pic u can see the Hill and output is at 2.5V (input at 7,5V) its flickering and the Hill is also running from left to right continiously. LM is not damaged, checked it.Weird..Edit: i just removed the 2M resistor for the hysteresis and then the output stays at 0V flickering with just the Hill from left to rightI used a 330K insta and then the output goes to 10V without flickering, but still proportional to the input, so no comparat behavior

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 10, 2020, 08:59:29 am
content: Any ideas?

author: Ian.M
author_rank: Super Contributor
timestamp: September 10, 2020, 09:03:22 am
content: As always, show us an up to date schematic. It would also be worth scoping the power pins of the LM393 to check its supplies are clean.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 10, 2020, 09:11:21 am
content: I can do that when im home, its still the same schematic but with a lm393 with pull up instead the tl072 for the comp and the beeing resistor is 330K the Rest is still the sameVCC looks clean on the scope

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 11, 2020, 06:00:29 pm
content: Well, I found it out... I was a big soldered mistake. Connected ground to the output

author: Ian.M
author_rank: Super Contributor
timestamp: September 12, 2020, 12:40:54 pm
content: I'm glad you worked it out in the end. For completeness, to help others, and to close off the topic, please post the final version of your tested, working, standby circuit schematic.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: September 12, 2020, 05:34:48 pm
content: Thats the final Version, it works.