Welcome to EDAboard.com

Welcome to our site! EDAboard.com 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

Status
Not open for further replies.

fantabulous68

Junior Member level 2
Joined
Aug 15, 2007
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,591
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.
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,845
pic16f690 circuit

Hai

What about the transmitter??

it should be emitting IR at 38KHz

Nandhu
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top