# I want to use logic analyzer to learn remote control IR codes

I've just ordered this generic logic analyzer (didn't get it yet).

Does the specs (channels/speed/accuracy) of such a cheap analyzer can be used to analyze IR remote control code sequences so I'll be able to send them later from a device I'll build?

If such an analyzer it enough to achieve this mission, can one guide me please what a circuit I have to build to be able to catch the signals from the IR RC led?

(I have an TL1838 38Khz IR sensor, but don't really know how to include it in a circuit).

The best way for me, I think, will be to see the signal using the logic analyzer (it it capable of it) from a simple electronics circuit, without the need of Arduino connection and programming.

So (and this is an Edit after reading some of the great and informative answers and comments) - A receiver circuit should be simple to build and connect the analyzer into it? What about software to 'understand' the IR codes?

• You have the IR sensor but you're not going to tell us what the part number is? Please edit your question to include the datasheet link. There are usually some sample circuits in the datasheet so check those out and if there is a point you don't understand then that's what should be in your question. Dec 31 '19 at 19:04
• Does this answer your question? Sequence multiple IR remote commands (button presses) Dec 31 '19 at 19:12
• That should work with sigrok software and maybe some custom python. Build whatever circuit from the receiver data sheet produces a logic output, it may show a pull up resistor needed. You are most likely to find an actual tutorial for doing this with an Arduino instead. Dec 31 '19 at 19:31
• sbprojects.com/knowledge/ir ir is pretty easy. an ir receiver like that removes the carrier and leaves you with the high and low periods that are filled by the carrier. your first interest is measuring the pulses to determine ones from zeros then decode that. the codes that have sync patterns up front are easier. If all you want to do is blast out ir, then you dont necessarily need to receive although you wont know what codes/numbers your specific device is looking for (although I have seen tables elsewhere on this). Jan 1 '20 at 11:54
• receivers like that are also trivial, vcc, gnd and signal the signal is an input into an mcu or cpld or fpga. Jan 1 '20 at 11:57

I did this as a class project in college. The remote LED frequency is very low, and codes are only a few bytes, so almost any analyzer will work.

If such an analyzer it enough to achieve this mission, can one guide me please what a circuit I have to build to be able to catch the signals from the IR RC led?

You don't need to build anything. Just open the remote and put the analyzer leads on the LED pins directly. Start the analyzer and then push each button. Once you have a few button traces you can look up which protocol your remote uses or just keep going until you have the entire list of command codes.

• Putting the logic analyzer on the transmitter LED makes it harder because you will then see the modulated IR, that is with the 38kHz carrier, which uses up more state transitions/memory in the LA. Better to build the receiver circuit because TL1838 provides a demodulated output so you don’t see the 38kHz, just the logical bitstream. Dec 31 '19 at 20:33
• That is a Saleae Logic clone. It can sample up to 24 MHz, the IR carrier is of no concern here. But still I'd prefer connecting to the receiver module, the transmitter IR LED voltage may not be enough to sense with logic analyzer. Dec 31 '19 at 20:39

So (and this is an Edit after reading some of the great and informative answers and comments) - A receiver circuit should be simple to build and connect the analyzer into it? What about software to 'understand' the IR codes?

https://www.sbprojects.net/knowledge/ir/

My preference is to burn an mcu for this rather than try to use interrupts but either way you need to find the pattern and decode it and there will be noise in the room other remote commands, etc.

Once you get this powered and are examining the signal with a scope or your logic analyzer, is your receiver inverted or not. The signal is AM radio like but square. Ones lets say are a burst of the carrier frequency, receivers like this will just give you a pulse roughly the duration of that burst, but if inverted that might be at gnd level not vcc. so figure that out. Then look at the NEC protocol for example a number of them are similar with different sized sync patterns. For NEC this says that the sync pattern is 9ms followed by 4.5ms, then it goes into 32 bit patterns. The signal level that is the same as the 9ms (lets assume high or vcc) is a fixed length, the space between is what varies and that tells you a zero from a one. this pattern ends with a short pulse, very clean pattern. If you have a programmable remote you can cycle through till you find one that matches or is similar. Sony SIRC is similar, has a sync pattern you can search for but the gaps are fixed and the pulses vary. Also very easy to decode for a first time project.

The software or logic if you use a cpld/fpga, would in these cases look for that long sync pulse, if you made a program to only do that, and blink an led or output something on the uart whatever to indicate you found that pulse it should line up with pressing the button on the remote. understand as you hold the button it repeats (and the repeat pattern is sometimes not just the same pattern over and over again some schemes have a separate repeat pattern from the initial code). then you look for the gap after the sync pattern and so on.

If you look at philips recs80 there might not be a simple sync pattern to search for out of the noise, but instead you have to go right into decoding and hope you received the whole thing. Some patterns have a way to confirm you got the pattern (the second half is the code inverted for example) some dont other than it matches one of the values you were looking for. Worse look at philips rc5, that is good and bad that encoding is biphase-L sometimes just called biphase sometimes called manchester, you are insured that the data is either a half bit cell or a whole bit cell. so you are looking for pulses and gaps of those two lengths, and then you have to sort out the code. If rc5 always starts with a one, then you are either looking for half bit cell or whole bit cell length pulse depending on whether the code starts with 11... or 10... with pencil and paper you can figure out if this gap/pulse was long and the prior was blah then this bit was X (one or zero). or perhaps better save the data as half bit cells starting with a 01 for the leading one. then look at ever other the second half bit cell is the data value 011001... x1x0x1 is 101.