Transmit & Receive Infrared Signals With Your PC Serial Port using PIC12F508

We no longer manufacture or sell the original Air-Byte IR transceiver, so we’re releasing the code & circuit design here for hobbyists and students looking to build a simple IR transceiver.

Note that the parts used here are not critical. I.E. the NPN darlington transistor driving the infrared LEDs, PNP transistor used for inverting the IR detector output, voltage regulator, LED’s, and most every other component can be replaced by something similar. However, we do have circuit boards and a full parts kit available for those who may want them.


The code or course can easily be modified to work on any PIC microcontroller.

The brain of the Air-Byte transceiver is a tiny 8-pin PIC12F508 microcontroller. Operation is simple. The PIC simply monitors GPIO,0 connected to the PC serial port TX pin #3. When this pin transitions from logic low to logic high, the 12F508 generates the 40kHz IR carrier. During low periods the carrier is suppressed.

This provides a simple method for receiving serial data on one pin, and outputting serial data on another modulated at the IR detectors band-pass frequency. Very simple, yet very effective.

The 2N3906 PNP transistor is used to invert the IR detectors data output. During idle periods, when serial data is not being received, the PC serial port RX pin should idle low. Since the idle output logic of the IR detector is logic 1, the PNP transistor inverter circuit is required. If we were to use a MAX232 RS232 to TTL level converter IC, we could eliminate the PNP inverter circuit, and connect the IR module data output directly to the MAX232.

Most PC serial ports work fine with TTL level serial data input, so we have used the direct interface to cut costs, and reduce circuit size. The 10K series resistor in series with the PC serial port TX pin and PIC serial data input pin is to limit current. This prevents damage to the PIC input from RS232 level voltage from the PC serial port. You’ll see quite a few finished products with this simple serial interface.

For more detail: Transmit & Receive Infrared Signals With Your PC Serial Port using PIC12F508

READ  An LED Dice using a PIC 16F84 (or 16F88)

Current Project / Post can also be found using:

  • interfacing microcontroller with internet

Leave a Comment

= 4 + 6

Read previous post:
PIC16F877 timer0 schematic
PIC16F877 timer0 code and Proteus simulation

This PIC16F877 microcontroller tutorial answers the question, " How to use timer0 of PIC16F877 and how to handle its interrupts?...

Scroll to top