Post Top Ad

Sunday, June 30, 2024

on video How to Test Optocoupler, super simple and easy


 How to Test Optocoupler, super simple and easy

When I was working on my garage door opener, I had trouble controlling a 12V relay from a 3.3V NodeMCU board and at the time, I did not have any optocouplers available. Hence, I had to resort to using a 5V relay.


While looking at what I could do, I came to the idea of ​​making my own optocoupler just out of curiosity so I could see if the idea would work and I must say that it worked better than I thought it would.


By using an LED and an LDR, I constructed a simple optocoupler that I then used to control a 12V relay from a 5V power supply.


Both of the devices will be enclosed with heat-shrink tubing as close as possible to each other so it is very important that we make proper electrical isolation in the LED and LDR leads.


To do this, I used the smallest heat-shrink tube that I had and I added it to the legs of the LED and the LDR. This will provide that electrical separation within the component.

To construct the optocoupler, I used a 5mm heat shrink tube and I first placed the light-dependent resistor inside, making sure to cut off the excess so there is only enough heat shrink for the LED body.


The LED has a small lip at the end that was not able to fit the tube but we will handle this in the next step.

To make sure that the optocoupler is not affected by external light, it is critical that we isolate it from external light as best as we can. Since the LED has one side exposed, I've cut and placed a small piece of electrical tape over it and then I also covered the entire optocoupler with one more heat shrink tube.


Since I only had yellow heat shrink, the end result was not perfect so at the end, I also wrapped the entire optocoupler with one more piece of electrical tape.

To make sure the optocoupler works, I made a circuit where I had its LED connected to a 5V power supply with a 100 Ohm resistor in series. This will provide around 20mA of current through the LED, making it sufficiently bright.


On the other end, I had the relay connected to 12V where the signal pin was connected with a 4.7kOhm resistor to 12V and to ground through the LDR.


When no light shines on the LDR, its resistance is very high, so the 4.7kOhm resistor keeps the signal pin high and the relay is off. As soon as we turn on the LED, the resistance of the LDR will drop and it will pull the relay signal pin to 0V so the relay will turn on.


This worked surprisingly well so I can say that the experiment was successful and I'm quite happy with the results.


 How to Test Optocoupler, super simple and easy

When I was working on my garage door opener, I had trouble controlling a 12V relay from a 3.3V NodeMCU board and at the time, I did not have any optocouplers available. Hence, I had to resort to using a 5V relay.


While looking at what I could do, I came to the idea of ​​making my own optocoupler just out of curiosity so I could see if the idea would work and I must say that it worked better than I thought it would.


By using an LED and an LDR, I constructed a simple optocoupler that I then used to control a 12V relay from a 5V power supply.


Both of the devices will be enclosed with heat-shrink tubing as close as possible to each other so it is very important that we make proper electrical isolation in the LED and LDR leads.


To do this, I used the smallest heat-shrink tube that I had and I added it to the legs of the LED and the LDR. This will provide that electrical separation within the component.

To construct the optocoupler, I used a 5mm heat shrink tube and I first placed the light-dependent resistor inside, making sure to cut off the excess so there is only enough heat shrink for the LED body.


The LED has a small lip at the end that was not able to fit the tube but we will handle this in the next step.

To make sure that the optocoupler is not affected by external light, it is critical that we isolate it from external light as best as we can. Since the LED has one side exposed, I've cut and placed a small piece of electrical tape over it and then I also covered the entire optocoupler with one more heat shrink tube.


Since I only had yellow heat shrink, the end result was not perfect so at the end, I also wrapped the entire optocoupler with one more piece of electrical tape.

To make sure the optocoupler works, I made a circuit where I had its LED connected to a 5V power supply with a 100 Ohm resistor in series. This will provide around 20mA of current through the LED, making it sufficiently bright.


On the other end, I had the relay connected to 12V where the signal pin was connected with a 4.7kOhm resistor to 12V and to ground through the LDR.


When no light shines on the LDR, its resistance is very high, so the 4.7kOhm resistor keeps the signal pin high and the relay is off. As soon as we turn on the LED, the resistance of the LDR will drop and it will pull the relay signal pin to 0V so the relay will turn on.


This worked surprisingly well so I can say that the experiment was successful and I'm quite happy with the results.

No comments:

Post a Comment

Post Top Ad

Pages