EEVblog 506:IR arduino How to get code into arduino - Page 1
Forum section: electronics / general

author: Beamin
author_rank: Super Contributor
timestamp: March 21, 2018, 03:47:42 pm
content: So I can't figure out how he gets the code sequence into the Arduino. Does that Salaea logic programhttps://youtu.be/BUvFGTxZBG8?t=18m44stake the code he recorded and put it into the Arduino sketch? How does it do that?I understand the video up to this part.Or did he write out the pattern into the sketch? Wouldn't this mean you would have to use a line of code for each on/off pulse:pin1 on 10mspin1 off 100mspin1 on 5msetc etc That seems the wrong way to do it.

author: rstofer
author_rank: Super Contributor
timestamp: March 21, 2018, 05:46:45 pm
content: https://gist.github.com/EEVblog/6206934He hardwired a single 32 bit code - defined at line 14.This is just the bare guts of a general purpose program. Many more codes would need to be decoded somewhere and included into the Arduino sketch.

author: Beamin
author_rank: Super Contributor
timestamp: March 21, 2018, 09:38:17 pm
content: Quote from: rstofer on March 21, 2018, 05:46:45 pmSo he figured out that model remote and found sample code? So then how did the first person get the sequence? Did they sit there with an IR detector and scope and count each pulse? Is there a way to record and play back like on those 3 in one "learning " remote controls through the scope?The remote that come with the generic Arduino is amazingly bright. I hooked a sensor to a simple transistor circuit and could get the LED to blink with the remote bouncing off two walls at a distance of 50' or so. Are our eyes just not that sensitive to color LED's or are they just not that bright?

author: rstofer
author_rank: Super Contributor
timestamp: March 22, 2018, 02:30:31 pm
content: Quote from: Beamin on March 21, 2018, 09:38:17 pmOnce you know which 'family' of IR remote you have, it is pretty easy to buy anIR receiverand hook it up to a uC (Arduino will probably work well) and trap the codes versus button pushes. This type of thing has been done for quite a long time and Google will probably turn up a lot of projects.Like this:https://learn.adafruit.com/using-an-infrared-library/hardware-neededThere are a few different protocols and apparently the Arduino library knows how to detect them.We can't see IR at all. If the transmitting device is truly IR, we won't see it. However, we can use our cell phone cameras to see it - same with other digital cameras.A simple photo sensor is not a good substitute for an IR receiver. Among other things it won't be looking for the 38 kHz carrier.

author: sokoloff
author_rank: Super Contributor
timestamp: March 22, 2018, 04:40:32 pm
content: Here's a short video that walks you through it. I hate videos that "ought" to have a voiceover but don't, but this one at least gives you captions that should allow you to extract codes from an arbitrary remote.

author: Beamin
author_rank: Super Contributor
timestamp: March 24, 2018, 11:05:56 pm
content: Quote from: rstofer on March 22, 2018, 02:30:31 pmIts like a metal box with a metal cross over the sensor bit. About the size of a power transistor but a little smaller. Think it has three leads.

author: rstofer
author_rank: Super Contributor
timestamp: March 25, 2018, 08:43:25 pm
content: Quote from: Beamin on March 24, 2018, 11:05:56 pmThat's not enough info. We would need a part number, picture and link to datasheet.38 khz IR receivers are pretty common and they usually look like a plastic transistorhttps://www.digikey.com/product-detail/en/vishay-semiconductor-opto-division/TSOP38338/751-1388-ND/176819056 kHz IR receivers are also available but read at the link above.https://www.digikey.com/product-detail/en/vishay-semiconductor-opto-division/TSOP4856/TSOP4856-ND/4074483