Shop OBEX P1 Docs P2 Docs Learn Events
Some audio schematics, will they work? — Parallax Forums

Some audio schematics, will they work?

KyeKye Posts: 2,200
edited 2009-10-19 05:41 in Propeller 1
Hey guys,

I was working on a design for a few audio circuits for a board I plan to produce and I just wanted to ask if the schematics below make sense.

attachment.php?attachmentid=64463

I'm thinking the audio out circuit using the transistor may be pushing it but I'm not sure. I would as other applications do, pass a 40Mhz signal through the DAC line adjusting its duty cycle.

Also, could I use a 10K ohm resistor in place of the 100k ohm resistor for the sigma delta ADC? Maybe I should adjust the caps as well?

Thanks for your input.





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
963 x 722 - 25K
«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-17 23:41
    On the amplifier for the DAC output. I'd replace the 1uF capacitor in the emitter lead with a resistor. The 1uF capacitor provides no DC return for the transistor and the 1uF just shunts the output signal to ground.
  • KyeKye Posts: 2,200
    edited 2009-10-18 00:09
    Sorry, forgot to mention that the point of the capacitor is to provide the rc integration of the 40Mhz signal. The idea I think benhind the circuit is to use the transistor as a larger current source than the prop chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-18 01:05
    It's a long time since I did transistor theory, but I agree with Mike, you need a resistor in the emitter.

    Circuits I have seen do not require transistors for headphones so you may not require this.

    Anyway, you could make a common circuit for both input and output, which would be useful for stereo in or stereo out, just by chaning loading different components.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-18 01:15
    Kye, you should put the low-pass filter in the base circuit. But, even then you will run into trouble with low-level signals, since an emitter follower won't begin to conduct until the base is 0.6V above Vss. Frankly, the transistor is superfluous. To achieve line-level output, a 430-ohm resistor with a 0.1uF cap to Vss for filtering, followed by a 4.7 - 10uF coupling cap is all you need.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-18 02:30
    Buffering does help as any loading affects the amplitude and filtering otherwise. But if you even think of buffering then just use an opamp, even the basic LM358 in a voltage follower circuit. If you are working with only the 3.3V rail then drop the output level to 1Vp-p for standard line level audio with maybe a bit extra for compensation. The easiest way to do this is use the second opamp as the final voltage follower buffer and have a divider in between the two stages.

    Audio input requires some limiting impedance for the charge balancing circuit to work but it does not require pullup resistors. The 10K feedback resistor tries to balance the charge on the capacitor but if the input impedance is too low it doesn't have a chance of balancing it. Also any resistors on the audio input side has only ever been for electret microphones which need power in which case it is also advisable to add an extra RC filter to this feed *if* it is required. At least make this resistor value more like 10K rather than 2K2..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • tronsnavytronsnavy Posts: 70
    edited 2009-10-18 03:08
    I used the audio amp using the LM386 in attachment.· Worked great.
  • KyeKye Posts: 2,200
    edited 2009-10-18 03:49
    @Peter - Actually 2.2K is the reconmended value for electret microphones.

    Thanks for the advice guys. (I know the transistor is not needed, however, I have a surplus of one used in my circuit and I was thinking that buffering the audio output would be the best use.)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-18 04:06
    Hi Kye, RC integration requires source and sink otherwise all you have is the buffered equivalent of a diode pump which builds up charge but doesn't discharge. The transistor could be added as an emitter follower buffer after the RC as long as your bias your DAC up by 0.6V in software (add an offset). I was thinking of 10K as a general-purpose figure for the cheap mini electret elements although you are right that 2K2 is recommended for standard electrets. You may want though a jumper for this as the DC may interfere with some audio sources.

    The series input resistor needs to go between the input caps and the charge balancing caps and this value is adjusted to suit the input signal level. Without this resistor the audio may work if the input is high impedance but that is not normally the case for line impedances.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • KyeKye Posts: 2,200
    edited 2009-10-18 04:59
    Okay, here is an improved version.


    attachment.php?attachmentid=64468
    ·

    Sorry, for bmp. Thought I made a png.

    So, this circuit uses the transistor as a buffer, and gets the full benifit of it. However, the charge path has a different time constant than the discharge path for the cap on the dac side. I'm not sure if this will matter or not. Any ideas?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,

    Post Edited (Kye) : 10/18/2009 5:06:14 AM GMT
  • BradCBradC Posts: 2,601
    edited 2009-10-18 05:34
    Unless my basic theory has gone out the window this does not look like it's going to give you any form of clean audio.

    The 2N3904 has a switching time between 35 & 50ns at a base current of 1mA. You are driving the base with 10K and therefore are going to get Ibase of about .27mA. This will slow the transistor down significantly and see all sorts of cool non-linearities.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-18 06:58
    Key,

    With a minimal investment in time and materials you should be able to breadboard and try your audio output circuit. Have you done this? If so, what did you observe?

    The input circuit is harder to breadboard due to the necessary proximity of the delta-sigma circuitry to the Prop. However, the Demo Board schematic provides all you need for a mic input. It works well, so why not just copy it? (Hint: your 10uF input caps are way too big.)

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-18 08:45
    Kye, the filter cap has to go with the resistor to create an analog voltage which is then buffered, you can't buffer it this way as the analog signal won't be buffered. What Brad and Phil said is correct about the circuit and it's values although 10uf ain't gonna hurt anybody but I would have used 1uf. I still don't see any input resistor from the audio input as *PART* of the sigma-delta. If you don't think you need it then put it in anyway because with a lot of these components you can leave them out or substitute values but it's a lot harder to put them in later on if you haven't allowed for them.

    The 2.2K resistors feeding power to the electret microphone inputs really do need to be bypassed and filtered otherwise you are directly injecting noise from the digital supply line into a sensitive part of the circuit.

    P.S. I have attached a sample circuit that should guide you although the actual component values could be optimized.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*

    Post Edited (Peter Jakacki) : 10/18/2009 9:25:26 AM GMT
    963 x 783 - 40K
  • KyeKye Posts: 2,200
    edited 2009-10-18 15:13
    Thanks again, then, now I see what you are talking about Peter.

    For all this stuff I'm actually trying to cut cost and use the most minimal implementation. I could use a filter on the 2.2k supply line, but then that would also be the case for the other I/O lines too. Mmm, decisions...

    I will have time to try this stuff out next week hopefully.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-18 17:37
    Peter,

    The Demo board doesn't use a serial resistor from the mic to the ADC either. I think the 10K resistance of the pullup on that board, along with the 0.1uF series caps, determines the input impedance. Along with the 100K feedback, this prooduces a 10x or so gain stage in addition to the ADC function.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-18 18:03
    Kye,

    I'm still not convinced that the NPN transistor is biased properly for what you are after. What are the DAC output characteristics, and what are the desired characteristics for the audio out? The way it is, if the DAC is a 5V DAC that swings from one rail to the other, there will be a small voltage level translation to the audio out that will cause it to go +/-3V... If you are driving a Prop ADC with that output, I think that you might really want +/-1.5V (or approx 1.65V) instead.

    The transistor should be placed in it's linear mode, and especially for single transistor amplifier applications, you should have an input cap as well as an output cap to prevent any DC bias.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • KyeKye Posts: 2,200
    edited 2009-10-18 20:19
    Argh, but I'm trying to cut cost, not do it the "right way". Using the prop chip I have very fine control over the frequency input.

    What would be the cheapest way to do this while still offloading the current sourcing from the prop?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-18 21:46
    Kye,

    Maybe I'm missreading your intentions. What characteristics are you looking for on the input and output of the transistor circuit? If you want an amplifier, there are better ways to bias the transistor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-18 22:44
    Kye, the transistor circuit example is only for for your reference since you want to use an NPN. The transistor will work in this circuit as long as the Prop's RC DAC feeding into it is offset by at least 0.6V in software so that you have a signal from 0.6V to 3.3V. But if you want to buffer the signal (I would) then an opamp is a much better solution and just as simple.

    Regarding the audio input maybe I am misreading you as I think that you want to handle standard line levels as well as electret microphones, am I correct? The series resistors can be adjusted to suit if you have a low impedance input vs the high impedance of the microphone.

    You don't need to bypass the other signals, only the DC power to the microphone as this would otherwise be the electrical equivalent of feeding any digital noise imposed upon the 3.3V rail directly into the sensitive input of the ADC. i don't know what the problem is with having an extra resistor and a capacitor for this at least. As I said before it is easy on a finished board to change values or leave them out but it is much harder to add components afterwards. Don't skimp here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-18 23:13
    Kye,

    Minus the 1uF and 10uF caps on your original transistor circuit, the attached image is voltage (green) and current (yellow) across the 240 Ohm resistor.

    Notice some clipping across the bottom of the sinewave in the 'upper image'.

    By slightly biasing the transistor with a 47K resistor across the B-C junction, the clipping goes away. (lower image)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    832 x 216 - 67K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-18 23:31
    Beau, isn't the original circuit actually an unbuffered circuit? The idea of the buffer is to isolate the whole RC filter from the load but that can't be isolated if the filter capacitor is on the output. The reason that the RC filter should be isolated is that external capacitance and loading affect the filter response leading to degradation of the frequency response and amplitude etc.

    I haven't looked into it a great deal but maybe this is the time to "nut out" the Prop RC DAC properly. There's a lot of talent and experience on this forum and I am sure we can come up with some reference circuits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-19 01:09
    Peter,

    The only thing really acting like a filter cap is the 1uF ... I don't know that I would put it there... the 10uF's just create a DC block allowing the signal to ride above and below 0V. Even in this configuration the 1uF with the 10uF's act more like a voltage divider than a filter. Still don't know that I would use it, since when paralleled with the 240 Ohm resistor it can have adverse effects.

    Your right though, any type of filtering needs to happen at the input rather than the output, and the input should be DC biased/blocked with a cap.


    Just some basics:
    www.st-andrews.ac.uk/~jcgl/Scots_Guide/audio/part1/page2.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-19 02:49
    Beau, I'm not sure which schematics you are referring to. If it's Kye's 2nd schematic (K2) then I agree with you but I don't know where to start or end on a critique of that particular circuit (sorry Kye). I usually operate around a software biased midpoint to avoid clicks and also I use opamps for buffering and extra filtering as well as level adjustment.

    I'm still not sure what type of audio input Kye is using though, because if it is electret mikes then the 2K2 "bias" resistors need to be in place and preferably with the RC filter shown from the supply. samplIf it's a line input then he will need those series resistors that I have in my example circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • KyeKye Posts: 2,200
    edited 2009-10-19 03:20
    Hah, okay, well I've asked for professional advice and you guys have given it. =)

    The point of the transistor circuit... well, is bad. So lets leave it at that. I believe the best and most constructive thing out of this topic is what Petter has proposed that I should use a filter on the audio input.

    Thanks again,

    (Its just really difficult trying to figure out the best implementation of stuff because I have to justify the extra cost when saying is it worth it? My board is made for education so the quality does not need to be steller... that said, only doing the necessary stuff for reliable operation is what I want).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-19 03:35
    I've implemented a board with line level audio outputs that skips the output buffering completely. It's described in my first post above and works fine for its intended purpose, which is driving speaker amps, TV audio inputs, etc. Capacitive loading has simply not been an issue.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-19 03:37
    Hi Kye, since you have said it is for education then that is a different story. Keep it simple (although you could allow for more). Just use the simple RC DAC for the ouput and what you have for the input will be fine although I would still allow for the series input resistors. I didn't think that any extra passives or even an opamp was going to add more than 50 cents to the cost of it though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-19 03:39
    Kye,

    I wonder if you could do everyone a favor and repost your second set of schematics. As it stands, it's a 2.0MB (!) BMP file, and page 1 loads very slowly as a result. Your first schematic set is a PNG and is much smaller at 26KB.

    Thanks,
    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-19 03:55
    Peter,

    I was going with Kye's ... http://forums.parallax.com/attachment.php?attachmentid=64468


    In the attached schematic, version #1 is similar to your version with a 4.7K resistor creating a bias to prevent clipping. The output drive of version #1 is only about 4.4mA ... Version #2 is derived from Kye's schematic using a 47K to bias the transistor from clipping and is essentially the same as version #1, but it delivers about 13.55mA of drive current.


    Note: In each case, the input resistor and CAP form your lowpass filter (Version #1 uses a 1K as the input R, and version #2 uses a 10K as the input R)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 10/19/2009 4:05:07 AM GMT
    1121 x 561 - 181K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-19 04:22
    Beau,

    In your first schematic (assuming Vdd = 3.3V, since the DUTY-mode output comes from a Prop), you won't be able to get more than 2.7V / ohm of output current or < 2.7mA into a 1K resistor. But the emitter resistor current is not the available output current anyway, is it? It seems to me that up to 2.7V * β/ (4.7K || 1K) could be delivered in total if the load required it.

    Is that right, or am I missing something?

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-19 05:25
    Phil,

    I had VDD set at 5V in the simulation hence 4.4mA .... this circuit works just fine at 3.3V also.

    The output Voltage should track at whatever the input voltage is, so even if VDD is 5V if the input doesn't go over 3.3V neither will the output. The current however with VDD at 5V will be slightly higher at the output than if VDD were at 3.3V

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-19 05:41
    "The output Voltage should track at whatever the input voltage is...", less 0.6V, right?

    But I guess what I was really trying to distinguish was the actual emitter current (which is determined by VE and the emitter resistor) versus the total available current, which is given by:

    ····(Vbase - 0.6V) * β/ (Rpullup || Rbase)

    In this case, the circuit on the left is capable of more current drive than the circuit on the right.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 10/19/2009 5:46:18 AM GMT
Sign In or Register to comment.