Beruflich Dokumente
Kultur Dokumente
Home (http://www.electroschematics.com)/Arduino
(http://www.electroschematics.com/arduino/)/Motor Speed Sensor Module Circuit
(http://www.electroschematics.com/wp-content/themes/electroschematics-
v2/img/fallbak.png)
(https://www.facebook.com/sharer/sharer.php?
u=http://www.electroschematics.com/12275/motor-speed-sensor-module-
circuit/) (https://twitter.com/share)
LM393 (/tag/lm393-circuits) (/qa/)
motor controllers (/tag/motor-controllers)
(http://www.electroschematics.com/wp-content/uploads/2015/09/motor-speed-sensor-
module.png)
Here is a motor speed sensor module, the major goal is to check the rate of an
electric motor. The module can be used in association with a microcontroller for
motor speed detection, pulse count, position limit, etc. In principle, any rate meter
simply measures the rate at which some event occurs. Usually this is done by
counting the events for a given period of time (integration interval) and then
simply dividing the number of events by the time to get the rate.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you
Looking for the latest from TI?
wish. Accept Read More (/policy/)
Basically, the microcontroller-compatible motor speed sensor module described is
a simple device that yields processed pulse trains when the visual path of its optical
sensor is physically interrupted by some sort of slotted wheel or similar
mechanism (an optical sensor commonly consists of a light emitting diode that
provides the illumination, and a phototransistor that senses the presence or
absence of that illumination). The transmissive optical sensor used here consists
of an infrared light emitting diode and a phototransistor. This both prevents
interference from stray external light sources and by having the two components
matched for a speci c frequency of radiation, they are even more immune to
undesired interference.
The Circuit
As stated, the circuity can be used to send calibrated pulses to a microcontroller-
based tacho meter or similar circuit/device. The wiring of the hardware turned out
to be deceptively simple. At the heart of the circuit is the OS25B10 transmissive
optical sensor with phototransistor output (OC1).
Next is the venerable LM393 dual comparator chip (IC1) con gured as a simple
Schmitt trigger (schmitt triggers are fundamental circuits with several uses; one is
signal processing, they can pull digital data out of some extremely noisy
environments). The green indicator (LED1) indicates the presence of voltage
applied, and the red indicator (LED2) monitors output of the motor speed sensor
module. Recommended working voltage of the module is 4.5 to 5.5 volt dc.
(http://www.electroschematics.com/wp-content/uploads/2015/09/motor-speed-sensor-
module-circuit.png)
(http://www.electroschematics.com/wp-content/uploads/2015/09/encoder-disc-
wheel.png)
The encoder disc (also known as index wheel) in the above image have multiple
slots/holes. You can easily fabricate your own encoder disk from a sheet of
stainless steel or hard plastic. If you are interested only in speed sensing (not
position sensing) application , one set of slots is su cient for the task.
(http://www.electroschematics.com/wp-content/uploads/2015/09/encoder-disk.png)
Proof of Concept
My basic prototype was built on a small piece of perfboard, photograph of which is
shown below (some components are soldered at the bottom side of the perfboard;
power indicator not wired).
(http://www.electroschematics.com/wp-content/uploads/2015/09/proof-concept.png)
After construction and pre- ight test, the module was connected to an Arduino
board and measured the rotation per minute (rpm) rate of a geared robo motor
(150rpm@5V) with the help of a home-made encoder disc (resolution 12 slots/disk)
attached to its shaft. Final result observed was somewhat close to the spec of the
robo motors rpm value. Arduino hardware hook up indicator (plus the demo
sketch) is given below. Have a try!
(http://www.electroschematics.com/wp-content/uploads/2015/09/arduino-module-
connection.png)
1. int encoder_pin = 2; // pulse output from the module
2. unsigned int rpm; // rpm reading
3. volatile byte pulses; // number of pulses
4. unsigned long timeold;
5. // number of pulses per revolution
6. // based on your encoder disc
7. unsigned int pulsesperturn = 12;
8. void counter()
9. {
10. //Update count
11. pulses++;
12. }
13. void setup()
14. {
15. Serial.begin(9600);
16. pinMode(encoder_pin, INPUT);
17. //Interrupt 0 is digital pin 2
18. //Triggers on Falling Edge (change from HIGH to LOW)
19. attachInterrupt(0, counter, FALLING);
20. // Initialize
21. pulses = 0;
22. rpm = 0;
23. timeold = 0;
24. }
25. void loop()
26. {
27. if (millis() - timeold >= 1000) {
28. //Don't process interrupts during calculations
29. detachInterrupt(0);
30. rpm = (60 * 1000 / pulsesperturn )/ (millis() - timeold)* pulses;
31. timeold = millis();
32. pulses = 0;
33. Serial.print("RPM = ");
34. Serial.println(rpm,DEC);
35. //Restart the interrupt processing
36. attachInterrupt(0, counter, FALLING);
37. }
38. }
Previous
High Speed Ecosystem
Support and Calamity
Monitoring System
(http://www.electroschematics.com/12241/high-speed-ecosystem-
support-and-calamity-monitoring-system/)
Next
Overheat/Overcooling
Circuit Breaker
(http://www.electroschematics.com/12242/overheatovercooling-
circuit-breaker/)
Related Tutorials
14 Comments
kikiloaw
pulse means interruption for IR Sensor by blocking receiver and transmitter. right? its that
what you mean in your code in variable pulsesperturn?
Taha
Thank you again
But can I know if I can connect it to LCD
Posted on November 27th 2015 | 2:49 pm (http://www.electroschematics.com/12275/motor-speed-sensor-
module-circuit/#comment-1869362)
Log in to Reply (http://www.electroschematics.com/wp-login.php?
redirect_to=http%3A%2F%2Fwww.electroschematics.com%2F12275%2Fmotor-speed-sensor-module-
circuit%2F)
tkhareendran
Yes, with little skill and patience you can add a display panel with the
hardware.For this,try an LCD Keypad Shield and modify the code accordingly. To
make it more clear,refer lcd-related projects published here from time to time.
Taha
My last question: How were gonna connect this circuit with the motor?And Is theres a
video for this circuit while it works?
Dandara
Tohundowc! Thats a really cool way of putting it!
Taha
Thank You very much.
It was the last step.
Posted on October 22nd 2015 | 8:10 pm (http://www.electroschematics.com/12275/motor-speed-
sensor-module-circuit/#comment-1849264)
T.K.Hareendran
(http://www.electroschematics.com/wp-
content/cache/comment-plus/1847051-1024x768.jpg?1472108799)
@Taha: Welcome!
Note that no electrical interfacing is required here. First of all, prepare a suitable
index disc (see the article) for your speci c application, and optically-couple
the disc to the sensor module. Refer the example image!
tkhareendran
@Taha: Its well below 50 mA (actually it depends on the current rating of the IR module,
and the output LED)!
Taha
Thanks
Taha
I was searching for a project, And I found this one.
When I read it I found it very good and simply project.
Really, Thank You.
tkhareendran
@Taha: Thanks!
Mart
I was thinking about how to make a drive by wire circuit control system to drive a
mechanical device and this is a simple means of doing this.
By mechanical device, I mean, for example, a portable mobile sca old that I can stand on
and motorize it to move me around while standing on it without having to get down and
move it myself.
Or, building a small go-cart and electronically control the desired speed by using this speed
control circuit system.
Obviously there are many other applications where speed control is desired and this simple
circuit you describe could be easily implemented.
I have an arduino uno and so thank you for providing the sketch and circuit diagram to
achieving and implementing this system.
T.K.Hareendran
@Mart: Thanks for your keen interest in my article. Really happy to note your
open feedback.
Login
Email
Password
Remember Me
Log In
View More ()
(/subscribe)
(https://www.facebook.com/groups/electroschematics/)
THE BASICS
About Us
Contact Us (/contact-us)
Participate (/participate)
Feedback (https://www.surveymonkey.com/r/2SMMN52)
FOR ADVERTISERS
ASPENCORE NETWORK
Electronics Tutorials (http://www.electronics-tutorials.w
ElectroSchematics s/)
CONNECT WITH US
All contents are Copyright 2016 by AspenCore, Inc. All Rights Reserved.