Posts: 54
Joined: Fri Apr 05, 2019 3:03 pm

Photo transistor as an RPM counter

Thu Sep 05, 2019 9:20 am

Hello guys,

For one project I am using a stepper motor to perform various acceleration. I need to check whether it is rotating on the same RPM which it's showing or not. For that, I have decided to use an ambient phototransistor which will show off when the arm of the motor comes above it. Could you help me with writing the code where it measures the time for the transistor was on? Thanks in advance

User avatar
Posts: 1657
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Photo transistor as an RPM counter

Thu Sep 05, 2019 9:51 am

I used a light barrier with an arduino, but you can do similar with Raspberry and light barrier as well.
To avoid junk measurements, a (hardware) Schmitt-Trigger would be helpful.
As you can see in this thread I built similar in software (fidget spinner showed 25.09rps or 1505.4rpm):


Return to “Automation, sensing and robotics”