Sadly there is a small mistake in the video. The IR photo diode is positioned the wrong way around. Just imagine the cathode and anode being flipped. Sorry. (Edit: Ok, there is a second mistake. I used the roller adapter in contact mode incorrectly. I just did another measurement the correct way and measured an RPM of 270 while the correct one would have been 230. So this way it was a bit better but still not good enough for me.)
But who knows that? I tried searching for information on that but not even the official manual of the product bothers to mention those details. I think most people would use it like I did.
@@greatscottlab Please make videos for the same project but with a new feature to turn ON a led when the speed reached 40 kmph. Awaiting...thanks in advance.
@@greatscottlab Please make videos for the same project but with a new feature to turn ON a led when the speed reached 40 kmph. Awaiting...thanks in advance.
Yup, in contact mode, the tacho will be accurately measuring how fast the tacho's shaft was turning. To measure the speed of the shaft, push the contact rubber onto the ene of the shaft, not rolling around its side. The user manual would have made this clear, but it was probably in impenetrable chinglish. Edit: someone else picked up the reason why it failed with the optical - insulation tape's optic properties are horrible. It is designed to be used on the bare shaft of the motor. If you need to add anything to make a mark, try painters masking tape.
What you're saying is correct, But in this case laser tachometer reading incorrect RPM value, Diameter comes into account when we measure travel distance of shaft m/min. DIY wins
Great video, very informative and practical. Just a thing I noticed, because I stumbled over it not too long ago myself: The two pixel white strip to the right of the OLED (10:03) is most probably caused by a wrong display type. If you have a SSD1306 but initialize it as a SH1106, or the other way around, you get those strips.
A tip for expansion later: Add a graph of the rpm over time on the lovely Oled display! Would be nice to see if rpm oscillates on things as well! Very few meters can do that.
That's again is a wonderfull video. I like the DIY or BUY series. Over the past few years, I more often to go DIY. Not just because it's cheaper and I learn while building, but also because I can repair easily and recycle parts if I don't need the device any longer. Thank you for all the fresh ideas. My actual project is a weather station that saves the weather data to an NAS. So I have the complete history available and have at the same time a better accuarcy for temperature, humidity and rain quantity than I got from standard weather station. As a side effect I can easily display abolute air humidity or dew point, which is not available at normal weather stations. I also plan to display a recommendation for room ventilation based on comparing temperature and (absolute) humidity. The internal (display) part might be upgrated by an air quality sensor in the near future, which will improve the ventilation recommendation.
I wonder why didn't he choose a veroboard rather than an ordinary perfboard. I think veroboards are better for semi-prototype stuff since their traces resemble solderless breadboards...
Hi Great Scott, I have the feeling that you missed something in the measurement of the rpm by contact. Indeed, your tachometer measures the rpm of its own head, and thus you must introduce a correction coefficient as the rate between the rotor head diameter and the tachometer head. The tachometer cannot know what is the diameter of your shaft!
Exactly! The "by contact" probe should be touching the motor axis in such a way that both rotate at the same angular speed: they mustn't touch side-by-side, but tip-to-tip.
I see it. Says that it's been there for a week. He doesn't go into detail but he said that he figured out he was doing something wrong and retested, and that it was closer but still had some error in the measurements.
I hope you read this. Please consider making a 3D printed 8th order bandpass speaker with a (hidden) 4.5 inch driver to 250-300Hz with port on same side as a 2.5 inch driver for the rest of frequency range and design a proper crossover for that design. We all learn about crossover eventually and now you can be authority and overcome previous mistake. We love your videos and your excellent efforts.
You guys right, but it makes the code more readable for people, anyway the characters you put here is way more that you would have spared by skipping “==1”
Thanks for this , I built it but was getting twice the rpm my scope said ! I have changed 120 in the code to 60 and now it works perfectly. Thanks for a great project. I am going to run it off of an 18650 a fuse instead of the charging board . On the occasions I want to use it I will put in a battery. This keeps costs down for something it will use now and again.
I bought a similar RPM counter 10 years ago. It came without any of the accessories. ("Digital Laser Tachometer with Pouch (2.5~99999.9RPM"). When I measured a 5400 RPM hard drive platter, the display read 5399 - 5400.
Even for the laser measuring part, you still messed up, you are supposed to attach a wheel to the end of the shaft and use the flat side for color differentiation (like this ◐). Doing so will give an instantaneous signal change instead of a gradual one when you tape on the round shaft. For some reason, your tachometer didn't come with some reflective tapes, these are like the ones on the trucks and provide better contrast.
So basically you're using a digital counter in front of a shift register - pretty ingenious! The output display can be stabilized more by using a rolling average of the previous three measurements.
ganz ehrlich, jedes mal wenn ich dir bei schreiben zu gucke bin ich wieder aufs neue fasziniert wie du jedes aber auch jedesmal den selben strich triffst, eins wird sicher sein, du hast kein parkinson :D
Nice video. When RPM is low switch from time per pulse to pulses per time. I once harvested IR LED pig-snout pairs (may have been just me that called them that) from VCR's for this. VCR's used them to monitor reel speed and designed more so the LEDs were hidden from each other. They seem rare these days.
For contact RPM counter, it's preferable to use IR encoder for accurate measurement. In non contact Measurements many factors affect the accuracy: angle, light, stability of both (the tachometer and the rotor).
@GreatScott. Thank you for including the Entire Creative Process, including misadventures and commenters input. Makes for a more interesting and interactive experience for me. I use DC motors and motor controllers in the Mobility Industry and am drawn to invasive videos such as this. Thank you and your excellent commenters. Too bad I caught this one so late. I blame TH-cam for poor notification.
Using the mechanical tach wrong... The diameter of the shaft will affect the reading using it like that! It has to be directly coupled to the shaft inline and not offset unless the shaft diameter is equal to the tach head you are using.
A year ago I had a similar project. I had quite the Problem with the accurate counting, because the Arduino was too fast and produced overcounting because the interrupt was triggered several times at the edge of the tape. I had to use a delay of some us to avoid double counting of rotations. I am rather surprised that your setup worked so well for you.
Thanks for reverse engineering the circuit of the module! I used your schematics to figure out how to add hysteresis (Schmitt trigger) to the circuit: You can easily add positive feedback to the comparator by adding a resistor between the output and the non-inverting input. I just soldered a 20k resistor between the OUT terminal and the anode of the Photodiode on the backside of the PCB. I did this because I had problems with false interrupt triggering on an ESP32 using this module. Apparently the ESP32 external interrupts need a quite fast rise time to trigger reliably. It would have been interesting to see how noisy the rising and falling edges of the signal in your setup are by zooming in on the DSO. The 20k might not work for all sensitivity settings of the trimmer pot. To change the hysteresis it might be a good idea to replace the resistor with another trimmer pot.
@GreatScott! Amazing video as always :). I just have one doubt though. In your explanation, you are saying 60 / (rpmtime / 31250), whereas in the code, you are using 120 / (rpmtime / 31250).
When I used to use some of these cheap optical tachometers I had trouble with 60Hz fluorescent lights in the room. Dark was best. Could that have been any part of the problems your devices were having? Also the flat and the edges of the flat can give spurious reflections that may not be easily ignored by the device.
The central problem is that there is no modulation on the IR LED. Television remote controls would have the exact same problem, except they use a ~38KHz carrier. The fluorescent lights could be easily factored out if the IR LED pulsed on and off, rather than just being nailed on. The “carrier” frequency wouldn’t even need to be particularly high, as even the fastest motor shaft will likely turn
@@a1nelson I wouldn't even use much math on a MCU to check carrier frequency, rather go old school style like IR headphones. Those use FM on 2 frequencies, one channel about 2.8MHz, the other 2.3MHz I think, then it's all analog FM radio tech, basically do the same but keep the frequency constant.
Back in my model airplane days some 20 years ago I used a Tower Hobbies optical tachometer to measure the prop speed of my glow engines. It could be set to read the speed of two or three-bladed props. Some of my engines could go as high as 25,000 RPM. I used to check its calibration by pointing it at a fluorescent light to read the line frequency. Seemed to be quite accurate so I never questioned the readings. The only mod I made was to fit a small flat-black painted tube made of cardboard over the sensor port to keep side-light from swamping the sensor, which only used reflected light - no laser. Oh, and I don't think I paid more than $20 for it back then.
An easy-to-implement software upgrade idea: You can measure slow speeds also by not counting the impulses per second (minute), but by measuring the elapsed time between impulses.
Why not take advantage of your full OLED screen? By offering a cool display? Three ideas come to mind: - a tachometer display (with a needle) - a graph (with values logged in the last 60 seconds) - a frequency display
I am from China and I like your video very much and I like it for you. I have also encountered the display problem on the right side of the OLED display because the library is not set up properly.
Hey GreatScott!, Congratulations on the project, it looks really neat and outperforms commercial equivalents! However, there is a small, 2px wide band of noise on the right side of your display. Its probably due to the display controller being a SH1106 - a "SSD1306-compatible" driver which has 132 px wide display RAM (contrary to SSD1306's 128 px). Most of the libraries and tutorials out there focus on the SSD1306. To fix it, either switch to SH1106 in the graphics library or just find the function which transmits the cursor address and add a permanent +2 term to the x coordinate. I had the same thing literally yesterday so I noticed it immediately. MfG :)
@Saksham Jain The way he used the device is totally wrong. The diameter of the measuring tip is different from that of the shaft of the motor, so for each rotation of the motor the measuring tip only rotates like 0.7 rotation. They basically act as two gears with different rotational speed. The correct way is to push the measuring tip against the center of the rotating shaft so that they rotate at the same speed. This is a very basic mechanical concept (I actually learned it in high school).
It was a distraction mistake. It doesn't require a mechanical engineer to understand what kind of error is produced by measuring in that way, it's something like 1st year high school physics.
The contact messasure with the outside of the wheel works only with the same diameter of the motor axis . If you want to messaure right you have to conact the middle points of the wheels.
Buiz That’s a really good idea. I have a rural property and I’ve long wanted to be able to visualize changing winds and turbulence across a large area. The 3€ comparator part should it a lot easier to fabricate the ~25 anemometers that I’ve been hoping to set up. Wish me luck ;). PS: I wonder how high they should be mounted in order to reject most of the surface effects from the ground...
@@a1nelson I was planning to make mine a project for a government agency here where I have to dot a huge area with weather beacons and all of them will transmit back to the nearest office here via VHF Morse Code
Question on the contact mode: isn't RPM shaft diameter relative? Strictly, inversely proportional to gear ratio... Buy option still might be good, but it beats the purpose of being "on the field" tool for the additional computation.
Wouldn't it be better to computer a moving average rather than the time between each sample? It seems as though a longer sample would give more precise results.
Thank you! I’ve been needing a better tachometer for a while but I just don’t want to spend the money on one. I already have the components you used so I can make it right now.
A few years back I built one for a record player to convince myself that I wasn't hearing things. Naturally I went about it in a far more convoluted way than this. In my defence I think most of the hard arduino code was phase 2, trying to regulate the motor PWM speed.
The problem is do you want to measure pulses pr time unit, and if so what time unit! Or do you want to measure time between pulses, and if so the triggering of the pulse/edge becomes a source of noise due to potential 50/60Hz flicker of ambient lights. It is always a debate. I think many meters use pulses pr time unit and thus have very coarse measurement steps at low end of range.
because he used it quite wrong. the laser setup was right, but if you use a roller, you need to adjust for the circumference of the part. imagine having a 1meter wheel in contrast to the shaft of the motor. of course the circumference spins quite a lot faster. in that mode, you could only measure the meters per second, not revolutions per second
GreatScott! Lol - “You had ONE JOB...” I see it as entirely possible that they’ve gotten away with it simply because few users have actually verified the measurements. Or the mfr just doesn’t care, of course.
I'm making a similar rev. counter, but I'm finding that the edges produced by the IR sensor are very noisy; it looks like it will need an additional Schmitt trigger to work reliably - the ESP32 board that I'm using never sees less than two interrupts per transition. [edit: I seem to have cleaned up the edges very substantially by putting a 680 pF cap. between the IR o/p and ground - it slows the rise time from about 10 us to 20 us, but the ESP32 seems perfectly happy with that - so maybe there is no need for a Schmitt trigger after all]
Nice project , Why you didn't a reverse engineering of the commercial one and repair it if it doesn't a firmware problem Or put inside an Arduino to read the sensor and drive the lcd .
Thank you for the author's release, very practical test device, very suitable for professional technicians: electrician/car repairman/industrial...etc, I like this project, I will create and assemble a 3D shell (There is no need for any circuit board PCB, as long as the distribution line is enough), it will not be long before I will post a comment on the shell 3D printing to stl to share with everyone
I read the pinned comment about contact mode, but haven't found anything about the issue whether putting a load on the motor could change the speed. That would explain why it went from 300 to 270 rpm, and it may just need some calibration.
I wonder if there's something wrong with the timing circuit on the 29€ unit? Would be neat to do a follow-up with diagnostics if you can get inside the thing, shouldn't be too complicated since all it does is compare pulses to a clock. (Unless you returned it for some reason.)
I'm generally useless with code, but would there be an easy way to add a peak rpm readout to the display (over a ~350ms window say) that could be reset with a momentary switch? Thanks for the great video!
Instinctively, I would think that measuring the time it takes for one turn in a slow-mo video would induce quite a big imprecision... 🤔 Don't want to sound like I'm teaching you anything, but have you tried, with the same method, to measure the time it takes the shaft to revolve, say, 10, 20 (50, 100!) times? (Maybe that is what you actually did already?) When measuring a single rotation (360deg), a 30-deg angle error (I'm using quite a big value for demonstration, don't know how many frames your slow-mo gear is capable of) would mean the time you measured can be off by almost 10% (1/12). The same 30-degree error, when counting 10 turns (3600 degrees), would result in a time measurement that is accurate to 1%. If your 0.26s measurement is off by 15% (again, extreme number for demo), then your RPM could be anywhere between 200 and 270... (Which I guess still does not match any of the 2 measurements made by the device... 😅) Also wondering if you've tried using a thinner white strip on the shaft, or playing with lighting (eg. avoid direct lighting on the shaft that could result in reflections, even from the black part)?
I enjoy watching your videos and I don't argue with your project being more accurate than the HoldPeak, but I have to comment that the *title* is a bit misleading since you are comparing a single 3€ component, which requires a bunch of other parts adding up to about 20€, to a finished 29€ product ready to use.
Thanks for the video and the tachometer project. I was doing experiments with PC-fans. And i wanted to know how to measure RPM correctly. And see if these sensors from AliExpress could do the job. So I bought a few of them, put one sticker on one of the blades of my 12 cm fan. The result was very dissapointing, the cheap sensor could not read this signal quick enough. Even not below a few hundred RPM (checked on scope via 3rd sensor wire). So these sensors are surely way to slow for this kind of RPM measurements. I bought a proper one (Voltcraft DT-10L laser tachometer, for about 62 euro's). This tachometer can measure up to 99999 RPM and works fine and precisely.
Used one of these sensors with my oscilloscope. The problem I had was as soon as I went outside the IR from the sun messed up the sensitivity range. Currently trying with a 38khz tv remote receiver and ir led transmitter.
the roller adapter would only give you a correct reading if the shaft of the motor is the same diameter as the roller, otherwise you'll get a different "gear ratio", which will cause the values to be off
You just build yourself an encoder. In some machinery they might use an inductive proximity sensor instead of IR to calculate speed of a gear or roller (welding some screw head on it). Different setup but still same concept
Sadly there is a small mistake in the video. The IR photo diode is positioned the wrong way around. Just imagine the cathode and anode being flipped. Sorry. (Edit: Ok, there is a second mistake. I used the roller adapter in contact mode incorrectly. I just did another measurement the correct way and measured an RPM of 270 while the correct one would have been 230. So this way it was a bit better but still not good enough for me.)
But who knows that? I tried searching for information on that but not even the official manual of the product bothers to mention those details. I think most people would use it like I did.
Ok. I just tried it this way and the result was better. I got 270RPM with the DC Motor which actually rotates at 230RPM. So still not good enough.
@@greatscottlab Great job, love your vids man, keep it up!
@@greatscottlab Please make videos for the same project but with a new feature to turn ON a led when the speed reached 40 kmph. Awaiting...thanks in advance.
@@greatscottlab Please make videos for the same project but with a new feature to turn ON a led when the speed reached 40 kmph. Awaiting...thanks in advance.
One of my favorite parts of your videos is watching you write. Your handwriting is impressive!
0:52 it's kind of cheap for tachometer in comparison to others
The $16 tachometer down there:
Delievery charges ... 100$
Now you‘re just missing a 3d printed case for it and then it would be perfect 👍
Agreed but I would change the layout some to be a bit more compact.
You mean"compact"?
@@111genti yes ty new phone and it puts what it wants LoL 😂.
I thought about it but decided against it in the end to keep it simple.
@@greatscottlab Good decision to make it simple.
Men the diameter of the rolling thing is affecting the values , smaller more turns bigger less turns, you got to used aligned, not in besides
Yup, in contact mode, the tacho will be accurately measuring how fast the tacho's shaft was turning. To measure the speed of the shaft, push the contact rubber onto the ene of the shaft, not rolling around its side.
The user manual would have made this clear, but it was probably in impenetrable chinglish.
Edit: someone else picked up the reason why it failed with the optical - insulation tape's optic properties are horrible. It is designed to be used on the bare shaft of the motor. If you need to add anything to make a mark, try painters masking tape.
To use contact mode you must put the probe coaxial with the motor shaft not side by side like a spur gear arrangement. Great video tho!
He tried that too, wasn't accurate either. 4:12
I was looking for this comment.
What you're saying is correct, But in this case laser tachometer reading incorrect RPM value, Diameter comes into account when we measure travel distance of shaft m/min.
DIY wins
Great video, very informative and practical.
Just a thing I noticed, because I stumbled over it not too long ago myself: The two pixel white strip to the right of the OLED (10:03) is most probably caused by a wrong display type. If you have a SSD1306 but initialize it as a SH1106, or the other way around, you get those strips.
I laughed when see you're sponsored by JLCPCB but build just using perfboard.
For prototyping, why not? Want to make a batch of faulty boards? He use them often.
LMFAOOOOO
@@bryanst.martin7134 they seem fine to me, ive ordered some pretty sketchy looking boards and they still worked fine
A tip for expansion later: Add a graph of the rpm over time on the lovely Oled display! Would be nice to see if rpm oscillates on things as well! Very few meters can do that.
Once, I made a tachometer using a hall sensor effect and a magnet, but this way with the IR sensor, looks much better. Great job!
I really like the way how great scott explain electronics without straining the time limits of his videos.
When you building meter, you have to dealing with non-linearity, error rate, accuracy, precision, and more. It's a whole study case
That's again is a wonderfull video. I like the DIY or BUY series. Over the past few years, I more often to go DIY. Not just because it's cheaper and I learn while building, but also because I can repair easily and recycle parts if I don't need the device any longer.
Thank you for all the fresh ideas.
My actual project is a weather station that saves the weather data to an NAS. So I have the complete history available and have at the same time a better accuarcy for temperature, humidity and rain quantity than I got from standard weather station. As a side effect I can easily display abolute air humidity or dew point, which is not available at normal weather stations.
I also plan to display a recommendation for room ventilation based on comparing temperature and (absolute) humidity.
The internal (display) part might be upgrated by an air quality sensor in the near future, which will improve the ventilation recommendation.
I miss the good old days when great scott used to make prefboards with clean satisfying soldering
I wonder why didn't he choose a veroboard rather than an ordinary perfboard. I think veroboards are better for semi-prototype stuff since their traces resemble solderless breadboards...
@@rizalardiansyah4486 Nevertheless you can still get decent solder traces with prefboard too
You've got the best left hand writing skill I've ever seen. You're a phenomenon !
Hi Great Scott, I have the feeling that you missed something in the measurement of the rpm by contact. Indeed, your tachometer measures the rpm of its own head, and thus you must introduce a correction coefficient as the rate between the rotor head diameter and the tachometer head. The tachometer cannot know what is the diameter of your shaft!
Read my pinned comment.
But then the IR Sensor is the better solution anyway. No need to calculate something...
@@greatscottlab There is no pinned comment :(
Exactly! The "by contact" probe should be touching the motor axis in such a way that both rotate at the same angular speed: they mustn't touch side-by-side, but tip-to-tip.
I see it. Says that it's been there for a week.
He doesn't go into detail but he said that he figured out he was doing something wrong and retested, and that it was closer but still had some error in the measurements.
Who else starts their Sunday morning with a cup of coffee and a slogan of " let's get started"?
Normally but I'm cranky today!! I forgot to buy coffee yesterday.
@@PerKroon coffeeless mornings is never a good thing 😭
Sorry not the age to drink coffee but soon I can taste it😁
More like coffee evenings in Germany
@@yxcvbnmmnbvcxy544realistically, it's a 24/7 affair 🤩
Gets me going at 8:00 a.m. keeps me up until 3:00 a.m. coffee coffee coffee!!!
I hope you read this. Please consider making a 3D printed 8th order bandpass speaker with a (hidden) 4.5 inch driver to 250-300Hz with port on same side as a 2.5 inch driver for the rest of frequency range and design a proper crossover for that design. We all learn about crossover eventually and now you can be authority and overcome previous mistake. We love your videos and your excellent efforts.
if (tooslow == 1)
> Quality code
@Bence Bujdosó only if
int boolean tooslow;
@@Ev-wj3lm Pretty sure Arduino wouldn't mind, since it's basically C/++ and these languages let you do that
@@Multibe150 thanks :) i'm kinda new to arduino...
You guys right, but it makes the code more readable for people, anyway the characters you put here is way more that you would have spared by skipping “==1”
Well, it works.
Thanks for this , I built it but was getting twice the rpm my scope said ! I have changed 120 in the code to 60 and now it works perfectly.
Thanks for a great project.
I am going to run it off of an 18650 a fuse instead of the charging board . On the occasions I want to use it I will put in a battery. This keeps costs down for something it will use now and again.
i love to see diy win . it so happy our own made product work so fine . i give joy and emotions own hand made things
I bought a similar RPM counter 10 years ago. It came without any of the accessories. ("Digital Laser Tachometer with Pouch (2.5~99999.9RPM"). When I measured a 5400 RPM hard drive platter, the display read 5399 - 5400.
old stuff what prolly much higher quality
did it cost more?
Even for the laser measuring part, you still messed up, you are supposed to attach a wheel to the end of the shaft and use the flat side for color differentiation (like this ◐). Doing so will give an instantaneous signal change instead of a gradual one when you tape on the round shaft.
For some reason, your tachometer didn't come with some reflective tapes, these are like the ones on the trucks and provide better contrast.
Putting a load on the motor with the physical tachometer will slow it down and reduce the reading...
I'm so going watch all your videos today.
Forget about Marvel or Disney....thanks for great entertainment.
Yes! DIY wins!!
I always wanted to do this project and find out how accurate these IR sensors can measure RPM. Thanks for doing it for me!
So basically you're using a digital counter in front of a shift register - pretty ingenious! The output display can be stabilized more by using a rolling average of the previous three measurements.
ganz ehrlich, jedes mal wenn ich dir bei schreiben zu gucke bin ich wieder aufs neue fasziniert wie du jedes aber auch jedesmal den selben strich triffst, eins wird sicher sein, du hast kein parkinson :D
Just talk about the pens you use sometime.😂 hand writing is soooo smooth!!
Lookup stabilo pointer.
@@tokk3 Stabilo Point 88 :-)
@@greatscottlab I guessed so. Wasn't completely sure.
Quality German pens.
I use them too.
Nice video. When RPM is low switch from time per pulse to pulses per time. I once harvested IR LED pig-snout pairs (may have been just me that called them that) from VCR's for this. VCR's used them to monitor reel speed and designed more so the LEDs were hidden from each other. They seem rare these days.
I can't find the code
For contact RPM counter, it's preferable to use IR encoder for accurate measurement. In non contact Measurements many factors affect the accuracy: angle, light, stability of both (the tachometer and the rotor).
Another mistake that you made is that the optical reading of the laser tachometer needs retroreflecting tape..usually it's included in the box
We need more diy winners very nice video keep up the good work
@GreatScott. Thank you for including the Entire Creative Process, including misadventures and commenters input. Makes for a more interesting and interactive experience for me. I use DC motors and motor controllers in the Mobility Industry and am drawn to invasive videos such as this. Thank you and your excellent commenters. Too bad I caught this one so late. I blame TH-cam for poor notification.
Excellent, great with great details there is no any misleading information.
Using the mechanical tach wrong... The diameter of the shaft will affect the reading using it like that! It has to be directly coupled to the shaft inline and not offset unless the shaft diameter is equal to the tach head you are using.
I AM WATCHING YOUR VIDEO FOR MORE THEN A YEAR.... BUT STILL DONT understand ELECTRONICS..... BUT i DONT MISS YOUR VIDEO
A year ago I had a similar project. I had quite the Problem with the accurate counting, because the Arduino was too fast and produced overcounting because the interrupt was triggered several times at the edge of the tape. I had to use a delay of some us to avoid double counting of rotations. I am rather surprised that your setup worked so well for you.
Thanks for reverse engineering the circuit of the module! I used your schematics to figure out how to add hysteresis (Schmitt trigger) to the circuit: You can easily add positive feedback to the comparator by adding a resistor between the output and the non-inverting input.
I just soldered a 20k resistor between the OUT terminal and the anode of the Photodiode on the backside of the PCB.
I did this because I had problems with false interrupt triggering on an ESP32 using this module. Apparently the ESP32 external interrupts need a quite fast rise time to trigger reliably. It would have been interesting to see how noisy the rising and falling edges of the signal in your setup are by zooming in on the DSO.
The 20k might not work for all sensitivity settings of the trimmer pot. To change the hysteresis it might be a good idea to replace the resistor with another trimmer pot.
@GreatScott! Amazing video as always :). I just have one doubt though. In your explanation, you are saying 60 / (rpmtime / 31250), whereas in the code, you are using 120 / (rpmtime / 31250).
When I used to use some of these cheap optical tachometers I had trouble with 60Hz fluorescent lights in the room. Dark was best. Could that have been any part of the problems your devices were having? Also the flat and the edges of the flat can give spurious reflections that may not be easily ignored by the device.
Even so, thats a problem that the company should have already know, -1 point for that
@@vermillionreaper Agreed! I don't think it's a defense of the device, but it might explain some things.
The central problem is that there is no modulation on the IR LED. Television remote controls would have the exact same problem, except they use a ~38KHz carrier. The fluorescent lights could be easily factored out if the IR LED pulsed on and off, rather than just being nailed on. The “carrier” frequency wouldn’t even need to be particularly high, as even the fastest motor shaft will likely turn
@@a1nelson I wouldn't even use much math on a MCU to check carrier frequency, rather go old school style like IR headphones. Those use FM on 2 frequencies, one channel about 2.8MHz, the other 2.3MHz I think, then it's all analog FM radio tech, basically do the same but keep the frequency constant.
@@a1nelson Really great explanation. Sounds like we need DIY or Buy - Episode 2!
Homemade products are the best, greetings from Mexico
One of the best videos of 2020
Back in my model airplane days some 20 years ago I used a Tower Hobbies optical tachometer to measure the prop speed of my glow engines. It could be set to read the speed of two or three-bladed props. Some of my engines could go as high as 25,000 RPM. I used to check its calibration by pointing it at a fluorescent light to read the line frequency. Seemed to be quite accurate so I never questioned the readings. The only mod I made was to fit a small flat-black painted tube made of cardboard over the sensor port to keep side-light from swamping the sensor, which only used reflected light - no laser. Oh, and I don't think I paid more than $20 for it back then.
An easy-to-implement software upgrade idea: You can measure slow speeds also by not counting the impulses per second (minute), but by measuring the elapsed time between impulses.
I love it when DIY wins , great work scott !
sometimes I wish TH-cam has a like button in full screen mode on my laptop. Nice video!
I have always loved your constructive approach to electronics and making things in general. you inspire me alot. keep up the great work Mr. Scott
I like ur writing and explanation
No way scott i was making one
This will be very helpfull!!!!!!!!
Tysm
Why not take advantage of your full OLED screen? By offering a cool display? Three ideas come to mind:
- a tachometer display (with a needle)
- a graph (with values logged in the last 60 seconds)
- a frequency display
Next on DIY or Buy: The differential probe
Would be nice to see GreatScott attempt to build one :)
At 4:51-5:35 your photodiode is backwards. In this orientation it will conduct whether absorbing IR or not. (In fact, it will emit IR.)
I am from China and I like your video very much and I like it for you. I have also encountered the display problem on the right side of the OLED display because the library is not set up properly.
Hey GreatScott!,
Congratulations on the project, it looks really neat and outperforms commercial equivalents! However, there is a small, 2px wide band of noise on the right side of your display. Its probably due to the display controller being a SH1106 - a "SSD1306-compatible" driver which has 132 px wide display RAM (contrary to SSD1306's 128 px). Most of the libraries and tutorials out there focus on the SSD1306. To fix it, either switch to SH1106 in the graphics library or just find the function which transmits the cursor address and add a permanent +2 term to the x coordinate. I had the same thing literally yesterday so I noticed it immediately.
MfG :)
Amazing. Going to try to build one following your video. Maybe I dont have to buy one again. Thanks for the video
Yes. We can customize our own tacho now
Of course, you can build your own, but it is really time consuming
@@snc1292 maybe. But Im curious in how tacho works.
Looks complicated
@@protustanuhandaru561 of course it is. This is not the typical arduino project we usually do
3:17 This is how you know that you're dealing with an electrical engineer and not a mechanical engineer.
I was surprised by that too 🤣
@Saksham Jain
The way he used the device is totally wrong. The diameter of the measuring tip is different from that of the shaft of the motor, so for each rotation of the motor the measuring tip only rotates like 0.7 rotation. They basically act as two gears with different rotational speed.
The correct way is to push the measuring tip against the center of the rotating shaft so that they rotate at the same speed. This is a very basic mechanical concept (I actually learned it in high school).
Look at the top comment
@@Willeexd1337 He edited his comment after I posted this.
It was a distraction mistake.
It doesn't require a mechanical engineer to understand what kind of error is produced by measuring in that way, it's something like 1st year high school physics.
The contact messasure with the outside of the wheel works only with the same diameter of the motor axis . If you want to messaure right you have to conact the middle points of the wheels.
Im using the same sensor for al kinds of counting stuff, quite accurate if you do you coding well, well worth the effords thumbs up for the video !
Thank goodness for this vid I can finally understand how to make a DIY anemometer
are you using a propeller for wind and this tachometer method to build it??
@@sayantanmaiti2513 either a prop or the three cup style
@@sayantanmaiti2513 and yes but I might still consider hall effect though
Buiz That’s a really good idea. I have a rural property and I’ve long wanted to be able to visualize changing winds and turbulence across a large area. The 3€ comparator part should it a lot easier to fabricate the ~25 anemometers that I’ve been hoping to set up. Wish me luck ;). PS: I wonder how high they should be mounted in order to reject most of the surface effects from the ground...
@@a1nelson I was planning to make mine a project for a government agency here where I have to dot a huge area with weather beacons and all of them will transmit back to the nearest office here via VHF Morse Code
Question on the contact mode: isn't RPM shaft diameter relative? Strictly, inversely proportional to gear ratio... Buy option still might be good, but it beats the purpose of being "on the field" tool for the additional computation.
Really you did hard work, worthy to watch complete video . Excellent 👌
We use an adjustable stroboskope light. If the shaft seems like standing still you can calculate the rpm.
Wouldn't it be better to computer a moving average rather than the time between each sample? It seems as though a longer sample would give more precise results.
I had bought an oscilloscope with 15$. I put this sensor on it and it gives me the result directly.
Thank you! I’ve been needing a better tachometer for a while but I just don’t want to spend the money on one. I already have the components you used so I can make it right now.
The contact method reduce it's force
Vinna 2k it’s “its”
@@yourandyourearetwodifferen2864 all thanks to Gboard prediction
I had once made RPM counter with telly counter & Reed switch
Timer capture peripherals are awesome. I use them extensively.
That "oh boy, hold onto your hats" is definitely from "oh boy, hold onto your papers"!!!
thought so, too :D
I think your video is great! I can tinker with Arduino. I draw with the elek. CAD and then I can order JLCPCB. Perfect! 👍😉😊
thanks Scott.. Video very clear, complete, complex and so on... See you next video...
A few years back I built one for a record player to convince myself that I wasn't hearing things. Naturally I went about it in a far more convoluted way than this.
In my defence I think most of the hard arduino code was phase 2, trying to regulate the motor PWM speed.
Nice how did it work out in the end, been thinking of a stepper motor record player with one of these to be self correcting
The problem is do you want to measure pulses pr time unit, and if so what time unit! Or do you want to measure time between pulses, and if so the triggering of the pulse/edge becomes a source of noise due to potential 50/60Hz flicker of ambient lights.
It is always a debate. I think many meters use pulses pr time unit and thus have very coarse measurement steps at low end of range.
I found using old IDE cables make running traces so much easier. You can make a ribbon as wide as you need. Bend it wherever you want. Lays flat.
I wonder though. Frequency counting is really easy even for a cheap product. Why is that commercial device off by so much?
I can see a few variants:
1. The black and the white tapes isn't in contrast enough.
2. The clock in the device is faulty.
because he used it quite wrong.
the laser setup was right, but if you use a roller, you need to adjust for the circumference of the part. imagine having a 1meter wheel in contrast to the shaft of the motor. of course the circumference spins quite a lot faster.
in that mode, you could only measure the meters per second, not revolutions per second
@@tobbleboii5988 Yes, I talked about this problem in my pinned comment. Why read this one but not my pinned one?
I think the clock could be a problem or a bad timer programming.
GreatScott! Lol - “You had ONE JOB...” I see it as entirely possible that they’ve gotten away with it simply because few users have actually verified the measurements. Or the mfr just doesn’t care, of course.
Learned a lot more in new video
I'm making a similar rev. counter, but I'm finding that the edges produced by the IR sensor are very noisy; it looks like it will need an additional Schmitt trigger to work reliably - the ESP32 board that I'm using never sees less than two interrupts per transition.
[edit: I seem to have cleaned up the edges very substantially by putting a 680 pF cap. between the IR o/p and ground - it slows the rise time from about 10 us to 20 us, but the ESP32 seems perfectly happy with that - so maybe there is no need for a Schmitt trigger after all]
Just got mine to work : = )) Had to change the resistance pot some to get to start reading.
Clearly a WIN for DIY !
Nice project , Why you didn't a reverse engineering of the commercial one and repair it if it doesn't a firmware problem Or put inside an Arduino to read the sensor and drive the lcd .
Thank you for the author's release, very practical test device, very suitable for professional technicians: electrician/car repairman/industrial...etc, I like this project, I will create and assemble a 3D shell (There is no need for any circuit board PCB, as long as the distribution line is enough), it will not be long before I will post a comment on the shell 3D printing to stl to share with everyone
I read the pinned comment about contact mode, but haven't found anything about the issue whether putting a load on the motor could change the speed. That would explain why it went from 300 to 270 rpm, and it may just need some calibration.
The contact sensor won't work because the two shafts are of different diameter. Love your explanations.
I wonder if there's something wrong with the timing circuit on the 29€ unit? Would be neat to do a follow-up with diagnostics if you can get inside the thing, shouldn't be too complicated since all it does is compare pulses to a clock. (Unless you returned it for some reason.)
Your Intro is awesome 😍
Is it possible measuring two RPM's simultaneously? ...and further more to compare which one of the two is higher?
I'm generally useless with code, but would there be an easy way to add a peak rpm readout to the display (over a ~350ms window say) that could be reset with a momentary switch? Thanks for the great video!
sincerely I got excited about this idea cause I think is the only one y can make without getting any extra parts.
If you use a bigger prescaler value in your timer or also count overflows between measurements you could get a lower minimum RPM.
I used a Hall sensor to make my RPM counter it also works flawlessly
Instinctively, I would think that measuring the time it takes for one turn in a slow-mo video would induce quite a big imprecision... 🤔 Don't want to sound like I'm teaching you anything, but have you tried, with the same method, to measure the time it takes the shaft to revolve, say, 10, 20 (50, 100!) times? (Maybe that is what you actually did already?)
When measuring a single rotation (360deg), a 30-deg angle error (I'm using quite a big value for demonstration, don't know how many frames your slow-mo gear is capable of) would mean the time you measured can be off by almost 10% (1/12). The same 30-degree error, when counting 10 turns (3600 degrees), would result in a time measurement that is accurate to 1%.
If your 0.26s measurement is off by 15% (again, extreme number for demo), then your RPM could be anywhere between 200 and 270... (Which I guess still does not match any of the 2 measurements made by the device... 😅)
Also wondering if you've tried using a thinner white strip on the shaft, or playing with lighting (eg. avoid direct lighting on the shaft that could result in reflections, even from the black part)?
I enjoy watching your videos and I don't argue with your project being more accurate than the HoldPeak, but I have to comment that the *title* is a bit misleading since you are comparing a single 3€ component, which requires a bunch of other parts adding up to about 20€, to a finished 29€ product ready to use.
Thank you. This will come in useful: I'm building a shaking water bath and needed a way to calibrate the shaking.
Thanks for the video and the tachometer project.
I was doing experiments with PC-fans. And i wanted to know how to measure RPM correctly. And see if these sensors from AliExpress could do the job. So I bought a few of them, put one sticker on one of the blades of my 12 cm fan. The result was very dissapointing, the cheap sensor could not read this signal quick enough. Even not below a few hundred RPM (checked on scope via 3rd sensor wire). So these sensors are surely way to slow for this kind of RPM measurements.
I bought a proper one (Voltcraft DT-10L laser tachometer, for about 62 euro's). This tachometer can measure up to 99999 RPM and works fine and precisely.
Used one of these sensors with my oscilloscope. The problem I had was as soon as I went outside the IR from the sun messed up the sensitivity range.
Currently trying with a 38khz tv remote receiver and ir led transmitter.
I had a dream to move to Germany, I'm electrical engineer, or smthg like that, after watching your videos i realized I'm nothing than a simple worker.
Your content is about very useful tools and stuff we can diy
Keep it up:)
I never thought that IR distance sensor was so fast and useful
the roller adapter would only give you a correct reading if the shaft of the motor is the same diameter as the roller, otherwise you'll get a different "gear ratio", which will cause the values to be off
You just build yourself an encoder. In some machinery they might use an inductive proximity sensor instead of IR to calculate speed of a gear or roller (welding some screw head on it). Different setup but still same concept