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.

Two-wire opto-interrupter?

Status
Not open for further replies.

MikeMl

Well-Known Member
Most Helpful Member
I'm building a PIC controller for an antenna rotator. The rotator will be mounted about 100 feet from the ham shack, and the I want to control/power it over a five-wire control cable. Three of the wires are used to control a split winding, capacitor start/run 24VAC motor. Of the other two wires, one is a DC ground return, and the other was used to connect to a wire-wound rehostat used as a not-very accurate heading indicator.

The rehostat is the weak point in this design, it has gone bad, and a replacement is too expensive. I have replaced the rehostat with a disk on the motor shaft and a opto-interrupter. One 220Ω resistor from +5V through the LED emitter, and a 22K pull-up on the collector of the photo-transistor gives me a clean 5V pulse once per disk rotation, suitable for a digital input to the PIC.

Here is my problem: the connection above requires three wires, +5V, GND, and the PULSE out. I would like to reduce this to two wires; some method of modulating the photo-transistor current onto the LED emitter current, and then separating the two currents at the other end of the 100ft run. The circuit could be powered either from 5V (the PIC supply), or from an unregulated 15Vdc supply. The goal is to deliver a clean pulse to the PIC pin.

Anybody have any ideas?
 
Mike,
I would consider sensing the current thru the wire by measuring the voltage drop across a lowish value resistor.

A quick LTS showed that the change in voltage drop across the resistor [at the local end of the 2 wire] is sufficient to control a pnp transistor

I tries alternative way of using a 25mA CC drive into the remote opto signal wire an detecting the voltage change on the 'signal' line when the interrupter was 'broken and open' this also gave a good signal.
 
Not to get off topic but I think your problem is going to be the accuracy. With a single opto sensor and an AC capacitor start motor how are you going to enforce an accurate position? At least the old rheostat gave a voltage output relative to absolute position.

The best you can do with a single optical sensor is two absolute positions (the / and \ edges), or a pulsed output every X degrees with no absolute reference. And a capacitor start motor can't be vector controlled.

If it was me I'd look for a different system;
1. Swap the motor for a DC motor with encoder, and use an absolute reference on the antenna. This will mean it needs to "home" the antenna everytime you power it up.
2. You have 3 motor wires so use a 3 phase ac motor and vector control AC drive, to turn the motor to any position (like a steppe rmotor), again this requires one absolute pos sensor and "homing".
3. Put a gray encoder on the mast to report back in absolute position, and put a PIC at the top end to send serial data back. This may be the easiest but will have a more limited resolution.
4. Design an optical rheostat where a shaped "cam" gives an analogue voltage or current back from the optointerruptor.

If you still want a 2 wire opto interruptor solution I would wire it in series with a 3.8v zener diode across the photo transistor. When dark it's total voltage will be
1.2v + 3.8v, when light probably about 1.2v + 1v or so, you will need a PIC comparator pin or ADC pin to sense it, and some current limiting to supply (like a resistor from 15v).
 
The UHF antenna aperture is the sharpest, and even it is like +- 15degrees. The VHF antenna is more like +-30degrees. The gear train in the rotator requires 2667 revs of the motor shaft to produce 360 degrees of antenna rotation, so that is about 7 pulses per degree. I will have more than enough resolution, even with only 1 pulse per motor revolution.

I do not need a quadrature encoder because the PIC apriori knows which direction the motor is turning (the PIC controls the direction relay). There will be an unsigned 16 bit int in the PIC which represents the current position. It will be decremented or incremented based on the rotation direction. That counter will be converted to degrees for display on an LCD.

Keeping the PIC's counter synchronized with the actual antenna heading will be relatively straightforward. Assuming the PIC is always powered, it can keep track of the last position. If the antenna array is moved by strong winds (pulses without a Move command) , it can know that the calibration has gone off, and it can do a recalibration on next power up. If Power is lost, the current heading can be written to Flash, and retrieved on next power up.

The rotator has mechanical stops at about -10 degrees and +370 degrees. The pulses stop as the motor stalls. Being the type of motor it is, stalling it is harmless. The PIC will know that it just ran into the stop, and will know which end of the travel it is at, so it can zero (or set to 2670) the counter. A recalibration can be done any time by just having the PIC drive the rotator to either stop.

As to the two-wire method, I think I have it solved. It turns out that the main power transformer secondary, motor windings, capacitor, and direction relay are all isolated from ground. I connected the motor common lead to the PIC's 5V supply through a current limiting resistor which lets me feed the LED emitter in the opto-interrupter between the motor lead and the ground wire. The collector of the photo-detector transistor is thus isolated from emitter circuit, and can utilize just two wires, for a total of five.
 
Last edited:
That's an interesting solution Mike! Keeping the PIC always powered and using the motor stall to detect absolute position at the end stops, in the event the PIC does lose position. :)

But now you have 3 wires available, I'd definitely put a PIC at the top end and use an absolute optical encoder (gray encoder) and serial data back. But that's just me. ;)
 
FWIW:

You should check out the ROTR 100 from Eagle Aspen. It uses satellite dish positioning signals over RG-6 to position and power the rotor. You can also power certain antenna amps and use the same downlead.

I chose not to. I use one RG-6 for the rotor. They reccomend not using copper plated steel cable.

And an RG-6 for a mast mounted amp and signal.

The internal design is pretty neat and it does rotate larger than 360 deg.

I wanted to add tilt, but the company making the tilt systems is no longer making them because of lack of demand. Their system used a linear actuator.
 
Aaaaa I still like the earth ground thing, The antenna mast should be grounded anyway. But yes Mikes idea is nice I bet he stayed up all night dreaming that one up. Way to go Mike. Andy
 
Aaaaa I still like the earth ground thing, The antenna mast should be grounded anyway. But yes Mikes idea is nice I bet he stayed up all night dreaming that one up. Way to go Mike. Andy

The fifth wire in the cable running from the rotator to the controller was used as a signal return for the original potentiometer heading indicator. It is connected to the body of the rotator which in turn is bolted to the Rohn steel tower (which is earth grounded), and the other end was connected to the ground of the indicator circuitry at the controller end. I though about "floating" it, but that might be risky in the event of nearby lightning strike.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top