Copy of https://github.com/dennisfrett/Arduino-Direct-NEC-Transmitter for the WCH CH32V00X RISC-V platform.
This was tested on a CH32V003.
This library can be used to control devices with an 3.5mm "IR input" directly using a microcontroller, without the need for an IR LED.
- Devices that support removable IR receivers / extenders
- Amplifiers with an "IR input" port, used to chain devices
As long as they work with (Extended) NEC, this library should work. I've tested the library with a NAD amplifier and a TOSLINK optical switcher. More information on the NEC IR protocol: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol
An IR remote typically sends out pulses that are modulated at 38khz. These pulses are received by an IR receiver (like the TSOP devices). An IR receiver is an IR photodiode and circuitry that filters out the 38khz carrier wave. The output of this receiver is the unmodulated IR signal that was received by the remote.
The receiving device expects an unmodulated signal on the data line.
This library cannot be used to control an IR LED directly, since there modulation is required. There are multiple libraries out there that can be used to control IR LEDs from Arduino:
Sometimes, the IR input port will provide power on one of the pins. When connecting your controller to such an input, it's probably best if you only connect the data line (ring) and ground (sleeve), the current requirement of the microcontroller is likely too high for the device to provide.
Some IR controllable devices come with a removable IR receiver, typically connected to a 3.5mm/2.5mm male headphone jack. These often do not have a separate power supply, and are powered through the cable.
The pinout of these devices is typically as follows:
- Tip: Provides 5V for the IR receiver.
- Ring: Data. Activates on a pulse. Typically active low.
- Sleeve: Ground.
Conceptually almost the same as the IR extenders, but these typically do not supply power and use mono 3.5mm/2.5mm male headphone jack cables.
The pinout of these devices is typically as follows:
- Tip: Data. Activates on a pulse. Typically active low.
- Sleeve: Ground.