Questions on building a 38KHz IR remote - Page 1
Forum section: electronics / beginners

author: Dan123456
author_rank: Regular Contributor
timestamp: August 25, 2023, 02:50:25 pm
content: Hey allFirstly, apologies if this has been asked and answered before! I tried searching “IR remote” but that turned up about a million resultsAnyways, 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 farI 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-circuitHowever, 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

author: langwadt
author_rank: Super Contributor
timestamp: August 25, 2023, 02:58:44 pm
content: 1.44/((1000+2*20000)*0.000000001) = ~35122

author: jpanhalt
author_rank: Super Contributor
timestamp: August 25, 2023, 03:24:47 pm
content: 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.QuoteThe 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)

author: Dan123456
author_rank: Regular Contributor
timestamp: August 25, 2023, 04:14:14 pm
content: Perfect! Thanks so much guysI really thought I was missing something important but looks like I was on the right track!Quote from: jpanhalt on August 25, 2023, 03:24:47 pmThanks 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 timeI 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 goYou 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.htmlThanks so much again allAm 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

author: Kleinstein
author_rank: Super Contributor
timestamp: August 25, 2023, 05:50:51 pm
content: 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.

author: ledtester
author_rank: Super Contributor
timestamp: August 25, 2023, 09:06:46 pm
content: Quote from: Dan123456 on August 25, 2023, 04:14:14 pmIf 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

author: Dan123456
author_rank: Regular Contributor
timestamp: August 27, 2023, 05:40:06 am
content: Thanks allNa, 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 :pI’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 knowledgeAnyways, 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

author: RoGeorge
author_rank: Super Contributor
timestamp: August 27, 2023, 06:10:09 am
content: Quote from: Dan123456 on August 25, 2023, 02:50:25 pmThose IR receivers ICs with 3 pins (e.g.TSOP17xxand 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.

author: jpanhalt
author_rank: Super Contributor
timestamp: August 27, 2023, 10:34:47 am
content: Hi Dan,I have attached a pdf of the 555 datasheet/application note I like. It goes into great detail. Under component selection,QuoteIf 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.

author: Terry Bites
author_rank: Super Contributor
timestamp: August 27, 2023, 10:35:04 am
content: 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_v2is just the job