Auto standby with Attiny - Page 1
Forum section: electronics / beginners

author: Michaelaudio
author_rank: Regular Contributor
timestamp: July 13, 2022, 06:43:47 am
content: So i wanna make a standby curcuit for an Audio amp. (Its on the same board). I have not much experience with Microcontrollers, so i wanna make sure it will work. I will get help to programm this thing, as im not familiar with programming.The Sense L/R markers are the Audio signal, since the attiny has internal ADCs, i guess it should work like that. I wanna sense the signal, if longer than 15mins is no audio signal applied, the tiny should switch a few transistors, and mute the amp.With the RC filter i wanna make sure no noise will mix with my audio Signal from the Attiny.So, will it work like that?

author: Ian.M
author_rank: Super Contributor
timestamp: July 13, 2022, 07:08:53 am
content: No.Using N-MOSFETs in common drain, you'd need gate drive >> 5V to get them to fully switch on and pass 5V signals. Q7 should probably be PMOS, source to the unswitched 5V rail. Q6 is switching a 10K pullup to 5V in/out, and you could probably get rid of the MOSFET and simply feed the pullup direct to an I/O pin then switch the pin between logic high, and Hi-Z.If the audio signals are DC biased to stay in the 0V to +5V range you can connect them direct to the ATtiny ADC inputs, however that's not the way to bet, as if they ever peak more than approx. 0.5V negative, the ATtiny wont be happy.Also, can the signal source stand 5.6nF shunt loading without loosing the high frequencies? If its unbuffered, that's probably a good way of turning Hi-Fi into Lo-Fi!

author: Michaelaudio
author_rank: Regular Contributor
timestamp: July 13, 2022, 09:56:13 am
content: Thanks for the reply. The Fets are TTLs, i think they should Switch Just fine?As for the pull up, yea that would be easier.The audio Signal is biased at 7.5V (i sensed the signal at 0V, but that didnt make Sense). Guess i'll do it with a divider, its 3.5V then, the max voltage of the Signal is 0.9V rms. Im using a Adau1701, can Post the whole schematic If needed.I was not sure about the Filter, i just dont want any noise produced from the tiny to mix with my audio Signal. I can add a resistor, before the caps, so it forms a "T" , it would Filter at 50kHz in both directions then, theoretically. But i dont know If that makes Sense.Updated it looks like this now:

author: Michaelaudio
author_rank: Regular Contributor
timestamp: July 14, 2022, 11:03:21 am
content: Will the Attiny even inject noise to my audio Signal? Its basically just an adc input, isnt it?

author: Ian.M
author_rank: Super Contributor
timestamp: July 14, 2022, 02:31:59 pm
content: A switched capacitor ADC input which will draw pulses of current at your ADC acquisition rate as it charges its sampling capacitor for each reading. Whether or not that will inject noise if connected directly depends on the source impedance of the signal feeding it. The sampling capacitor is only 14pF so it shouldn't inject much noise if the signal source impedance meets the datasheet recommendations for ADC use.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: July 14, 2022, 08:06:51 pm
content: Its recommended for 10k or less.I wanna sense the signals directly before the Input caps of the adau1701, the signals to the input come from 3 different sources (switchable via an ic). I thought about, If it will matter, when the noise produced by the Tiny, gets fed into the Input ADCs of the adau, since its an ADC too an there is an output filter of the DAC of the DSP anyways. I may dont have to worry about this If i got it right?

author: Ian.M
author_rank: Super Contributor
timestamp: July 14, 2022, 08:21:50 pm
content: Are you *CERTAIN* the DC level of the signal after the analog switch IC is suitable for your ATtiny ADC? If not, you need an OPAMP buffer anyway to level-shift your signals, which would also prevent the ATtiny ADCs pulsed input current disturbing the input signals.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: July 15, 2022, 06:37:02 am
content: The DC level is at 7.5V, so when i use a devider, lets say 50:50, id have max + 4.5V and min 2.5V ptp with 2V rms on the Input. (Which is too high already). The 7.5V is stabalized with an op amp as a Buffer with a devider on the + input, that gets fed with 15v. So that should be fine, max Level would just depend on my resistor devider.

author: Ian.M
author_rank: Super Contributor
timestamp: July 15, 2022, 08:54:31 am
content: So run the numbers on how low an input signal you can reliably detect. I suspect that with a 7.5V DC offset, and a simple resistive divider to get it to the center of the ADC input range (for max. dynamic range), you are rapidly going to run out of usable ADC resolution (i.e. above the noise floor), before you get down to the min. level you want to detect.

author: AndyBeez
author_rank: Frequent Contributor
timestamp: July 15, 2022, 11:57:26 am
content: Not sure if it is clear, but what is your audio input? Are you sampling the amplifier output stage or the line input? Those are very different voltage ranges.Either way, you will need an op amp stage as a mixer-attenuator to clamp your voltage levels to a predictable range. If you are just looking for 'quiet', a biased transistor might suffice which turns on/off when the input goes to zero.From the attiny side, check out the diminuative ATTINY10 as it does what your 85 does but with less pins.

author: Michaelaudio
author_rank: Regular Contributor
timestamp: July 25, 2022, 02:22:54 pm
content: Im not sure what is Common to use, but i thought about something like 50mV rms, which would be 25mV after the devider, should be enough.I'll sense it on the RCA Inputs, bc i can only use RCA for the Standby function. In BT or spdif mode, there will be just a high on the Attiny Input, so it just stays on.AndyBeez, with a resistor divider i should just do that i guess, the voltage wont be affected.