RMT - carrier_level explained?

bobslawblog
Posts: 11
Joined: Sun Dec 12, 2021 4:55 pm

RMT - carrier_level explained?

Postby bobslawblog » Wed Jan 12, 2022 4:43 pm

I am using the RMT library to send IR signals for the MileTag2 protocol.
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.
The protocol has two user defined settings:
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

:idea: 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
Thanks in advance.
Last edited by bobslawblog on Tue Jan 18, 2022 1:59 pm, edited 1 time in total.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RMT - carrier_level explained?

Postby WiFive » Wed Jan 12, 2022 8:21 pm

I think any power adjustment would have to be done with external analog circuitry.
Would adjusting the RMT carrier_level between low/med/high result in amplitude (voltage) changes to the PWM output?
No, this setting only means whether the carrier is active on low output or high output, depending on how your mosfet is switched.

bobslawblog
Posts: 11
Joined: Sun Dec 12, 2021 4:55 pm

Re: RMT - carrier_level explained?

Postby bobslawblog » Wed Jan 12, 2022 9:12 pm

Thanks for the reply.

I was hopeful that I found a setting that would accomplish what I was after. You are correct, it does not do what I thought it did.

If any others have some advice on how to get great control over the emitter power level, I am all ears.

Thanks

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: RMT - carrier_level explained?

Postby ESP_Sprite » Thu Jan 13, 2022 1:11 am

Potentially, you could mess with the duty cycle of the carrier signal. Lower duty cycle = lower power = less range.

bobslawblog
Posts: 11
Joined: Sun Dec 12, 2021 4:55 pm

Re: RMT - carrier_level explained?

Postby bobslawblog » Thu Jan 13, 2022 3:48 pm

ESP_Sprite wrote:
Thu Jan 13, 2022 1:11 am
Potentially, you could mess with the duty cycle of the carrier signal. Lower duty cycle = lower power = less range.
Thanks for your reply. Perhaps you are correct and the Range is duty cycle which I could easily manipulate from the SW interface in 10% increments.

This just leaves me trying to determine Power which seems to me it would be related to the amount of current through the emitter which would be the amplitude or voltage of the PWM bursts driving the MOSFET. Not sure how to dynamically adjust that portion quite yet.

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: RMT - carrier_level explained?

Postby ESP_Sprite » Fri Jan 14, 2022 3:24 am

For power, you could have two mosfets: one that switches the IR emittor via the path you have now, and one that switches it but has an (extra/higher) series resistor to limit the current to a lower value than the 'high-power' mosfet.

Who is online

Users browsing this forum: No registered users and 83 guests