IR Widget Consumer infrared remote control capture and visualization

11,063

Circuit Image

The IR Widget operates in a manner that ensures compatibility with modern multitasking operating systems. It can determine the carrier frequency and demodulate the carrier in both the digital and analog domains. The captured information can be utilized to view, recognize, or reproduce the signal. The hardware is designed to be simple and cost-effective. A PIC12F629 was utilized for development, although any PIC that employs the 12 or 14-bit instruction set could be applicable. The conventional approach to low-cost IR capture generally involves an IR detector or demodulator module connected to a serial or parallel port. This method can function effectively when the CPU is dedicated to servicing the port. However, it often performs inadequately within a preemptive multitasking operating system, as the OS continuously manages hardware interrupts even during idle periods, leading to constant interruptions in IR capture. Disabling hardware interrupt handling is risky and may be restricted by the OS. High CPU usage typically occurs when polling is employed. Utilizing the hardware interrupt capability of the port can significantly decrease CPU load, but interrupt latency may result in inaccuracies. Increasing thread priority may provide some improvement, though outcomes can vary. Parallel and serial ports are becoming increasingly rare, and USB adapters are not compatible with these basic circuits. Numerous DIY and commercial products utilize a microcontroller to process the IR signal, primarily designed for remote control applications rather than research. Many of these devices only include an IR demodulator, preventing them from determining the carrier frequency or reporting precise timing. The data transmitted to the host computer may be formatted in a way that does not facilitate the reconstruction of the actual IR signal. The acquisition duration is often restricted to a single key press of the remote, making the capture of macros challenging or impossible. The IR Widget addresses these issues by employing a microcontroller to process the IR signal without interruptions and transmit the data to the PC through standard asynchronous serial transmission. This enables the OS to manage the serial port using standard drivers and supports the use of USB to serial converters. Simple circuits constructed with 74HC series components can also be implemented. Data is transmitted in real time and formatted to allow for reasonably accurate reconstruction of the actual IR signal received. An infrared detector module is utilized to enable the microcontroller to detect every infrared pulse at close range, providing maximum detail and accuracy. An optional infrared demodulator module can be employed for long-range reception with less detail. Infrared remotes typically operate at a carrier frequency ranging from 30 to 60 kHz, with the carrier being fully on and fully off. Carrier on durations generally vary from 400 microseconds to several milliseconds, while carrier off durations can range from 400 microseconds to over 100 milliseconds. The IR Widget requires minimum on and off durations of 300 microseconds to ensure at least three consecutive 100 microsecond sampling periods during both states. A short gate time is necessary to measure the frequency of a pulsed carrier, as a standard frequency counter with a 1-second gate will not yield accurate readings. While the frequency could be determined from the period of one cycle, this would necessitate a high-resolution measurement for precision. The IR Widget counts the number of infrared pulses occurring within a 100 microsecond period, with the count transmitted to the PC at 115200 bps. This process repeats every 100 microseconds, effectively functioning as a frequency counter with a 100 microsecond gate time. A single sample period cannot provide a precise frequency measurement; thus, multiple sample periods are employed for greater precision. All non-zero counts are summed, excluding the first and last in a burst.

The IR Widget’s design incorporates a microcontroller, specifically selected for its ability to handle rapid data processing without the interruptions typical of multitasking environments. The use of the PIC12F629 or similar microcontrollers allows for efficient operation, as these devices can execute the necessary logic for IR signal processing while maintaining a low cost and simplicity in design.

The IR detector module serves as the primary interface for capturing infrared signals, ensuring that even brief pulses are detected accurately. For applications requiring longer-range detection, the optional infrared demodulator module can be integrated into the system, balancing the need for sensitivity with operational range.

Data transmission from the IR Widget to the PC employs standard asynchronous serial communication, facilitating compatibility with various operating systems and reducing the complexity associated with custom drivers. The choice of a 115200 bps transmission rate ensures that data is relayed quickly, allowing for real-time monitoring and analysis of captured IR signals.

The architecture of the IR Widget includes a robust method for frequency counting, where the microcontroller samples the incoming infrared pulses at 100 microsecond intervals. This approach not only enhances the precision of frequency measurements but also allows the system to effectively reconstruct the original IR signal waveform. The exclusion of the first and last counts in a burst is a deliberate design choice aimed at improving the accuracy of frequency determination by mitigating the effects of transient signals.

In summary, the IR Widget represents a sophisticated solution for IR signal capture and analysis, leveraging microcontroller technology to overcome the limitations of traditional IR capture methods. Its design is optimized for both performance and ease of use, making it suitable for a wide range of applications beyond simple remote control functionalities.The IR Widget operates in a way that makes it compatible with modern multitasking operating systems. It is able to determine the carrier frequency and demodulate the carrier in the digital or analog domain. The captured information can be used to view, recognize or reproduce the signal. The hardware is designed to be as simple and low cost as possible. A PIC12F629 was used for development, but almost any PIC that uses the 12 or 14 bit instruction set could be used. The usual approach to low cost IR capture typically consists of an IR detector or demodulator module connected to a serial or parallel port.

This can work quite well when the CPU is dedicated to servicing the port. It often performs poorly within a preemptive multitasking operating system. The OS is constantly servicing hardware interrupts even when the system is idle, so the IR capture is constantly interrupted. Disabling hardware interrupt handling is dangerous and may be prohibited by the OS. CPU usage is high when polling is used. Using the hardware interrupt capability of the port can greatly reduce CPU load, but interrupt latency may cause inaccurate results.

Boosting thread priority may help, but results vary. Parallel and serial ports are becoming less common, and USB adapters do not work for these simple circuits. There are many DIY and commercial products that use a microcontroller to process the IR signal. These are typically intended for remote control rather than research. Many of them have only an IR demodulator, so they can not determine the carrier frequency or report precise timing.

The data sent to the host computer may be in a format that does not allow reconstruction of the actual literal IR signal. The acquisition duration is often limited to a single key press of the remote, making capture of macros difficult or impossible.

The IR Widget solves these problems by using a microcontroller to process the IR signal without interruption and send the data to the PC using ordinary asynchronous serial transmission. This allows the OS to service the serial port with standard drivers and allows the use of USB to serial converters.

Simple circuits built with 74HC series parts can also be used. The data is sent in real time and is in a format that allows reasonably precise reconstruction of the actual IR signal received. An infrared detector module is used to allow the microcontroller to see every infrared pulse at close range.

This allows for greatest detail and accuracy. An optional infrared demodulator module can also be used to allow for long range reception with less detail. Infrared remotes typically use a carrier frequency of 30 to 60 kHz. The carrier is keyed full on and full off. Carrier on durations typically range from 400 microseconds to several milliseconds. Carrier off durations typically range from 400 microseconds to more than 100 milliseconds. The IR Widget requires minimum on and off durations of 300 microseconds. This ensures that there will be at least 3 consecutive 100 microsecond sample periods during the on and off states.

To measure the frequency of a pulsed carrier, a short gate time is required. An ordinary frequency counter with 1 second gate will not give an accurate reading. The frequency could be determined from the period of one cycle, but this would require a rather high resolution measurement for a precise reading. The IR Widget counts the number of infrared pulses that occur within a 100 microsecond period. The count is sent to the PC at 115200 bps. This repeats every 100 microseconds. This is effectively a frequency counter with a 100 microsecond gate time. A single sample period can not provide a precise frequency measurement. To calculate the carrier frequency with greater precision many sample periods are used. All the non-zero counts are summed excluding the first and last in a burst. As long as the 🔗 External reference