Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

reading output of IR receiver with pic16f690 micrcontroller

Not open for further replies.


Junior Member level 2
Aug 15, 2007
Reaction score
Trophy points
Activity points
pic16f690 programming c

im designing an infrared proximity detector for my project. I am a new user to the pic microcontroller. I am programming in C.

i have an infrared receiver IC TSOP48.
the output of the infrared ic is active low. and can be directly demodulated by a microcontroller.

the output is on the 1st pin of the receiver module.

hardware connections:

1)pin 1 of receiver IC connected to RC2 of microcontroller
2)in RC3 has a LED connected to it going to ground.

1)i want to feed this active low signal from the receiver IC to pin RC2 of the microcontroller when detection occurs.

2)only when the receiver IC detects an object is near, then it will be active low.
So i want to read this pin RC2 to check if it is low.

3)now only when it is active low i want a LED connected to RC3 to light up.

4)if the module does not detect any object then i want the led to be off.

here is my code:

#include <pic.h>
#include "pic.h"
#include "delay.h"
#include "math.h"
#include <stdio.h>
#include <stdlib.h>

void main(void)

TRISC=0X04; //making pin RC2 input

if(RC2==0) //if receiver detects something then output is active low
{PORTC=0x08;} //light up led connected to RC3 if detect object else
{PORTC=0x00;} //dont light led if no detection

please assist me. i dont know why the led is always on after i program the chip and put it into the proximity circuit.

i want it to go on when an object is near the proximity circuit.

i want it to go off when there is no object near.

pic16f690 circuit


What about the transmitter??

it should be emitting IR at 38KHz


Not open for further replies.

Part and Inventory Search

Welcome to