Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 6 FirstFirst 1 2 3 4 ... LastLast
Results 26 to 50 of 133

Thread: Teeny Guitar Audio Board

  1. #26
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Vancouver Canada
    Posts
    627
    Quote Originally Posted by Blackaddr View Post
    An NE5532 is a BJT op-amp, it doesn't have high enough input impedance for a guitar buffer.
    By spec sheet it's min 30K (typ 300K) ... I'd have thought that would be enough for coil pickups...
    Quote Originally Posted by Blackaddr View Post
    The TL072 is definitely not audiophile, but is VERY common in guitar pedals as a preamp is very usable.
    that's kinda my point... a low-end part that works fine for guitar
    Quote Originally Posted by Blackaddr View Post
    If you unity buffer into the ADC (like I show in my OP schematic) you run the risk of the signal being too low.
    Then add a smaller resister in-line with the switch/JFET.
    (I believe a programmable SPST audio switch like TS5A3166 is nearly as cheap as a J107 and it's THD spec had enough zeros after the decimal for me to not worry about it).

    The hi-gain calculation would have to consider both feedback paths if there is resistance on the switched path.

    Quote Originally Posted by Blackaddr View Post
    Hot humbuckers will likely be fine but a piezo pickup on an acoustic requires far more gain than then the +12db the WM8731 has built in
    ...and then you mentioned piezos... much of what I said doesn't necessarily apply to them.

  2. #27
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Quote Originally Posted by oddson View Post
    By spec sheet it's min 30K (typ 300K) ... I'd have thought that would be enough for coil pickups...

    that's kinda my point... a low-end part that works fine for guitarThen add a smaller resister in-line with the switch/JFET.
    (I believe a programmable SPST audio switch like TS5A3166 is nearly as cheap as a J107 and it's THD spec had enough zeros after the decimal for me to not worry about it).
    I guess it's subjective what input impedance is acceptable but nominal guitar amp input impedance is 1M, many people find 500K tolerable....below that, I guess the question is how strong are your pickups and how much tone suck is acceptable?

    The TS5A3166 is unfortunately a 5V part. The solid-state switch needs to handle the +9V supply that the guitar JFET buffer requires. :-(

  3. #28
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Vancouver Canada
    Posts
    627
    Quote Originally Posted by Blackaddr View Post
    ...The TS5A3166 is unfortunately a 5V part. The solid-state switch needs to handle the +9V supply that the guitar JFET buffer requires. :-(
    Right... how many times can I forget the same point in one thread... TI shows 9V or better parts for <$0.50 in quantity. So not terribly more than a JFET if the noise from the latter turns out to be a problem.

    Re: tone suck... I don't quite understand when tone sucking is supposed to start. I know it matters on very low impedance circuits like Fuzz Face but I'd have thought something like 20 times humbucker output impedance would be sufficient. (Since read should be 'several orders of magnitude' greater for signal input bridging... live and learn!)

    But I have only the most general understanding of the issue.

    Personally I'd use the 072 just out of habit and familiarity.

    Best of luck on you build.
    Last edited by oddson; 03-17-2017 at 04:08 AM.

  4. #29
    Member
    Join Date
    Nov 2015
    Location
    Norway
    Posts
    65
    Quote Originally Posted by Blackaddr View Post
    I guess it's subjective what input impedance is acceptable but nominal guitar amp input impedance is 1M, many people find 500K tolerable....below that, I guess the question is how strong are your pickups and how much tone suck is acceptable?

    The TS5A3166 is unfortunately a 5V part. The solid-state switch needs to handle the +9V supply that the guitar JFET buffer requires. :-(
    The input impedance of an opamp is dependent of the configuration.
    In a non-inverting configuration the input impedance is defined as: (1+A0*B)*Zi
    Look at this link:
    http://electronics.stackexchange.com...verting-op-amp
    So if you have a voltage follower, 30k input res * 10^6(open loop gain) you get an input impedance of more than enough as seen into the opamp.
    It will pratically be determined by the voltage dividers on the input to GND and Vcc.
    So on your input you will have 1M||2M2||2M2 = apprx. 0.5M.

    I use 470kOhm to GND and Vcc and that gives about 240k input impedance. That can of cource be raised=)

  5. #30
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Quote Originally Posted by omjanger View Post
    The input impedance of an opamp is dependent of the configuration.
    In a non-inverting configuration the input impedance is defined as: (1+A0*B)*Zi
    Look at this link:
    http://electronics.stackexchange.com...verting-op-amp
    So if you have a voltage follower, 30k input res * 10^6(open loop gain) you get an input impedance of more than enough as seen into the opamp.
    It will pratically be determined by the voltage dividers on the input to GND and Vcc.
    So on your input you will have 1M||2M2||2M2 = apprx. 0.5M.

    I use 470kOhm to GND and Vcc and that gives about 240k input impedance. That can of cource be raised=)
    Okay, I decided to check out your links and go back to my university textbooks on op-amps to go over input impedance calculations. In my day job I am a digital signal processing engineering, and while I have some good analog experience, much of it is from adopting the practices handed down to me by Sr engineers earlier in my career (which can be wrong of course) so I do often need to question my conclusions.

    The worst case open-loop gain of the NE5532 (from TI) is spec'd at 25,000 at ambient for VCC = +/- 15 (I couldn't find where you got openloop gain = 1,000,000?). I'm obviously running much lower supplies but let's assume for open-loop it's at least 25,000. That factor is reduced by the actual gain. I think I will be adding a switch to select 0db or +12 db (approx 4x). This sets the closed loop gain > 25,000/4 or > 6250. Input impedance would be worst case 30K * 6250 = 1.875M worst case, and I'm not a pessimist.

    So I think you are correct the input-inpedance requirement can be satisfied given the fact it is amplified by the closed loop gain.

    HOWEVER, the idea that BJT based op-amps should not be used for guitar pre-amp inputs is deeply ingrained in pedal lore, and while that may be unjustified it may also indicate there is a good reason. Another major difference between JFET and BJT op-amps is the input bias and offset currents. The NE5532 has bias/offset currents of 200/10 nA respectively. The TL072 has input bias/offset currents of 65/5 picoamps (because of the gate of course).

    @omjanger - do you have any comments on these currents as it pertains to the direct connection to a guitar's pickups & volume/tone circuit?

  6. #31
    Member
    Join Date
    Nov 2015
    Location
    Norway
    Posts
    65
    Yes I have to read my books too here=P You are right about the open loop gain. I had one zero too much. TI specifies the typical gain to 100V/mV.

    To be honest, I started using the NE5532 many years ago in my pedals because they had a good reputation for audio, low noise, low price(relative) and high voltage supply. And I have been happy with them and have not thougth about the offset or bias current=) So you are right that the TL072 has better specs on that point.
    qoute from somewhere on the great internet..: "I was testing also popular TL071, TL072, like in MicroAmp, but it was a little bit colder and less full than the NE5532." audio will always be subject to thoose feelings
    I have mostly made overdrives and fuzzes, so the overall sound has been the goal. (but I think the TL072 would have done the job perfectly good too). The sound shaping has mostly been done by clipping diodes and filters.

    Anyway, you can just test several opamps and deside when the rest of the board is up and running. At least good with standard pinouts..

  7. #32
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    @omjanger - yeah I've got the board layed out with an SOIC package for the dual opamp. So you can choose TL072, or NE5532, or even OPA2134 if you got $$$ to burn.

    Thanks everyone for the discussion. I looked at all the other codecs suggested, but have a requirement that it be in a hand-solderable package like a TSOP, no QFN or BGA. Given the requirements for +20db and -30db of gain to handle a wide range of instruments, I'm going to stick with the WM8731 due to providing good gain and attenuation in it's internal PGA.

    In the interests of the KISS principle, the gain in the OP-AMP will be mechanically switched rather that digitally switched. Any software controllable solution for the opamp feedback results in expensive parts once you go over +5V analog supply as discussed previously in the thread, and the guitar preamp needs +9V minimum.

    Here's a block diagram of the boards functionality. I'll be finishing up the schematic changes and final board layout over the next few days. The PCB is about 9.5cm by 5cm.

    Click image for larger version. 

Name:	teensy_guitar_audio_diagram.png 
Views:	236 
Size:	240.0 KB 
ID:	10014
    Last edited by Blackaddr; 03-18-2017 at 05:45 PM.

  8. #33
    Junior Member
    Join Date
    Oct 2012
    Location
    Boston
    Posts
    15
    @Blackaddr and all,

    Does that input buffer need overvoltage protection for the codec? Both the WM8731 and the SGTL5000 specify an abs max input of AVDD+0.3V/AGND-0.3V. I'm pretty sure that my son damaged one of my SGTL5000 audio board line-in's with his overzealous guitar playing. Would a pair of 1n914 diodes to AVDD/AGND and the op amp output be a good idea? I'm using TL072's because I have a bunch of them.

    We are playing around with milling PCB's for Guitar pedal/synths with MIDI, Teensy 3.6, a 2.42" OLED, and the SGTL5000 audio board. It's lots of fun but I want to avoid blowing more audio boards.

  9. #34
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Quote Originally Posted by SteveC View Post
    @Blackaddr and all, Does that input buffer need overvoltage protection for the codec?
    Hmm...that's an excellent discussion point. Normally you would throw some schottky diodes with low forward voltage drops (note: 1N914 is general purpose and the forward voltage drop may to be too high to protect correctly) connected to the supply but it's more complicated than that.

    My plan had been to use the WM8731's PGA attenuation to reduce the level of a hot input into the 1vpp range the ADC wants. GIven a maximum possible input of 9vpp (if you install a rail-to-rail op-amp) you need about around -20db attenuation to get the signal down with a little headroom. This is the big reason why the WM8731 was the winner. It's got both moderate gain and heaps of attenuation available in that onboard PGA.

    That's the nice thing about an inverting op-amp configuration (as used in the WM8731). The input resistor (when attenuating) drops the voltage down before the signal hits any active circuitry.

    That said, I was only thinking from a signal distortion perspective. Not a electrical protection perspective. The PGA guarantees you can bring the signal down to avoid distortion, but it doesn't prevent damage the ADC if you've set the PGA gain improperly. I'm sure no one likes the idea of accidentally blowing up their CODEC based on a software setting.

    Adding protection diodes as SteveC originally suggested should ensure there is no damage. BUT, there is a problem here. If the signal from the guitar happens to be greater than 3.3V, and the input TL072 is set for 0db gain, it will still trigger the protection diodes and while nothing is damaged, the signal is wrecked before the PGA has a chance to attenuate.

    Perhaps we need a compromise here. Added protection diodes to ensure the hardware can't be damaged, modify the TL072 to provide a small amount of attenuation on it's output divider (say 25/75 ratio) to get a 4vpp signal down to prevent diode activation. This reduces total available system gain by about 2.5db.

    Even active pickups rarely put out more than 4vpp, if so you've probably got a guitar pedal in front and you're just gonna have to turn the damn thing down. ;-)

    Anymore more thoughts on the codec input protection issues raised by SteveC?
    Last edited by Blackaddr; 03-19-2017 at 02:23 PM.

  10. #35
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    148
    The Hoxton Owl programmable guitar pedal also uses the WM8731. You can check out their schematics, in case you don't feel like creating your circuit from scratch. In light of all the theorizing happening in this thread, one might find their schematic to be helpful in seeing what others have found to be important to address (and what wasn't found to be important)....

    Schematics: https://hoxtonowl.com/mediawiki/index.php/Schematics

    Note that they have two PCBs contained within the guitar pedal: a "digital" board that includes the CPU and codec and then a "Pedal", or analog, board that has the interface to the outside world. Most tellingly, on the schematic for the "pedal" PCB, you can see that they buffered the inputs and outputs with the 4-channel version of the TL072 (ie, the TL074).

    I have the Owl pedal. It's fun to play with. I'm not a huge fan of the web-based software compiler...it works well enough, and I like the web-based documentation and sharing, but for algorithm development, I'd much prefer a local compiler, like the Arduino+Teensy combo.

    Chip
    Last edited by chipaudette; 03-19-2017 at 07:35 PM.

  11. #36
    Junior Member
    Join Date
    Oct 2012
    Location
    Boston
    Posts
    15
    @Blackaddr, Sorry, yes of course I forgot the .7V forward drop of a silicon junction diode, a schottky with half that would be good. Thanks! Also to be clear, the damage I'm worried about is in the CODEC's input pad structure before the PGA and any other downstream circuitry. The PGA can't damage the ADC.

    @Chipaudett, thanks for pointing out the Owl pedal project. I looked at it a long time ago and forgot about it. It uses a BAT54S dual schottky protection diode on the TL072 output to 3.3v (the CODEC's AVDD) and GND. Interesting that the input is DC coupled, is that common?

  12. #37
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    @chipaudette I took a look at the Owl. Some interesting design choices, and a couple things I'm not a fan of. As SteveC pointed out, it's DC coupled. The TL074 is powered by 5V, but it's biased at VMID from the CODEC, which is 3.3V / 2. This permits DC coupling straight to the CODEC. It's only AC coupled at the TL input. Technically nothing wrong with this, and saves some components, but I still don't like it. Any offset errors in the opamp will end up on the output, shifting away from VMID and reducing the headroom before the CODEC. This is why you AC couple between chips, it prevents offsets from accumulating.

    Another issue is if the TL is biased at 1.65V, and since the TL is not rail-to-rail, if it goes within 1.5V of a supply it risks latchup. Which means you only have 150mv of range on the low side before you get too close to GND. This effectively limits your max vpp on the input to 300mv! This is enough for most passive pickups, but a hot humbucker could exceed that and if you use active pickups or put a hot pedal in front you're gonna have to turn your volume on on the guitar way down to prevent input clipping.

    The whole point of the hassle I've gone to with running the preamp off 9V, then safely getting it down to 1vpp is to prevent this problem.

    @SteveC I looked at both the analog and digital board schematics and I'm having trouble spotting the BAT54S protection diodes. This is the same part I've got on my latest schematic at the moment so I'd like to take a look at it. Exactly where, and on which schematic are those diodes? My eyes keep missing them.

    As for the output OP-AMPs, it looks like it's just buffering and setting the output impedance. I did not include output buffers on mine, more parts I don't have space for. I presume this is because the inverting op-amp in the CODEC results in inverted polarity with respect to the board input, so the inverting op-amp restores this. In my case I planned to do the inversion digitally in the microcontroller.
    Last edited by Blackaddr; 03-20-2017 at 03:22 PM.

  13. #38
    Junior Member
    Join Date
    Oct 2012
    Location
    Boston
    Posts
    15
    @Blackaddr, I took another look at the schematic sheets and realize that I was looking at the Modular sheet. It looks like it is interchangeable with the Analog pedal sheet so that you can make a modular synth with the digital board. The protection diodes are only on the Modular sheet! I was confused by the label EX_IN_L for expression input but it looks like there is a jumper on JP3 that can route the IN_L jack to EX_IN_L.

    So the TL074 can drive 5V into the CODEC? Am I missing something? Now, when we blew the SGTL5000 input channel we had no buffer amp in the way, so perhaps, despite the manufacturer's Max specification, the inputs are robust to being over driven by an op-amp but not directly by a pickup. My background is in semiconductor industry DSP design and apps but I'm woefully inexperienced in practical analog electronics. Is there something in that TL074 configuration that would limit the output swing?
    Last edited by SteveC; 03-20-2017 at 08:39 PM.

  14. #39
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Quote Originally Posted by SteveC View Post
    So the TL074 can drive 5V into the CODEC? Am I missing something?
    ...Is there something in that TL074 configuration that would limit the output swing?
    Well, we know that the TL07x can't get to it's rails, so worst case it' probably sends about 3.5V into the codec since it is supposed to only get within 1.5V of the rails. 3.5V into the CODEC probably won't destroy codecs very often, but I still think there should be protection as SteveC brought up in the first place, I wouldn't rely on the inability of a TL07x to reach it's rails as a safe feature. What happens if you swap it for a rail-to-rail op-amp? Then you are pretty much guarenteed to damage something if that op-amp rails.

    I'll post an updated schematic soon. The changes since the OP is selectable gain has been added to the preamp, and protection diodes have been added to the CODEC inputs. I think I'll going to breakout some unused teensy I/O to solder pads in case they become useful for driving external LEDs or something.

    I'm hoping that's just about everything. The board is *really* full in the analog area I don't really have room for anything else.. I could barely fit the gain switch and protection diodes without adding long stub tracks.

  15. #40
    Member
    Join Date
    Nov 2015
    Location
    Norway
    Posts
    65
    Thank you @Blackaddr for bringing up these topics! Will also influence my next revision of my pedal input board=)

  16. #41
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Quote Originally Posted by omjanger View Post
    Thank you @Blackaddr for bringing up these topics! Will also influence my next revision of my pedal input board=)
    Hey, no problem! We'are all here to help each other right!

    I can't wait to dig into chipaudette's floating point extensions to the Teensy Audio Library.

  17. #42
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Vancouver Canada
    Posts
    627
    A couple of app-notes on these issues:

    If you overlook the sales hyperbole for their op amps this document covers a number of methods for signal conditioning for low voltage ADCs:
    http://www.ti.com/general/docs/lit/g...Number=SBOA097


    This one seems to be more about showing the SNR impact from scaling amplifiers is less than you might think (and the argument would appear particularly strong for guitar signals):
    https://www.maximintegrated.com/en/a...ex.mvp/id/5282

  18. #43
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    @oddson Yeah, I agree the SNR impact from the front-end TL07x doesn't worry me. They're already ubiquitous in guitar pedals and pickups by their nature aren't pristine sound generators anyway.

    I also decided to add footprints for two optional SOIC-8 SPI devices, such as 1Mbit SRAMs (23LC1024). I've got some space in the digital area of the PCB. Just seemed like the right thing to do.
    Last edited by Blackaddr; 03-22-2017 at 12:59 AM.

  19. #44
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Just donned on me. That input op-amp filter on the Owl pedal is a standard sallen-key lowpass filter, it's got a cutoff of about 29 kHz. I guess this is supposed to be an anti-aliasing filter before the ADC, but it's totally redundant. The WM8731 already had built in anti-aliasing filters that will be much lower noise and distortion than the external one. I really don't think having an extra one up front is needed.

  20. #45
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Board is nearly done. I've attached the updated schematic with the changes discussed thus far in this thread and some 3D pcb renderings. The I2S pinout is designed based on the defaults from the Audio Editor GUI for I2S components.

    MIDI RXD / TXD = 0 / 1

    MCLK = 11
    BCLK = 9
    LRCLK = 23
    DAC_OUT = 22
    ADC_IN = 13

    SPI0_SCLK = 14
    SPI0_CS = 15
    SPI0_SI = 7
    SPI0_SO = 8
    SPI1_SCLK = 20
    SPI1_CS = 31
    SPI1_SI = 21
    SPI1_SO = 5

    And some extra testpoints
    TP 0,1,2,3,4,5 = 3,4,17,16,34,33

  21. #46
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Here's the schematic and some pics.
    teensy_audio_rev1.pdf

    Click image for larger version. 

Name:	teensy_audio_rev1_comp.jpg 
Views:	672 
Size:	58.8 KB 
ID:	10107Click image for larger version. 

Name:	teensy_audio_rev1_conns.jpg 
Views:	656 
Size:	44.0 KB 
ID:	10108Click image for larger version. 

Name:	teensy_audio_rev1_conns2.jpg 
Views:	640 
Size:	50.8 KB 
ID:	10109

  22. #47
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    133
    Okay, gerbers have been sent to the board shop. Should be a few weeks before I can start assembling protos.

  23. #48
    Junior Member
    Join Date
    May 2016
    Posts
    6
    Great job! I can not wait to see the proto. ; D ( sorry i had write in frenchglish)
    Last edited by djimip; 03-27-2017 at 10:42 AM.

  24. #49
    Junior Member
    Join Date
    Mar 2017
    Posts
    4
    Very interesting tread. I was thinking about another project that also included the Teensy a codec and guitar input.

    I came across the Analog Devices ADAU1772 that has a PGA on the input with a gain of -12 dB to + 35.25 dB.
    This codec can easily be soldered at home with reflow, has very low latency, dual stereo analog line-in or digital microfon input, and a more powerful headphone amplifier (22.4 mW at 32ohm). It's ment to be used in noise canceling headphones, and can be programmed in Sigma Studio.
    Would there be a lot of work to make code for a new codec like this?

    Regards Kristian Solberg

  25. #50
    Junior Member
    Join Date
    Apr 2017
    Posts
    17
    Hi
    I have built a prototype guitar pedal based on Teensy 3.5/3.6 , a small tft, an encoder for menu navigation and a couple of pots for live settings. Initially I started with a Teensy 3.6 and the SGTL5000 audioboard. However, as I model multiple drive stages with a total gain in the order of 100, I found that the audio board had too much background digital noise probably caused by large peak cpu load when processing each audio block. I tried different ways to power the Teensy+Audio board (stacked together) like lm317 filtered regulator on 5v input or directly a 3.3v supply but I could never reach a sufficiently low noise level: typically 0.05-0.08% measured with the peak audio block with an input range set around +/-1.5V. Also lowering the CPU freq or using a Teensy 3.5 lowered the noise level but not sufficiently.
    Maybe I could have improved the noise levtl by using a dedicated 3.3v regulator for the audio board itself but I did not try

    I moved then to the MikroE WM8731 audio board and the noise level is way better: no more digital noise and peak level at 0.02%.
    I would have prefered to use the PJRC audio board as it has better support, more features and also to support Paul and his great developments...

    If you are interested, I plan to publish the code and design of my pedal when it is done.
    The pedal is just a quick assembly of boards and components and I have not designed a PCB... so it is far from being a clean build!

    At the moment, it still lacks a good input buffer (I am preparing a small Klon type buffer with a TL072 right now) but here are the implemented features:
    -Multistage distortion (4 stages) in floating point with Hermite interpolation and adjustable DC blocker + low pass filter for each stage.
    -pre and post parametric EQ
    -pre and post FIR filters (and an Octave script to capture it from an existing pedal/amp)
    -compressor and noise gate (to improve)
    -preset management

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •