Wrong Hz in IRremoteESP8266 - could affect range

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Wrong Hz in IRremoteESP8266 - could affect range

#1 Post by olleman » 28 Oct 2017, 09:11

Hello,

I've read several threads about the IR function and even with a transistor in place the range would only be a couple of meters. I had it worse than that and only could get about 50cm. So me and a friend examined the signal with an oscilloscope and saw something quite interesting. The frequency generated by the plugin was around 34 000 Hz and not the desired 38 000 Hz. Changing the following line in IRremote8266.cpp got it very close to 38 000 Hz.

File: IRremoteESP8266.CPP
Line: 490 : halfPeriodicTime = 500/khz; > halfPeriodicTime = 465/khz;

Now, in my case this didn't make much of a difference since I found out I had gotten the wrong Ir-diode for my project but this could have an impact on range depending on the receiver you're having.

This was tested on a NodeMCU V3 and latest ESPEasy dev firmware.

,Olle

s0170071
Normal user
Posts: 36
Joined: 21 Oct 2017, 20:49

Re: Wrong Hz in IRremoteESP8266 - could affect range

#2 Post by s0170071 » 03 Nov 2017, 10:40

Olle,

There are two aspects to consider.
1. the spectral response (wavelength) of the sender / receiver diode. Think of it as the colour of the IR light. IR is about 900nm-1200nm.
2. the modulation frequency of the signal coding. The signal is not just on / off like the output of the UART pin. It is sort of frequency modulated. The frequency that you want actually depends on the sender and or the receiver. Both need to be on the same (carrier) frequency .
Besides a common photo transistor, there are also integrated IR receiver modules (usually with 3 pins) which do process the IR coding and output a signal that you can directly read with a UART. Part if that processing is filtering everything but the frequency range of about 38kHz which carries the signal. Other light (ambient etc.) which has not a 38kHz component is blocked.
35kHz and 38 kHz receivers are the most common, I have also seen 40kHz. After de-modulation the signal very often has a speed of 9600 bps.

It would therefore be useful to have this setting configurable...

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests