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.

tsop 1738 ouptut connected to microcontroller

Status
Not open for further replies.

Disha Karnataki

Full Member level 5
Joined
Jul 20, 2013
Messages
249
Helped
9
Reputation
18
Reaction score
8
Trophy points
18
Location
india
Activity points
2,231
here is the circuit how i have connected https://www.edaboard.com/threads/275615/
except connecting pin 3 o/p to the microcontroller.
when i checked the voltage @ the o/p (pin 3) i got 4.89v(almost equal to supply voltage).
then when i pressed a remote control button in front of it then to the voltage fluctuated between 4.5v(after button pressed) & 4.89v(after button released).
Is it that the ir signals are coming at such a fast rate that i am unable to see the volatge going to zero! or what is it?
then,
i connected simply ir led in front of it & then too there was no voltage variation in the o/p pin of TSOP1738.
what is wrong or it's actually ok & i can connect it to the interrupt pin of microcontroller?
 

It seems an obvious behavior with a signal. The output of TSOP1738 has a square wave output, with frequency equals to the data rate of the input signal. It could be probably few kHz. So output (considering an average reading) falls in between peak and 0 volts. Multimeters cannot read such fast fluctuations. They are slow and reads voltage in a signal in terms of dV/dt.

You can use a PC oscilloscope software if you want to read the output graphically. No special hardware needed....
 

A 38kHz TSOP IR receiver tries to ignore continuous 38kHz IR because it would be produced as interference from a compact fluorescent light bulb as shown in the TSOP datasheet.
A TSOP IR receiver also ignores continuous IR that is not modulated by 38kHz.
The 38kHz IR should be in bursts with gaps between the bursts for the gain to be high as shown in the datasheet. The durations of the bursts and gaps are important.
 

ya i used pc oscilloscope software and here is the result of no 8 button pressed:View attachment 8osc.zip
here is the attachment please veiw it in photo viewer .
the waveform got here is the inverted one i.e the original waveform is the inverted of what presented in this image.
i inverted the actual got waveform because the command bits correctly showed number "8" whereas the actual waveform did not show no "8".
now if i make micro controller to read this then, should i invert & send it to the interrupt pin or what is it?
 

That is RC5 protocol as described here:

https://www.sbprojects.com/knowledge/ir/rc5.php

Toggle bit is 1, address 0, command 8

No need to add an extra inverter - have your micro-controller handle the inversion.

Use of an interrupt pin is a good idea, but for simple applications, interrupts may not be essential.

What micro-controller do you plan to use?

Note that RC5 normally uses 36kHz carrier frequency. Your 38 kHz receiver module will work perfectly well, but range will be reduced a little - perhaps to about half of the range of a 36kHz module.

A sound-card oscilloscope makes a poor quality oscilloscope - which is why your waveform is so wobbly. Did the job OK for this purpose though :)
 
Last edited:

That is RC5 protocol as described here:

No need to add an extra inverter - have your micro-controller handle the inversion.

Use of an interrupt pin is a good idea, but for simple applications, interrupts may not be essential.

What micro-controller do you plan to use?
i am planing to use 8051 micro controller (it's newly taught to us in our college) .
And i actually plan to control some devices using remote control.(though this is one of the tasks in my project)
so for that i need to write a code which will detect the "command code only" to detect which button is pressed & thus then i can control any appliances.
i did not get why did you say interrupt pin not necessary to be used.
Here when the button on the rc is pressed that time only micro controller has to execute so it's necessary to use interrupt.
And let me once again say that whatever image i have attached in above post i have got number "8" in the command code only after pressing INV tag on the pc oscilloscope.Why i am saying this is see this post here file:https://www.pcbheaven.com/userpages/The_Philips_RC5_Protocol/ from here i got to know how to detect a 0bit & 1bit.
the page also shows waveforms got on his oscilloscope. And he got exactly the same one that he had received after the receiver and did not had to invert it.
But i had to so.
Whether i use the method as given in above page or have to just detect in opposite fashion(as i had to press INV on my pc oscillo) as what explained in that page is not a real matter.But,
You see protocol used by me & in the page (above mentioned) are same that is:RC5 though i had to invert it & he didn't.
 
Last edited:

Most 3-pin IR receiver modules give out an inverted signal. This is normal.

It is usual to get the micro-controller to handle the inverted signal and save on a hardware inverter, but you can add an inverter if you really want to.

You can use interrupts if you want to.
 

i have written c code 8051 microcontroller with proper timing delays but.. not displaying proper results here is the code:
in this code i am decoding only command code(i.e 6 bits in rc5 protocol) as per the image:https://www.pcbheaven.com/scripts/i...rpages/images/The_Phillips_RC5_Protocol_9.png
Code:
#include<reg51.h>
void interruptdelay(void);       
void middelay(unsigned int);	     //arbitrary delay
void delwaste(unsigned int);		 //delay to skip the reading of code upto command            
#define y P1			      //to display number in the command code  of rc5 protocol
sbit mybit=P3^3;						 //tsop1738 signal connected at P3^3(interrupt pin)
void timer0(void) interrupt 2           //isr routine for external hardware interrupt 
{
interruptdelay();
}
void main()
{
unsigned char z=0;
P3=0XFF;  //make as input
P1=0X00;   //make as output
IE=0X84;  //low level triggered
TMOD=0X01;	  //timer 0 in mode 1
}
void interruptdelay(void)
{
unsigned int z;
delwaste(16);   //13.824ms skip
while(z!=6)    //here in rc5 protocl the command length is of 6 bits
{
  if(mybit==0)
    y=y<<1;
   else
     y|=0X01;          
   delwaste(2);
  z+=1; 
}
P1=y;   //display final value  in command code
middelay(100);   //keep the display for a little long time    

}    

void delwaste(unsigned int e)   //for e=1 creates delay of 860microsec
{
for(;e>0;e--)
{
TH0=0XFC;
TL0=0XE4;
TR0=1;
if(TF0!=1);
TR0=0;
TF0=0;
}
}
void middelay(unsigned int g)   //arbitrary delay
{
unsigned int h;
for(;g>0;g--)
{
for(h=0;h<10000;h++);
}
}

- - - Updated - - -

i have written c code 8051 microcontroller with proper timing delays but.. not displaying proper results here is the code:
in this code i am decoding only command code(i.e 6 bits in rc5 protocol) as per the image:https://www.pcbheaven.com/scripts/i...rpages/images/The_Phillips_RC5_Protocol_9.png
Code:
#include<reg51.h>
void interruptdelay(void);       
void middelay(unsigned int);	     //arbitrary delay
void delwaste(unsigned int);		 //delay to skip the reading of code upto command            
#define y P1			      //to display number in the command code  of rc5 protocol
sbit mybit=P3^3;						 //tsop1738 signal connected at P3^3(interrupt pin)
void timer0(void) interrupt 2           //isr routine for external hardware interrupt 
{
interruptdelay();
}
void main()
{
unsigned char z=0;
P3=0XFF;  //make as input
P1=0X00;   //make as output
IE=0X84;  //low level triggered
TMOD=0X01;	  //timer 0 in mode 1
}
void interruptdelay(void)
{
unsigned int z;
delwaste(16);   //13.824ms skip
while(z!=6)    //here in rc5 protocl the command length is of 6 bits
{
  if(mybit==0)
    y=y<<1;
   else
     y|=0X01;          
   delwaste(2);
  z+=1; 
}
P1=y;   //display final value  in command code
middelay(100);   //keep the display for a little long time    

}    

void delwaste(unsigned int e)   //for e=1 creates delay of 860microsec
{
for(;e>0;e--)
{
TH0=0XFC;
TL0=0XE4;
TR0=1;
if(TF0!=1);
TR0=0;
TF0=0;
}
}
void middelay(unsigned int g)   //arbitrary delay
{
unsigned int h;
for(;g>0;g--)
{
for(h=0;h<10000;h++);
}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top