rajbuddy007
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
HermannSW
Posts: 1655
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):
https://forum.arduino.cc/index.php?topic=347579.0
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Automation, sensing and robotics”