1
\$\begingroup\$

I built an AVR-based gadget (bare metal AT90USB162, not Arduino) that receives an infrared remote signal and does some stuff. For testing, I used a random TV remote that I had, and it's VERY reliable: whenever I push the remote button, my gadget sees the message and does what it's supposed to do.

Next, I built an ATtiny-based transmitter to send the same message as the TV remote. This works too, but it's much less reliable than the TV remote. About 20% of the time, something goes wrong and my gadget misses the signal. It usually works on the second transmission, and I can always move the transmitter and receiver around a bit and get it to trigger.

However...I don't know where to start looking to fix this. Since the signals are IR, I can't really compare them for brightness or other characteristics. I don't know if it's signal strength, timing variance, or what else.

Short of gutting a TV remote and sticking it where I need to transmit from (which is unacceptable for other reasons) I don't know where to troubleshoot next. So...people who have designed or troubleshot IR communication systems, what do newbies to the technology usually screw up? How do I figure out what I did wrong?

\$\endgroup\$
  • 1
    \$\begingroup\$ Get an oscilloscope and compare the driving signals from your gadget and the TV-remote and check for timing issues. Use a digital camera to check the IR intensity - many digital cameras can "see" IR and you can see how bright it is on the display of the camera without making a picture. \$\endgroup\$ – JRE Aug 26 '16 at 16:33
  • 1
    \$\begingroup\$ Your going to have to find some way to see your signal, I think an oscilloscope is going to be your best bet. "Pull" your system apart one thing at a time, find the parts that work and fix the parts that don't. With complex systems it may be a software thing or a hardware thing. It might be useful to pipe out the messages that the AVR gets. See if the problem is repeatable. \$\endgroup\$ – Voltage Spike Aug 26 '16 at 16:39
  • 2
    \$\begingroup\$ There are also infrared detector cards made to test remote controls. You may be able to see the difference in intensity. \$\endgroup\$ – JRE Aug 26 '16 at 16:40
  • \$\begingroup\$ Is there a rule of thumb for how hard to drive IR LEDs? I tend to stay way below specs on visible LEDs because I just don't need that much light. But maybe I'm just not driving the IR transmitter hard enough? I could certainly drop the load resistor so that I'm at spec, and since it's intermittent, I could probably go much brighter than that if that's likely to be the problem. Another thing, I guess, is the interaction between 38kHz PWM carrier and the signal pulses -- on the shorter, 560us pulses, there are only 21.28 carrier pulses, so I can imagine only 18-19 getting through sometimes. \$\endgroup\$ – Dave M. Aug 26 '16 at 16:55
  • 1
    \$\begingroup\$ @JRE todays "infrared detector cards" are called smartphone cameras. See nothing with your eyes? Camera sees something? Its working - might be the wrong wavelength or modulation, but it's emitting. \$\endgroup\$ – Chris Stratton Aug 27 '16 at 2:59
1
\$\begingroup\$

Show he exact part numbers you are using & links to datasheet.

The criteria to compare with a TV RC for reliable communication are;

  1. LED peak current 100mA pulse modulated
  2. Modulation carrier frequency must be matched. ( 30~50kHz range in optional channels for chips.)
  3. Preamble duration to allow AGC on Rx to lock onto signal level for the comparator to derive accurate binary levels on the 1st burst.

4. Also narrow emitter Beamwidth improves reception.

  • LEDs use total angle, IR LEDs are specified using HALF ANGLE.
  • Because the beam angle is so small it is measured from peak to side 1/2 power angle
    • ( e.g. 4 to 15deg) it may not be centered so IR LEDs are always in Half-angle.
  • Generally comparing outputs at 1/2 the angle, one can expect twice the output but with 10~20% lens loss, so it is not quite double at half the angle.
\$\endgroup\$
  • \$\begingroup\$ Wow, that's a lot more current than I'm running through the LED. I have it switched by FETs that can handle that much (I'm not just driving it with AVR pins) but I wouldn't have thought to drive the transmitter that hard. I'll give it a try, though. Thanks! \$\endgroup\$ – Dave M. Sep 27 '16 at 4:25
  • \$\begingroup\$ Check specs for max duration of peak current \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 27 '16 at 13:34
0
\$\begingroup\$

Timing variance should not be a problem for verification. Just use the digital signal driving your LED, and figure out a way to look at it, either with an oscilloscope, logic probe, jury-rigged microcontroller, or some other tool. Push comes to shove, a Bus Pirate will probably serve.

Optically, you have more work to do. you can probably rig up your own photodiode with an amplifier, and use the output of that to compare your devices. Don't forget to check the beam shapes of the LEDs, as well as intensity at straight ahead.

\$\endgroup\$
0
\$\begingroup\$

Since you said you built a receiver that is working fine, it must have some sort of receiving amplifier. Put a scope probe on the output of the photodiode amplifier on your receiver and see what the output looks like. The scope signal will tell you if your brightness is different between the two transmitters, or if your timing is off somehow.

\$\endgroup\$
  • \$\begingroup\$ Good idea, but the IR receiver is a module (TSOP57338). Power goes in, IR shines on, and "IR at 38kHz detected" comes out. No access to the details. \$\endgroup\$ – Dave M. Aug 27 '16 at 2:12
  • \$\begingroup\$ Not really a problem. The scope on the transmitter checks the modulation frequency. The scope on the receiver checks the timing of the data you are sending. Make sure you don't have a timer ISR that gets in there sometimes to distort that. \$\endgroup\$ – Chris Stratton Aug 27 '16 at 3:01
0
\$\begingroup\$

The receivers and leds actually have a wavelength spec, you can have them mismatch and work, but getting the right parts makes it better. As important as that is the carrier frequency needs to be as good as you can get, if your arduino has software counting one one thousand, two one thousand, three one thousand, wiggle the line, one one thousand. You could be off by a little, check it on the scope is it 50% duty cycle and the right frequency and is the window with the signals on and off the right duration? if you are putting 39KHz into a 40Khz led to a 40Khz receiver led and decoder, it is going to kinda work but not much range.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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