For an industrial project which requires detecting whether some text is printed on the cable at regular intervals or not, I was wondering if Arduino with IR sensor could work? The cable would be typically black with white text printed at each metre and will be unwounding from a cylindrical drum (To give you an idea of text length, it will contain cable type, metre mark, etc., I'll update the question with the linear velocity of the cable soon).

My approach was to raise an interrupt if the colour change is not recognized in the predetermined time. For this, I think I need to check if I can measure light changes, let's say 4 or 6 times in a time it takes to unwind a metre of the wire. I however don't know how fast IR sensors are to judge whether this approach is feasible.

Also, let me know if this is unfeasible and I should instead move to Raspberry Pi with a camera.

  • 1
    They're fast enough to transfer meaningful digital information faster than the human eye can discern.
    – Majenko
    Feb 15, 2022 at 8:47
  • 2
    Using a camera with pattern detection will be slower than the IR sensor. You won't get numbers about the speed of IR sensors here. This entirely depends on the sensor, what phototransistors are used and if you have additional circuitry on the sensor. When you use a pure phototransistor without any circuitry connected to an analog input it will be limited by the sample rate of the ADC. This again depends on the used microcontroller/ADC, the chosen resolution (lower resolution gets faster) and the further processing of the data (slowest part of the chain dictates the total speed)
    – chrisl
    Feb 15, 2022 at 9:16
  • Thanks, that was useful!
    – Deep
    Feb 15, 2022 at 12:48

1 Answer 1



As demonstrated in the project linked above an IR sensor connected to an Arduino is capable of reading and decoding the signal from a typical IR remote sending at about 38 KHz. In the ones I've tried the signal is a burst of 10 or 11 digits. Given that, sensing the presence or absence of a contrasting color sounds quite a bit less challenging.

I built the decoder in the linked Instructable with a Nano (author used a Mega) and it worked well.

I believe what you're proposing is feasible.

  • 38KHz is the modulation frequency of IR, not the data rate it transmit. The transmission rate using 38KHz modulation is typically around 2400 baud.
    – hcheung
    Feb 16, 2022 at 0:55
  • I stand corrected. Thanks. Still should be fast enough to capture a 1 bit signal, i.e. a blob of white text on a passing cable.
    – allardjd
    Feb 16, 2022 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.