IR Blaster to on and off TV

  • Hi. I'm new here. I have setup latest libreelec on a Raspberry pi4. I would like to add a IR blaster to the pi 4 to control my tv.


    Thinking of getting this Infrared IR Wireless Remote Control Kits for Arduino & Raspberry | Online Shopping Lazada .


    However i cant find a recent guide on how to do it.


    Infrared Remotes [LibreELEC.wiki] this link says nothing about transmitting at all.


    https://openelec.tv/documentat…guide-to-lirc-ir-blasting this is exactly what i want to do. Wondering if it will work in libreelec. And any specific instructions available?

  • To me, this device will only control the Pi, not the TV.


    I do not know for sure, but something like


    MX3 2.4G Wireless Remote Control Keyboard Air Mouse for MXQ Android XBMC TV Box | eBay might work


    There are buttons on this, that can learn tv controls.


    Hopefully someone with more knowledge will offer some input.

    Samsung RU7400 Onkyo HTX22HDX Nvidia Shield HD Homerun Duo (Living Room)

    Samsung UE40ES5500 H96 Pro, X96+, Fire TV 4K Stick (Bedroom)

    Synology DS414 Plex Pass

    :)

  • Hi. Sorry i forgot to mention. My tv is not a smart tv. Its a older hd tv. So that remote wouldnt work.

    Does your TV have an IR remote? If it does, it should be able to be "LEARNT" You don't need a smart TV


    Just to clarify, the IR blaster for the Pi will not be able to control the TV, particularly if it's not a network tv. You can however get remotes, that can learn various TV functions, like TV volume control

    Samsung RU7400 Onkyo HTX22HDX Nvidia Shield HD Homerun Duo (Living Room)

    Samsung UE40ES5500 H96 Pro, X96+, Fire TV 4K Stick (Bedroom)

    Synology DS414 Plex Pass

    :)

    Edited once, last by bubblegum57 ().

  • Does your TV have an IR remote? If it does, it should be able to be "LEARNT" You don't need a smart TV


    Just to clarify, the IR blaster for the Pi will not be able to control the TV, particularly if it's not a network tv. You can however get remotes, that can learn various TV functions, like TV volume control

    Not sure if im missing out on something. The remote you suggested doesn't have an ir blaster right? How could it control my tv?


    I apologize again. I have lost focus from what i originally intended to do. The ultimate goal would be :-


    When libreelec is idle (when the black screen saver comes up) i want rpi to send a turn off signal to the tv via ir. (my tv doesnt have a cec). When i try to watch something in kodi, press any key / wake up - i want the pi to send a turn on signal.


    Am i too ambitious?

    Edited once, last by anand0412: More information ().

  • IF the remote with 2.4 dongle works, & I don't know if it will on a Pi, it has buttons on it, that can be learnt from your tv remote.


    Samsung RU7400 Onkyo HTX22HDX Nvidia Shield HD Homerun Duo (Living Room)

    Samsung UE40ES5500 H96 Pro, X96+, Fire TV 4K Stick (Bedroom)

    Synology DS414 Plex Pass

    :)

  • The kit you linked isn't quite ideal as it only seems to contain an IR transmitter LED, without a transistor/FET and current limiting resistor to drive it.


    Hooking up the IR LED directly to the GPIO isn't a good idea as the current output of the GPIO is too low so the range (distance to the TV/IR receiver) will be rather limited.


    See also this thread on the RPi forum for background info on how to hook up IR LEDs Extend IR Led Range - Raspberry Pi Forums


    If you are not into soldering/electronics stuff search for breakout boards with IR LED and driving transistor - I've seen several of those in various shops but don't have any links or recommendations.


    The configuration / software side isn't too hard, ideally use the pwm-ir-tx dtoverlay with the IR-LED/driving circuit connected to GPIO 18 (pin 12 on the header) or, if you need to use another GPIO, use the gpio-ir-tx dtoverlay. To transmit IR signals use the ir-ctl command.


    Just search this forum for ir-ctl, I posted info on how to use it in several threads.


    so long,


    Hias


  • I've been looking into gpio-ir and the other modules for quite some time now and I've seen good advice from you, HiassofT , several times, so thanks for that :). Are the breakout boards in the image below the kind you're talking about? They look nice, clean and are small. Can they be hooked up directly to 5V, GND and the data pin to GPIO 18? These board can be found dirt-cheap on AliExpress for example.

         

  • Phew, hard to say. The second board (with the 2 LEDs) seems to have a transistor on it so that might work. Can't spot a transistor on the first board (with 1 LED) though.


    Do you have any links to datasheets or schematics for these boards?


    so long,


    Hias

  • Thanks HiassofT


    As far as I can tell these boards are made for Arduino projects and should work with the IRremote Arduino Library.


    No datasheets on AliExpress for sure, but some detailed pictures:

    IR Infrared Transmitter Module Ir Digital 38khz Infrared Receiver Sensor Module For Arduino Electronic Building Block|transmitter module|ir transmitterelectronic module - AliExpress


    Found the same boards here with simple datasheets as well:

    Single LED: https://www.emartee.com/product/42200 (datasheet: 42200.pdf)

    Dual LED: Wrobot Dual Digital 38KHz IR Transmitter Sensor - emartee.com (datasheet: 42265.pdf)

  • Thanks, the linked datasheet contained a schematic and confirmed what I thought:


    The one with the dual-LED should be fine, the single LED one not so much as it's missing the transistor.


    so long,


    Hias

  • Thanks again HiassofT I see what you mean now, after Googling I learned that the "J3Y" SMD part (visible in AliExpress images) is the transistor missing from the single LED one.


    Lastly, as you seem to be a true expert on the subject, is gpio-ir a generic module for devices other than Raspberry Pi's (it is a replacement for lirc_rpi after all)? I can not really find any official information on this module. Eventually I would like to use the GPIO header on my Khadas VIM3 with gpio-ir-tx.

  • gpio-ir-receiver, gpio-ir-tx and pwn-ir-tx are available on all platforms and included in the official linux kernel.


    See eg here linux/Documentation/devicetree/bindings/leds/irled at master · torvalds/linux · GitHub and here linux/gpio-ir-receiver.txt at master · torvalds/linux · GitHub for the devicetree bindings and here linux/drivers/media/rc at master · torvalds/linux · GitHub for the source code.


    Amlogic, Rockchip, Allwinner etc unfortunately don't support device tree overlays yet, like the RPi does so it'll be a bit tricky to include the device tree fragment needed to activate the driver on the correct GPIO pin. I think you'd need to patch the dtb file ATM.


    Ah, and these drivers are rather new, you need to use a late 4.x or a 5.x kernel to get them - LE10 Amlogic builds will be new enough. Also not sure if the IR transmitter drivers are included in LibreELEC kernel configs, that could be changed quite easily though.


    These rc-core IR drivers completely replace the old lirc drivers and have the huge benefit that they can use in-kernel IR decoding. The old lirc drivers needed userspace lircd to do the decoding. In the meanwhile the kernel supports generic decoders using BPF programs so it can handle almost every protocol that lircd supported.


    so long,


    Hias