# Voltage drop after optocoupler

I don't know what's wrong... I have an ATTiny13 which gives a dummy impulse turning a fan on and off every 2 seconds; so the plan.

I attach two power sources (for dummy purpose) before and after the optocoupler (5V on the top right; and DV on the center bottom). In the experiment both have 5V but it has to be tested like this.

When I put an LED behind the opto instead of the fan, it shines bright and nice. When I replace it with the fan - you see it trying to move but without enough power so he just move 1mm until the power goes off again.

I just circled the optocoupler part.

It would be very nice if someone has a clue why there is such a voltage drop through the optocoupler.

EDIT: After the answers below I came up with this working solutions (it seems so).

• As mentioned in my comment below: add a resistor (> 1kOhm) between ATtiny and base of BC141.
– Curd
Sep 6 '19 at 9:58

## 2 Answers

The optocoupler is able to switch a few mA (the datasheet says max. 30mA @ 5mA input current) which is enough for a LED but obviously by far not enough for your DC motor.

A simple solution would be to add a transistor at the secondary side (motor side) of the the optocoupler.

• I just tried this after I sent the question. But the current seems to be too low anyway. I use a 'BC 141-16' transistor which can switch 1A but nothing happens on the fan.... (when I put it directly on the 5V it turns; so the power supply has enough A) - any ideas? Sep 6 '19 at 8:02
• How did you connect the transistor?
– Curd
Sep 6 '19 at 8:14
• The opto signal I used for the Base-Pin. The Collector to the second power source and the emitter on the + of the fan. The - of the fan to the GND of the second power source. Sep 6 '19 at 8:29
• What you've described (emitter follower) is not a suitable circuit for this purpose. Use a common emitter circuit: Emitter to GND (=neg. power supply), collector to (-) of motor, positive power supply to (+) of motor.
– Curd
Sep 6 '19 at 8:43
• patrickbeck.de/stuff/dummy.jpg (Can you give it a look?) I've just done it like you said, but it just tries to rotate; no movement. (24V ist just for me; it's 5V to test with the fan-thing) Sep 6 '19 at 8:57

Optocouplers aren't made to switch power. They are made to transfer signals.

Here's a snippet from the datasheet for the PC817 you are using:

Do you see the line "Collector current" in the "Output" section? That 50mA is all the current that optocoupler can pass without burning out. That's probably a lot less than your motor needs.

You don't need an optocoupler to drive your motor. A properly sized transistor would do - together with a diode in anti-parallel with the motor to catch the high voltage spikes when you switch the motor off.

• "You don't need an optocoupler" >> even if I want to run it with 5V on one side and 24V on the other side? Sep 6 '19 at 8:03
• Nope. If you can connect the grounds of both power supplies then you don't need the optocoupler.
– JRE
Sep 6 '19 at 8:07
• Look around this site. You'll find plenty of examples.
– JRE
Sep 6 '19 at 8:08