CE351 lec18 IR emitter, transmitter, baud rate
Overview
The lecture explains how an IR emitter, a 38 kHz carrier, and an integrated receiver-decoder turn light pulses into an active-low digital signal that a microcontroller can read. It connects that signal to UART framing and baud-rate matching, then reviews timer-register configuration for PWM, including ICR as TOP, OCR compare values, and a roughly 10% emitter duty cycle.
Key takeaways
- The IR receiver-decoder output is active-low: detected carrier pulses produce logic 0, while an idle optical path produces logic 1.
- The IR carrier frequency and UART baud rate are different timing parameters; the lecture uses a roughly 38 kHz carrier and a 9600-bit-per-second serial example.
- A standard UART byte frame uses one low start bit, eight data bits, and one high stop bit, totaling 10 bit periods.
- At a 38 kHz carrier, the period is about 26.3 microseconds; a 16 MHz timer uses that period and its prescaler to calculate the PWM TOP count.
- A roughly 10% PWM duty cycle reduces IR LED heating while carrier modulation helps reject ambient infrared interference.
- The IR emitter and receiver both peak near 950 nm, improving optical compatibility between the transmitted light and the detector's strongest response.
Chapters
- The board pairs an IR LED emitter with a receiver-decoder that converts detected light into a digital output.
- The emitter sends invisible IR pulses that can reflect from room surfaces back to the receiver.
- Avoid staring directly at an energized IR emitter; a sheet of white paper can improve reflections when reception is unreliable.
- The receiver-decoder responds to a modulated IR carrier, described mainly as 38 kHz, although 30 kHz is also mentioned in the lecture.
- Detected carrier pulses make the decoder output logic 0; when no pulses arrive, its output returns to logic 1.
- A white-paper reflector is presented as an occasional signal-strength aid, not a required part of the setup.
- A BJT acts as a switch: PWM at its base controls current through the IR LED and reproduces the pulse pattern as light.
- The Skyboard application uses approximately 10% duty cycle to limit LED heating and current exposure.
- The carrier’s rapid PWM pulses and the slower data pattern are separate layers of the transmitted signal.
- The receiver-decoder’s inverted output preserves the transmitted information as a sequence of digital highs and lows.
- A microcontroller can interpret the resulting bit stream when transmitter and receiver agree on the communication timing.
- The lecture distinguishes the IR carrier waveform from the data bits encoded by the longer on/off pattern.
- UART baud rate sets how quickly data bits are sent; the example default for the Arduino serial monitor is 9600 bits per second.
- At 9600 bits per second, one bit lasts approximately 1/9600 second, or 104 microseconds.
- The 38 kHz IR carrier is not the UART baud rate; confusing the two leads to incorrect timer settings.
- The IR decoder output connects to a microcontroller UART RX pin, while the IR emitter supplies the optical transmission.
- On the Skyboard, UART0 is wired through a USB-to-UART converter to the laptop; Serial.begin(9600) configures the link used by the monitor.
- UART1 can be configured separately for the IR receiver, and its baud rate must match the bit timing generated by the transmitter.
- A baud mismatch between the board and laptop serial monitor can produce unreadable or corrupted characters.
- A UART line idles high; a falling edge to low marks the start bit and prompts the receiver to begin sampling.
- A typical frame contains one start bit, eight data bits, and one stop bit, for 10 bit periods per byte.
- The IR decoder output can serve as the UART-like RX signal because no received carrier leaves the output high and detected pulses pull it low.
- UART sends bytes with start and stop framing, then repeats the frame for additional bytes.
- The lecture characterizes UART as inexpensive and adequate for low-volume uses such as temperature readings, but less suitable for high-throughput transfers.
- SPI is contrasted as a faster option whose message length can be configured for applications such as communication with storage devices.
- The timer calculation begins with the carrier period, using T = 1/f; at 38 kHz, one carrier period is about 26.3 microseconds.
- For a 16 MHz timer clock, convert the target period into timer counts, then account for any prescaler.
- ICR is introduced as the input capture register, used as the timer TOP value in the discussed PWM configuration.
- The lecture reviews Timer1 waveform-generation mode bits across TCCR1A and TCCR1B, including the mode 14 configuration.
- ICR sets the PWM period, while an OCR register sets the output-compare point and therefore the duty-cycle behavior.
- The output-compare action changes the pin at compare match and at TOP; register values and output polarity determine the resulting waveform.
- Initialize timer control registers before setting mode bits, compare values, and prescaler settings.
- The receiver-decoder has a response delay, so UART bit periods must be long enough for the optical signal to be detected and converted reliably.
- The plotted receiver response peaks near 950 nm, and the IR emitter spectrum also has its peak near 950 nm.
- An LED emits a wavelength spectrum rather than a single exact wavelength, even when one wavelength is dominant.
- Modulating the LED with a low-duty carrier helps limit heating and distinguish the desired signal from ambient IR light.
Transcript excerpt
0:00 or it's one emitter and one receiver. Um, which is this guy. Okay, it is uh at here. So, this guy is a receiver. It's a receiver and decoder. A lot of times as a product you should actually integrate the digital components into instead of just an analog sensor because nowadays everything is digital. Um if the customer has to design connect everything to the analog sensor and process a digital signal that that
0:48 product cannot go far. Okay. So it has to be analog in and directly digital out. Okay. So people don't want to convert anything by themselves. So everything is highly integrated. So the decoder itself receives IR light from the air right after the IR emitter which is soldered here. Solder here. So I emitter is going to shoot IR pulses. It's actually light pulses and it's not visible but you never want to stare at it. So if you turn it on, you are see, hey, there's nothing I want to look at through my eyes and h it's going to hurt your eyes. So the reason for that is this IR emitter emits the IR signal, the pulses to anywhere in the room and
1:38 bounces back from the wall and eventually will be received by the decoder, the receiver. So you can imagine it requires high energy, high power. So it's running a lot of current through the diode. It's invisible. It's in the invisible wavelength. So, you couldn't see the light, but actually it's super strong. Okay, it's kind of hurt your eyes directly looking for it. So, never do that. And for some of the experiments, if you are not really receiving good signal um it could be issues from the whatever the surface is bouncing back from the um from that surface. So what we usually
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Yiyan Li.