Speed measurement of a small DC motor using myDAQ and LabVIEW

Thread Starter

wolfG

Joined Nov 20, 2022
4
Hey guys
I'm trying to measure the speed of a small DC motor using a rotary encoder and an OPTO sensor, and counter input on myDAQ.

Here's my circuit on the breadboard.
1669553374423.png

1669553390362.png

1669553404300.png

The Collector pin of the transistor is connected to the DIO1 port of the myDAQ.

And here's the LabVIEW code.
CHARNICS_0-1669548104463.png


On the front panel, I only have the RPM numeric indicator.

When I run the program, with the rotary encoder spinning in the gap of the OPTO coupler, nothing happens. The RPM numeric indicator keeps showing 0.

I thought the problem was my OPTO coupler. I tested it through analog input and I successfully visualised the pulses, as shown here


CHARNICS_4-1669549351048.png


So the problem is not the OPTO coupler.
And I can't seem to figure out the source of the problem. I would really appreciate some help please.
 

Reloadron

Joined Jan 15, 2015
7,501
Why do the pulses appear to be going negative? Which opto-coupler and if open collector do you have a pullup? Your schematic is pretty small to understand.

Ron
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
You can use the inverted output of the opto also, in this case the 10k resistor to GND and the output would be on the 'emitter' side of the opto output.

1669586450910.png
 

Ya’akov

Joined Jan 27, 2019
9,069
Welcome to AAC.

Since you identify as student, and this certainly looks like schoolwork, I am moving your thread to the Homework Help forum. The rules of AAC limit the sort of help members are allowed to give in such cases. Our advice can only relate to your specific attempts at a solution.

If somehow this isn't schoolwork, please explain the application and the thread can be moved back.
 
What do you mean by "didn't work" it is a very common usage of an opto , so it DOES work.
By the way, the component you are using is called and Opto Interrupter - sometimes a Photo Interrupter. An Opto Coupler is with the LED and photo transistor in one sealed package, used to isolate one side from the other.

At the risk of upsetting the teaching community, I'd argue that trying to teach by using a myDAQ is fundamentally wrong and personally I'm not a fan of LabVIEW either. Too many students are given degrees for playing with toys like this without understanding the fundamentals. A resistor either side of the collector/emitter should work - check it with a DMM. I doubt you'll ever use a myDAQ in the real world
 
Top