38 KHz sensor for joystick infrared controller

Thread Starter

Alessandro Marchei

Joined Apr 21, 2020
2
Hi everyone,

I am trying to build a system that takes 2 analog inputs from a dual-axis joystick controller (via Arduino Nano) and sends them via IR communication to another microcontroller(arduino Mega in my case). I am trying to use my personal IR communication protocol because i will need more bits(20 bits per instruction) of data and I think NEC or SONY protocols are just not adaptable for my purposes.

According to the datasheet of the TS38238 it's optimal to set a burst time of at least 10/38khz per period, so i chose Tb(Burst period) = 390 us for each burst.

My protocol is for semplicity composed of:
- START period : 3 ms burst and 1 ms idle
- INSTRUCTION period where 1 = 1 Tb of burst and 3*Tb idles ; 0 = 1 Tb of burst and 1 Tb idle;
- END period of 1 ms idle.

After i arranged all correctly, it comes out that it works properly and receives data for just a few instructions.
In fact after a brief period of exposing the sensor to the IR led, I need to hide the IR sensor again and it start working for another brief period and so on..

Why is that? Why does it stop receiving data every time i put the IR emitter continuously in front of the sensor?
Is there something inside the sensor that doesn't like my communication protocol?

Thank you in advance.
 

MisterBill2

Joined Jan 23, 2018
7,687
Hi everyone,

I am trying to build a system that takes 2 analog inputs from a dual-axis joystick controller (via Arduino Nano) and sends them via IR communication to another microcontroller(arduino Mega in my case). I am trying to use my personal IR communication protocol because i will need more bits(20 bits per instruction) of data and I think NEC or SONY protocols are just not adaptable for my purposes.

According to the datasheet of the TS38238 it's optimal to set a burst time of at least 10/38khz per period, so i chose Tb(Burst period) = 390 us for each burst.

My protocol is for semplicity composed of:
- START period : 3 ms burst and 1 ms idle
- INSTRUCTION period where 1 = 1 Tb of burst and 3*Tb idles ; 0 = 1 Tb of burst and 1 Tb idle;
- END period of 1 ms idle.

After i arranged all correctly, it comes out that it works properly and receives data for just a few instructions.
In fact after a brief period of exposing the sensor to the IR led, I need to hide the IR sensor again and it start working for another brief period and so on..

Why is that? Why does it stop receiving data every time i put the IR emitter continuously in front of the sensor?
Is there something inside the sensor that doesn't like my communication protocol?

Thank you in advance.
It might possibly also be due to having a very high signal amplitude. Try pointing booth the transmitter and receiver at the ceiling instead, which will provide a much lower amplitude signal.
Of course it is certainly true that there may be in the firmware code to ignore constant signals, because they would be presumed to be interference.
 
Top