if you have a limiting R from the motor to the input of the opto, you can put diode opposite to that of the LED so that when the motor is reversed, the current flows though a forward biased diode. That will mean the voltage across the LED will never get too high.
The LED only needs a small (5mA) current to work so little current is wasted if the right R is chosen.
My suggestion actually was to have the protective diode across the LED but reverse direction. When voltage is forward, LED lights, when reverse, diode conducts to limit reverse V on LED.
JRemington, the bidirectional will not allow determining direct as requested in OP.
weedpharma:
Feed the voltage into opto isolators with voltage connected opposite on each. Only one will operate for each direction.
Precisely that.
Connect the optocoupler LEDs "back to back" with a common resistor. Rather like this diagram:
But with two optocouplers and you only need one resistor with the value that suits (1k for 12V) - no reason to split it as here.
weedpharma - thank you for clarifying, I understand now.
So if i use 2 opto isolators but have them connected 'back to back' then I won't need diodes as eachothers LEDs will act as a diode? Is that correct?
As I don't have any opto isolators to hand but I do have LEDs and LRDs, I've mocked up my own opto isolator for the forward direction and it's working nicely!
I don't have any diodes to hand to test the reverse direction but following on from above, if I mount my second led 'back to back' with the first will they protect each other when the current reverses?
Another full-wave bridge opportunity missed.
(You could get one that looks like an IC, so it'd be sexier and worthier that way.)
I guess there's a direction divination design goal.
Had the idea that only whether was important (Reply #11?)
Assuming you have "control" over the thing, you should know which direction it's going.
What's to be accomplished here?
Is the output from an opto isolator digital or analog?
When the motor is running it draws around 11v but sometimes it draws around 9v when stationary and the rest of the time its at 0v.
On my test set up using an LED and LDR I can easily set the threshold in my code as the LDR is analog. Will I be able to do the same with an opto isolator?