blackelbowfoot ([info]blackelbowfoot) wrote,
@ 2009-04-13 13:15:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
thoughts on a simple unidirectional infrared communications protocol
so, say i want to build a simple IR remote control for some microcontroller project. all i need to do is grab an infrared detector that will demodulate a given signal (such as a TSOP1736) at the receiver, and design my remote around that. basically, the detector senses infrared radiation at only a fixed modulation frequency, say, 36kHz. if i modulate an IR led at that frequency towards the detector, it will output a logic-level signal.

the next step is implementing some kind of data transmission system. short and sweet is the idea here. lets describe a bit of data as having four equal segments in time. for a high bit, the first three segments will be a modulated signal and the last will be no signal. for a low bit, only the first segment will be a modulated signal. like so (low bit on top):

the detector output is then wired to an external interrupt pin of the receiver avr. because every bit has some off-time, the interrupt will signal the start of each new received bit. all the receiver avr has to do is sample the detector output at the middle of the bit: if it's a signal, it's a logic 1, if it's no signal, it's a logic 0.

from here, all you need to do is determine the length of the codes you will need for the number of codes you want to have. if i want 12 codes, i need each code to be 4 bits long (16 codes max).

so the final product:
0000 = power on/off
0001 = volume up
0010 = volume down
0011 = mute on/off
0100 = use input 1
0101 = use input 2
0110 = use input 3
0111 = use input 4
1000 = use input 5
1001 = use input 6
1010 = use input 7
1011 = use input 8

make sense?

~ brad.



Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…