Maker Pro
Maker Pro

Help me understand my scope trace result on a IR photocoupler.

apples

Jul 1, 2012
97
Joined
Jul 1, 2012
Messages
97
In another post I had some small second hand motors that I wanted to see if the included IR photo coupler on the back shaft of the motor were working. Turns out I managed to get a signal form one of them. Now I would like to understand what is going on with the trace I have captured on my scope. And the last question is about a bit of maths on how I can calculate the motor RPM from the Hz of the motor
Here is the mentioned post. https://www.electronicspoint.com/my-ir-photo-interupter-dead-can-you-test-them-t267013.html

I want to use the motor and the signal that the sensor gives off and feed that into an input pin on the arduino that I have.

So I guess I need to make sure that the voltages are not too high and that the current is not to large either. I do not know if I can read current off my scope, because with a multimeter you need to put it in series in the actual circuit, and you don't do this with a scope. Which brings me to another thought, will my cheap digital multimeter be able to read how many mA the sensor uses if it is spinning on the motor? Will my meter be able to detect it quickly enough.

Here are the scope images:


This is me turning the motor shaft very slowly. You can clearly see when I hit a blanked out part in the encoder disc which blocks the light beam that nothing pretty much happens and there is a flat line. And when the light beam is visible to the sensor it gives an output.
Scope_of_infrared_photocoupler_signal_output_turning_motor_shaft_slowly_by_hand.jpg

This capture is with the motor running off a 6v battery to give a a constant speed. Zoomed in I see that it still has the flat line part but that the rest of the signal is like a sine wave or AV wave going up and down crossing over that flat line part.

So one question is why is there a sine wave. Obviously this is just what the output of the IR sensor give you to work with. I think that the IR LED actually pulses the light ie 38Khz or Mhz or what ever it is. does this have something to do with it or is it something to do with the receiver side sensor?
Motor_running_on_6v_battery_and_scope_on_IR_signal_output.jpg

Here is what I am after regarding the voltages. To me that is like an AC voltage? does this mean for me to input this into my arduino I would need to clean up this signal or something? Or do I need to make a little circuit that detects each time that wave simply crosses over that middle flat line? Well it might have to be every 2nd line cross over, but then I guess you could program that in the arduino software.
Scope_of_the_infrared_optocoupler_output_signal.jpg


Here is top of wave
Top_of_wave.jpg


Here is bottom of wave
Bottom_of_wave.jpg


Here is flat line
Flat_line.jpg



Delta Y in the top of the wave is 120mV, delta Y in the bottom of the wave is 0. So is that then right that the maximum total voltage is only 120mV?

Because if you then look at the delta Y when the cursor is on the flat line it too says its 0v. Ahh hang on a minute, I must have adjusted the vertical position as the top and bottom waves have the same vertical position but the flat line is adjusted up to 0.
Can you still work out from here what the voltage is on the flat line, is it truely 0v or what?
Then if it is that would mean that I have a positive voltage and also an negative voltage going on here. Which like I mentioned before how the scope looks like an AC wave.


I just fiddled on the scope again. What exactly does it do when I adjust my vertical position up and down. What is that little yellow flag/tag on the left hand side of the screen that has the number 1 in it? and what do you do with it? If I adjust it on the screen to POS=0v it it now zeroed in on the center horizontal line on the scope screen. Is this then what 0v is? Anything above is POS, anything below is NEG? If that is the case then I am getting a dead 0v when on the flat line?

Also I see I have two cursors on the screen too.
I think that are called: A->Y and B->Y why do I have two of these, I mean I only need one for the info I am after right? I guess you would use two so that you can compare two values etc?

And I have a 1/DeltaX: = 5.00Hz This is the reading of the Hertz which is the frequency??? The time between say one upper peak to another upper peak, ie one full wave cycle? What is the maths then for me to work out the motor RPM from that 5Hz?
Do I need to count how many open gaps there are in one revolution of the motor encoder disc.? Then what?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The first thing I recommend you do is to read the manual for your scope and understand what the controls do and what the displays on the screen mean.

After you understand that, many of your questions will be answered.

In general, it looks to me like the output signal uses PWM to emulate a sine wave. It looks like the scope is set for AC input so you're seeing the effect of this on what is a pulsed DC circuit (the "base" of the waveform goes up and down when it shouldn't).

You need to understand what the vertical sensitivity measurements mean and how they are impacted by your probe.

For example, I'm seeing one of those displays reporting 500mV per division with a waveform that appears to be just over 1 division high. If you're using a 10x probe, the vertical sensitivity is likely now 5V per division. That means you're seeing about 6V, which may be what you'd expect.

There are so many variables that it's not possible to give hard and fast answers to some of your questions. It's a lot easier with a digital scope like yours because it shows you many of the settings on the display, still, there are variables (also I don't have a Rigol and I may be missing some important details).
 

apples

Jul 1, 2012
97
Joined
Jul 1, 2012
Messages
97
For example, I'm seeing one of those displays reporting 500mV per division with a waveform that appears to be just over 1 division high. If you're using a 10x probe, the vertical sensitivity is likely now 5V per division. That means you're seeing about 6V, which may be what you'd expect.

.

That would now make sense because my multimeter was showing somewhere around the 4 to 5v range.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
That would now make sense because my multimeter was showing somewhere around the 4 to 5v range.

Yes, the multimeter will display some sort of average and you can probably eyeball it now from the scope and see why.
 

apples

Jul 1, 2012
97
Joined
Jul 1, 2012
Messages
97
No, sorry I take that back Steve. I just checked with the meter and it is no where near over even 1 volt.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
No, sorry I take that back Steve. I just checked with the meter and it is no where near over even 1 volt.

In that case, your scope may be smart enough to know you're using a x10 probe (or you might be using a x1 probe).

A scope is a complex instrument and you really need to have some degree of mastery over it to be able to interpret the results.

1) Do you know if you're using a x1 or a x10 probe?
2) Are you using AC or DC coupling?
3) As a check, describe what you see with the probe tip shorted to the ground. Then compare it with what you see when place the probe ground and tip across a 1.5v battery.

edit: you especially should note the vertical scale (volts/div) and how far the trace moves.
 

jcurrie

Feb 22, 2011
128
Joined
Feb 22, 2011
Messages
128
you ask how to get the speed of a ac motor the speed of a motor at voltage is dependent on how it is wound a 60 cps single phase can be wound at different output speeds of 600rpm to 3600rpm .at 50 cps it would be different.
jc

ps hope this makes sence to you.
 
Last edited:

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
It sounds like you have a disc, connected to the shaft of the motor, between the IR transmitter and receiver.
How many cutouts are there in the disc?

You can calculate the revolutions by counting the output transitions(pos to neg or neg to pos) and dividing by the number of cutouts. Then use the time you counted to calculate RPM. However, you will need to establish the voltage of the swings between on and off to know whether you still need an amplifier circuit to drive the arduino. Depending on the number of cutouts and the motor RPM, you might not be quick enough to process all the transitions and might have to modify the disc, reducing cutouts or have circuitry to reduce the count.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
It looks to me like the disc contains many printed lines in a pattern which produces a PWM signal, that when smoothed approximates a sine wave. The phase and amplitude of the sine wave gives you the motor position, and the frequency gives you the speed.

However, it could also be an artefact of how the signal was measured, so you need to take a closer look.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Can you post a picture of the disc, and a few pictures of the photointerrupter from different angles?

How many connection points does the photointerrupter have? What have you connected to each point? Can you post a diagram of how it's connected? Do you have a pullup resistor on the output, or are you just measuring the voltage across the phototransistor with nothing else connected to it?

Is it possible that the envelope of the sinewave in image #2 in post #1 is mains hum? The cycle period is roughly 20 ms which corresponds to 50 Hz. Are your wires very long or located near a source of mains interference? Is there any large transformer or motor near your test setup?
 

apples

Jul 1, 2012
97
Joined
Jul 1, 2012
Messages
97
Ok found some more time. Here are two more pics of the rotary disc with the slots.
Motor encoder slots.JPG

Motor encoder slots 2.JPG

How many connection points does the photointerrupter have? What have you connected to each point? Can you post a diagram of how it's connected? Do you have a pullup resistor on the output, or are you just measuring the voltage across the phototransistor with nothing else connected to it?


3 wire off device. Grey, Green and White.
I think I have worked out that Grey is +, Green is -ve and White is the signal out.

No, I do not have any pull up resistor on the output. I am just measuring voltage with nothing else connected to it. I guess that you are suggesting that I need to have a resistor there so that there is a small load? So that it pulls a little current through so that it does not randomly float around and that you can get a propper reading???

Is it possible that the envelope of the sinewave in image #2 in post #1 is mains hum? The cycle period is roughly 20 ms which corresponds to 50 Hz. Are your wires very long or located near a source of mains interference? Is there any large transformer or motor near your test setup?

That is funny, my scope sits between my PC case and next to the monitor on a stand that is above a 6 slot mains power board, lol. I have moved it away from any noise, but I still get that kind of wave happening.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
3 wire off device. Grey, Green and White.
I think I have worked out that Grey is +, Green is -ve and White is the signal out.
Are you sure? Does the photointerrupter have any markings on it? If so, Google them and see if you can find a data sheet. That will tell you what the wires are for.
No, I do not have any pull up resistor on the output. I am just measuring voltage with nothing else connected to it. I guess that you are suggesting that I need to have a resistor there so that there is a small load? So that it pulls a little current through so that it does not randomly float around and that you can get a propper reading???
Right. Four-terminal photointerrupters have open collector outputs - they're just like a four-terminal optocoupler but with a gap for the disc. So they need a pullup resistor to pull the collector up to the positive rail when the transistor turns OFF. But yours is a three-terminal device that combines the connections for the LED and the detector, and it will have a current limiting resistor for the LED built in, so it's quite possible that it has a pullup resistor built in as well, in which case you won't need to provide one externally. It may even have a signal conditioning circuit, in which case it could have a push-pull output or an open collector output. A data sheet would really help.
Is it possible that the envelope of the sinewave in image #2 in post #1 is mains hum? The cycle period is roughly 20 ms which corresponds to 50 Hz. Are your wires very long or located near a source of mains interference? Is there any large transformer or motor near your test setup?
That is funny, my scope sits between my PC case and next to the monitor on a stand that is above a 6 slot mains power board, lol. I have moved it away from any noise, but I still get that kind of wave happening.
Well, it looks to me like there is a 50 Hz wave combined with the signal from the photodetector. The frequency of the photodetector signal responds to the motor speed in the expected way, but the 50 Hz wave is always present and interacts with the expected signal. Have you tried turning off all the room lights? I'm not sure what else to suggest, apart from getting a part number and a data sheet.
 

apples

Jul 1, 2012
97
Joined
Jul 1, 2012
Messages
97
Well I guess I should turn everything off in the room and then try again for the scope trace.

No markings of any use on the photointerrupter. Went through this in another post.

But on a side note, I just hacked a photointerrupter out of an old printer. I have been able to set it up using the same power source and have it working using a LED to flash on and off each time you clock the light beam. I would like to add a disc to the same motor as above and then run it through this new photo gate and see what the scope does then.

I think that my scope RIGOL DS1052E does come from the factory with a bit of noise anyway. I did just post in another of my older threads that I found a similar motor as the one above.

Mabuchi Motor RS-555PH

My part number is RS-555PH-22150 or RS-555PH-22180
Then under that is says Made in China
Then under that is has TD425410

This one has the same looking photo gate too, but I can't find a spec on it, only the motor itself.
 
Top