Infra-red Sensor

The infra-red sensor decodes any correctly modulated infra-red light signal it receives and passes this to a PICAXE. This allows key presses on an infra-red remote control or infra-red commands sent from another PICAXE to be detected and acted upon.

Related Commands:

Print Page




Read an infra-red key press code

This program will receive key presses from an infra-red remote control using an infra-red receiver connected to input pin C.0 and will display all key press codes in the 'b1' variable. The infra-red remote control must be set to produce Sony TV infra-red command codes.

Code Example:
main:	irin C.0, b1		; Wait for a key press code
	debug			; Display the value
	goto main		; Repeat
Copy Code Submit an Example

Create Module

The infra-red sensor create module allows infra-red commands from a TV-style remote control to be received.

Bill of Materials

Infra-red sensor LED020 1 Buy Now
4k7 resistor (pack 100) RES4K7 1 Buy Now
4.7uF electrolytic capacitor CAP004 1 Buy Now


No Image Selected

Submit Your Own Code!

You must be logged in to submit code examples. Login now.


  • Posted by GlenRichardson

    Can you explain what the resistor and capacitors do please. Also can you use a single Capacitor between V+ and GND for and entire circuit board with multiple chips on it, or do you require one for each chip?

  • Posted by erco

    Capacitor & resistor are not needed in most cases if the power supply is stable.

  • Posted by bertkdowns

    My IR sensor is overheating whenever I connect it to the board... also can I use a 470r instead of a 4k7?

  • Posted by szpalko

    470r is way too low. The pull down open collector output transistor in these receivers is quite small, so you need at least a few kOhm, like 4.7. Anything will work between say 2-10kOhm. This is likely a cause for overheat, also check the pinout and make sure it is connected properly, there are various versions if these receivers. Once you had it heat up, chances are it will never work again.

  • Login to leave a comment.