Discussion in "General help Guidance and Discussion" started by    lucky6772    Mar 25, 2013.
Sat Jul 27 2013, 06:59 pm
now i am getting good range wen i place the tsop1738 reciver and ir led transmitter face to face abt 3ft...! but wen i place them both together to use them reflected beam type..i.e (when i place hand in front of ir led it reflect back the signal to tsop recicevr) i am not getting range its only abt 10cm..!
nw i am using this circuit..!


[ Edited Sat Jul 27 2013, 07:01 pm ]
Sat Jul 27 2013, 07:03 pm
now i am getting good range wen i place the tsop1738 reciver and ir led transmitter face to face abt 3ft...! but wen i place them both together to use them reflected beam type..i.e (when i place hand in front of ir led it reflect back the signal to tsop recicevr) i am not getting range its only abt 10cm..!
nw i am using this circuit..!

 ajay_bhargav like this.
Sat Jul 27 2013, 08:16 pm
#include <REG2051.H>

sbit ir=P1^7;
sbit motor=P1^6;
sbit motor1=P1^4;
sbit sense=P3^3;
int a,b,c,d,e,j,k,l,m,i,n,flag;




void delay_ms (unsigned int count) // @ 11.0592 MHz
{
unsigned int i;
while(count) {
i = 115;
while(i>
0) i--;
count--;
}
}
  
void timer0_isr () interrupt 1
{

	if(n<=99) //		600Us ON-OFF Burst for 100 cycles(60ms)
	{
		if(n%2!=0)
		{
			TH0=0xFD;	//	600Us OFF
			TL0=0xD6;
			TR1=0;
			ir=0;
			n++;
		}
		else
		{
			TH0=0xFD;	//	600Us ON
			TL0=0xD6;
			TR1=1;
			ir=1;
			n++;
		}
			
	}
	else	//	IR completely off for 60ms
	{
		
		TR1=0;
		TH0=0x27; //60ms OFF Period
		TL0=0xFB;  
		ir=0;
		n=0;
	}
}
  
void timer1_isr () interrupt 3
{
	ir = ~ir;
}

void isr(void) interrupt 2
{
	e=1;
	if(flag==0)
	{
	   motor=1;
	   delay_ms(3000);
	   motor=0;
	   a=1;
	   flag=flag+1;
	}
	
}

void main ()
{
	a=0;
	flag=0;
	e=0;
	n=0;
	P1=0xff;
	TMOD=0X21;

	TH1=0xf4;//38Khz Timer

	TH0=0xFD;//600Us
	TL0=0xD6;

	IE=0x8f;  //0x8f; 
	IT1=0;   // Configure interrupt 0 for falling edge on /INT1 (P3.2)
	TR1=1;
	TR0=1;		  
	  
	  while(1)
	{
		if(a==1)
		{
			e=e-1;
			if(e<0)
			{
				TR0=0;
				motor1=1;
				delay_ms(7000);
				motor1=0;
				TR0= 1;
				TR1=1;
				a=0;
				flag=0;
				e=0;
			} 
		} 
	} 	   
}

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am