Continue to Site

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.

[PIC] Interfacing PIC16f877a with IR Remote to control home appliances

Status
Not open for further replies.

UMAPK

Newbie level 3
Joined
Apr 4, 2015
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
26
Hai,


I need source code to interface the IR remote with PIC16f877A to control the electrical devices. i don't know how to write the program to decode the IR signal please help me......
 

You have to learn PIC UART communication and IR sensor TSOP1738. Modulate serial data with 38khz signal(can be generated by pwm in pic) and send to IR led. The tsop will do the demodulation and gives back the serial data. Google it you will get lot of examples.
 

You have to learn PIC UART communication and IR sensor TSOP1738. Modulate serial data with 38khz signal(can be generated by pwm in pic) and send to IR led. The tsop will do the demodulation and gives back the serial data. Google it you will get lot of examples.

sir, am using sony tv remote for controlling, just i gone through the sony IR remote protocol i got the command for particular keys given below

Address Device
1 TV
2 VCR 1
3 VCR 2
6 Laser Disk
12 Surround Sound
16 Cassette Deck / Tuner
17 CD Player
18 Equalizer



Command Function
0 Digit key 0
1 Digit key 1
2 Digit key 2
3 Digit key 3
4 Digit key 4
5 Digit key 5
6 Digit key 6
7 Digit key 7
8 Digit key 8
9 Digit key 9
16 Channel +
17 Channel -
18 Volume +
19 Volume -
20 Mute
21 Power
22 Reset
23 Audio Mode
24 Contrast +
25 Contrast -
26 Colour +
27 Colour -
30 Brightness +
31 Brightness -
38 Balance Left
39 Balance Right
47 Standby

i gave the command directly in codings but its not working, how do i want to give the command for particular key pressed.....
 

...
i gave the command directly in codings but its not working, how do i want to give the command for particular key pressed.....
where is the source code that you used?
 


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<pic.h>
 
 
 
void main()
{
int i;
TRISB=0XFF;
TRISD=0X00;
PORTD=0X00;
//RBPU =0;
     while(1)
    {
        if(RB0==0)
            {
            RD0=1; 
            RD1=0; 
            RD2=0; 
            RD3=0; 
            }
 
        else if(RB0==1)
            {
            RD3=0; 
            RD2=1; 
            RD1=0; 
            RD0=0; 
            }
 
        else if(RB0==2)
            {
            RD4=0; 
            RD5=0; 
            RD6=1; 
            RD7=0; 
            }
 
        else if(RB0==3)
            {
            RD7=0; 
            RD6=0; 
            RD5=0; 
            RD4=1; 
            }
        else
            {
            
            }
    }
}






i am not that much familiar in codings, this is the code i written for switching the relays but i don't know whether it is right or not
 
Last edited by a moderator:

You are asking too much to do with almost no knowledge of programming...

RB0 is just an input pin.
It always have one of the two possible values, TRUE or FALSE (1 or 0).
It cannot have a value of 2,3,...

How do you expect to get the input values 1,2,3,... ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top