An IR (Infrared) receiver, often implemented using a photodiode or a phototransistor, works by detecting infrared light signals, typically from a remote control or other IR transmitters. Here's a breakdown of how it functions and addresses your question about "calculating how much time it loses charges":
1. Basic Operation of an IR Receiver
- IR Emitter (Transmitter): Sends modulated infrared light (e.g., 38 kHz carrier frequency) encoded with data (e.g., button presses on a remote).
- IR Receiver (Photodiode/Phototransistor): Detects the infrared light and converts it into an electrical signal.
2. Detection Mechanism
- Photodiode/Phototransistor: When IR light hits the receiver, it generates a current or changes its resistance, depending on the type of component.
- Demodulation: The receiver circuit filters and demodulates the carrier signal to extract the original data.
3. "Losing Charges" and Timing
Your question about "losing charges" likely refers to the timing of the signal or how the receiver interprets the duration of pulses and gaps in the IR signal. Here's how it works:
- Modulated Signal: The IR transmitter sends a carrier frequency (e.g., 38 kHz) that is pulsed on and off to encode data. For example:
- A long pulse might represent a binary
1.
- A short pulse might represent a binary
0.
- Receiver Timing: The receiver measures the duration of these pulses and gaps to decode the data. This is done using a microcontroller or dedicated IR receiver IC (e.g., TSOP series).
4. How Timing is Measured
- Microcontroller: If a microcontroller is used, it measures the time between state changes (high to low or low to high) on the receiver's output pin.
- For example, it might count clock cycles or use a timer to determine if a pulse is long or short.
- Dedicated IR Receiver IC: These ICs internally demodulate the signal and output a clean digital signal, often with a specific timing protocol (e.g., NEC, RC-5).
5. Example: NEC Protocol
In the NEC protocol:
- A logic
1 is represented by a 562.5 µs pulse followed by a 1687.5 µs gap.
- A logic
0 is represented by a 562.5 µs pulse followed by a 562.5 µs gap.
- The receiver measures these durations to decode the data.
6. "Losing Charges" Clarification
The term "losing charges" isn't typically used in this context. Instead, the receiver focuses on:
- Detecting the presence or absence of IR light.
- Measuring the duration of pulses and gaps to decode the transmitted data.
Summary
The IR receiver doesn't "calculate how much time it loses charges." Instead, it measures the timing of pulses and gaps in the modulated IR signal to extract the encoded data. This timing is critical for decoding the transmitted information, and it's handled by either a microcontroller or a dedicated IR receiver IC.