How to control servos though optocouplers

I am powering the servos(hitec hs-322hd) with an external power supply and the arduino from USB, I don't want to burn the board it is safe to work without optocouplers?

SpaceOne:
I am powering the servos(hitec hs-322hd) with an external power supply and the arduino from USB, I don't want to burn the board it is safe to work without optocouplers?

As long as your grounds are connected, it shouldn't be an issue. I'm still not sure what exactly you were trying to do with the optocoupler, but I can tell you that you didn't have it hooked up right (at least, by your description). For one thing, you didn't have a current limiting resistor on the LED side of the opto-coupler (without looking at the spec-sheet, though - it may or may not need one, but like any LED, you need to limit the current if it isn't limited already, to prevent the LED in the optocoupler from burning out, or from damaging you i/o pins on the ATMega).

If you were trying to control the power to the servo, your output didn't sound like it was properly hooked up, either (plus, I doubt it could handle the current needs of one servo - you would actually want to use the optocoupler to switch a larger power transistor, or some other "switch" capable of handling the current, in that case). If you were trying to isolate the servo signal (which I am not sure would work right, since the NPN would invert it), then the emitter of the transistor on the optocoupler should go to ground, the collector to the signal line on the servo.

What part of the servo were you trying to control with the optocoupler - power or signal?

safe to work without optocouplers?

Yes the only thing the arduino supplies is a logic control signal, that is the only thing you can isolate with an opto isolator.
How have you tried to isolate it? I think you need to look up how these things work.

I am trying to control the signal with an optocoupler, I use resistors. I will try to connect the emitter to the ground.

I have servos connected to my arduino which are externally powered, and the arduino is also connected to the USB on my computer. The arduino has suffered no ill effects.

SpaceOne:
I am trying to control the signal with an optocoupler, I use resistors. I will try to connect the emitter to the ground.

given that you are not trying to power the servo via the arduino, i dont see why there would be much current traveling down the signal line from the arduino to the servo. an optocoupler seems more appropriate to power it.

i am doing something very similar right now, in which i have the servos powered off an external power supply, and just feed the signal straight from the arduino. seems to work fine.

can anyone tell us how much current would be going down that signa line?

can anyone tell us how much current would be going down that signa line?

Most likely just some microamps, so say 1ma.

I will try to connect the emitter to the ground.

If you use the opto couplers (resistor in line with the LED) you do not have to connect the grounds of the two supplies together. However if you connect directly from the arduino you do have to connect the grounds together.

I got it working, using the circuit bellow the servo can be controlled with an optocoupler, but the servo jitters I am guessing that the response time of 18 micro seconds is causing the problems. I will try high speed optocouplers 100nano seconds.

The control signal for the servo is 5v will this cause servo problems ?

2controller.JPG

Shouldn't the PWM output be connected to the anode of the optocoupler LED with the 1kohm resistor and the cathode connected to ground? Or is it your intention to invert the LED-input? How did you calculate the R(led)? What is the 75 ohms resistor to GND for?

What do you mean with "jitters" and what about the sketch?

markbee

Shouldn't the PWM output be connected to the anode of the optocoupler LED with the 1kohm resistor and the cathode connected to ground?

This is the route I would take. As to the jitters, the wiring per the schematic should not work. Hopefully the OP is using the servo library to produce PPM instead of PWM to control the servo.

I am using the servo library, so the optocouplers input must be reversed, is the output good?

And do I need faster that 18 milliseconds optocouplers ?

And do I need faster that 18 milliseconds optocouplers

I don't ever recall ever seeing optos rated in milliseconds.
(apart from ones where the LED is five and a half thousand kilometres from the phototransistor)

That is my mistake, I didn't read the right value the only thing about time is 1 Pulse width<=100ms, Duty ratio : 0.001

I tried signal to cathode and it works much better, now the servo rotates but it can't get into the right position it moves back and forth between the correct position

I got a 4N35 optocoupler and it behaves the same way, it can't get into the right position it moves back and forth between the correct position until it stops

could be bad code, bad wiring, bad servo, power supply issues, or other things not provided for evaluation.

I tried different servos, optocouplers, wiring is good, power supply is good. Don't know the problem, I am thinking of not using optocouplers.

Has any one used optocouplers to control servos?

I am thinking of not using optocouplers.

I think that was suggested a long time back. You need to test your servo without the optocouplers to see if it works.