Fast Hacks #16 - Clone Infrared Signals with Arduino
HTML-код
- Опубликовано: 2 авг 2024
- This week I used an Arduino and my PC to clone an infrared remote control. I used this to automatically turn on an electric heater every morning so my bedroom is nice and toasty when I wake up!
Download the code: www.richardosgood.com/blog/wp-...
Much of the Arduino code was borrowed from Adafruit.com's IR Decoder examples. Be sure to check them out if you do a lot of electronics projects!
Music track:
"Hustle" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
creativecommons.org/licenses/b... Наука
Quick tip for anyone having issues with this, turn off the lights in the room when recording the infrared. I could not get it to work at all until I turned off my lights. I'm not entirely sure why that made a difference, but worth trying nonetheless.
Dude you are a genius! This video was just what I need for a project that I want to build.
And this is why I'm glad I bought the elegoo arduino kit, it has all the goods included for this project.
haha, that was fun. You take me back to my old days when I played with telos motes, wifi chips and msp430s. I didnt know abt that powershell feature in windows. Thanks.
Great video. Simply explained!
Nicely done, thank you!
Hi Rick
Great job
Thanks for the video ! For other users, the program can work but indeed need a little tweaking. I made it worked for the ON/OFF command of a LG TV. I can explain my tweaks if people want to ;)
i had love to know and if we could increase the range
@@noobking5056 Long time I've used it but it worked two years ago. Hope this will helps : drive.google.com/file/d/1z-6SNfmUgEQxPiibjIX8rfvrgboXW7_e/view?usp=sharing
Regarding the range, infrared is not famous for having great performance at long distance unfortunately ...
Does the code in this video still work on latest Arduino ide?
Nice job, but I have 2 comments: You need to set the pinmode of the IR LED pin to OUTPUT, so add "pinMode(IRledPin, OUTPUT);" to the setup. I also recommend to use pin 12 instead of pin 13, because pin 13 will flash during programming and as you are not using a resistor in series with the LED, this will cause unneeded stress on the LED. BTW: I needed to change the delays in pulseIR to 9 microseconds for it work with Philips RC5 code on my Arduino Uno.
As noted in several comments below, adding "pinMode (IRledPin, OUTPUT);" to the setup section is necessary to allow PlaySignal to generate IR pulses. However: the code pairs that are captured in the preceding step, IRdecoder, are inconsistent. (Repeated tests using the same button on the same remote yield duration pairs that differ by several units.) For me, anyway, this has resulted in an inability to control any of the devices I've tried. Has anyone had success with these sketches?
Thank you
Will this work with very long IR codes? I have a Mitsubishi airco/heater and it uses an IR code of a whopping 288 bits.
i get the sketch to upload onto my arduino but after it uploads I get this text in orange
avrdude: stk500_getsync(): not in sync: resp=0x00
and when I try to throw the ir a signal nothing happens, please help.
I cannot find the code. the link above takes you to a page that says "Not Found". Is the code still available somewhere else?
I'm trying this using an arduino nano. I have an ultrabright LED to test. It flashes super fash so I'm guessing this is correct. However a pin on high makes it shine not nearly as bright as it could. When I put in the IR Led using the extracted IRSignal Array it does not control my TV. I'm guessing the voltage is too low? I can barely see the IR LED light up at full 5V under a camera.
Any ideas?
How to find the NumIRsignals value? I am using it for a TV Remote?
mine says error: "stray ‘\5’ in program" when i upload it please help
Nice tutorial, I'm trying to do something similar, so after you get the remote code using arduino, can you using your phone that has an IR blaster on it to control the device instead? I'm not sure which app will allow you to enter your own code though...
play.google.com/store/apps/details?id=net.binarymode.android.irplus&hl=en
something like script manager is something you'd better make use of for this case. it's very customizable. although it might take a while to set it up
Really nice tutorial! However, I had to specify pinMode(IRledPin, OUTPUT); in void setup() for it to send anything.
Thanks for the tip! I wonder if this depends on which Arduino board you are using or which version of the IDE you are using?
Rick Osgood
Welcome. I'm using and UNO with IDE 1.0.5
I had to specify too that code, and it worked fine, thank you
What is the name of this IR decoder/reciever ?
@Rick Osgood, i can't access to the code uploaded to your website. Could you reupload it, please? Thank you so much.
Is it possible to clone signals from reciever instead of blaster
Can you do the same with a 2.4 ghz remote?
Can you do that with car remote
What is BCC or VCC? I only see Vin, 2 times GND, 5v, 3.3v
the IR led doesn't seem to flash when i enter POWER I have 100 as NumIRsignals can you help me ?
Ghassen Charai I have the same problem :(
Just a quick situation and than a question... Im working w/ this concept , but i want to apply on the Raspberry Pi.. Do you know anything about? I downloaded your sketch and i saw that its sais that digitalRead() is too slow. Do you know if the common GPIO of RasPI can handle the IRdecoder? And/or any library to work with php or phyton ? If anyone knows something about , please .. I'm loosing my sleep to solve this hahahhahahaha
And Rick great video and i took a look at you channel and it is good as well .Outstanding job !
João Eduardo Saad If theres in the text some ugly grammatical error , please dont take in account . I'm not a natural english speaker and still learning . thanks a lot!!
Arduino Nano hardly catching the signal, What Should i do???
great!
now program an attiny13, hook up the IR LED, connect a watch-battery and leave it somewhere near the heater.
you could maybe make the attiny13 go to sleep mode and wake up after a couple of minutes just to see what time it is just to save battery power.
Can the ATTINY13 keep reliable time? Or would it need a real time clock chip of some sort? It would be much better than having to run my PC all night and day just to turn on/off the heater.
Rick Osgood yes it should. or else just use the arduino uno or mega or whatever you have laying around.
another idea would be to have a pushbutton which resets time.
or if you get an arduino with ethernet maybe you could get it to check for the time through the internet.
there's bunch of ways to do this.
If the chip can keep pretty accurate time itself, that would be the best. For this project (and most of my weekly projects) I'm usually working with what I have laying around or what I can get quickly and inexpensively. But if you really needed super accurate time keeping then I know it can be done.
Rick Osgood I understand. I don't know if the attiny13 has a CLK pin, it should have, then you could connect a crystal oscilator. it has built in at 9.6mhz I think, so the timing should not be a problem, be it that you use the internal clock or an external.
Can you figure a way to do that with RF for a garage opener or car remote?
I think the simplest way to do that would be to modify the remote control so the Arduino presses the button for you. In that case, it would be beneficial to purchase a second remote strictly for this hack. That way you don't ruin your only remote accidentally. If you power the remote and the Arduino off the same power source, you can likely use a transistor (or perhaps an Arduino pin directly) to "press" the button. I did something similar in my Fire Breathing Jack-o-Lantern video but with a Glade automatic air freshener. It would depend on how your remote works though.
Can you update the code page please!!!!!!
Good video but could certainly have been better lit very dark in some segments.
The requested URL /blog/wp-content/uploads/2013/11/ArduinoInfraredCloner.zip was not found on this server.
Download here: halckemy.s3.amazonaws.com/uploads/document/file/1339/ArduinoInfraredCloner.zip
Here my fixed version of "PlaySignal" pastebin.com/tejC5xui :) the other ones didnt work for me
Rick Osgood I have an arduino MEGA 2560 I modified your code to look like this
//#define IRpin_PIN PIND
//#define IRpin 2
// for MEGA use these!
#define IRpin_PIN PINE
#define IRpin 4
and I have connected to the arduino a keyes IR Module with G-R-Y outputs that are connected to G-ground R-3.3V Y to pin number 4 (that's a PWM pin) and at my serial monitor I see Ready to decode IR, I press the controllers button I see the module's LED blink that's an indication LED that the module has received a signal but at my serial monitor I don't see anything, I also have tried the 5V instead of 3.3V still nothing. Any ideas what went wrong???
Thanks
Hi this is a great tutorial thanks, I have a remote controlled fan but want 2 remotes is there any way I could use my spare led strip light remote to operate my fan? Many thanks ... John :)
+karen berry If the LED strip outputs light in the proper wavelength, then I don't see why that wouldn't work. It has to output enough light in the correct infrared wavelength, plus you'll have to pulse the LEDs at the proper frequency and then modulate that signal to send out the correct codes.
Thank you very much, I think its a bit beyond me just yet :)
my computer is my heater :D
URL download isn´t working. :(
Hey, i copy IR code to Arduino then i uploade PlaySignal and my IR diode don't flash, can you tell me why? what do i need to do to flash?
What he said. (Same problem. )
There's a comment about 6 months ago indicating a need for 1) declaring the output LED as OUTPUT; 2) using pin 12 instead of 13, and 3) changing to pulse duration from 10 to 9.
Has anyone had success with the PlaySignal sketch?
Is there a way to go directly from receiving the signal to emitting the signal, ie not having to receiver and decode the signal, then manually copy the numbers to a different sketch?
Sorry I'm not sure what you mean. The first part of your question sounds like you want to build an IR repeater. Like something that would read a signal and just replay it back out immediately. The second part sounds different and I'm not sure I understand what you want to do.
Rick Osgood What I mean is to make it similar to a programmable remote control, be able to push a button which would receive the code and store the information, then push a second button to repeat that code.
Joe Shmoe to make a storage , you can insert on the code one struct to storage the information , if you want to storage more than one info. But to make the same code to read and send the signal , you will have to merge the two codes that he has provided to us and than set buttons to read and send signals. And talking about the code specifically , you can use the same info on the variable that he used to to send the signal. Because its already contains the full array of pulses inside.
Once again If theres in the text some ugly grammatical error , please dont take in account . I'm not a natural english speaker and still learning . thanks a lot!!
All right?
I saw your video. Congratulations.
I could not control my air conditioning Electrolux brand. Can you help me? How did you capture and send the code? Which library? thank you
Filipe. I'm from Brazil
I like your tutorial. I am new to Arduino and I wanted to get your input on the project I have. I have an IR curtain drapery that is controlled with a remote. What I would like to do is to control it ( open and close the curtain) with my Arduino. I have an Arduino Yun, which is wireless. And I believe i am able to control it from anywhere via the browser. I want to be able to open the curtain and close the curtain. Any suggestions on how I can go about doing this? Your input would be greatly appreciated. I am going to attempt this with this tutorial once I get home
If the curtain is controlled via infrared remote, then you should be able to do it the same way you see in the video. It's the same concept but with a different device.
Rick Osgood cool thanks for the quick response. I'll let you know how it turns out
I type POWER and nothing happens. I added pinmode output into setup, again nothing happens. Even sending signal does not appear on serial monitor.
Same, found anything?
Great video but even at 720p that resolution made everything super small. lol
Hi. Could you make me a circuit that can store several infrared codes and send them in sequence when I press a button? How much would it cost? Thank you
That's not hardware, it's software and i am in the middle of building one my self.
Hi i want this to store multiple buttons like volume up and down etc. have you had any luck?
hello, can i use an arduino nano for this project?
I did it with arduino nano
Clone any Remote control with Arduino Nano
ruclips.net/video/W3sIW7VfsLo/видео.html
error with db on ur site
Hi Rick,
Do you think it's possible to do it with cars? I have an old Corolla with an IR keyfob that recently broke. It would be easier just to use my phone(has an IR blaster) to open and close the car. I would clone the signal from my keyfob. Question is, how easy it is to decode car IR signals.
Thanks for the answer!
I have zero experience with car IR fobs. I would hope that they have some security mechanism in place to prevent this sort of thing, otherwise it would be pretty simple for someone to be able to unlock your car. If I were doing this, I would start by recording the signal and just looking at the waveform. Record it several times over an hour or so. See if the signal changes. If it always looks exactly the same, then chances are you can just copy that signal. If it changes every time, or every minute or hour, etc... then it probably has some security mechanism in place that would prevent you from being able to copy the signal.
Rick Osgood Thanks for the quick answer! The only security mechanism I heard is that it sends different signals every time. On the other hand I think this security measure is not present in my car because I replaced once the battery in the fob and nothing happened. What setup do you require to capture signals? The Uno R3 is a bit of an overkill for such a simple task I guess?
It might still be present in your car even though the battery was replaced. It could have some kind of built in memory. It really depends on how it works.
As for recording the signals to analyze them, a logic analyzer might be best. Those can be expensive, though. I'm not sure the Uno with the adafruit script is the best way to go. You really want to see the actual waveform I would think. Just getting the numbers timing might not work well since the timing could be just slightly off each time and look totally different to you.
Something you might be able to do is hook up an IR receiver module to a microphone input jack on a computer. Then use a free program like Audacity to record the signals as audio. If you then zoom into the "sound" that was recorded, you can probably see the actual waveform. You can record several tracks and compare them all. In order for this to work, you might need to amplify the signal before it goes into your computer, otherwise it might be too weak, or "quiet", to show up. That might be the least expensive option.
Rick Osgood Thanks, never though I could use the mic input for IR purposes. Where do you get such module?
The IR receiver in this kit might work: www.radioshack.com/product/index.jsp?productId=2049723
That one would likely show you the 38khz signal as well. You could also try something like this: www.radioshack.com/product/index.jsp?productId=2049727
That one would demodulate the 38khz for you and give a simpler output signal, but it might be more complicated to figure out how to hook it up to your computer.
is it posible to do this with a button not a timer?
Is my eye still considered naked if I wear contacts?
+J_laubster if you are wearing something are you still naked?
if it is a watch yes or shoes yes
The link doesn't work.
Download here: halckemy.s3.amazonaws.com/uploads/document/file/1339/ArduinoInfraredCloner.zip
Good Idea but doesnt work. You have to modify the code
How do i need to modify it?
please share the code
Download here: halckemy.s3.amazonaws.com/uploads/document/file/1339/ArduinoInfraredCloner.zip
can u re up load the code to guthub where it belongs along with pinout instructions thanks! also must work for esp 8266 mcu
can a photocell do the job?
code not found
Your Download Link is broken. can you please fix it?
+1, also trying to reproduice this project.
create.arduino.cc/projecthub/richardosgood/clone-infrared-signals-with-arduino-3a3cb2
@@pedroalves2997 thx 😉
Download the code: www.richardosgood.com/blog
Not Found
Sorry, but the page you were trying to view does not exist.
It looks like this was the result of either:
a mistyped address
an out-of-date link
Search for:
Search
Couldn't this just be done with a timed plug?
you can. by using relay as a switch to the plug, and the relay activated by the arduino.
Doesn't need to be that complicated. I wanted to do this for my room as well so i just bought a normal cheap heater and plugged it into a 7 day timer that turns on the heater according to my timetable.
THE LED IS NOT POWERING WHEN I SEND SERIAL COMMENT POWERHELP!!
Thanx for ur help I had resolved it long back ....
Thank you for this comment. I was bashing my head to the desk trying to figure out why it wasn't working.
I need your help same problem, if I type "POWER" nothing happen, not even in the monitor
Hey i am trying on pin 13 but no output was given
what could be the problem?
link dead!
+川崎春と read other responses, OP has provided a new link that still works
link down
Here is my project ,
Clone any Remote control with Arduino Nano
ruclips.net/video/W3sIW7VfsLo/видео.html
that's not a very good way of using arduino. i suggest you to make the scheduler with the arduino without interference of any other computer. that would be a lot more of power saving.
My led wont blink at all
Are you sure you have it hooked up the right way? LEDs will only work when hooked up in one direction. Simple, I know, but sometimes the simple things sneak past us. Also, how are you checking to make sure your LED is blinking? You can't see it with the naked eye alone, you need a digital camera that does not have an IR filter. If you are using a camera already, try checking with a second camera just in case the first one has an IR filter built in.
When i uploaded the "blink an led " code it worked fine but it wont work with this code, i have no idea why
You mean the PlaySignal sketch isn't working?
yes
I have a couple basic questions to start debugging. Are you using a standard Arduino board? Did you definitely plug the positive lead into pin 13 on the Arduino? Have you tried replacing the IR LED with a standard LED to see if it works with a regular LED?
This looks like the one He used.
github.com/adafruit/Raw-IR-decoder-for-Arduino
+Jason Hearne hi, could you please help me out? I just want to turn on my samsung Tv with the Arduino, I already decode the signal wich will be "4105841032" or "F4BA2988" this is all I get from the ir receiver, I appreciated your time thank you!
I've been unable to get the IR signal decipherable. I haven't had a lot of time on this. I'm hoping holidays downtime.
+Jason Hearne thanks anyway i will give it a shot
+Jason Hearne I lost a bunch of stuff on my website unfortunately, but luckily Archive.org copied it. You can still download my scripts here: web.archive.org/web/20150429181524/www.richardosgood.com/blog/wp-content/uploads/2013/11/ArduinoInfraredCloner.zip
nice tutorial but i would have just used a plug timer
This XML file does not appear to have any style information associated with it. The document tree is shown below.
AccessDenied
Access Denied
FXMJCE5WVB2P9NH7
RFWEIT16AvaODlyVpHfdH3hGudwZ49+rtcJHwOMESbh+DhgigDtoLpp3YxT2EmuBJKIf7eJw06Y=
put the code on github and reply with link plz