RPi controlled by IR remote: is it possible to turn it on by it?

  • Hello to everyone! :) I know by experience that what I've described in the title is achievable on an OPi PC (and also other Allwinner based devices) using an RC6 remote but could I succeed in getting the same result even on my RPi? I've bought a very cheap solution made up of a remote, an IR receiver and DuPont jump wires by which I've connected the receiver to GPIO. After a bit of digging around (I've got a great help reading on the forum here too, as it often if not always happens), I've been able to get it working quite issues free but I still miss maybe the best part of my project! ;)

    The protocol used by the remote isn't RC6 but Nec but it's clear that if you tell me that it can be done just replacing the remote with another... Hey, I'm fine with it! If it can be achieved even leaving everything as it is, even better but I don't know...

    Thanks in advance for your advices and have a nice day! :)

  • RPi has no native IR capability so needs an additional device with independent power and IR receiver that can control the main power to the board, either by being inline to the normal power connector or through driving power input pins on the 40-pin connector. It is not possible to use a GPIO receiver because the GPIO pins on the 40-pin connector need power before they can receive anything.

  • this board can be used, it's from german store and needs to be built by you:

    ELV Bausatz Power Controller für Raspberry Pi RPi-PC
    Der Raspberry Pi erfordert ein definiertes Herunterfahren zum Ausschalten, sonst kann es zu Datenverlusten kommen. Das Betriebssystem des…
    de.elv.com

    it allows you to use two IR codes for PowerOn and PowerOff (learned by board). Maximum power is 2.5A.

    it looks similar to my one (bought over Internet from Thailand), but the shop is closed already (no longer available).

    another possibility is the Argon V2 case, but some people in the forum have problem with this case and LibreElec. There is also one with space for M.2 SATA drive.

    if the RPi is always powered, there are many possibilities, e.g. FLIRC on USB.

  • Flirc requires the USB ports to be powered. Once you turn the board off, the USB is not powered so you cannot turn on again. Apart from that the flirc receiver is awesome.

  • RPi has no native IR capability so needs an additional device with independent power and IR receiver that can control the main power to the board, either by being inline to the normal power connector or through driving power input pins on the 40-pin connector. It is not possible to use a GPIO receiver because the GPIO pins on the 40-pin connector need power before they can receive anything.

    Exactly as I expected unfortunately. Thanks for your follow-up anyway, precious as always! :)

    wtuppa

    Great advices, thanks! As it often happens on a forum, my request hasn't been completely useless, fortunately. ;) I don't know if it is permitted to add links to online listings but I don't think so. BTW, I've also found this alternative:

    but at this point why not someting like this one?

    It is a one channel 5V IR relay and, if I'm not mistaken, just connecting the USB cable power lines to the relay and two DuPont jump wires from the pins in the photo to the corresponding GPIO comb ones should work at a fraction of the cost (around $4)... It's clear that I'm aware it is a complely different approach, a much dirtier one with much less functionalities offered but...if your aim is just turning it on and off, it could make sense though it involves using a third remote (the first one being the one controlling the TV unless you successfully setup CEC at its full capabilities which sometimes isn't an easily obtainable result) unlike what happens with the solutions suggested by wtuppa which are certainly more elegant. An alternative to the third remote (needed also for the other OOTB solution I've found) could be one of those learning remotes which can be bought quite cheaply too and could control the RPi, the TV and turning on and off the RPi, all in one: not that bad I believe but it's just my point of view.

    I'm also wondering if I could use the IR receiver from the relay even to control the RPi, just connecting its signal and GND legs directly to the GPIO comb given that power to it is fed by the relay board. It would tidy things up a bit removing the need for a second IR receiver.

    Thanks to the both of you! I mark the thread as solved.

    Edited 12 times, last by -=guybrush=- (April 10, 2022 at 8:09 AM).

  • it would be more useful, to get links to the products (as I did). Then is possible to know more of these solutions and how they fit.

    I agree with you but I've done it purposedly, not by mistake. If I had placed some links to the products, they hadn't been links to the manufacturer's site but to an online platform where they're currently being sold so no datasheets or other useful informations but only advertising and this is usually against the rules on a forum. BTW I've described them and making a search by image with Google Lens for example is just enough to find them if someone is interested.

    In the meantime, I've already bought them both to make some testing on the field! ;) Have a nice day! :)

  • It's fine then. Here are the links to the products I was speaking of previously (being links to currently active listings, I don't know how long they would remain valid while the photos added above would remain valid anyway):

    Alternative OOTB solution

    One channel IR relay 5V

    The second one could be found from various sellers with slightly different board layouts (when the PCB colour varies, usually even the layout changes) but under the same descriptive title. Indeed, the link isn't the one to the listing for the relay I've bought which has almost no description. Reading the description for the listing linked here makes me think I was completely misleaded by the title (while the specs printed on the relay packaging could have led me in the right direction) and this IR relay isn't suitable to achieve what I'm looking for. Now it seems quite clear that the 5V and GND comb is to fed power to the IR receiver while control happens on 250V AC appliances for example, even on 28V DC ones but certainly not 5V DC ones like the RPi. My fault.

    Edited 4 times, last by -=guybrush=- (April 10, 2022 at 9:36 PM).

  • the first one will work for Power ON/OFF. Since it is for the RPi3, there will be a limitation to 2.5A (at least I think so). The RPi will be powered than over the HAT (similar to my solution no longer available) instead of its own USB connector.

    Full documentation of this board will show, how to use it with each kind of RPi.

    An additional FLIRC would be needed for full control of LE.

  • the first one will work for Power ON/OFF. Since it is for the RPi3, there will be a limitation to 2.5A (at least I think so). The RPi will be powered than over the HAT (similar to my solution no longer available) instead of its own USB connector.

    Full documentation of this board will show, how to use it with each kind of RPi.

    An additional FLIRC would be needed for full control of LE.

    I knew that but thanks for confirming it and for having added that very useful link. For what concerns Flirc, I knew it almost since its birth and it is a great piece of HW but it is also quite expensive and, given the price of an RPi zero, I'd prefer to scratch my head and see if I can find alternatives (if any and if possible, even less elegant and with less functionalities offered, even creating them from scratch like I've, unsuccessfully, tried to do with that relay) rather than ending up with spending for accessories more than for the RPi itself but I'd like to underline this is only my approach, not necessarily the right one. Have a nice day! :)

  • you can use a IR receiver on GPIO pins of the RPi. This is a supported configuration.

    you can see such a setup here.

    Already done since the beginning as written in my first post but this setup is incapable of switching the RPi on because, as explained by chewitt , GPIO isn't active while the RPi isn't powered. That's the reason why all of those other solutions we've talked about afterwards have been developed and are being sold at not that cheap prices (when compared to the price of what they're supposed to control).

    I don't want to start an endless debate about what's better and what worse (it depends upon way too much aspects, the first certainly being the needed usage scenarios) but my one cent opinion is that at least in this regard OPis are better engineered. With my OPi PC (and I'm sure with many other models of the line) I can do what I wanted to reproduce on my RPi zero with no additional hardware apart, obviously, an RC6 remote (or, as I've done, a much cheaper universal one programmed to resemble it by which, as an added extra, I can control the TV too like I couldn't have done with a real RC6 remote being mine a 4 in 1 remote).

    To be honest, my feeling is that all of this wasn't an engineering fault but a precise choice to keep production costs to the bone and let a very profitable accessory market flourish.

    Thanks for all of your advices: I'm sure they would be useful for many coming across this thread. :)

    Edited 4 times, last by -=guybrush=- (April 16, 2022 at 7:28 AM).

  • Already done since the beginning as written in my first post but this setup is incapable of switching the RPi on because, as explained by chewitt , GPIO isn't active while the RPi isn't powered.

    but you can combine it with the OOTB solution for just powering the RPi up and down.

  • Hello to everyone! :) As promised more than a month ago, I'm here with a brief update on the results. The hat has been a complete disappointment unfortunately. It seems to be a very old stock (the production date printed on the PCB is back to 2016 and the board is scattered with oxidation signs almost everywhere, especially on the connectors) and it doesn't work: it just emits a clicking noise, nothing else. I've been unfortunate but it could easily happen given that it seems these hats are no longer being produced.

    The IR relay has been a success instead. I've paired it with two separate 5V PSUs (a 2A one and another with just 400mA output, the former controlled by the relay feeds power to the RPi Zero, the latter is always powered and feeds the relay) and bought a 3 in 1 learning remote too (by which I control the RPi, the TV and the soundbar connected to it). With just one remote I control everything I need including turning the RPi on and off without the need for plugging and unplugging anymore. Here is the current arrangement:

    The cost for all the needed parts has been ridicolous ($2.31 for the 2A PSU, $0.93 for the 400mA PSU, $2.99 for the relay, $2.84 for the remote, $1.94 for TEN IR receivers so I've nine of them still left. $11.01 overall if we don't consider the cables and the connectors that I already had and just the need for some soldering work, easy even for me and I'm not that good with soldering!) and it becomes even more ridicolous if we consider that there isn't any need for a MicroUSB cable and an USB PSU anymore, not to mention the convenience given by the 3 in 1 remote.

    Given their very cheap price, I wasn't confident about that (in spite of the fact the seller has a very good feedback) but the PSUs are reliable, well made and they remain cool, always a good sign. No problems at all till now and I've both a WiFi card and a DVB-T2 tuner connected to my RPi.

    It's clear it's just a quick and dirty approach, just to get a proof of concept. Now I plan to put everything inside a neat enclosure and find a way to get rid of the second IR receiver using just the one already present on the relay board. By now, in spite of the fact I've already soldered the connectors even on the IR receiver on the relay PCB, I've chosen to use a second one to use a single ground otherwise I had been forced to connect the RPi to two grounds coming from different circuits and I don't like that approach, apart from the fact that the approach had required one more cable, one more connector on the GPIO and another bit of soldering work.

    What I'm looking forward more than anything else is finding a way to put everything on the same base with more effective, safe and solid connections. I've thought about a breadboard but this isn't exactly what I'm looking for... I don't even know if anything like what I'm thinking about does actually exist... I'm thinking about something like a multilayer PCB but that's too overkill and too space consuming to put everything inside an enclosure so I'm looking for something simpler (if it does exist and it doesn't, at least to my knowledge).

    A nice day to everyone! :)

    Edited 3 times, last by -=guybrush=- (May 25, 2022 at 7:48 PM).

  • I would use a single-side prototype board to put everything together. Example: Click!

    Use the non-contact side to glue your PCB's on (hot glue gun), and use the contact side for the wiring.