mattcuk / IRtranslator

Arduino IR Translator. Converts incoming IR codes from one manufacturer to another set of IR codes from a different manufacturer,
Creative Commons Zero v1.0 Universal
61 stars 5 forks source link

No "sending alternative command" activity or IR transmission #3

Closed Noshtzy closed 11 months ago

Noshtzy commented 1 year ago

Hello, I've found your project and it's exactly what I need to make the remote for a very locked-down stream box from my cable company work with the volume controls of my Logitech Z-5500 speakers.

I've assembled an Arduino Nano Every with an IR receiver and KY-005 transmitter on a breadboard, just as you have done, and uploaded the program. I'm using the same version of the IRremote library you have, and I am able to get recognized IR codes to show up in the serial monitor when pressing buttons on the remotes.

What I'm not getting is "Received VOL Up.. sending alternative command" on any of the output, after punching in the command values and raw data to translate. The KY-005 is not transmitting (no light up while viewing through a camera sensor.)

Do you have any idea what I might be missing? I've attached the adjusted code and the received remote commands that I'm trying to work with. I'm not using an Amazon soundbar, not using a power up delay, not using justBooted special behavior, and have no need for the sequence of commands to trigger a power on.

Thanks!

NoshIRtranslator.zip

mattcuk commented 1 year ago

Hi :) I've not tried this with the Nano Every, but looking at the pinout diagram it looks almost identical. You've done what I'd have suggested, which is to check the KY-005 is transmitting using a camera. I'm not sure what to suggest next. Do you have a picture of the breadboard setup.. maybe we can spot something not set up quite right?

Anyone else have any suggestions on how to debug this a bit more?

Noshtzy commented 1 year ago

Thanks for checking in! I didn't think the Nano Every would differ much from the Nano but the Every is a "megaAVR" board and seems related to the Uno somehow? Not sure really.

I've attached a few angles of the breadboard. Made it as simple as possible, but let me know if another angle is needed.

PXL_20230901_194422607 PXL_20230901_194428083 PXL_20230901_194437533 PXL_20230901_194456724 PXL_20230901_194449601

mattcuk commented 1 year ago

Looks good to me; I can't see any obvious problem in how you've wired that up. It could be worth continuity testing that the wires are actually working from the Arduino pin row to the target row of the breadboard for the KY-005. I've had cheap breadboards before which haven't been great!

Noshtzy commented 1 year ago

If the KY-005 wiring was off, would that still prevent the "Received VOL Up .. sending alternative command" from showing up in the serial monitor? I tried another breadboard I had and still have the same issue.

mattcuk commented 1 year ago

Ah, you're right. That's more about it not recognising the IR code you're sending in, rather than not being able to send a code out. In the section of code that's basically a big block of IF statements, we need to see why it's not recognising the decodedIRData, so you could put in Serial.println before that block.

E.g.

Serial.println("Debug received command.. ");
Serial.println(IrReceiver.decodedIRData.command);
if (IrReceiver.decodedIRData.command == 0x40) {
    :
    :

That'll hopefully help narrow down why the IF statement doesn't think the IR code matches.

You should see the same data in the debug output that is generated by line 46.

image

Maybe copy that output into this thread, together with what you have in the IF statement so we can see if there's anything odd there.

Noshtzy commented 1 year ago

Thanks, I inserted the println as you intended (hopefully) and uploaded, but the output looks the same. If it was supposed to print "Debug received command.. " it did not.

I also picked up an Arduino Nano and used better quality wires with headers on the Nano and Nano Every, same result.

image

image

Noshtzy commented 1 year ago

I also programmed the remote for Sony and tried those commands, and another unrelated remote, same issue. Serial Monitor outputs the code info but doesn't print "debug received command" or "received x .. sending alternative command"

Noshtzy commented 11 months ago

So it turns out this was totally my bad, I absolutely missed the IrReceiver.decodedIRData.address needing to match the Address from the received data. Once I added it in, it began working as advertised on the Nano and Nano Every: image

I ran into a new problem where the KY-005 signal and negative pins seem to be reversed on the ones I received. It began working when I connected negative to the Nano's Pin 3 and Signal to the Nano's GND. Might just be a bad PCB printing.

To that point, the brightness of the KY-005 is low and range is very limited. Did you have any range issues with yours? I'm wondering if there's a brighter one I could use instead, that doesn't have this PCB reversal issue either.

mattcuk commented 11 months ago

Brilliant; I'm so glad you figured this out! I hope this helps other people who are copying this project.

I felt the range/directionality was limited on mine too, but I initially put this down to the speakers also being quite picky with the remote I have.. it really has to be bang on target to work. I'd therefore put the KY-005 on the end of a longer wire & stuck it in place right in front of the speaker's IR receiver.

Noshtzy commented 11 months ago

Yeah, I had the same experience. I picked up a pack of 20cm header'd cables so I can mess with the arrangement. Thanks for all your help!