Sunday, May 16, 2010

Partial Implementation of Active Guitar Circuit

A good number of my parts came in on Friday, and I spent yesterday putting together a prototype of my circuit.  I'm missing the new blend pot, but I did get the AD706's, the 10K 1% tolerance resistors, and some other things.  I chose 1% tolerance to be precise with the relative gains between neck and bridge.

Armed with these new parts, a 12V wall wart, a breadboard, and some solid core hook up wire, I decided to implement part of the circuit, specifically the summing amplifier.  The neck/blend/bridge switching will be done manually on the breadboard, and the series/parallel/coil cut will be implemented later when I'm ready to dismantle the electronics all together.

For a power supply, I snipped the barrel off of a 12V wall wart.  This will give me +-6V, which is well within the +-18V max that the chip will take.  I hooked up the power supply with 10K resistors (I will use 1M at least later to cut down on current draw). 9V will be a little less of course.

To hook up to the guitar, I had to isolate the feeds from the neck and bridge pickups.  I did this by disconnecting the 3-way switch from the volume pots.  Since each pickup has its own volume pot, I traced the wires back to the pickups and identified which was which.  I marked these with a sharpie.

I used alligator clips to tap into the guitar's circuit at the appropriate places.  For the pickup signals, I clipped onto the (newly disconnected) wipers from the pickup volume pots.  This allowed me to still use the pots to adjust blend and volume.  For the ground, I just picked a place.  For the output from the circuit (through the tone pot to the amp) I clipped into the wiper on the tone pot, which has previously been connected to the output of the 3-way switch.

Modified Guitar Wiring

With alligator clips.  Green=Gnd, Red = Neck, Black = Bridge, White = Output

It was very easy to connect to the solder lugs.  Alligator clips are a must for doing all prototyping.  

Guitar hooked up to circuit.  Yes I sat and played it like that and had the courage to hook it up to my amp (with very low volume that is).

This is the circuit.  Very simple.  Up on the top left of the board, I hooked up the 12V supply.  It's hooked up through an ammeter with the yellow and red alligator clips.  The two capacitors are the power supply.  You can't see the resistors underneath.  The small vertical jumper is the ground connector.  (actually that is a virtual ground too).  The chip is of course the 2 AD706's.  Far left blue rail is -4.5V.  Left red rail is 4.5V.  Right blue rail is ground.  
From a different angle, you can see the two adjacent resistors with the neck and bridge pickups connected (red and black).  Take a moment to admire the exactness of the wiring lengths.  You can also see the feedback resistor next to the yellow alligator clip.

The circuit pulls 1.397 milliamps no matter what I'm playing, even with no playing.  This will be reduced because I will use higher resistors for the power supply and a lower supply voltage.  Probably 750uA or so of that current is consumed by the opamp.  600uA is from the power supply.  That will drop to 4.5uA when I use 9V and 1M resistors.  So hopefully, it will consume less than 1 mA.  A quick look at an Energizer 9V datasheet says that the capcity is 600mAh at constant 10mA current draw.  So we should get at least 600 hours of operation per battery (probably a lot more). 

Here's a picture of my whole setup.  I'm working on the kitchen bar.  Soon I'll be married and she's promised me a whole room for my stuff.  :)  This is the first time I've gotten to use my new soldering iron (though most of this was on a breadboard).  I love it.  It has digital temperature control.  Nice.

Conclusion and Performance
I am thrilled with the performance.  The virtual ground works as expected.  I can turn one pickup all the way down without affecting the other pickup at all.  Right now the volume varies quite a bit because I can adjust each volume separately, but the blend pot should counteract that volume variance, because both will be adjusted simultaneously.  

I connected the neck output directly to the output of the guitar as a test.  The sound was a lot muddier and I lost a lot of treble.  This is solely because of the additional load on the pickup.  I had the tone pot connected to the output of the opamp, and the sound was crisper and brighter.  So providing a constant 500K to the pickups definitely helps the sound, and it's easy to hear the difference by simply connecting the tone pot in parallel.  I expect great performance from the full circuit.  To clarify, connecting the tone pot and capacitor adds a parallel path for the current to flow.  Like an inductor, a capacitor's impedance varies with frequency.  So for high frequencies, it's like having 250K instead of  500K.  For lower frequencies, it's not as bad, but it drops the load impedance to the pickup.  This is what the original setup was like.

The only drawback was that the opamp's output did have a little more hum.  However, nothing was shielded, and the hum got louder based on the position of the bridge pot.  So I expect that proper shielding and the elimination of the long wire runs strung out of the guitar will reduce the additional hum.  

So I declare victory.  I am eagerly awaiting the arrival of the rest of the parts.  Although, it's looking like I will have to wait a longer time to get some new wire from Digikey.  The stuff is $50 bucks for 2 pair 4mm wire 100', and I was hoping I wouldn't have to spend that much when I need so little.  Oh well.  I can keep the rest.  

Thanks for reading,

Active Guitar Circuit

This guitar circuit is the final result of my guitar mod as described a few days ago.  To reiterate, the goals were:
  •  1 knob that always controls volume.
  • Preserve the neck, blend, bridge option with a single knob to control blending between pickups (preferably with a center detent!)
  • 1 switch for switching between series, parallel, and coil cut for both pickups. 
  • 1 switch for switching between neck, blend, and bridge for output.  
  • Provide a more stable impedance to the pickups. Or at least don't let the impedance fall below 500K.  
  • No new holes/ routing in the guitar. Minimal deepening of original routed area, and only if absolutely necessary.  
The Circuit

The two opamps are AD706's (2 per package).  It is available in an 8-pin dip from digikey.  It pulls about 750uA regardless of supply voltage, and since we're dealing with low drive currents, it doesn't ever pull much more than that from the opamp.

I'll explain the circuit from left to right.  The four voltage sources are the 4 coils in the two humbucker pickups.  N= Neck; B=Bridge.  The first set of switches (labeled series, parallel, coil cut) control how the internal coils of the pickups are wired together.  All four switches reside in a single rotary switch.  The switch is a 4 pole 3 position switch, and the connection scheme is shown below.
 The second set of switches (labeled neck, blend, bridge) controls how the two pickups are wired together.  This is a vast improvement over the original wiring.  Originally, each pickup had its own volume control.  In the middle position on the 3 position switch, the two taps were shorted together.  Here, the two inputs are fed into a summing amplifier (the first opamp).  That deserves its own section...

The Summing Amplifier
The first opamp is connected in a summing (and inverting) amplifier setup.  The two signals from the pickups are summed and amplified (with unity gain) so that we get exactly the same thing we had before, but 180 degrees out of phase.

Maybe you're saying, "But that's the same thing we were doing before."  But you would be wrong.  The only reason to use a complicated opamp in this circuit is because it gains us the all-important "virtual ground."

Because of the ultra high gain of the opamp and the negative feedback connection, the opamp will attempt to hold its negative terminal equal to its positive terminal.  In this case, since the positive terminal is grounded, the negative terminal will be driven to 0V by the opamp (making it a virtual ground).  One very important effect of this is that it eliminates crosstalk between the pickups.  No current will flow from the negative terminal back out to the pickups.  So in theory the two pickups should have absolutely no effect on each other.

Also, because of the ultra high input impedance of the opamp, no current will flow into the negative terminal either.  This is also very important.  This means that the opamp introduces no additional load to the pickup.  So both pickups will see 500K of load no matter what kind of blending or switching we do!

After the Summing Amplifier
Opamps are amazing things!  After the summing amplifier, we can use smaller pot values, because the opamp has negligable output impedance (unlike the pickups).  So the opamp acts as a buffer as well as a summing amplifier.  We hook up the tone and volume pots as we would any other pots, except that in my case they are concentric pots so that I don't have to drill any holes in my guitar.  Tone and volume on the same axis of rotation, but separately controlable.

The second opamp in the AD706 package is mostly there to drive the cable instead of the volume pot.  This will enable us to limit the effects of a high capacitance (long) cable.  If you want to undo the 180 phase shift, hook it up as shown.  Otherwise, you can save 2 resistors and make a simple voltage follower.  I'm still considering doing this instead.

Also, I may decide in the end to up the 50K concentric pots.  I will have to do some math to discover what kind of capacitor I will need to make a decent tone circuit.  That is still open to debate.

Power Supply
The only drawback to this circuit is that it needs to be powered. Here's a good way to get a +- power supply out of a battery.  I'll use a 9V battery and get +-4.5V.  I have played around with the idea of adding a diode in series with the battery to make sure that I don't ever accidentally connect it backwards, even for a second.  I will probably do that.  The current draw by the power supply will be very small with these circuit values.  (4.5uA).  So all together we're looking at less than 1mA to run the whole circuit.

This circuit accomplishes all of the goals set out in the beginning of the project.  Only 2 holes are required for pots as well as 2 holes for switches.  There are 4 original holes in the guitar.  I may have to drill down a little bit to get the switches to mount easily in the current holes, but I'm not too concerned about that.  I've ordered all the parts, and I've done a trial run with some that have come in, but that's for the next post.

Thanks for reading


Wednesday, May 12, 2010

Guitar Pot Values Or Electrical Theory Crash Course


After reading a lot of nonsense on the subject of guitar pot values all over the place, I thought I would say a few words about it based in electrical theory.  This dovetails nicely with my guitar mod article, and it helps to explain why I wanted to keep within 500k of impedance.

Definitions aka electrical theory primer

frequency - this is the number of oscillations that a signal makes in a given amount of time.  Since the electrical generated by the pickups will eventually be amplified and turned into sound, frequency represents the pitch of the note.  A high note has a high frequency, and a low note a low frequency.  It's simply a measure of how high or low a note is for the purposes of guitar electronics.

voltage and current- voltage is the electrical signal generated by the pickup.  The metal string vibrating near the magnetic pickup "induces" a voltage in the pickup.  A voltage causes a current to flow through a circuit, provided that there is a return path.  Voltage is a difference in "potential" between two points.  It has the potential to cause current to flow.  Basically, charge builds up on the positive side, and a negative charge builds up on the negative side.  These want to equalize to zero, and the only way they can do it is through a conductive circuit.  If there is no conductive path between + and -, then the voltage will just sit there and the difference in charge will never equalize (in theory).

resistance/impedance - as its name implies, resistance resists the flow of current in a circuit.  The voltage has a certain force that will cause charges to move.  Resistance makes it more difficult for the charges to move through the material.  Materials have different resistance.  Metal wire has very low resistance, which is why it is used in electric circuits.  Plastic, wood, air, enamel, and wire insulation have high resistances, so very little (if any) current flows through them.  Carbon is in between, which is why it's used in pots.  You don't want the charge to fly around the circuit, otherwise you won't get a signal.  The pots slow it down and allow us to see the voltage level.
Impedance is just resistance for AC signals.  I will use resistance for both terms.

AC voltage - here's where the frequency/oscillation comes in.  The moving string doesn't generate a constant voltage.  It swings up and down.  Half the time, the + and - are switched.  Think of it as a sinusoidal wave.  As you move through time, the voltage swings high and low, and the frequency is the speed of that oscillation.  Constant voltage (DC) wouldn't sound like anything.  The oscillation makes the sound when put through the amplifier.

Voltage Drop - This is something of a weird concept.  But suffice it to say the following.  If we assume that wire has no resistance, a circuit boils down to two things: a source of voltage, and a load resistance.  The resistance determines how much current flows.  The resistor has some length, and the voltage distributes evenly across the resistance as you move down the length.  So close to the end of the resistor where it connects back to -, the voltage would be very small.  Near the top, where it connects to the +, the voltage would be nearly as high as coming right out of the pickup.  This is the idea behind using a pot for volume control.  The pot's tap grabs the voltage at some point along the resistor, and the tap can move up and down the resistor.  So we can get different levels.  The total resistance of the pot does not change as the knob is turned.  Turning the knob simply repositions the tap somewhere along the pot's resistor.

Pot Resistance Effects

A pickup can be modeled as shown below...

The circle with +- is the pickup generating a voltage.  The looped component is an inductor.  The two angular components are resistors.  The + V.out - represents where we will measure the voltage.  Actually, I will talk about measuring at the top of R.load.  This is just the standard way to draw a pot.  The inductor and first resistor are part of the pickup.  This is because the pickup is not a perfect voltage source.  The R.load is the equivalent load of the rest of the circuit.  For our purposes, we will say that it is the resistance of the pot itself.

Note: resistive components connected back to back (in series) will act like a single resistor with a resistance equal to the sum of parts.

 The inductor is a complicated component.  The effect comes from the wrapping of the wire around the magnet.  Its resistance changes with frequency.  To a high frequency, it is a high resistance.  To a low frequency it has low or 0 resistance.  Because of the inductor, we have to look at the circuit from two perspectives: low frequency and high frequency.

Low Frequency
At low frequency, the resistance of the inductor is negligible.  So we have only the 2 resistors in the circuit with the voltage source.  The internal resistance of the pickup will remain the same.  Now what if we had a low resistance for our pot?  Since the two resistors are connected in line (in series), they act as a single resistor with the sum of the two values.  The lengths are also combined, so the voltage drop idea applies over the combined length of both resistors.  If we measure the voltage at the top of the pot (turned all the way up) then we will get whatever portion remains to be distributed across the pot.  So if the pot is a low value, there is not much left to be distributed, and we will have a low volume.

Now suppose we have a high resistance for the pot.  Most of the voltage will be distributed across the pot itself.  So if we grab the voltage at the top, it will be close to what we would see if the pickup were a perfect source.

You can think of the low frequency as the general case and apply it to the whole frequency range.  The resistors affect all frequencies equally.  So obviously we will lose a lot of volume by using a small pot value.  And this is undesirable.  But there's more...

High Frequency
As I said before, the inductor's resistance increases with frequency.  So for a high frequency, let's say it becomes the same as the internal resistance.  What happens with a small pot value?  More resistance before the pot makes the signal strength even lower for high frequencies!  So the higher the note gets, the softer the volume will be.  This is what leads to the decreased highs in a humbucker.  The construction of the humbucker has a higher internal inductance.

Now consider a high pot value.  We will still lose some volume as we get into high frequencies, but the effect will not be as noticeable because such a large portion of the voltage is already distributed over the pot.

Considering High and Low
So to really get a picture of what will happen when we have a low pot value, we have to consider both high and low, and everything in between.

A low pot value will give us lower volume, but it will also change the whole sound of the guitar.  You will lose a lot of highs, and some mids.  The effect will start gradually, and you will lose more and more volume as you get into the higher notes.  Eventually, you won't hear anything above a certain frequency.  Of course, this could be higher than your audible frequency.  I'm not sure.

Limitations of this explanation and Conclusion
I tried to make this accessible to those with no electrical experience.  So I apologize if it is overly simplistic for some people.  The concepts are sound.  There is a lot of other stuff going on in a guitar circuit.  Multiple pickups.  Tone control.  The effect of connecting a long cable.  The effect of connecting to an amplifier.  All of these things play a part in the way the guitar sounds.  But those effects were not the focus of this article.  I hope that it makes sense now why a really high volume pot (say 2M) would make a guitar sound very bright, and somewhat louder.  Of course, at some point there are diminishing returns.  To get as close to a perfect signal as possible, we wouldn't even have any pots in the circuit!  Then only the amplifier will load the pickup.  But then we'd lose volume and tone control.

It's sometimes hard to stay on topic.  I hope that someone will benefit from this knowledge.
Thanks for reading.


Guitar Electronics Mod


 I have been playing guitar since my sophomore year in high school.  That would be 2002, which makes it 8 years since I started playing.  That's a little ridiculous to think about.  At least it's not ten.  Then I would feel old.

A few years ago I bought an EC-100QM Ltd guitar, ESP guitars' second brand.  I love it.  The playing action on it is great.  The frets are pretty high, and I find it easy to play.  Of course, I want to mess with it.

I've already done a similar mod on my first guitar, a Dean Playmate.  Not a high quality instrument, but good enough to start with.  That involved my accidentally drilling through the guitar with an auger bit and filling the hole with bondo.  My goal is to not do that this time.

Reasons for the Mod 
  1.  There are separate volume controls for each pickup on the guitar (humbuckers btw).  They are wired in the configuration shown in figure 1.  Although I do like the flexibility of the wiring scheme, there are at least 3 problems.  a) There is no single volume control knob when in the middle position.  This makes it hard to adjust the volume easily and/or reproducibly.  b) There is no single control to blend between pickups.  That's what we really want here.  There's no reason to have separate knobs, though it is better than simply shorting them together with no control over blend.  c) When blending, the circuit presents a continuously varying impedance to the pickups.  Turning one pickup down low changes the sound of the other pickup due to the decreased load.  Having one pickup turned all the way up and the other turned all the way down shorts the desired pickup to ground and results in silence.  
  2.  I would like to check out the capabilities of humbuckers wired in series, parallel, and coil cut configurations.  The current wiring scheme does not allow for this.
  3. The stock pickups in the guitar are very very very muddy and unpleasant.  I want to replace them with a pair of Seymour Duncan SH-55 Seth Lover pickups that are clean and beautiful.  These are pretty expensive at about $100 a piece.  So that will be the second phase of the project.  It's reasonably easy to modify stock pickups to pull out the leads for each coil.  And if you mess up a little bit, there are so many coils on there, you can afford to lose one or two.  I've done this on my last guitar with success.
  4.  As always, the challenge, and the chance to leverage my electrical knowledge to make something more usable.  Not to mention that I want to get more knowledgeable about analog.  (most of my study was digitally based).

Goals of the Mod 
  1.  1 knob that always controls volume.
  2. Preserve the neck, blend, bridge option with a single knob to control blending between pickups (preferably with a center detent!)
  3. 1 switch for switching between series, parallel, and coil cut for both pickups. 
  4. 1 switch for switching between neck, blend, and bridge for output.  
  5. Provide a more stable impedance to the pickups.  Or at least don't let the impedance fall below 500K.   
  6. No new holes/ routing in the guitar.  Minimal deepening of original routed area, and only if absolutely necessary.  
 To Be Continued...

You know, I'm thinking that one way to keep these posts from being too long is to split them up.  I will describe the project in the first post, and then do background, theory, and implementation in separate posts.  Maybe that will be a good thing.   

Thanks for reading,