Author Topic: Questions on building a 38KHz IR remote  (Read 1629 times)

0 Members and 1 Guest are viewing this topic.

Offline Dan123456Topic starter

  • Regular Contributor
  • *
  • Posts: 199
  • Country: au
Questions on building a 38KHz IR remote
« on: August 25, 2023, 02:50:25 pm »
Hey all  :)

Firstly, apologies if this has been asked and answered before! I tried searching “IR remote” but that turned up about a million results  :P

Anyways, I just recently started getting into / back it to electronics and figured I’d start with something fairly simple, a 38KHz IR remote and receiver switch combo to turn an a circuit on and off from a far  :)

I did a search online and found the below and started following along on a bread board.

https://circuitdigest.com/electronic-circuits/ir-transmitter-and-receiver-circuit

However, I noticed in the text they say “IR Transmitter Circuit We have used 1k R1, 20K R2 and 1nF capacitor to generate the frequency of approx. 38 KHz. It can be calculated using this formula: 1.44/((R1+2*R2)*C1)”.

When I chuck 1.44/(1+2*20)*1 into a calculator I get 0.0351.

Now, I assume the decimal point being in the wrong spot is just me using the wrong units but when I test the output from the 555 (across the IR LED just using a cheap multimeter), I seem to be getting a reading of about 36kHz.

So, my question is, have they made an error in their calculations and this is a 35KHz IR transmitter circuit? Or have I just screwed something up / am misunderstanding something?

Thanks so much in advance all!

P.s. I really want to just understand this more than anything! I know there are probably a dozen better ways of turning something on and off remotely these days but am just using this project as a way to learn the fundamentals while also ending up with something useful :)
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4701
  • Country: dk
Re: Questions on building a 38KHz IR remote
« Reply #1 on: August 25, 2023, 02:58:44 pm »
1.44/((1000+2*20000)*0.000000001) = ~35122
 
The following users thanked this post: Dan123456

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 3762
  • Country: us
Re: Questions on building a 38KHz IR remote
« Reply #2 on: August 25, 2023, 03:24:47 pm »
The frequency is not terribly critical, and 35 kHz will probably.  If you have slightly smaller resistors, you might try them to get closer.  Not worth buying exact ones IMHO.

How sensitive do you need the receiver?  With a steady tone, sensitivity will be decreased.
Quote
Source:TSOP2438 datasheet
This series is designed to suppress spurious output pulses due to noise or disturbance signals. The devices can
distinguish data signals from noise due to differences in frequency, burst length, and envelope duty cycle. The data
signal should be close to the device’s band-pass center frequency (e.g. 38 kHz) and fulfill the conditions in the table
below.

The pulse pattern is easily made using 2 555's.  One for 38 kHz and the other to modulate that one.
BTW, the TSOP1738 is obsolete.  You might want to consider the TSOP2438 (https://www.farnell.com/datasheets/2049301.pdf )
 
The following users thanked this post: Dan123456

Offline Dan123456Topic starter

  • Regular Contributor
  • *
  • Posts: 199
  • Country: au
Re: Questions on building a 38KHz IR remote
« Reply #3 on: August 25, 2023, 04:14:14 pm »
Perfect! Thanks so much guys :D

I really thought I was missing something important but looks like I was on the right track!

The frequency is not terribly critical, and 35 kHz will probably.  If you have slightly smaller resistors, you might try them to get closer.  Not worth buying exact ones IMHO.

How sensitive do you need the receiver?  With a steady tone, sensitivity will be decreased.
Quote
Source:TSOP2438 datasheet
This series is designed to suppress spurious output pulses due to noise or disturbance signals. The devices can
distinguish data signals from noise due to differences in frequency, burst length, and envelope duty cycle. The data
signal should be close to the device’s band-pass center frequency (e.g. 38 kHz) and fulfill the conditions in  the table
below.

The pulse pattern is easily made using 2 555's.  One for 38 kHz and the other to modulate that one.
BTW, the TSOP1738 is obsolete.  You might want to consider the TSOP2438 (https://www.farnell.com/datasheets/2049301.pdf )

Thanks so much! It doesn’t need to be super sensitive as just plan on using it to tun an Aurduino powered puzzle box on and off without needing to open it up each time :D

I will definitely look into the pulse patten option regardless (sounds life a good excuse for me to mess around with another 555 if nothing else :p) and I have a bunch of resistors on me that will get me pretty close to the ideal range so will pop them in and see how they go :)

You make a good point though! The receiver I have is a RPM6938-V4 which is a 37.9KHz receiver (it is what my local electronics store keeps in stock :p) and was going to ask how close you have to be to the ideal frequency for it to work.

From the data sheet below, it seems like anything from 35-41KHz would technically work but I’m guessing I want to keep it between roughly 37.5-38.5 for best results?

https://pdf1.alldatasheet.com/datasheet-pdf/view/169025/ROHM/RPM6938-V4.html

Thanks so much again all :D Am still learning and feel like I’m in this weird beginner moving to intermediate area and there don’t seem to be many good resources for that kinda level so really appreciate all your help :D
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14749
  • Country: de
Re: Questions on building a 38KHz IR remote
« Reply #4 on: August 25, 2023, 05:50:51 pm »
If the signal / data are comming from the Arduino anyway, one can as well use it to create the 38 kHz signal and the modulation. There may even be ready made libraries for this, as this is a relatively common task.  For the modulation is more effective to have a on/off ratio of less than 50%, more like 25% which gives about 70% the signal strength at half the power / average current.

There are plenty of comparable receiver chips. So even if one is obsolete there are plenty of alternatives that are only different in minor details.
 
The following users thanked this post: Dan123456

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: Questions on building a 38KHz IR remote
« Reply #5 on: August 25, 2023, 09:06:46 pm »

Thanks so much! It doesn’t need to be super sensitive as just plan on using it to tun an Aurduino powered puzzle box on and off without needing to open it up each time :D


If I understand the situation correctly I would just use an old remote you have lying around to generate the signal. Program the Arduino to recognize the code sent by the remote.

Maybe this library would work for you:

https://github.com/Arduino-IRremote/Arduino-IRremote
 
The following users thanked this post: Dan123456

Offline Dan123456Topic starter

  • Regular Contributor
  • *
  • Posts: 199
  • Country: au
Re: Questions on building a 38KHz IR remote
« Reply #6 on: August 27, 2023, 05:40:06 am »
Thanks all :)

Na, I want to build an IR on/off circuit seperate to the Aurduino (basically a remote switch that supplies power to the Aurduino board itself) :) One reason for this is I have already used pretty much all the pins on the board and my code is already a complete mess :p

I’m aware this probably isn’t the best way of doing it but the main reason I am going this route is I am currently just building lots of little circuits to try and build up / refresh my knowledge :D

Anyways, update on the project, I messed around with the resistor values and no matter what I set R1 as, I seem to always get ~36MHz.

For instance, the ideal value I calculated of R1 =1800, R2 =1800, C1= 1uf should give me pretty much spot on 38KHz.

However, when I test it (just with a cheapish (aka ~$30AUD) multimeter over the LED) I seem to still get about 36KHz.

I even tested changing R1 to a 1K and even 470 Ohm resistor and was still only getting a reading of about 36 or 37KHz!

I know it is really hard to say without playing with it in person but do you guys think this is most likely just a tool limitation? Or do you reckon it’s probably caused by something else?

I’m fairly sure the remote would work as is and the question is really just to satisfy my curiosity more than anything :D
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6706
  • Country: ro
Re: Questions on building a 38KHz IR remote
« Reply #7 on: August 27, 2023, 06:10:09 am »
have they made an error in their calculations and this is a 35KHz IR transmitter circuit? [instead of 38kHz]

Those IR receivers ICs with 3 pins (e.g. TSOP17xx and alike) are not selective at all.  They have a maximum sensitivity at the specified frequency, but they work just fine anywhere between 30kHz-50kHz at least.  I've bought once a few receivers at different frequencies, and they were all receiving just fine inside the room, all from the same remote.

Maybe if you push the range to 10 meters or difficult lighting condition one might see a difference, but inside a casual room you may consider the receiver as heaving no selectivity regarding the IR modulation frequency.

The identification of each remote is made by the vendor code in the train of the IR pulses sent by each remote, not by the IR carrier frequency.

For a small automation at home, I'll use the RC5 standard for IR remotes.  There are ready made libraries and examples for decoding RC5 with a microcontroller, so you can reuse already existing IR remotes.  Using a known standard like RC5 will make possible to distinguish which button of the remote was pressed, if needed.

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 3762
  • Country: us
Re: Questions on building a 38KHz IR remote
« Reply #8 on: August 27, 2023, 10:34:47 am »
Hi Dan,

I have attached a pdf of the 555 datasheet/application note I like.  It goes into great detail.  Under component selection,
Quote
On the other end of the spectrum, there are certain minimum values of resistance that should be observed. The discharge transistor, Q14, is current-limited at 35mA to 55mA internally. Thus, at the current limiting values, Q14 establishes high saturation voltages. When examining the currents at Q14, remember that the transistor, when turned on, will be carrying two current loads. The first being the constant current through timing resistor, RA. The second will be
the varying discharge current from the timing capacitor. To provide best operation, the current contributed by the RA path should be minimized so that the majority of discharge current can be used to reset the capacitor voltage. Hence it is recommended that a 5kW [sic: should be Ohm) value be the minimum feasible value for RA.

If you go back to your original values, note that changing R1 makes an an almost trivial difference in the product of R1 + 2R2.  It's 1k v. 2x20k.  Change R2.   

EDIT: The kW is a translation problem from the actual pdf, which shows the Ohm symbol, and this blog, which translated the symbol in the copy to W.
« Last Edit: August 27, 2023, 10:41:35 am by jpanhalt »
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2504
  • Country: gb
  • Recovering Electrical Engineer
Re: Questions on building a 38KHz IR remote
« Reply #9 on: August 27, 2023, 10:35:04 am »
A world of simplicity beyond the 555!
I've used a gated oscillator made from a from a CD4093. It generates short bursts of 38kHz. Its stable enough with film caps. Tweak R2 for 38kHz. The average power consumption when active is about 20mW. A TSOP4438 reciever outputs a pulse on each burst. I have run it on a much longer duty cycle (1s: 100u) and it ran non-stop for three weeks on a pair of AAs.

Save youirsewlf the bother.

"Infrared IR Relay Board" on aliexpress $2 all in. You can bodge the switch presses using a 4066 across the contacts for control by another device. A tiny SN74LVC1G66 will do it.
hackaday.io/project/182093-controlled-remote.

This is brilliant little usb thing for capturing and resending IR codes. Point a remote at it, grab the codes and stuff them into an arduino. Get one for your bench! www.compendiumarcana.com/irwidget/ I cant find the version I had but.. http://dangerousprototypes.com/docs/USB_IR_Toy_v2 is just the job
« Last Edit: August 27, 2023, 11:17:32 am by Terry Bites »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf