RMT - carrier_level explained?
Posted: Wed Jan 12, 2022 4:43 pm
I am using the RMT library to send IR signals for the MileTag2 protocol.
IR Power: (Indoor / Outdoor) with Indoor being less
IR Range: (Min, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, Max)
I am scratching my head on what the difference between the Power and Range would be as to me they are the same thing but I don't expect anyone on this forum to have that answer. However, If you do, feel free to give your opinion.
I am driving the IR emitter via a MOSFET controlled by PWM GPIO out of the ESP32
https://www.digikey.com/en/products/det ... 1G/2050557
I believe to satisfy this feature I need to be able to increase/decrease the voltage of the PWM pulses coming out of the ESP32 GPIO. In turn, the MOSFET would increase/decrease current through the IR emitter accomplishing the intent of user defined power setting via SW. Is this a correct assumption?
If that assumption is correct. Now I need to figure out how to accomplish this with the RMT library.
Questions
1) Would adjusting the RMT carrier_level between low/med/high result in amplitude (voltage) changes to the PWM output?
2) How would one adjust the power level to the emitter in 10% increments via SW?
Thanks in advance.
The protocol has two user defined settings:The MilesTag 2 IR protocol is a series of pulses of this carrier wave beginning
with a 2400 microsecond (µS) long pulse. This is followed by a series of pulses
either 1200µS or 600µS in length, representing 1 and 0 respectively. Each of the
pulses is separated with a gap of 600µS of no carrier wave.
IR Power: (Indoor / Outdoor) with Indoor being less
IR Range: (Min, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, Max)
I am scratching my head on what the difference between the Power and Range would be as to me they are the same thing but I don't expect anyone on this forum to have that answer. However, If you do, feel free to give your opinion.
I am driving the IR emitter via a MOSFET controlled by PWM GPIO out of the ESP32
https://www.digikey.com/en/products/det ... 1G/2050557
I believe to satisfy this feature I need to be able to increase/decrease the voltage of the PWM pulses coming out of the ESP32 GPIO. In turn, the MOSFET would increase/decrease current through the IR emitter accomplishing the intent of user defined power setting via SW. Is this a correct assumption?
If that assumption is correct. Now I need to figure out how to accomplish this with the RMT library.
Questions
1) Would adjusting the RMT carrier_level between low/med/high result in amplitude (voltage) changes to the PWM output?
2) How would one adjust the power level to the emitter in 10% increments via SW?
Code: Select all
configTx.rmt_mode = RMT_MODE_TX;
configTx.channel = channel;
configTx.gpio_num = IR_PIN;
configTx.mem_block_num = 1;
configTx.tx_config.loop_en = 0;
configTx.tx_config.carrier_duty_percent = 50;
configTx.tx_config.carrier_freq_hz = freq * 1000;
configTx.tx_config.carrier_en = CARRIER_EN;
configTx.tx_config.idle_output_en = 1;
configTx.tx_config.idle_level = RMT_IDLE_LEVEL_LOW;
configTx.tx_config.carrier_level = RMT_CARRIER_LEVEL_HIGH;
configTx.clk_div = 80; // 80MHx / 80 = 1MHz 0r 1uS per count