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.

tsop1738 connected to micrcontroller

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
i have connected a tsop1738 to my atmega8L.
as per the characteristics of tsop1738 it detects signal only when signal frequency is of 38khz.
circut as shown:https://www.8051projects.info/images/thumb351437.GIF
i have already connected to 8051 microcontroller it worked fine over there.

But when i connected this to atmega8 it continuously started executing the isr routine though there was no key pressed on remote control(as tsop detects only that).
I have written a code where the ISR routine displays some message on LCD connected to it.
So i switched off the lights of my room thinking the lights may be causing the signal to go low on the ext interrupt pin,& yes that was the real problem. Even if i touched the tsop it again caused the interrupt.
Why is TSOP sensing the room light & my touch?
each & every time i on the tubelight it is executing the ISR causing interrupt to the uc.
whereas it should only detect the remote control carrier frequency.
 

You should always decouple the TSOP Power supply using an RC circuit. Say, use a capacitor of around 22uF and a resistor of around 100E (ohms). This will prevent lot of problems.

Also one more thing, the tube light with electronic choke will have light flickering may have a frequency component matching the TSOP. This mostly will happen when the tube light is turned ON or OFF, but that time it will not execute any keypress because you will have a protocol for the commands. Any way, try using decoupling circuit and see if it is still there or not..

 

use a transistor with the tsop.connect the output of the tsop to the base of an npn transistor through a suitable base resistor.now connect the collector of the transistor to the microcontroller.depending on your code,if you intent to make the microcontroller pin high until the remote is pressed,then you need to add a resistor(4k7-10k) between the 5v and the collector of the transistor.this will make the pin high until the transistor switches on which will ground the pin of the microcontroller.when no signal on the tsop,the transistor is off thus the microcontroller pin is high.when signal falls on the tsop,its output goes high switching on the transistor thus grounding the microcontroller pin.good luck
 

i used the same circuit except that i connected a 1uf cap instead of 4.7uf & 100ohm resistor instead of 330ohm.
But earlier the same sensor with it's circuit(tsop1738) i had connected to 8051uc & successfully decoded the rc-5 protocol now the same i want to try on atmega8L-8pu but, it isn't working.
i do not whether i have done something wrong in my code i shall post that too:
Code:
#include<avr/io.h>
#include<avr/interrupt.h>
#include<util/delay.h>
#include"lcd118010.h"
int main(void)
{
DDRB=0X0F;   //O/P
PORTB=0X00;
DDRD=0X00;
PORTD=0X0F;
sei();
GIMSK|=(1<<INT1);
MCUCR =(1<< ISC11); 

while(1)
{
PORTB=0X01;
_delay_ms(1000);
PORTB=0X05;
_delay_ms(1000);
}
}

SIGNAL(SIG_INTERRUPT1)    //isr for interrupt @INT-1
{
getdata();


lcd_init();
	lcd_string("hi how are you ? ");         //displays message on interrupt
	
_delay_ms(999);	
lcd_cmd(0X01);
return;
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top