Audio Card Infrared Receiver

 Posted by:   Posted on:   Updated on:  2019-12-07T16:33:18Z

Record and decode infrared remote signals with a simple device that connects to the audio input of the computer. Once recorded, the signals can be reproduced using Android applications.

Looking back at an old post where I described how to view, record and decode infrared remote protocol with no more than an integrated receiver, a few parts and your computer with the right software, I decided to make a PCB for such a circuit. Back then I used the breadboard to quickly connect the required parts. I also made some other tests. There is an inconvenient of a soundcard IR receiver. It requires power to operate, but there's no usable power output through the audio input of the computer. At first, I believed I could use the bias voltage for electret microphones that is present only on microphone input. But the IR receiver requires a minimum of 2.5 V. And my card only supplied 2 V. This voltage output cannot provide enough current to drive a DC-DC converter, therefore I had to find an alternative.

One option is to provide voltage from USB port. I didn't like this. If I'm using the USB port, I could as well use a microcontroller and send IR data over the same USB port without using an additional cable. Obviously, the second option is to use a battery. I used for this circuit a CR2032 cell, but this may not be the best option. The rechargeable type LIR2032 may as well be used.

Audio Card Infrared Receiver

Infrared receiver built on PCB

Why isn't the CR2032 a good power option? Well my IR receiver requires 1.3 mA while doing nothing. I used something with the pin configuration of TSOP33138 (I don't know exactly what type it is because I got it from a device). Anyway, the datasheet for TSOP331xx claims a maximum current requirement of 3 mA. The circuit uses a transistor to invert the output of this receiver. With the resistor values from the schematic, when a signal is detected by the receiver, the transistor is turned on. The current draw raises to about 10 mA. This may not seem much, but for CR2032 it is. Even though this current is required as long as a signal is received, with the limited capacity of about 250 mAh, the battery may discharge quite fast.

Schematic of soundcard infrared receiver

Schematic of soundcard infrared receiver

You could use LIR2032 battery and recharge it every time it is needed. You could replace with a bigger 18650 Li-Ion cell and place everything in an enclosure. The circuit makes use of an ON/OFF switch, so you can completely disconnect the battery from the load and keep it charged.

PCB of soundcard infrared receiver

PCB of soundcard infrared receiver

The circuit fits on a small, single sided PCB of 23 by 69 mm. Making this PCB at home and populating it with parts should be easy. Note that the only way to know when this is powered on is to look if the switch is pressed. After building this device, connect it to the audio input of the computer (either Line In or Microphone In).

Let's get to the software. The purpose is to record IR signals of remote controls. I'll use a tool called NetHome Protocol Analyzer. This is a cross-platform Java application that supports Audio and Serial Port IR receivers. Download archive, extract it and launch analyzer_xx.bat script (if Java is installed, the main window will launch). Go to View menu and choose Settings. In first tab select audio signal source and set 38000 Hz frequency for Pronto. Go to next tab and make sure the correct audio input is selected. From the same View menu choose Decoders. Uncheck all except Pronto and Raw. I didn't get useful results with those decoders (I have no idea what all that names mean; I know the most common protocols are RC-5/RC-6 with Manchester encoding and NEC with mark/space encoding). Anyway, Pronto can be used by LIRC and by irplus Android application, however there is no easy and straightforward way of exporting Protocol Analyzer data to other tools.

Point a remote control towards the device and at least two lines should appear in the main window of the analyzer. There should be Pronto and Raw. Double click on Pronto to get the code for the button you pressed. Double click on Raw to see the signal waveform.

Viewing the IR signal and Pronto code in Protocol Analyzer

Viewing the IR signal and Pronto code in Protocol Analyzer

The Pronto code can be pasted into the converter at to identify the protocol. If you want to create a configuration file for irplus, this is the format:

<device manufacturer="Manuf." model="LCD TV" columns="12" format="PRONTO_HEX" frequency="38028">
<button label="ON/OFF" labelSize="18.0" span="4" backgroundColor="FFC84334">0000 006D 0001 0011 013F 00A1 0014 003C 0014 003C 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 003C 0014 003C 0014 003C 0014 0014 0014 003C 0014 0014 0014 0014 0014 0014 0014 0356</button>
<button label="MENU" labelSize="18.0" span="4">0000 006D 0001 0011 013F 00A1 0014 003C 0014 003C 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 003C 0014 003C 0014 0014 0014 0014 0014 003C 0014 0014 0014 0014 0014 0014 0014 037E</button>

Add a new <button> tag for each button, style it with some basic CSS and paste Pronto code inside this tag. Save the file with .irplus extension, transfer it to Android device and use the import feature in irplus. This is not quite straightforward and easy to do, so I'll be looking into other ways, probably using some hardware with microcontroller and USB interface.


Download the KiCad project (PCB and schematic) for this device here.

1 comment :

  1. This works great.
    Even without formal knowledge of electronics, I'm able to build this and it works great.
    Thank you for the knowledge shared.


Please read the comments policy before publishing your comment.