NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » Rotary Encoder how to??

February 12, 2013
by Ralphxyz
Ralphxyz's Avatar

OK, I have my Stepper Motor running.

Now the pump has a encoder:

I have no idea how to wire this up or encoder code.

The yellow/black wires go off together to the right.

The black/red/blue wires go off to the left.

I "assume" the yellow/black power the led.

I only get a open when I test with my ohm meter going both ways.

In fact I only get opens between all of the wires none of them make a circuit.

The Optical Encoder is a SHARP GP3S25 I have searched but cannot find a specsheet.

Also in all of my searching for Optical Encoders I never came across a five wire one.

Anyone have any idea of what I should try?

Some of the 6 & 7 wire Optical Encoders have Anode/Cathode/GND pins with one or two additional pins.

It seems as if I should be able to measure the resistance of the led and the phototransistor or possible photoresistor but I just get a open circuit.

Ralph

February 12, 2013
by Rick_S
Rick_S's Avatar

It looks like there may be two recievers. One for timing the wheel (the higher one), and another for counting steps. The Yellow/Black pair may be the IR LED, and the Red/Blue/White may be two IR detectors with a common wire. Treat the IR LED as a regular LED placing a current limiting resistor on the leads and applying power. Look at it with your cell phone camera to see which way the polarity needs to be to light it (Most digital cameras can see Infra Red). Once you have the IR LED lit, you should be able to connect to the other wires with your tester to see what is what.

Rick

February 12, 2013
by JimFrederickson
JimFrederickson's Avatar

Hello Ralph,

Do you remember where you purchased the encoder from, or what you got it out of? (Whatever the case may be...)

Well it is not really a good idea to "guess on these things", at least for me, but...
(Probably a good attempt at tracing the wiring would be helpful, and/or looking for additional individual part numbers. Also the assumption is this is mostly a "dumb device", which for the ones I have used is what I get/end up with.)

From what I see it seems like there are 2 sensors/emitter pairs. (Either optical light, or IR Diode Emitters with the appropriate sensors...)

That "slash" in your encoder wheel I am taking to be a "index mark". Once of the "sensor/emitter pairs" is for reading only that.

Red - Common VCC for both pairs... (Whatever voltage that is going to be?)

Black - GND for 1 emitter/sensor pair.
Yellow - GND for the other emitter/sensor pair.

Blue - Sensor output #1
White - Sensor output #2

PURELY this is a guess and conjecture.

I also was not able to find any documentation on this specific part. Which leads me to be believe it is a "sub-assembly" from something larger that Sharp Built for resale.

While I have NEVER blown a Microcontroller I tend to blow diodes often.
(Mostly the LED varieties, but none-the-less blown...)

I would do more digging before using this.

The good thing is though, you can always just use the encoder wheel and board and mount your own emitter/sensor pairs so that you know what the parts are!

February 12, 2013
by Ralphxyz
Ralphxyz's Avatar

Thanks Rick and JimFrederickson, I had thought about making up my own Opto Encoder.

I tried powering black/yellow both ways with a 1000 ohm resistor in line but could not detect a flash with my camera which I have used before to see IR leds.

I wish I could detect some resistance between the various wires.

This is the only link to the pump they do not give much info.

They do say "DualSlot Photo sensor on rear pump shaft," so I guess that accounts for the 5 wires.

I figure the pump is 6 volts so the encoder probable should be 6 volts, should I try a lower value resistor maybe?

Ralph

February 12, 2013
by JimFrederickson
JimFrederickson's Avatar

I don't think you can count on the Stepper Motor and the Rotary Encoder to be powered at the same voltage. (In fact I would expect them to be different...)

Again, I have blown way too many diodes...
(Even though my meter is supposed to be able to test/analyze diodes, when I DO NOT have the specs/datasheets it is rarely a good thing for me...)

Maybe Rick_S has some better ideas on how to troubleshoot/analyze this...

February 13, 2013
by Rick_S
Rick_S's Avatar

Take a good photo of the traces on the bottom of the board so I can see where they go. Also, maybe a photo - overhead view w/o the wheel in the slot. That may help determine better what wire is what.

Rick

February 13, 2013
by Ralphxyz
Ralphxyz's Avatar

Here is a photo of the optoencoder and the pcb.

There definitely is a high and low optoencoder!

Ralph

February 13, 2013
by Ralphxyz
Ralphxyz's Avatar

Do you think I should try 12 volts for the encoder?

Ralph

February 13, 2013
by Rick_S
Rick_S's Avatar

OK, Looking at that, I would guestimate that the Red/Blue Pair are for the IR LED's. The Black is the common between the two IR Photo transistors with the yellow and white being the outputs. Check the Red/Blue pair as I said above to see which way they are polarized treating them like standard LED's with your 1K current limiting resistor. Then, I'd check the photo transistors. I think with the IR LED's on, you could place a 1K resistor between the black wire and 5V, then connect an LED between the White or Yellow wire and ground and it should light. When the IR LED is off the LED should go off too.

Just my thoughts, I may be off a bit on the photo transistor side, haven't messed with them in a while. So maybe do a bit of research if you want 1st.

As for the wiring... I would feel pretty good about that being correct, but again, test to be sure.

Rick

February 13, 2013
by Ralphxyz
Ralphxyz's Avatar

red/blue is open as is blue/red!!

As are all of the wires I cannot make any connection between any pairing!!

With the black + I can light a terminating led and resistor on the white but so far I have not been able to make any other connections.

This is with no other wire connected.

I have + black to white to Led to /\/\/\ to GND.

No other wire combinations lights a Led so far.

Ralph

February 14, 2013
by BobaMosfet
BobaMosfet's Avatar

Ralph,

If you look at the PCB, the RED/BLUE are in series-- so you know this is one side of the transducer. Either the transmitter or the receiver. Black and yellow appear to be similar, with a slight difference.

Use a resistor to drop the voltage and current to like 3.3-4V at no more than 15mA. Try the BLACK/YELLOW as well, please. BLUE/RED may be the receiver, in which case you won't see anything.

BM

February 14, 2013
by Noter
Noter's Avatar

I think Rick has it right when he says: "Red/Blue Pair are for the emitter LED's. The Black is the common between the two IR Photo transistors with the yellow and white being the outputs".

Following along Boba's recommendation, 3.5 volts across the two emitters is a good starting point. So 5v - 3.5v = 1.5v, 1.5v/15ma = 100 ohms. Try 5v --> 100 ohm --> red wire --> emitters --> blue wire --> gnd. See if you have around 1.5v across the resistor and if so it is working. Otherwise reverse the polarity, 5v --> 100 ohm --> blue wire --> emitters --> red wire --> gnd and check for about 1.5v across the resistor. If you don't see around 1.5v across the resistor with either polarity then likely one of your emitters is fried resulting in an open circuit.

February 14, 2013
by Ralphxyz
Ralphxyz's Avatar

Hi Rick thanks, ok here is a better illustration of the pcb:

black is common to both opto encoders impling that white and yellow are the signal wires.

red and blue are in series as Rick said meaning that one should be + the other -.

10 - 13 (red/blue) should be the Leds

4 - 7 (black/yellow/white) should be the photo transistor.

Does this sound correct??

I have a opto interrupter that I got from Radio Shack years ago I'll play around with that also to see what I can get out of it.

Ralph

February 14, 2013
by Ralphxyz
Ralphxyz's Avatar

with blue + and red terminated with a led and resistor to GRN the led lights!!

with black + and yellow/white terminated with leds and resistors to GRN the white led lights all of the time, same as noted above.

I still cannot detect the IR Led with my camera possible I'll pull the pcb from the housing so that I can get a clear shot.

Ralph

February 14, 2013
by electriccharle
electriccharle's Avatar

Ralph I have some experiance working with 5 terminal opto sensors. The equipment was made in the 70's. The diode was a GaAs infered Emitting Diode (LED 55C).This diode had a high forward Voltage drop, 1+ Volts at operrating current. It was hard to see on a VOM. The other three leads were on an photo transistor. The base could be used to strob the operation. I have some of these transistors but the labeling is gone.All I can see is TIL MEXICO. Sorry I couln't get better part numbers.

E Charlie

February 14, 2013
by electriccharle
electriccharle's Avatar

Ralph It always work out this way.At the bottom of my junk box was a perfectly marked photo transistor TIL81HR-2. Chuck

February 14, 2013
by Ralphxyz
Ralphxyz's Avatar

Ok, so what should my white and yellow circuit look like?

I had black + white to led to resistor to GND.

But circuits I have seen on google have had black at GND and some had a pullup resistor with a pin to the mcu before the phototranssistor and others with the pin to mcu aftr the phototransistor.

Any ideas, circuits?

Ralph

February 15, 2013
by Ralphxyz
Ralphxyz's Avatar

Here is the signal circuit I have tried.

but so far I cannot detect a signal.

Suggestions?

Ralph

February 15, 2013
by Noter
Noter's Avatar

Maybe the 10k resistor is the problem. Here is some good information on Photo Sensor circuit design.

February 15, 2013
by BobaMosfet
BobaMosfet's Avatar

Ralph,

After looking at this a little more, here's your hookup. The wires are grouped for a reason. The two wires are your transmitter, and the 3 wires are your receiver. Because the receiver side has to have an amp internal, it needs powered.

Put it at 5V at no more than 20mA Max.

YLW/BLK      -- Anode/Cathode for LED (transmitter).
WHT/RED/BLU  -- Power/Output/Ground (Receiver).

Swap the colors end for end, if need be. Red has to be your collector output, because it's a common-emitter. White or Blue will be GND.

Hope that helps

BM

February 15, 2013
by BobaMosfet
BobaMosfet's Avatar

Ralph,

BTW-- You will want to put a pullup on the collector (RED), since it's an open collector output.

BM

Post a Reply

Please log in to post a reply.

Did you know that interrupts can be used to trigger pieces of code when events happen? Learn more...