Help with IR-based tachometer

This should be very simple, but it has proven to be otherwise. My question is verbose, because so many questions on here don't provide enough info for a good answer, so I'm trying to provide everything you might need to know.

I need to build a tachometer for a real engine, not just a bench project. I don't want to use Hall Effect (too hard to keep the magnets attached to the spinning part on the engine). I don't want to use a normal photocell (too much ambient light). So I want to use IR.

I need help only with one aspect of the project: detecting a piece of relfective tape attached to the spinning engine part, from about 2" away, as the engine turns. I tried with an "IR sensor" that I had, but have determined that it modulates what it receives, and I'm pretty sure I don't want that - too complicated. I think (after all I've read and tried) that I want to:

  1. Turn on an IR LED constantly and point it at the spinning engine part. ("Constantly" may mean that it's flashing on and off at 38KHz, but that's all it ever does: just sends a light signal that can reflect off the reflective tape and be reliably detected by the IR photosensor.)

  2. Detect the reflected light, and when detected, change the state of a digital input pin on the Arduino. When not detected, change the state of the pin back. IOW, "blink" the input pin HIGH/LOW (or LOW/HIGH) each time the reflective tape passes by.

EDIT: I'm going to use two different Arduinos for this project - one to transmit the light, the other to receive it. Don't ask why - it's complicated. But that will hopefully simplify things, since each sketch will be completely independent of the other.

Don't worry about what I'll do with the input once it's coming into the Arduino. That's all being handled by some other code that I know works (I've tested it with a Hall Effect Sensor). It uses interrupts, so it's quite fast.

Maximum number of times the piece of reflective tape will pass by the IR light / receiver is 9,000. (Although I'd like to know what the MAX is that could be handled, as a bonus.)

Questions:

  1. Do I need to blink the IR LED at 38KHz, or simply turn it on constantly?

  2. What exactly do I need to use to receive the reflected light that can change the status of an Arduino digital input pin, and what does that circuit look like?

Thank you so much for any help you can offer. I really, really have looked all over the place for my answer, but nothing has hit the mark yet.

I tried with an "IR sensor" that I had, but have determined that it modulates what it receives, and I'm pretty sure I don't want that - too complicated.

What do you mean by modulate? If it's an IR receiver for remote controls it probably filters the 38kHz you're producing anyway. And if you really have ambient light, you should go for that filtered signal as with ambient light you almost always also have ambient IR light.

Maximum number of times the piece of reflective tape will pass by the IR light / receiver is 9,000

I'm missing the unit. 9kHz? Or does the engine have a max RPM of 9000 (which results in 150Hz)?

  1. Do I need to blink the IR LED at 38KHz, or simply turn it on constantly?

Depends on the answer for question 2 but in my case: yes.

  1. What exactly do I need to use to receive the reflected light that can change the status of an Arduino digital input pin, and what does that circuit look like?

It might work with a simple IR receiver for remote controls. If that works depends on the reflectivity of the tape and of the surrounding material. If the difference is high enough it probably will work.

Modulate: maybe I'm using the wrong term, but it seems like every example I've found wants to break down the incoming light into "digits", by reading pulses and translating them into... something more complicated than just ON or OFF. IOW, the sensor doesn't output a binary result (on/off, high/low, 1/0, however you want to think about it). It breaks it up into signals (by length of the on/off pattern, I think), and outputs something based on that. It's supposed to make it easier to use to send and receive "codes" - but I don't want to do that. I just want ON or OFF.

I figured I would probably need to use a 38KHz receiver, and use some simple "blink" code to flash the light at 38KHz. But I wasn't sure, which is why I asked.

Units: oops! I forgot to finish that with "9,000 times per minute". Same as 150 per second. (The engine turns no more than 1,800 rpm, or 30 rps, but that doesn't give me the output granularity I want - so I want to evenly space 5 pieces of reflective tape around the spinning engine part, which translates to 9,000 "reads" per minute, or 150 "reads" per second.)

"It might work with a simple IR receiver for remote controls."

No - that's what I've been trying. See the "modulate" issue above. I am pretty sure I need just a simple IR phototransistor, with on/off output... but I was really hoping for some rock solid guidance.

Thanks!

The IR remote receiver outputs a true/false signal, depending on ligth on or off. The 38kHz filter makes the receiver somewhat slow (10kHz), but it may work for your purpose.

ATOH the IR remote works well with reflections, in your case with light possibly reflected by other parts than the reflective strips.

Is this a petrol engine ? If so can you use an ignition signal ?

I would use an inductive pickup and a toothed wheel attached to the front of the engine - google “ trigger wheels”. This is the technology used on production cars .

DrDiettrich:
The IR remote receiver outputs a true/false signal, depending on ligth on or off. The 38kHz filter makes the receiver somewhat slow (10kHz), but it may work for your purpose.

Are you saying that a basic IR receiver, (like this: https://smile.amazon.com/AIRSUNNY-three-Infrared-Emission-Receiver/dp/B00EFOQEUM), when exposed to an IR LED being pulsed at 38KHz, will output HIGH on the data leg, and when not exposed, it will output LOW on the data leg? (Or vice versa - I honestly don't care which.)

How is that receiver different from this one, which has only 2 legs? (https://smile.amazon.com/gp/product/B01ERPBF0W) Does it not "filter" at 38KHz, and the one above does?

ATOH the IR remote works well with reflections, in your case with light possibly reflected by other parts than the reflective strips.

I'm not concerned about that. I can get the light and receiver within a couple inches of the reflective strips, and if necessary, I can make a small wrapper around both components to make sure they each point only at the spinning part. Besides, there isn't anything else that close to the spinning part, and it's in a rather dark section of the engine bay.

Looking a bit closer at the advertisement it announes pairs of emitters (2 legs) and receivers (3 legs).

DrDiettrich:
Looking a bit closer at the advertisement it announes pairs of emitters (2 legs) and receivers (3 legs).

Both of the links I included are kits, and they include emitters and receivers. I'm ignoring the emitters for now. The receivers in the first link have 3 legs. The receivers in the second link have 2 legs. This may very well be the gist of my issue - determining the difference between these two types of receivers, in order to decide which one I need. The 3rd leg on some would seem to indicate that there's some more processing going on than the ones with 2 legs. Maybe the processing is the "filtering" to make the receiver detect at 38KHz? And maybe the 2-leg version is just a dumb photoresistor that can detect IR light instead of visible spectrum light?

See what I mean about this being a lot harder than it seems like it should be?

The second link refers to emitter and receiver diodes, which have 2 legs like other diodes.

DrDiettrich:
The second link refers to emitter and receiver diodes, which have 2 legs like other diodes.

But... does that help me? Specifically, I still need to know what, exactly, to use to receive the IR light and have it, plain and simple, give me HIGH/LOW on one of the legs, depending on the "seeing" of the light, or not.

The sensitivity of photo diodes is very low, i.e. an amplifier is required to turn the signal into HIGH/LOW. Forked light barriers with photo transistors instead of diodes may provide a strong enough signal by themselves, Without electronic skills it's easier to use the 3-legged IR remote receivers, which have that ciruit and more already built in. These receivers react on modulated (38kHz) ligth only, i.e. that signal has to be generated by e.g. a microcontroller and fed into the IR sender diode.

No - that's what I've been trying. See the "modulate" issue above. I am pretty sure I need just a simple IR phototransistor, with on/off output... but I was really hoping for some rock solid guidance.

You are wrong with that. These receivers just filters the incoming IR light and if that IR light isn't modulated on a 38kHz carrier they simply ignore it. So if you provide a digital signal to the IR LED modulated on 38kHz you will get the same digital signal from these receivers back. The biggest problem will be to ensure that the receiver only gets the light from the reflective tape and no reflections from other parts in that area. This is especially hard to detect as the human eye is not able to see this light and a camera will only see a small part of the spectrum.

I am actual curious if the “reflective” tape might cause issues with modulated pulses.

If it’s truely reflective tape it will have prismic properties that when spinning, seems might induce interfere on a modulated beam.

The additional comment that this was going into a darken engine bay, maybe just painted white mark using paint with titanium dioxide should be appropriate.

I always use the hall units with a small magnet. All this guff about magnets flying off is simply b/s.
I run small engines to 10,000 rpm no problem with magnet.
It may be the op is using way too large a magnet and using incorrect mechanical placement/retention methods.
With rare earth type, 3mm dia x 1mm thick is sufficient.

pylon:
You are wrong with that. These receivers just filters the incoming IR light and if that IR light isn't modulated on a 38kHz carrier they simply ignore it. So if you provide a digital signal to the IR LED modulated on 38kHz you will get the same digital signal from these receivers back. The biggest problem will be to ensure that the receiver only gets the light from the reflective tape and no reflections from other parts in that area. This is especially hard to detect as the human eye is not able to see this light and a camera will only see a small part of the spectrum.

pylon,

What receivers do you mean by "these receivers"? This thread has talked about IR photo diodes, IR phototransistors, and IR receivers like the one in a TV or stereo, that receives and turns the light signals into digits (I think?). And when you say "you will get the same digital signal from these receivers back - what do you mean? What "digital signal"?

Slumpert:
I am actual curious if the “reflective” tape might cause issues with modulated pulses.

If it’s truely reflective tape it will have prismic properties that when spinning, seems might induce interfere on a modulated beam.

The additional comment that this was going into a darken engine bay, maybe just painted white mark using paint with titanium dioxide should be appropriate.

Slumpert,

If I get inconsistent results, I can always paint over the reflective tape. But thanks for bringing up something that I never would have thought of.

bluejets:
I always use the hall units with a small magnet. All this guff about magnets flying off is simply b/s.
I run small engines to 10,000 rpm no problem with magnet.
It may be the op is using way too large a magnet and using incorrect mechanical placement/retention methods.
With rare earth type, 3mm dia x 1mm thick is sufficient.

bluejets,

My fear is also that I won't be able to get the sensor close enough to the magnet. With a very small rare earth magnet like you describe, can you say what the maximum distance is that you would use for a reliable result?

And, how do YOU attach the magnet to the spinny thing? I would probaby use some kind of 2-part epoxy, like JB Weld, but I'd love your input. Thanks!

ba58smith:
bluejets,

My fear is also that I won't be able to get the sensor close enough to the magnet. With a very small rare earth magnet like you describe, can you say what the maximum distance is that you would use for a reliable result?

And, how do YOU attach the magnet to the spinny thing? I would probaby use some kind of 2-part epoxy, like JB Weld, but I'd love your input. Thanks!

Usually around 2mm...too close is no good and also too far.

I'll sketch up the arrangement I use and post it back for you a bit later.

Don't know if you are aware of it but there is also an arrangement where the same hall effect switch can have an opposite-flux-to-normal magnet placed (glued) onto the back of the hall effect switch and operation is then from a metal vane passing in the front of the hall switch.

Again, around 2mm clearance for the rare earth 3mm dia x 1mm magnets.

bluejets:
Usually around 2mm...too close is no good and also too far.

That's what I was afraid of. I'm not sure I can mount the sensor adequately so that it could end up 2mm from the spinning engine part. Heck, I'm not sure that the engine doesn't vibrate in its motor mounts more then 2mm. I think I'm going to have to use and IR light sensor.