Hi,
Project Intro
My project is to build an IR emetter-receiver system linked to my arduino to make the shooting system of an arduino based laser tag game.
I noticed that the TSOP2238 I'm using can receive IR pulse from standard remote control (15 meters easily approx 49ft).
Datasheet of the TSOP2238 used in this project
The receptor
I built a small circuit with an arduino uno, this receptor and a led which switches on when the TSOP receive an IR signal at 38khz:
The code for the receptor is as follow:
int ledR=7;
int IRReceiver=8;
void setup() {
pinMode(ledR,OUTPUT);
pinMode(IRReceiver,INPUT);
digitalWrite(ledR,LOW); //eteint
}
void loop() {
bool reception=digitalRead(IRReceiver);
if(reception==true){
digitalWrite(ledR,HIGH);
}
else{digitalWrite(ledR,LOW);}
}
When I point a standard remote control at it it works perfectly so I guess there is no problem on the receptor side.
The emetter
At first I only used a n555 timer with a matching IR led. I used a 10uF capacitor, R1=1100Ohm, R2= 1330Ohm
Datasheet of the n555 timer used in this project
The problem
Yet this doesn't really work, where I had a bright red led with a remote control on the receptor, now it only fades and have a much smaller range (10 centimeters approx 0.33 ft).
After checking forum and websites about the topic (such as this very good one )
I noticed that this 38khz signal should be modulated at at a low frequency approx 30 hertz. I did this with the tone function of my arduino nano. The red witness led still switches on at small range (still 10centimeters approx 0.33 ft) but more briglthy so I guess it's better. But when the led is straight forward oriented to the detector, the red witness led doesn't switches on. Indeed, i must put some angle between the receptor and the IR led to recieve the signal.
Have you tips on how have a bigger range (such as a remote control) ?
Thanks a lot,
An arduino and electronic noob,