Introduction: How to Make a Optocoupler (Vactrol)
This is a short ‘ible on how to make an Optocoupler. There’s a whole bunch of names that this little electric component comes under. Others include vactrol, Opto-isolator, photocoupler and optical isolator.
An optocoupler allows you to transmit an electrical signal between two isolated circuits with two parts: an LED that emits infrared light and a photosensitive device (LDR) which detects light from the LED. Both the LED and the LDR are enclosed so no light can reach the LDR. The shop brought ones will be enclosed in plastic. This homemade version uses a small piece of heat shrink.
So what is an optocoupler and why do you need to know how to make one. If you build circuits then at some stage you will come across a weird schematic symbol that is a optocoupler. An optocoupler can be used in many applications such as synths and sound effect circuits, input/output switching, and a bunch of other applications.
Here's a couple of links for those who want to learn more about optocouplers
More Technical Link 3
Step 1: Identifying an Optocoupler in a Circuit
Below are some of the more common optocoupler schematic symbols you might come across. You can see that the symbol is made up of an LED and photoresistor symbol.
Actually, the symbol depicts what an optocoupler is quite well. I did find it a little confusing however when I first come across one as I didn’t realize they were connected parts
I have also added a couple of schematics that show you an optocoupler being used
Step 2: Parts and Tools
Parts List
1. 5mm LED – eBay
2. LDR – eBay
3. Heat Shrink 6 to 7mm – eBay
Tools:
1. Lighter
2. Scissors
Step 3: How the Optocoupler Goes Together
The images in this step shows how the components go together. You can see that the LED and the LDR face each other inside the heat shrink. The LED acts as an input and the LDR is the output receiver.
Step 4: Placing the LED and LDR Inside the Head Shrink
Steps:
1. First, grab your heat shrink and cut a 20mm piece
2. Next, Place the LED into the heat shrink. If you have troubles pushing the LED into the heat shrink due to the rim on the LED, you can remove it with a file.
3. Push the LED into the heat shrink so there's about 5mm over the LED legs.
Step 5: Shrinking the Heat Shrink
Steps:
1. Whilst holding the LED legs, start to add some heat to the heat shrink around the LED section
2. Make sue you only add heat to the section where the LED is as you only want the heat shrink to shrink around it.
3. Once the heat shrink has melted enough, use a pair of needle nose pliers to squash the heat shrink around the LED legs, effectively forming a seal. What you are trying to do is to seal any potential outside light reaching the LDR - you only want the light from the LED to affect it.
4. Do the exact same for the LDR.
Step 6: Bending and Cutting the Legs
Steps:
1. Take note of which leg is the positive on the LED. A good idea before you trim the legs is to snip a small corner away from the heat shrink next to the positive leg. This way you will always know which one it is.
2. Bend both the legs of the LED and the LDR down
3. Trim the legs on both the LED and the LDR
That's it. You have now made your own optocoupler which will work just as good as any store brought one.
12 Comments
Question 3 years ago
Hello Lonesoulsurfer,
I would like to know what type of LDR do you use. I know that the LDR being resistances can vary their value, but here I have not found within which values this resistance oscillates
Thank you
Answer 3 years ago
See my post above ;-)
Tip 3 years ago
I struggle for a while with these things and did similar like you did. I have some tips to get better results. Most important for many things is to get the lowest resistance possible. To achieve this, take care of these options:
- Use a flat head WHITE bright LED (or make it flat head, to reduce the distance and fit the LDR better). Other colors don't produce the same results, you need a white LED;
- Use chrome decoration tape (it is plastic) and roll it in this shiny mirror plastic before you put heatschrink on it. Black surroundings absorbs light and this shiny mirror plastic reflects light. You can also use Alu-tape but you have to be careful cover the legs and both components with sticky tape first before applying the Alu-tape. Be sure the Alu-tape does not short any of the legs.
- Experiment with sanding paper to make the transparent LED bulb difusse, it will light up the whole bulb and spreading light better;
To secure and tighten the plastic/rubber around the legs, I use a lighter to burn/molt the endings and then press it together. After cooling down, the rubber/plastic will be solid and harden.
I use the LDR type nr 5516. Anyway, with these options I get much better results, about 50 Ohms at full brightness (5V , 100 Ohm resistor). With a button cell I get around 100 Ohms. That's much better than without these options, without it, the difference is a couple of hundred ohms.
Nice article however lacks some details, for example the colour, type of LED and type LDR. This is important to know because it gives different results. Keep up the good work! ;-)
PS: It is a vactrol, not an optocoupler.
4 years ago
That is a pretty good example of opto-isolation, but it does use a variable resistor. Typically a phototransistor is used which does a few of things that this model does not.
1) It is very fast acting.
2) It typically carries a bit more current.
3) It can be triggered electrically if desired.
Take a look at my favorite... the 4N35 optocoupler. You can connect the LED and the two phototransistor outputs... but there is also a base that allows for electrically switching the device on if desired.
RE: https://www.vishay.com/docs/81181/4n35.pdf
Reply 4 years ago
Interesting part, I didn't know they make them with an exposed base connection.
Reply 4 years ago
This is my "go to" part... I order 25 at a time. :-)
4 years ago
Although your build does provide galvanic isolation, it is not a substitute for an optocoupler. Not only will the transfer function be different (ie. the same input current will not have the same effect on a real optocoupler), but it will be also about 100 times slower. Typically optocouplers are used in high voltage applications as a safety measure and thus must have a guranteed voltage rating, which your build doen't have either.
So yeah, to understand the concept this is fine, but for real applications it won't work in the best case or be a risk for electric shock in the worst case.
4 years ago
Interesting, thanks for sharing :)
4 years ago on Step 6
I’m not an engineer, but optocouplers I know of use an LED and a photo transistor to get quick on and off( as shown in your schematic sample) Your part is using a Light Dependant Resistor which may give different results in a project. I would guess the photo transistor would work in your Instructable the same way though.
4 years ago
An LDR is not a light activated transistor or diode, it is a variable resistance that has nothing to do with your schematics.
4 years ago
This is great! You have a few missing placeholder links at the beginning, though.
Reply 4 years ago
Thanks for the heads-up. I've added the links now