Thursday, August 18, 2016

Relay bypass with anti pop system: noiseless and clickless true bypass

Did you like my post about relay bypass? At least I did, and now I use it in almost all my pedals! Thus, they are longer lasting, and we avoid the mechanical noises of a 3PDT. However, I noticed something annoying: the relay bypass makes more "pop" noises than the 3PDT, especially with high gain circuits... Indeed, relays tend to switch from one state to another much quicker than big mechanical 3PDT switches, which causes the "pop" noises to appear. The more the pedal is gainy, the more it will amplify the pop and make it louder.

So I adapted a system that I have found on Stompville that suppress all these noises. Here is the result, with a (very) simple "before and after" video:

Works well!

Beware: before reading this post, I strongly suggest that you read my post about relay bypass to understand well what relay bypass and microprocessors are about.

How does it work?

It is quite simple: when the pedal is switched on, the sound is mute to get rid of the pop! The signal will be send to ground while the relay is switching. Then, when the pop has disappeared, the pedal is "unmuted" and the pedal is on. There will be a small period of 40 ms of silence, but do not worry, in practice, you really cant tell!

In order to mute the pedal during the switching, we are going to use a photoFET. What is it?

It is a small component that looks like a mini 4-pins IC, which include a LED and a switch made by 2 MOSFET that will let the current flow when the LED is on. It is kind of a switch activated by a current, with on / off positions.
TLP222A photoFET
The LED will be lit by the microcontroller, and the MOSFET part will be placed between the part where the signal exits the effect and ground. When the LED is on, the signal goes to ground: we can say bye bye to that awful popping noise!
TLP222A photoFET
When the microcontroller activates the LED, the current can flow between the pins 3 and 4 of the photoFET and the signal is sent to ground.
When the microcontroller does not activates the LED: the current cannot flow between the pins 3 and 4 of the photoFET and the signal can go out.
Basically, we got a mute switch here!

So... Why don't we use a photoFET to switch the signal instead of using a noisy relay? PhotoFET are smaller, they use less current and are virtually indestructible (non mechanical)! However, there is one downside with photoFETs: they use MOSFETs that modify your tone! Indeed, active photoFETs have a low resistance (2 Ohms), but a quite high capacitance (130 pF). If you have read my post about cables, you know that 130 pF represents almost 3 meters of a good cable! This is not very good for a "true bypass" system!
Here, it is not a problem as we only use it to mute the signal, but for a bypass signal, that would be quite awful for instance.

Here is the schematic of this "relay bypass version 2":
Silent noiseless relay true bypass schematic
Thus, it is almost exactly the same circuit as the relay bypass circuit, except that the photoFET is connected to the pin 5 of the microcontroller, and the pin 4 of the microcontroller is connected to the end of the effect circuit.
I choose to use a TLP222A photoFET, which is easy to find, and not that expensive.

How to ?

We will use the pin number 5 of the PIC to activate the LED of the photoFET.
Beware: pin numer 4 (GPIO3) is an "input only" pin, so we cannot use it to activate the LED. You must use the pin number 5!
Do not worry, we will find a use for the pin number 4 later...

Lets open MPLab to create the header, that will be exactly the same as the one we made before in the relay bypass blog post. Create a new project for the PIC12F675, and add a header file with the following configuration:

#pragma config FOSC = INTRCIO   // Internal clock of the PIC is on
#pragma config WDTE = OFF       // Watchdog Timer disabled
#pragma config PWRTE = OFF      // Power-Up Timer disabled
#pragma config MCLRE = OFF      // GP3/MCLR pin is a GPIO
#pragma config BOREN = OFF      // Brown-out Detect disabled
#pragma config CP = OFF         // No code protection
#pragma config CPD = OFF        // No internal memory protection

// Defines the internal oscillator / clock frequency (4MHz)
#define _XTAL_FREQ 4000000

If you do not remember exactly what is the role of all these parts, read my relay bypass article.

Lets switch for the code now! We have to add a sequence when the effect is going to change its state (on or off), with 4 steps:
  1. Turn on the photoFET: signal goes to ground
  2. Activate the relay : the "pop" noise goes to ground through the photoFET
  3. Wait a bit until the "pop" is completely gone
  4. Turn off the photoFET
These 4 steps will be in the code. Basically, we are going to tell the microcontroller "when the switch is pressed, turn the effect on or off with these 4 steps"

To do that, we will use a variable "changestate" that will tell the microcontroller when to change state, that we will define at the beginning of the code by writing:

    uint8_t changestate; // changement d'état (pour couper le son avec le photoFET)

    Initially, the value is 0. When the value of changestate is 1, the microcontroller will change the state of the pedal (on to off or off to on)
    On lui donne la valeur de zéro initialement. Lorsque la valeur de changestate sera de 1, le microcontrolleur activera la pédale.

    For instance, changestate will be equal to 1 when the switch is engaged (with debouncing):

    if(GP1 == 0) { // if the switch is pressed
       __delay_ms(15); // debounce
          if(GP1 == 0) {
             __delay_ms(200); // switch is off
             if(GP1 == 1) {
                changestate = 1; // changestate = 1
              else {
                 changestate = 0;


    Then, we will have to precise the 4 steps we have defined earlier in the code when changestate is equal to 1, depending on the state of the pedal. If the pedal is on (state =1), it is turned off, and if it is off (state = 1), the effect is turned on:

    if(changestate == 1) {
       if(state == 0) { // if the pedal is off
          GP2 = 1; // activates the photoFET (step 1)
          GP0 = 1; // LED on
          GP5 = 1; // relay on (step 2)
          GP4 = 0;
          __delay_ms(30); // wait for the pop to go to ground (step 3)
          GP2 = 0; // photoFET off (step 4)
          state = 1; } // pedal is on
       else { // if the pedal is on, same steps
          GP2 = 1;
          GP0 = 0; // LED off
          GP5 = 0; // relay off
          GP4 = 0;
          GP2 = 0;
          state = 0;

       changestate=0; // reset changestate to 0 (otherwise it will switch continuously)

    if (state == 1) { // effect on
       GP0 = 1; // LED on
       GP5 = 1; // relay on
       GP4 = 0; }
    else { // effect off
       GP0 = 0; // LED off
       GP5 = 0; // relay off
       GP4 = 0;
    It adds a small delay during activation of the effect (40ms), but while playing, you cannot tell at all. However, there is no more "pop" noise, which is completely audible!

    It works really well, and we only need to add one component! Finally, we have a true bypass system that is reliable, with clickless switches and absolutely silent!

    Here is the full code. Do not hesitate to read again the relay bypass post to understand which part does what.

    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>
    #include <xc.h>
    #include "header.h"

    void main(void) {
       ANSEL = 0; // No analog GPIOs
       CMCON = 0x07; // comparator off
       ADCON0 = 0; // AD ND converter off
       TRISIO0 = 0; // output LED
       TRISIO1 = 1; // input footswtich
       TRISIO2 = 0; // output TGP222A photo FET
       TRISIO5 = 0; // output activated relay
       TRISIO4 = 0; // output ground connection of the relay

       GPIO = 0; // set outputs as low level (0V)

       uint8_t state; // set the on or off state of the pedal
       state=0; // pedal off at the beginning
       uint8_t changestate; // changing state


       while(1) { // main loop
          if(GP1 == 0) { // if the switch is activated
              if(GP1 == 0) {
                  if(GP1 == 1) {
                      changestate = 1;
                  else {
                      changestate = 0;
          if(changestate == 1) {
              if(state == 0) { // change to on
                    GP2 = 1; // PhotoFET on
                    GP0 = 1; // LED on
                    GP5 = 1; // relay on
                    GP4 = 0;
                    GP2 = 0; // PhotoFET off
                    state = 1; }
              else { // change to off
                 GP2 = 1;
                 GP0 = 0; // LED off
                GP5 = 0; // relay off
                GP4 = 0;
                GP2 = 0;
                state = 0;
            if (state == 1) { // effect on
                GP0 = 1; // LED on
                GP5 = 1; // relay on
                GP4 = 0; }
            else { // effect off
                GP0 = 0; // LED off
                GP5 = 0; // relay off
                GP4 = 0;

    There it is! I hope that everything is clear. I know it is not an easy subject, but guess what? You can ask any question you like in the comment section!

    In a next blog post, we will see how to add a "temporary mode" like in my Montagne Tremolo!

    If you liked this post, thank me by liking the Coda Effects Facebook Page!

    To go further:
    Stompville post that helped me a lot!
    Datasheet of the TLP222A
    read more

    Thursday, August 4, 2016

    Ultimate guide to guitar effect wiring: how to wire DIY guitar pedals properly?

    Your guitar pedal circuit is finally populated and ready to rock! However, you still have to solder all the wires... I noticed that it was during this step that beginners encounter most of the issues that go along with guitar effects making. Especially with veroboard, you can quickly get a huge mess of wires going everywhere in the enclosure, with the so-called "spaghetti wiring" that we all achieved at least once when starting to make guitar effects!
    Moreover, the wiring step is often the root-cause of many errors and mistakes that prevent your pedal from properly working, making guitar effects making really frustrating at the beginning. In this post, I want to show you how to make a good wiring, and what you can do to avoid mistakes.

    First of all : always wire in the enclosure! I know a lot of people are saying "rock it before boxing it", but I personally think that wiring directly inside the enclosure helps to make beautiful wiring, because you can adjust the size of the wires more easily. However, it is a bit more risky (if your pedal does not work, it will be a bit more difficult to repair), and complicated (less space). Try to wire as much as you can outside the box (especially potentiometers).

    1. Which wire should I use ?

    First, and important question of course! There are two types of cables : solid-core wires, with one copper wire inside the cable (black cable on the picture below), and xxx wires that have many copper wires inside (in red): 
    I prefer solid-core wires, because it is possible to twist them to make the overall wiring more aesthetic, or to maintain firmly some elements in the enclosure, which is super useful with veroboard plates to avoid false contacts.

    Only use isolated wires to avoid false contacts. Finally, a 0.24mm2 cross section wire is big enough, no need for bigger cables.

    2. Potentiometers and switches

    Always start with potentiometers. Thus, you can easily fix the PCB / veroboard inside the enclosure. It is very easy with PCB: just solder each lug of a PCB-mount potentiometer inside the holes on the PCB. It should look like this:
    PCB wiring is waaaay easier than veroboard, and this is one of the many reasons that make me prefer PCBs to veroboard. Indeed, with a veroboard circuit, you will have to wire each potentiometer, which quickly generate a high amount of wires (4 pots = up to 12 wires!). I will show you the technique I use to avoid a complete cable mess when using veroboard.

    We are going to use a piece of cardboard to wire the pots, that uses the same template as the pedal enclosure: drill holes the same way that you drilled your enclosure, and place the potentiometers in mirror order, as if it was inside the enclosure. Here is an example for an overdrive pedal:
    Do not forget to reverse everything, especially the legs of the potentiometers. I strongly recommend to write the name of the pots and the number of each potentiometer pin in order not to make mistakes. Then, place the potentiometers in each holes and you should have something like this:
    Once you are done, solder a wire longer than needed on each potentiometer leg that you have to connect to the board (Gain 1, Gain 2...etc). I strongly advise you to use solid core wire that will firmly maintain the veroboard above the pots and prevents false contacts that way. Another thing that could be useful to avoid mistakes: use a different color wire for each pot so you do not mix them up!
    Double check that they are no mistakes (typically, soldering Gain 3 instead of Gain 1 for instance). Place the veroboard above the pots, and start cutting the wires to the righ length, then solder them to the veroboard. You should have something like this now:
    Please check again that all your connections are correct! It is the best way I found to make veroboard wiring that are not completely messy, and avoid quite a lot of mistakes that you can make. Once you are done, unscrew the potentiometers and place the whole circuit inside the enclosure. Lets finish to wire everything now!

    3. Power supply wiring

    Simple stuff now: the power supply DC jack! Most of the times, it looks like this:
    DC jack input
    Behind it, there are 3 legs that are used to connect the power supply to your circuit. There is the ground connection, +9V connection, and a +9V battery connection that will disconnect the battery if a power supply jack is connected to the DC jack input.

    There are also metallic versions of the DC jack. They look good, but I suggest that you do not use them because they are made for center positive power supply, and the external part of the jack is often connected to the enclosure. Thus, if you use it to wire a negative center power supply (guitar pedals standard), it will create a short circuit!

    Here are the different pins of a classical DC jack:

    If you use a battery, do not forget to connect the positive wire of the battery snap to the "battery +" of the DC jack, in order not to use the battery when a jack is plugged in.

    For the wiring, I suggest that you follow this method, that is closed to the one used for potentiometers:
    1. Place everything in the enclosure: screw the potentiometers and PCB/veroboard, screw the DC jack input, audio jack inputs...etc
    2. Tin the legs that you are going to connect: fill the holes of each leg with solder.
    3. Prepare a wire longer than needed (1 cm/ 0.5 inches more is enough), tin it with a bit of solder (it helps to solder it)
    4. Solder it to the leg.
    5. Twist it with tweezers like you want (I find that square looks good), then cut it to the right length, and solder it to the PCB/veroboard!
    I use the same method for jacks and 3PDT, it is quite easy to make clean connections and an overall clean wiring with this way.

    4. Input and output jacks

    Another part that is not very difficult to wire. It exists at least 3 different versions of jack inputs: open (good for crowded builds or 1590A enclosures), closed "amphenol-style" that I like a lot, and "amp-style" that are used for PCB-mounted jack builds.
    I will show you the connections for each type of jack input.

    Open jack
    It should look like this:
    The metallic central ring is connected to the ground, whereas the small leg and the tab are connected to the tip of the jack that conduct the signal. If you are not sure, you can check it with a multimeter.
    These jacks are nice for crowded builds because they do not take that much space, however it is easy to mess it up. Moreover, they are not of very good quality most of the times, except if you go for expensive Neutrik jack.

    Amphenol type jack
    Here are the connections of this type of jack:
    I really like this kind of jack: it is hard to mess it up, and they are though as rock!

    Amp-style jack
    They look a bit more complicated because there are at least 4 connections for a mono jack... I usually avoid to use this style of jack, because they take a huge amount of space inside the enclosure. However, they are the only type of jack that you can use to mount it on a PCB. Two connections are only used to detect whether there is a jack inserted inside the jack input. It can be useful if you want to disconnect the battery when there is a jack inserted in the input.

    Solder the legs that are on the "blade" side, these are the ones connected to the jack:

    The ground is conducted by the leg closer to the input, whereas the signal is conducted by the leg that is the farest from de input.

    For the wiring, use the same technique presented for the DC jack to connect the ground to the ground of the PCB, and the signal to the 3PDT.

    5. The 3PDT switch

    If you use true bypass switching, you will probably use a 3PDT switch, which is the "error generation pack" for beginners... Take your time when wiring this little beast!

    First, I think it is really important to understand how the 3PDT switch works, read my post about 3PDT and true bypass.

    You need to make all these connections:
    I suggest that you make the connection on the top left outside the enclosure,it will be easier that way. Then, proceed like the input jacks and DC jacks.
    Be really careful in order not to create false contacts between the different legs of the 3PDT, which happens quite often!

    6. LED: let there be light

    Nearly the end! Last thing to wire: the LED.
    This drawing can help a lot in order not to mess with the polarity of the LED:
    Always wire a resistor in series with a LED, it should be connected to the +9V pad of the power supply, and to the long leg of the LED. The short leg of the LED is connected to the 3PDT. Here is a schematic:

    Usually, a resistance between 1k and 10k is fine, depending on the LED color. Indeed, blue or green LED can be a bit agressive for your eye with a low value resistor. Another solution is to use a 50k trimpot, so the user can set the intensity of the LED himself!

    7. It does not work, what can I do?

    I like to say that it never works on the first attempt, so if you are in this case, it is perfectly normal! There are many potential mistakes that you can made, fortunately there are many ways to find them.

    I suggest that you read these two posts I made that should help you to sort everything out:

    There it is!

    I hope that this post was useful to you, if you have any question, post a comment!
    If you liked this post, thank me by liking the Coda Effects Facebook Page!

    read more

    Friday, May 27, 2016

    Other Vemuram Jan Ray variants

    Since I designed my own Jan Ray circuit board, I assembled quite a few. The PCB is quite small, so I have made different variants of various sizes and colors, and I though you migh enjoy it. Here are some of them!

    Here is a Jan Ray in a beautiful "mirror" copper color:
    I could have this beautiful thanks to Dirty Fuel, a motorcycles workshop and repair chop (if you like beautiful custom motorbikes, check their website!). Indeed, the painting technique used for effects pedals (powder coating) is the same that the one used for cars and motorbikes!
    I find it really beautiful, it is a bit different from the classic colors that you get with guitar effects. I would be really glad to make more of them, however the oven that is used to "dry" the paint consumme a lot of electricity (like a lot), so you need to make quite a lot of enclosures (at least fifty). Moreover, the enclosures needs to be polished perfectly to get this "mirror" aspect. If you are interested to get some enclosures like this one, post a comment and subscribe to the newsletter. If there are enough people, I can try to provide some enclosures like this one.
    Inside, it is very classic, with a 3PDT, and my circuit board (blue!). I made a small series of this PCB. I am currently writing up a build document in order to offer them to sale like the Dolmen Fuzz PCB.
    Anyway, it is a really nice pedal, that is on my board now :)
    Here is another variant that I made in a bigger enclosure (1590BB), with top mounted jacks... It reminds me of my first Jan Ray clone

    I also used the "Golden Hour" sticker that I made. I placed it on the side to keep the look of the first one I have made.
    I worked quite a lot on this one to make it beautiful inside. I used solid core wire that is bendable to make a perfect angled wiring. I am really satisfied with it, one the most beautiful wiring I have done! However, I will not redo it, it was a lot of work to get it done: you have to get the perfect length, angle...etc

    Here it is! I hope that you like it!

    Any question? Post a comment!
    If you like this post, like the Coda Effect facebook page for more!
    read more

    Saturday, May 21, 2016

    Why you should NOT paint your guitar pedal enclosures yourself

    I know this is a bit against the concept of DIY, but the more I am painting enclosures, the more I notice that the results are not as great as a commercialy available prepainted enclosure. First, sanding the enclosure is a long and painful task and is mandatory if you want a clean surface to paint on. Avoid the long long hours spent carefully polishing your enclosure !

    Second, a lot of thin layers are required if you want a proper painting, and most of the time, the painting will still be fragile and sensitives to shocks. I got craks or scratches on the paint really quickly... Nice if you want a beaten-up, vintage, relic look, but not if you want something really clean and durable. You will end up having something similar to the first tall font russian big muff that had paint quality issue:
    Big muff tall font low quality paint
     (ok it looks cool like this I know... But imagine this on your new beautiful pedal that you spent hours to make!)

    Layers can be inequals, and if you spray too much paint, you will have an horrible painting with traces like these :
    painting enclosures damages 
    Whereas commercialy available prepainted enclosure will always look nice. Moreover, buying spray paint is also expensive. 12 euros for one can, which can certainly paint a lot of pedals, but in one color only. Finally, it is needed to say that spray painting is extremely unhealthy: if you do it, do it outside, with a mask to prevent inhalation of particles. With a prepainted enclosure: no risks.

    The price is usually 3 to 4 euros more, which is quite expensive, but for all the advantages listed above, it really worth it to me. Especially if you are going to make a few pedals, and not like a hundred !

    Remember that professional pedal enclosures are not spray painted. Most of the time, they are powder coated, which is a different technique that is not really accessible to common mortals like us. (like silkscreening). Powder coating involves a kind of spray gun that will project a powder on the object that is negatively charged (only works on metallic items). Then the object is "baked" in a very high temperature oven (very expensive too), and you get a proper, shiny, beautiful paint. It is the same kind of process that is used with cars for instance.
    powder coating
    Pedal part plus is based in the US and offers some super cool powder coating colors. In Europe, Banzai Music, and also have powder coated enclosures at reasonnable prices and cool colors! Finally, if you want to go cheap, Tayda now makes super cheap black and white powder coated enclosures. However, they usually have some flow so maybe not perfect for a commercial pedal, but largely good enough for a prototype or a DIY pedal!

    Of course, this is just my advice for now, maybe I will change my mind later !

    You disagree? Post a comment!
    If you like this post, thank me by liking Coda Effects Facebook page!
    read more

    Saturday, May 14, 2016

    Tap tempo tremolo DIY: a complex project!

    I am currently prototyping a tap tempo tremolo that I conceived. It is quite a big project, and I have been working on it since nearly 6 months now! Like many guitarists, I really like the warm vintage sounds that you can achieve using tremolo (like in "Bang Bang" from Nancy Sinatra), but also the choppy madness that you can get with square waves, like in "Know your enemy" from Rage Against The Machine, or even weird stuff with high speed tremolos... A really cool effect!

    I play regularly in a band, and my point of view is that tap tempo is just absolutely needed for rhythmic effects like delays for instance. Thus, I decided to add one in my tremolo. It is not easy to implement a tap tempo, as you have to use digital circuitry, as we will see later... Here is my current prototype:
    DIY tremolo with tap tempo
    That is a lot of knobs! You can already notice that there are two footswitches: tap tempo (right side), and the true bypass footswitch that is a clickless relay bypass system! I used the relay bypass system that I conceived, which is completely silent, and more reliable than classic 3PDT true bypass. Indeed, 3PDT footswitches are the main reason for guitar pedal failure. The little switch in the middle of the two LED (bypass LED, and tempo LED) allows you to switch the pedal temporarily. This is nice to add some choppy stuffs while you play!

    Here is a small demo I made quickly:

    Next, there are 6 potentiometers (many options!). From left to right, top to bottom:
    1. Depth: set the tremolo's deepness, from very subtle tremolo to huge choppy tremolo!
    2. Rate: speed of the tremolo
    3. Symmetry: changes the waveform, by modifying its duty cycle.
    4. Waveform: 6-way rotary switch to choose the waveform: square, random, sweep, triangle, sin or "ramp up" waveform
    5. Volume: can boost a bit the output signal
    6. Tempo subdivision switch: set the ratio between the tapping or rate knob and the rhythm of the tremolo 2:1 (the tremolo is twice slowler), 1:1 (same speed as tapping), 1:1,5, 1:2, 1:3 et 1:4!
    7. "Hold" switch: allows you to choose between classical switching or temporary switching (the effect is on only while your foot is on the footswitch)
    DIY tremolo with tap tempo
    I create this kind of scheme to understand the controls:
    DIY tremolo with tap tempo controls
    I tried to make a design for it. I called it "Montagne" which means "mountain" in french, like the shape of the waveforms:
    Montagne tremolo with tap tempo

    It is my second prototype. The first one did no had relay bypass, and had also some noise issues... and had a different PCB! It was a lot of work, and I already designed no more than 5 versions of the PCB that changed a lot through experimentations! Here are the two prototypes I have made:
    DIY tremolo with tap tempo
    I tested different color schemes :) Here is a gutshot of the beast!
    DIY tremolo with tap tempo circuit inside
    There is my version of relay bypass! It is a bit of a mess, because of my testing to reduce noise, but it fits! My goal now is to include everything on a PCB (jacks and relay bypass) to avoid a lot of wiring...

    How does a tremolo work?

    A tremolo modifies the volume of the guitar in a rythmic way. It is different from a vibrato that changes the pitch of the guitar rhythmically. There are two main types of tremolo:
    • classic tremolo: changes the overall volume of the guitar.
    • harmonic tremolo harmonique: initially developped in Fender "brown face" amps, it is a different kind of tremolo that alternatively changes the volume of bass and treble frequencies: when bass are up, trebles are low and vice versa. It is a more subtle and weirder tremolo.
    Lets talk about the classic tremolo!

    To make the volume go up and down, we have to use a Low Frequency Oscillator (LFO). LFOs are very common when making music, especially with synthesizers: it generates a sound waveform with a given amplitude and frequency. Depending on the circuit we use for the LFO, the shape of this waveform can be different, generating different sounds:
    LFO waveforms
    It can generate sounds (like on a synthesizer), and modulate the sound by modifying the amplitude / volume of the signal (tremolo), the pitch (vibrato / chorus), cut some frequencies (enveloppe filter / auto-wah)...etc!

    It is the main element of many modulation effects! (almost all of them!)

    A LFO can be analog, using a double OP amp like a TL072, but also numeric like here.

    This LFO will modulate the volume of the guitar. There are different possibilities:
    • Use a Light Dependant Resistor (LDR) on the signal path, and a LED lit by the LFO. A LDR is a resistor with a value that changes depending on the ambient light! The LFO will light the LED according to its waveform and rate, and thus modulate the value of the LDR.Thus, the amplitude (volume) of the signal will be modulated by the LFO:
    tremolo LFO LDR schematic
    • It can be used in different ways. The photocell can be connected to ground, or use it to bias a tube, an IC or a FET transistor ! It does not change a lot the sound of the tremolo.
    tremolo LFO LDR schematic
    You can either use a separate LED and LDR, but most of the times we use a vactrol that combines the LED and the LDR in a small black module:
    tremolo LFO LDR optoisolator vactrol
    The top-right one is a commercial vactrol and the bottom one a DIY one made with a LED, a LDR and heat shrink sleeve. I prefer to use commercial ones; they are expensive (around 7 euros each!) but are much more reliable and less variable from one unit to another.
    For my tremolo, I used a really simple circuit using a double OP amp, a TL072. The TL072 is a dual J-FET OP amp, well known for its transparency. This is the part where the signal goes across, so my aim was to have a super-transparent analog section:
    tremolo analog schematic
    RT1 and RT4 are pulldown resistors that prevent noise when turning the pedal on / off. CT1 and CT3 are coupling capacitors, with a high value (1uF) to let all the frequencies goes through the circuit. A first OP amp with a gain of 1 buffers the signal, which is then modulated by the LDR (VACT_1B). Then, the signal is amplified a bit by a second OP amp , with a "Volume" pot to set the final output volume. With a 100k pot, boosting the signal a bit is possible !

      What characterize the most the sound of a tremolo is the waveform of its LFO. Thus, having a lot of available waveforms is really a cool feature. This is why I choose to use a digital LFO that allow me to add a tap tempo as well, the Electric Druit TAPLFO2D! I use it to light up the LED of the vactrol, so I can use it and keep the signal analog!
      Electric Druid TAPLFO
      Electric Druid (Tom Wilshire) sells a lot of different digital chip programmed to be used in various audio circuits. Tom is very nice and very helpful, and helped me through this project.

      The TAPLFO is perfect for audio circuits. It is a PIC microcontroller, a classic device that I used also for my relay bypass project. Microcontrollers are like mini computers, sized like a chip, which contains a program that will tell it what to do in the circuit. Most of the controls you would need for a tremolo are directly included in the TAPLFO. Each pin has a different role:
      Electric Druid TAPLFO schematic
      For instace TAP TEMPO IN : connected to 5V and to the switch of the tap tempo (connected to ground), PWM OUTPUT = LFO output to drive the LED, TEMPO CV : tempo division rate, WAVEFORM : to choose the waveform...ect.

      The TAPLFO can generate 8 different waveforms! 
      tremolo LFO waveforms
      It was the perfect match for my project!

      This is the schematic of the LFO:
      DIY tremolo with tap tempo schematic
      I know, it seems quite complex, but in fact, it is pretty close from the circuit indicated in the datasheet!

      First, lets divide the circuit in several parts as usual:
      DIY tremolo with tap tempo schematic

      The external clock is required for the chip to work correctly. It is a 20 MHz crystal oscillator (that you can also find in watches, cellphones, computers...) that give the chip a notion of time! It is crucial to adapt the rate of the tremolo, or correlate tapping with the rate of the LFO. Most of the PIC have an internal clock, but it is generally of a lower frequency like 4 to 8 MHz.

      Power supply
      The power supply needs to provide 3 different voltages: 9V (for the first OP-amp of the analog circuit), 4.5V (second OP-amp) and 5V (for the TAPLFO).
      DIY tremolo with tap tempo schematic power supply

      The 4.5V voltage is provided by a voltage divider formed by RA2 and RA3. The 5V is provided by a classic 7805 voltage regulator. The power supply also needs to be well regulated to avoid noises, so I added quite a lot of electrolytic and films capacitors, included a gigantic 470uF electrolytic one before the voltage regulator. Finally, DA1 protects the circuit against polarity inversion.

      Ok so this part seems very messy, but in fact it is quite simple.
      DIY tremolo with tap tempo schematic controls

      If we look at the schematic of the TAPLFO:

      TAPLFO schematic
      We can see that each pin on the right side is for a specific control:
      • Tempo CV: rate knob
      • Waveform: choosing the waveform (8 possibilities)
      • Multiplier: choosing the tempo multiplier (6 possibilities)
      • Level CV: depth knob
      • Wave distort CV: symmetry knob
      • "Next multiplier" input: button that switches to the next tempo multiplier (not used here)
      The PIC will "read" the voltage value at these pins and attribuate a value to the parameter it controls:
      • For the rate knob: 5V will be the minimum rate, 0V the maximum rate, and every other value in between will follow a linear relationship between the voltage and the value. Same for the depth knob and simmetry knob.
      • For the multiplier and waveform: the waveform will be sinusoidal between 0 and 0,6V, then squared between 0,6 and 1,2V...etc Same for the multiplier.
      For the rate, depth and simmetry knob, a potentiometer connected to ground and 5V is enough to define the value:
      TAPLFO controls schematic
      The pot form a voltage divider that provide a certain voltage allowing the chip to adjust the speed of the tremolo.

      For choosing the waveform and time division, I wanted to have rotary switches. However, rotary switches are generally huge... Except for this 1P6T Alpha switch!
      Alpha 1P6T rotary switches
      To adapt them to my circuit, I create another PCB with connectors so they can be easilly incorporated in the build without too much wiring. It was quite a job to get the perfect size and alignment with other pots, and the switching scheme of these units is not really the clearest one! I had to use "long lugs" pots to make it fit perfectly:
      DIY tremolo with tap tempo circuit
      This way, I was also able to add component on the other side of the board, like a huge 470uF capacitor, and the vacrol that you can see on the above picture!

      LFO output and tap tempo
      This last part will light up the LED to modify the value of the vactrol. It will also display the waveform and rate on an external LED.
      DIY tremolo with tap tempo schematic

      The tap tempo is detected by the pin number 4 of the TAPLFO. When the tap tempo is activated, it connects the pin to the ground, which is detected by the PIC. The PIC then calculate time between 2 activations and set the rate accordingly. The only problem is that it consider only the last two taps, no mean between several tapping, so you rather be quite precise when tapping the tempo.

      The LFO is delivered through pin number 5. The D1 LED is external and let you see the waveform and tempo directly : you can directly see the LFO! A transistor then amplifies the current to light up the LED that will modulate the volume of the guitar. A trimpot allows you to set the maximum brightness of the LED, to set the final volume and amplitude of the modulation. (note: an 1k value is largely enough)

      There it is! Tracing the PCB was quite difficult, because I wanted it to fit in a 125B enclosure. I find that BB enclosures are really not fitted for a pedalboard: they take large amount of space horizontally and they are not very practical to use. Moreover, as I had to use long lugs pots, I would have to use "tall" 1590BB that are absolutely gigantic, so no thanks!

      A problem with LFO and high frequency digital devices is that they can generate noise. To avoid that, they should be well separated from the signal circuitery. This is a very complex problem, and they are a lot of engineers out there that struggle with it (especially when designing cellphones). To avoid that I separated the analog and digital ground, and connected them in one point with a big capacitor there. Luckily, it worked well!

      However, I had noise trouble with the square wave setting. This is a very common problem: square waves generate sudden current draw that generate a "ticking" noise, quite aweful. It was quite difficult to solve this, but I finally manage to do it by many means:
      • Using ultrabright LED for the external tempo LED, which reduce the current draw needed for this LED.
      • Using a high gain transistor for the LED in the vactrol. Here I used a MPSA18 with a gain of more than 1000!
      • Using a huge 470uF electrolytic capacitor between 9V and the 7805. It will give the bit of missing current when switching on the "on" part of the square wave. I put it horizontally under the top pots.
      • Bypassing the 100 Ohms resistors in the power supply. I prefer to have a small noise due to power supply than this annoying ticking noise!
      • Separating analog and digital grounds.
      It was long and painful, but it nows work perfectly!
      Square waves are a really cool feature with tremolos, so I could not give up on it!

      There it is!

      As you could see, prototyping an effect is quite difficult, and it is a very long process! You have to conceive the circuit, test it, design the PCB, make it, testing it, and redo it if not satisfied! It can take a lot of time. Before my tremolo is finished, I still have one last step: including relay bypass and jacks on the board. You can understand now the notion of "Development Hell" where a lot of unfinished projects stay...

      With a bit of luck, this tremolo should be available soon (PCB, kit or full pedal :)  )

      To go further:
      Tremolo types by Strymon, really good explanations
      Datasheet of the TAPLFO (pdf)
      Ticking LFO noises, and how to get rid of it.
      Electric Druid website: lots of cool chips there, take a look!
      read more