Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Optically isolated polarity sensing circuit

Status
Not open for further replies.
I"m looking for a circuit that can sense the polarity of a signal and it optically isolated. I'd also like to do this with one uP input port, I'm using PIC processors. I want to recognize three states, no voltage, negative voltage, or positive voltage. This circuit is to sense the rotational direction of an DC motor, and of course, sense when it's not running. The voltage input to the circuit can be anywhere from 1 volt to around 15 volts, depending on how fast the motor is running.

So far my thinking is two opto-isolators that have a different set of resistor dividers and using an A/D channel to sense if either one of them has been triggered. I just can't help thinking I may be missing something and there's a more clever way. I want to stick with one I/O pin as I don't want to move up from the 8-pin PIC.

I've done a simple circuit with an AC opto-coupler that just senses whether the motor is running or stopped, but I want to expand the capability to sense direction as well.
 
Three states requires two inputs for static signals, but you could encode 3 detected states into a single input using some sort of digital encoding. For example a 1 could be positive voltage, a 0 could be a negative voltage, and an alternating square-wave or pulses could be zero voltage. But, of course, that would require some logic and an oscillator at the source end to generate the three signals. It could be done with a 555 timer and a couple of transistors along with a few resistors and capacitors. (See simulation below. There is a Low input to keep the 555 output low and High input to keep the 555 output high. No inputs allows the 555 to oscillate. V2 and V3 are for simulation only and represent the input signals from your detection circuit.)

555 Astable.gif
 
Last edited:
Actually, as I mentioned, just outputting levels for the A/D would accomplish the three states easily. Since I have a no-cost A/D on the input pin to the PIC, that's not an issue. I don't want to add another chip, since I already need total isolation, and I can do that with a two channel opto-coupler. A simple resistor divider on one of the output transistors gives me one direction, pulling the input low with the other one gives me the other direction, and when both opto transistors are open, the input is pulled up to 5V, indicating the motor is not running.

I'm just trying to see if that's the best solution here. Best is the lowest component count in this case. :)
 
Dual opto and some resistors.
Output will be 1/2 supply with no input voltage.
Output will be near gnd or near supply.
You might need a capacitor to remove noise. AN0 to gnd.
upload_2014-6-8_15-41-19.png
 
Ron, I like your "no frills" schematic!

JimB
 
Certainly if you have a spare ADC available in the PIC then a 3 level output, such as generated by Ron's circuit, would likely be the simplest way to generate the three signals.
 
Thanks folks, I guess my original inclination was as good as it's going to get. I like Ron's circuit, he used one less resistor than I had in mind. :)
 
You may need to find a way to boost the input voltage when the input is providing only 1V; otherwise the opto-LEDs may not conduct sufficiently.
 
That normally isn't an issue. This is for a model train application, and it takes more than that on the motor to get it moving, so it should work out. I have a similar circuit with an AC opto to just sense motion, and the opto with a 330 ohm resistor works great in that one.
 
Status
Not open for further replies.

Latest threads

Back
Top