Finding IR remote output words?

abu1985

Joined Oct 18, 2015
61
I'm calling the output of the remote a "word" because I assume it's a 4 to 8 bits long of a binary number; pressing the power button sends, as an example, 01001001, or something like that.

I'd like to find the output words of a simple IR remote. I've attached a small sketch of how I hooked up to my DSO. I got some waves when I pressed the button on the remote pointed at the receiver, but my scope was kind of wigged out. Is it possible to find the output word with a DSO?

I've found an Arduino sketch that can print the output codes, but I don't have an Arduino. I do have a TI Tiva LaunchPad, but I'm not experienced with the MCU stuff.

Attachments

• 522.5 KB Views: 12

AlbertHall

Joined Jun 4, 2014
9,009
They are not commonly 4 or 8 bits.
You may be able to find the codes here: http://irdb.tk/find/

abu1985

Joined Oct 18, 2015
61

djsfantasi

Joined Apr 11, 2010
5,923
I was going to recommend that same Arduino sketch, until you said you weren’t familiar with the Arduino family.

It is not difficult to start. You need a PC or laptop, a USB cable (USB A TO USB B OR MINI-USB) and an Arduino Uno. The last two items can be found together for as little as $5 (including shipping). The development software (IDE) is free and once you open it and the sketch (a sketch is Arduino-speak for program), connect the cable and one click later, you’ve programmed the Uno. Follow the instructions for connecting the IR receiver and any other miscellaneous components, press a button on the remote and the code will print out in your PC or laptop screen. It can be that simple. And you’ll find many other uses for that$5 MCU.

abu1985

Joined Oct 18, 2015
61
I was going to recommend that same Arduino sketch, until you said you weren’t familiar with the Arduino family.

It is not difficult to start. You need a PC or laptop, a USB cable (USB A TO USB B OR MINI-USB) and an Arduino Uno. The last two items can be found together for as little as $5 (including shipping). The development software (IDE) is free and once you open it and the sketch (a sketch is Arduino-speak for program), connect the cable and one click later, you’ve programmed the Uno. Follow the instructions for connecting the IR receiver and any other miscellaneous components, press a button on the remote and the code will print out in your PC or laptop screen. It can be that simple. And you’ll find many other uses for that$5 MCU.
I have an evaluation board from TI that is kind of the poor mans version of Arduino boards. These boards are programmed in Energia, which is based off of Arduino software. I tried to copy the program over but I had problems with the header files.

Also, the site that Albert linked has some info, and I don't think I'll be able to do what I want to do anyhow. I thought I'd be able to remove the IR receiver from the project PCB I'm trying to hack, and replace the receiver with outputs from my Tiva board, so I'd be able to simply press a button, the Tiva board sets the binary output from the button input. As I've learned in the last 15 minutes, IR remotes send more than just a binary word.

djsfantasi

Joined Apr 11, 2010
5,923
The Arduino is programmed in a variant of C. The header files are included when you download the IDE.

I have no idea what the TI board is (but fairly sure it’s not Arduino compatible). If you have an Arduino sketch, you’ll need an Arduino. As I pointed out, they’re not expensive.

An ATMega assembly program won’t run in a Z80 processor. Why you think an Arduino sketch would run in a Tiva baffles me.

abu1985

Joined Oct 18, 2015
61
The Arduino is programmed in a variant of C. The header files are included when you download the IDE.

I have no idea what the TI board is (but fairly sure it’s not Arduino compatible). If you have an Arduino sketch, you’ll need an Arduino. As I pointed out, they’re not expensive.

An ATMega assembly program won’t run in a Z80 processor. Why you think an Arduino sketch would run in a Tiva baffles me.
By the end of the night, every night, I'm baffled how I even made it through the day. You should see me try and tie my shoes..
The Tiva board is close to the Arduino, done by Texas Instruments. I had no clue about header files at the time, and just simply tied to copy/paste the code over to Energia. Worst that could happen, it doesn't work, which it did not. I will get into the Arduino stuff then. It is not expensive, as you stated.

AlbertHall

Joined Jun 4, 2014
9,009
I will get into the Arduino stuff then
And there is a lot of stuff for arduino online including a forum if you get stuck.

djsfantasi

Joined Apr 11, 2010
5,923
And there is a lot of stuff for arduino online including a forum if you get stuck.
And if you tag me in your posts @djsfantasi , I’ll help you directly. I’m almost an Arduino expert!

(I wrote a run-time module for an AI-based proprietary animatronic control language which runs in an Arduino Mega.)

abu1985

Joined Oct 18, 2015
61
I'll have an Arduino Uno on the way, it will be here Friday. I might post a separate thread for this, but would it be possible to output from the Uno, the code that the IR remote is outputting?

be80be

Joined Jul 5, 2008
1,971
Energia is an open-source electronics prototyping platform started by Robert Wessels in January of 2012 with the goal to bring the Wiring and Arduino framework to the Texas Instruments MSP430 based LaunchPad. The Energia IDE is cross platform and supported on Mac OS, Windows, and Linux. Energia uses the mspgcc compiler by Peter Bigot and is based on the Wiring and Arduino framework. Energia includes an integrated development environment (IDE) that has it’s foundation in the Processing IDE (Processing→Wiring→Arduino→Energia). Energia is also a portable framework/abstraction layer that can be used in other popular IDEs. Utilize a web browser based environment with Texas Instruments CCS Cloud at dev.ti.com or TI’s powerfull CCS Desktop IDE.

djsfantasi

Joined Apr 11, 2010
5,923
I'll have an Arduino Uno on the way, it will be here Friday. I might post a separate thread for this, but would it be possible to output from the Uno, the code that the IR remote is outputting?
Yes! When connected to your laptop with the USB cable, when you write to the built-in serial device, the IDE has a serial monitor which displays what you print (using Serial.print() or Serial.println()).

So using functions from the IR library to read the output of the remote control and writing the result to the built-in serial port, you can interpret the results.

Every Arduino library comes with sample sketches that run out of the box. Look for “samples” in the drop-down menu if the IDE.

be80be

Joined Jul 5, 2008
1,971
You don't have to wait till Friday Energia comes with iR dump if it didn't work you did something wrong .

This code should work on your board you just need to add it with this I took you a pic below code.

Code:
#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
void dump(void *v) {
decode_results *results = (decode_results *)v;
//void dump(decode_results *results) {
int count = results->rawlen;
if (results->decode_type == UNKNOWN) {
Serial.println("Could not decode message");
}
else {
if (results->decode_type == NEC) {
Serial.print("Decoded NEC: ");
}
else if (results->decode_type == SONY) {
Serial.print("Decoded SONY: ");
}
else if (results->decode_type == RC5) {
Serial.print("Decoded RC5: ");
}
else if (results->decode_type == RC6) {
Serial.print("Decoded RC6: ");
}
Serial.print(results->value, HEX);
Serial.print(" (");
Serial.print(results->bits, DEC);
Serial.println(" bits)");
}
Serial.print("Raw (");
Serial.print(count, DEC);
Serial.print("): ");

for (int i = 0; i < count; i++) {
if ((i % 2) == 1) {
Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
}
else {
Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
}
Serial.print(" ");
}
Serial.println("");
}

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
dump(&results);
irrecv.resume(); // Receive the next value
}
}

DNA Robotics

Joined Jun 13, 2014
522

abu1985

Joined Oct 18, 2015
61
You don't have to wait till Friday Energia comes with iR dump if it didn't work you did something wrong .

This code should work on your board you just need to add it with this I took you a pic below code.
Thank you for the assistance! Unfortunately Energia won't compile for any board on my Mac. I get an error "bad CPU type in executable". Evidently, the IDE has not been updated for MacOS 10.15, which is what I'm running. Energia ran fine on OS X 10.14. I'll have to dig out my old windows machine and try with that.

be80be

Joined Jul 5, 2008
1,971
I used Energia a bit it works fine on windows and linux can't say about mac . It's not bad and it is really about the same as arduino

If you can use it you can use arduino ide no problem MAC maybe a problem I hear drivers not working sometimes.

Joined Apr 16, 2011
386
Does your scope allow export to USB drive?
If so, attach the trace file here, and I or other forum members might tell you what the format is..... or may come back with more questions...

.... or wait for Arduino to arrive and do the work for you....

abu1985

Joined Oct 18, 2015
61
@be80be I got Energia working... I get many errors when compiling. Were you able to compile? See attached.

Attachments

• 303.8 KB Views: 7

be80be

Joined Jul 5, 2008
1,971
What code are you using the one I posted or something else
The one I posted works fine on my Launchpad

Last edited: