Maker Pro
Maker Pro

Voltage Drop after optocoupler.

Good day all.

I am currently working as a student and my project is to build a microcontroller based subsystem that will be used to communicate with a servo drive to control a rotation table for antenna testing. With the progress made I have stumbled upon a rather annoying problem I can not seem to debug. For some reason after 5V passes through the optocoupler (which is inside the Servo Drive) it drops to 2.29V. This causes a big problem since the controller sees 2.29V as a 0 instead of a 1. I am currently testing the ports with a simple program that pulses the digital pins to high and low (3.3V) at the base of the transistor. I have also done a simulation in LTSpice (Image attached) and all looks well. Unfortunately I cannot show hardware since I am writing this at home and I am not allowed to bring my project to home. I get around 4.49V after the optocoupler. Any advice will be appreciated. Thank you for your time.

Ryan
 

Attachments

  • tempsnip.png
    tempsnip.png
    116.9 KB · Views: 22

Harald Kapp

Moderator
Moderator
The voltage you show in the diagram is irrelevant for the function. Note that R4 is required for the simulation only as SPICE cannot handle completely separated circuits. In practiced R4 would be omitted and the voltage you indicate is limited only by the isolation voltage of the optocoupler. That is what optocoupler are used for.

The relevant voltage is Vout <> GND2 (see image):
upload_2022-1-24_13-19-15.png
This voltage is either 5 V with the output transistor of the 4N25 off or lower when the transistor is on. How low it is depends on the current transfer ratio, the load resistance R2 and the base resistance R3 (the latter is imho much to low - chose a higher resistance as a low resistance will remove charge from the base and thus prevent full turn- on of the transistor wen the LED is on). Read e.g. here how to use optocouplers.

BTW: I will move this thread o the homework section where I think it belongs.

BTW2: Please don't draw connections as you did with R2. Ideally you'd draw the connection like this:
upload_2022-1-24_13-23-24.png
Or at least leave some room between resistor and wire. This makes the schematic much better readable.


Regards,
Harald
 
Hello,

Check the value of R1.
Is it really 270 k?
Change it to 270 Ohms and try again.

Bertus
Hi thank you for the reply. The resistor is indeed 270ohm inside the servo. After changing it in my simulation \i still have the same results. Unfortunately I cannot change the resistor value inside the servo drive.
 
The voltage you show in the diagram is irrelevant for the function. Note that R4 is required for the simulation only as SPICE cannot handle completely separated circuits. In practiced R4 would be omitted and the voltage you indicate is limited only by the isolation voltage of the optocoupler. That is what optocoupler are used for.

The relevant voltage is Vout <> GND2 (see image):
View attachment 53944
This voltage is either 5 V with the output transistor of the 4N25 off or lower when the transistor is on. How low it is depends on the current transfer ratio, the load resistance R2 and the base resistance R3 (the latter is imho much to low - chose a higher resistance as a low resistance will remove charge from the base and thus prevent full turn- on of the transistor wen the LED is on). Read e.g. here how to use optocouplers.

BTW: I will move this thread o the homework section where I think it belongs.

BTW2: Please don't draw connections as you did with R2. Ideally you'd draw the connection like this:
View attachment 53945
Or at least leave some room between resistor and wire. This makes the schematic much better readable.


Regards,
Harald
Hi, thank you for the reply. I do not care about the output of the optocoupler, but the voltage value after the optocoupler's IR diode. Thus the voltage I show is relevant since it shows the ideal voltage on that point where I am getting a voltage drop.
 
UPDATE: I have might have found a reason for the drop. It might be the shield that I have constructed. For some reason the digital pin is only sensding 0.6V instead of 3.3V to the base. Thus resulting that the transistor never drops to zero.
 

Harald Kapp

Moderator
Moderator
Hi, thank you for the reply. I do not care about the output of the optocoupler, but the voltage value after the optocoupler's IR diode. Thus the voltage I show is relevant since it shows the ideal voltage on that point where I am getting a voltage drop.
What is the use of the optocoupler then?

You could help us help you by explaining what you want to do, not how you do it.
 
What is the use of the optocoupler then?

You could help us help you by explaining what you want to do, not how you do it.

"I am currently working as a student and my project is to build a microcontroller based subsystem that will be used to communicate with a servo drive to control a rotation table for antenna testing." As stated above. The optocoupler is part of the circuit inside the servo, there is nothing wrong with the servo drive or the optocoupler. I firstly thought it was due to a bad transistor but this was not the case. I have found that the digital pins on the Arduino shield that was created by the company only produced a 0.6V input to the base instead of 3.3V like my LTSpice schematic. So I have finally pinpointed a main issue.
 
Goto #10, would save a lot of bother if you provided the details you have there.
Arduino shield conclusion doesn't seem correct.
 

Harald Kapp

Moderator
Moderator
For some reason the digital pin is only sensding 0.6V instead of 3.3V to the base.
Sounds like a missing or much too small base resistor (R5 as shown having 1 kΩ would be o,k., but check the real circuit).

Revisit your circuit and draw a circuit diagram that actually matches your circuit with correct component values. Also label your nets (as you have done wit VCC) with meaningful names (F4 key in LTSPICE). Automatic net names such as e.g. n003 are useless to us, we can't know which voltage V(n003) refers to.
Instead of the misleading optocoupler use an LED only. Use the diode symbol in LTSPICE, then select an LED as component), as neither you nor we are interested in what's going on on the optocoupler's secondary side (transistor).
To know whether the circuit works, the relevant thing to know is the current through the LED. This can easily be indicated in the simulation using a current probe. In the real circuit you can use a milliamperemeter or simply measure the voltage across R1 and compute ILED = VR1/R1
 
Top