Want to Preserve a Treasure before it is lost

An IRWidget is an instrument used to analyze carrier-based PWM signals of the type where an infrared carrier is gated on and off with precise timing to encode addresses and commands. Better than 90% of all infrared remote controls use some variant of this system. A remote's infrared LED is driven in bursts at a frequency typically in the range of 30KHz to 60KHz. With some protocols the data "1"s and "0"s are encoded by the length of carrier ON bursts, with constant length OFF periods between bursts. With others it is just the oposite. Still others use completely different encoding schemes.

When a user clicks on the CAPTURE button on his PC screen the PC sends a USB signal to the IRWidget telling it to start looking for infrared pulses (with a 6 seconds time-out for the first pulse) and another signal later when to stop looking. The Widget's sensor sees each individual LED pulse in a carrier burst and counts them, starting with the first pulse seen at the beginning of a remote signal. Every 100 uS the Widget transmits serially to the PC a single byte containing the hex value of the least significant 8 bits of the carrier pulse count. At a speed of 115.2K baud, transmission of a single byte (START bit, 8 DATA bits, and 1 STOP bit) takes less than 100 uS (actually 86.8 uS), so the Widget has no problem keeping up with very long captures that can last for thousands of bytes (tenths of seconds). In summary, each byte sent to the PC has a value N larger than the previous byte, where N = the number of IR LED pulses detected during the last 100 uS interval. During OFF times between carrier bursts the byte values obviously stop incrementing (N = 0). To avoid missing the leading edge of a pulse the counter is never cleared while capturing a signal.

Here's an example showing the bytes sent to the PC from the Widget while capturing a remote signal that happened to be Sony12 protocol.

00 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D
41 45 49 4D 51 55 59 5D 60 60 60 60 60 60 61 65
69 6D 71 75 79 7D 81 85 89 8D 90 90 90 90 90 90
91 95 99 9D A1 A5 A8 A8 A8 A8 A8 A8 A9 AD B1 B5
B9 BD C1 C5 C9 CD D1 D5 D8 D8 D8 D8 D8 D8 D9 DD
E1 E5 E9 ED F0 F0 F0 F0 F0 F0 F1 F5 F9 FD 01 05
09 0D 11 15 19 1D 20 20 20 20 20 20 21 25 29 2D
31 35 38 38 38 38 38 38 39 3D 41 45 49 4D 50 50
50 50 50 50 51 55 59 5D 61 65 69 6D 71 75 79 7D
80 80 80 80 80 80 81 85 89 8D 91 95 98 98 98 98
98 98 99 9D A1 A5 A9 AD B0 B0 B0 B0 B0 B0 B1 B5
B9 BD C1 C5 C8 C8 C8 C8 C8 C8 C9 CD D1 D5 D9 DD
E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0
E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0
E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0
E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0
E0 E0 E0 E0 E0 E0 E0 .....

For the Widget, that's all there is to it ! That string of data is all the PC app needs to calculate the carrier frequency, the ON time of each carrier burst, and the OFF time between bursts. It then searches through its data files to identify the signal protocol and coding, and almost instantly provides a picture of the waveform complete with all timing in microseconds. The picture can be saved, zoomed in or out, exported in various formats, etc. There's enough information in the picture to completely reproduce the waveform. You never actually see the raw data transmitted from the IRWidget.

I was part of the JP1 Forum team that developed and sold hardware for the IRWidget a dozen years ago. I've reached the age of 92, and as I prepare for the inevitable I want to preserve this incredibly wonderful tool by publishing an article that details how any semi-skilled hobbyist can build an IRWidget using less than $12 in parts and without special tools or experience handling small surface mount components. I believe an Arduino NANO is the ideal candidate for this task. It is small and inexpensive. It has more than enough speed, more than enough I/O and memory, and built-in USB communications. The only technical part of the project the hobbyist will be stuck with is downloading the Arduino IDE and using it to upload the sketch into the NANO.

I don't have the skill and ability to convert the present program running in a PIC12F629 to an Arduino sketch for this project, but there are many ways I expect to help. I can provide a detailed description of the way an IRWidget collects data and sends it to a Windows PC in real time without it being corrupted by Windows activity. The Windows app is a freeware download. I can provide that and an IRWidget for you to use with it. I can provide Asm source and hex files for the PIC12F629 program in case it is of any help in porting everything over to the NANO.

This is a project that is challenging (but do-able) as well as fun. I plan to publish an illustrated article in Circuit Cellar or Nuts and Volts magazine. I will give complete credit in the article to whomever helps me by writing the firmware, and you can be sure you have made a lot of people very happy. I can't afford to pay for this help, but I do think it would be fair to share 50% of any renumeration paid to me by the publisher. I was paid $600 for the last article I published two years ago

Check out the IR libraries. I believe some of them have a similar functionality available.

I think this should be moved to "Jobs and Paid Comsultanse" category

1 Like

Are those two really still around? I still have the CD-ROM of CC #1-#30 that I bought after I ran out of room to store boxes of magazines.

N&V was the first magazine I was ever published in, so long ago!

Is Steve still alive?

Want to bet?

I don't know. I used to have years of Circuit Cellar magazines because my first job advertised in it and we got a free subscription as a result. But I threw those out over 10 years ago because I got tired of moving them around. I haven't visited their website in years.

1 Like

Same here with the paper issues. Since my question I did a little Internet search and it turns out the magazine and MicroMint are still going strong. I bought one of his basic on a chip C51 chips when it came out. Looks like Steve is still kicking too.

Please ask a moderator to move this.

Sounds like porting something similar to:
IR protocol analyzer (ostan.cz)
completely to an Arduino?

PC application code:
IR protocol analyzer (ostan.cz)

So, your idea if I understand is to take a microprocessor version for PIC12F629 and put it into Arduino ecosystem? Original source in C or assembler?

I seem to remember using this 10+ years ago for an Atmega2560 project... still have the source on this W11 tablet.

/*
  ☺  Original code implemented by pmalmsten, David Cuartielles:
      http://arduino.cc/forum/index.php/topic,17965.0.html
  ☺  Second adaptation by Sparkfun
      https://www.sparkfun.com/products/10783
  ☺  Third (this) adaptation by M. Burnette (Ray Burne) on 20121230
  
Sparkfun Note: It's come to our attention that on some (if not most) models of TV, 
the channel buttons on this remote will act opposite to the way they're marked. 
Channel up changes the channel down and vice versa. If you're using this remote 
with your own embedded application, this shouldn't affect anything.

*/

/*
  IR remote control (Sony) detection for Arduino, M. Burnette
  Binary sketch size: 3,642 bytes (of a 32,256 byte maximum)
  
  ☺  20121230 MRB modifications to adapt to numeric input, avoid dupes,
      and to generally "behave" consistently
  ☺  Used with Electronic Goldmine IR detector MIM 5383H4
      http://www.goldmine-elec-products.com/prodinfo.asp?number=G16737
  ☺  IR detector:
      Pin 1: To pin 2 on Arduino
      Pin 2: GND
      Pin 3: 5V through 33 Ohm resistor
  
  ☺  This is based on pmalmsten's code found on the Arduino forum from 2007:
      http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1176098434/0

*/

int irPin     = 2;       //Sensor pin 1 wired to Arduino's pin 2
int statLED   = 13;      //Toggle the status LED every time Power is pressed
int start_bit = 2200;    //Start bit threshold (Microseconds)
int bin_1     = 1000;    //Binary 1 threshold (Microseconds)
int bin_0     = 400;     //Binary 0 threshold (Microseconds)

void setup() {
  pinMode(statLED, OUTPUT);
  digitalWrite(statLED, LOW);

  pinMode(irPin, INPUT);

  Serial.begin(9600);
  Serial.println("IR/Serial Initialized: ");
}

void loop() {
  int key = getIRKey();   //Fetch the key
  
  if(key != 0)            //Ignore keys that are zero
  {
    switch(key)
    {
      case 128: Serial.println("1"); break;
      case 129: Serial.println("2"); break;
      case 130: Serial.println("3"); break;
      case 131: Serial.println("4"); break;
      case 132: Serial.println("5"); break;
      case 133: Serial.println("6"); break;
      case 134: Serial.println("7"); break;
      case 135: Serial.println("8"); break;
      case 136: Serial.println("9"); break;
      case 137: Serial.println("0"); break;
      
      case 144: Serial.println("CH Up"); break;
      case 145: Serial.println("CH Down"); break;
      case 146: Serial.println("VOL Right"); break;
      case 147: Serial.println("VOL Left"); break;
      case 148: Serial.println("Mute"); break;
      case 165: Serial.println("AV/TV"); break;
      case 149: Serial.println("Power");
        //This toggles the statLED every time power button is hit
        if(digitalRead(statLED) != 1)
          digitalWrite(statLED, HIGH);
        else
          digitalWrite(statLED, LOW);
        break;

      //default: Serial.println(key); // for inspection of keycode
    }

    delay(500);    // avoid double key logging (adjustable)
  }
}

int getIRKey() {
  int data[12];
  int i;

  while(pulseIn(irPin, LOW) < start_bit); //Wait for a start bit
  
  for(i = 0 ; i < 11 ; i++)
    data[i] = pulseIn(irPin, LOW);      //Start measuring bits, I only want low pulses
  
  for(i = 0 ; i < 11 ; i++)             //Parse them
  {	    
    if(data[i] > bin_1)                 //is it a 1?
      data[i] = 1;
    else if(data[i] > bin_0)            //is it a 0?
      data[i] = 0;
    else
      return -1;                        //Flag the data as invalid; I don't know what it is! Return -1 on invalid data
  }

  int result = 0;
  for(i = 0 ; i < 11 ; i++)             //Convert data bits to integer
    if(data[i] == 1) result |= (1<<i);

  return result;                        //Return key number
} 




Sounds worthwhile, and I can help, but ... are you sure that this hasn't already been done? I find a bunch of "IRWidget" projects around, including stuff already included in the Arduino IRRemote libraries (I can't immediately tell if they're compatible), as well as this project that specifically refernces IR Widget - Consumer infrared remote control capture and visualization (which is you, right?)

It seems to have been expanded to include a lot more functionality, is obscured in C++ness, and I'm not sure what's needed to interoperate with your windows-side "scope." (There's a long history of credits there, but it doesn't seem to go all the way back to your project...)

Looking at you PIC asm code, it seems pretty straightforward. The main worrisome bit is using the Analog Comparator with a 200mV threshold - I'm pretty sure that the AVR has relatively few (one?) choices for the "other side" of the comparator. (OTOH, perhaps the ADC is fast enough to be used instead.)

westfw,

The link "IR Widget - Consumer infrared remote control capture and visualization" is what started it all. That's the original disclosure by the brilliant inventor, Kevin Timmerman, of the IRWidget and its companion Windows software "IRScope", which was later taken over by another skilled programmer, Graham Dixon, of Cambridge University. In spite of all the references to IRWidget, I have never seen anyone talk about a true IRWidget that works with IRScope. There have been a number of devices claiming to capture infrared signals but they invariably work with demodulated waveforms and most use demodulator receiver chips with a 38 KHz center frequency, so they don't measure true carrier frequency. Even the schematic of the IRWidget I have been selling for the past dozen years has never been published. I could write a DIY article that is based on the PIC chip. It needs only two ICs costing about $5 total, and less than $5 of other materials. But (1) The ICs are surface mount with tiny leads on 0.025" centers -- bad for semi-skilled hobbyists who lack the tools, experience, or skill with these components. (2) A printed circuit board is almost a necessity with SM parts -- another cost and procurement hurdle that would discourage a hobbyist. (3) Dumping a hex file into a PIC chip is the final nail-in-the-coffin. Even I, who many years ago worked with a PICkit and MPLAB, have completely forgotten how to use those tools, and any kind of PIC programmer costs more than the IRWidget we are trying to develop.

I wish we could discuss this by phone or personal email. Send me your email address or phone number via tomytyler@comcast.net. That's an obsolete address that gets to me but will keep your information from being broadcast. I'll make you a solemn promise: If we discuss it and you decide you don't want to help because you don't have time, or you don't think it is a worthy project, or maybe you just don't like the sound of my voice -- whatever... one word and you'll never hear from me again.

Oldokasional

the schematic of the IRWidget I have been selling for the past dozen years has never been published

The spirit of this forum favours open source. So if you want to capitalize on it, and collaborate with forum members privately, this is not the place to do it.

Also I think you've missed the boat, concerning interest in projects like this. I visited a surplus store today, I was chatting with the owner, he says "Nobody is building anything any more. I used to sell quite a few electronic kits per week. Now, maybe one a year".

The best, and most altruistic way to "Preserve a Treasure" is to publish the whole thing in the public domain. In fact, paid publication of a device like this in the magazines you mentioned, is far from guaranteed. But if you can't update or refresh it yourself, then you really have a problem.

1 Like

I did look briefly at your IRwidget as a consequence of another activity you were pursuing at one time, that is attempting to reverse engineer a Learning IR remote control, the Chunghop L181. As I have mentioned previously, I did succeed in building a replica of this based on an ATMega328P chip. That was quite a feat because (a) the Chunghop L181 used an Application Specific Integrated Circuit with special IR features and the ATMega328P is simply a general purpose microcontroller and (b) the remote control works at the carrier frequency level, that is it does not offload processing to an IR demodulating receiver of the TSOP variety, simply uses a photodiode (equivalent). The project is, incidentally, published here: Arduino IR Learning Remote Control

Anyway, I was also interested in using the PC scope part which was supplied with your IRwidget but the interface was not published (or I could not find a description of it) so, instead of another reverse engineering task, I simply used a logic analyser instead. Obviously, this was not quite as convenient because the scope makes very nice compact and annotated graphs, but was usable.

I can understand you wanting to preserve your development and suggest you start by publishing the schematic for the IR widget, the code and a description including the interface to the PC scope software.

The problem may come, however, that the scope may also require updating depending on future versions of Windows and that requires another skill set.

Interesting that you had worked on reverse engineering the Chunghop L181. I had begged all over for help doing that, but when nobody spoke up I went ahead and published an article in Circuit Cellar anyway, using the circuit board taken from an L181. (see it HERE:

That was my first Arduino NANO project, and I wrote the sketch myself. I needed a device like the L181 to learn and replicate infrared signals, so my article shows how to just take the little 1" x 2" circuit board out of the learner remote and let the NANO use that when it needs a signal.

I have no motivation to preserve the present PIC design because it's not suited to SEMI-SKILLED HOBBYISTs for the reasons I have stated. I want to publish (and therefore put into the public domain) an Arduino design, which I don't have. As for the IRScope software, It is being aggressively and competently maintained by the gentleman I mentioned previously. Performance bugs as such were all taken care of years ago, and maintenance involves mostly dealing with special requirements of new model remote controls and other infrared consumer applications from time to time to expand its repertoire.

Are you sure you don't want to help me with this project?

Well, my publication of a replica Chunghop L181 IR learning design came about 10 months after the publication of your article in Circuit Cellar so it is clear anyway I could not match your time scales there. I did not really even know I would ever finish it - it was a large and complex project - but was nevertheless very interesting and challenging.

I, incidentally, have another solution to the problem your Circuit Cellar article addresses, namely the elimination of TV commercials, and that is not to watch TV at all !

I did not say that, but you have already had at least one strong offer of assistance (@westfw). I don't know PIC assembler but, having said that, capturing an IR data stream and rolling it up into a protocol for transmission to the PC presentation application (IRScope) can't be too hard providing there is a description of it all including the interfaces (and, as I said, schematics and code). I'd guess that the ATMega328P based Nano is a good choice as target platform and has features like input capture for precision timings of waveforms. Anyway, it looks better than the PIC12F629 and, once it is in AVR code, can be relatively easily ported to other similar microcontrollers.

Just to be clear, it is this one ? : JP1 Remotes :: View topic - TOMMY TYLER'S IR WIDGET STORE

Did you get any further with this ?
I could imagine that you are stuck with using an FTDI USB chip since the Scope software, at least a version I could find, appears to interface to a Windows FTDI driver. Creating an Arduino based version of the Widget should be reasonably straight forward and may even allow higher frequency signals to be measured. However, the limit would probably anyway be the performance of the IR detector.

No. No further word from anyone. Let me send you a bunch of stuff, a working IRWidget and all the source and background material I have. If that doesn't hook you on getting involved I promise not to have any hard feelings. Just out of curiosity, does anyone still manufacture a 6V6 tube, and are you one of the fanatics that swear tube audio amplifiers sound better than solid state?

Tommy

I suggest sending your personal email forward via a private message and then deleting it from the public message. You are inviting a boatload of spam.

You can edit the post to delete your Email address. In fact, you should already have an answer in that mail box.

As for the tube/valve questions:

  1. There are stacks of new 6V6GT tubes available from music stores, Ebay etc. These are used, for example, in guitar amplifiers. These are probably made in China now and can, I guess, be ordered with any labelling and logos the buyer requests.

  2. No, I am not a fanatic but my first electronics project, a 4 watt amplifier, used one of these tubes, hence my screen name.