IR remote for Kodak Carousel slide projector

Greetings! Beginner here.

I'm attempting to create an IR remote for my Kodak Carousel slide projector. Ultimately, I want to trigger a sequence of IR remote commands with a single button press, but at the moment it won't even respond.

I've tried to follow a few different guides, most recently this one. I've got the hex codes from the remote, so I'm pretty confident they're correct, and this is the code I'm using for the Arduino itself:

#include <ir_Lego_PF_BitStreamEncoder.h>
#include <boarddefs.h>
#include <IRremoteInt.h>
#include <IRremote.h>

// IR Transmitter ...
#include <IRremote.h>

IRsend irsend;

void setup()
{
  pinMode(7,INPUT); // button 1
  pinMode(8,INPUT); // button 2
  pinMode(9,INPUT); // button 3
  
}

void loop() {

	if (digitalRead(7) == HIGH){
   
  delay(50);
  irsend.sendNEC(0xCD221686, 32);} 

  if (digitalRead(8) == HIGH){
  
  delay(50);
  irsend.sendNEC(0xCD221686, 32);} 

  if (digitalRead(9) == HIGH){
 
  delay(50);
  irsend.sendNEC(0xCD221686, 32);} 
  
   delay(1);
  
	
	
	}

This is the circuit, just in case I've messed up there somehow:

If anyone can point me in the right direction, I'd be super grateful. :slight_smile:

if (digitalRead(7) == HIGH){

The breadboard has the switches wired to ground with pullup resistors. The switches will read LOW when pressed.

Is that an IR LED on the lower right of the breadboard? Why 3 terminals?

Have you checked, with your cell phone camera, that the LED is actually transmitting?

Thanks so much for the reply.

groundFungus:

if (digitalRead(7) == HIGH){

The breadboard has the switches wired to ground with pullup resistors. The switches will read LOW when pressed.

Thanks. I have amended the 'HIGH's to 'LOW's.

Is that an IR LED on the lower right of the breadboard? Why 3 terminals?

Hmmm. I am idiot, so I don't really know. One terminal is 'DAT', which is connected to pin 3, another is marked 'VCC', connected to + on the breadboard, and the other is 'GND' connected to ground. To be fair, the guide LED only has two pins, so maybe that's where I'm going wrong.

Have you checked, with your cell phone camera, that the LED is actually transmitting?

I can't see any IR light with my cell phone camera, but not sure if that's down to the camera or not. Since swapping the 'HIGH's for 'LOW's the little red 'DAT' light by the LED does light up whenever I push a button, which at least feels like progress, even if it's not.

Cheeky bump (just in case anyone can help).

Do you have another Arduino that you could set up as a receiver? Then run the IRrecvDump example and see if the transmitter is at least sending and if so, what is going out.

groundFungus:
Do you have another Arduino that you could set up as a receiver?

Failing that a somewhat roundabout way would be to use a TV remote. Determine the code it uses for TV on/off with the receive program and then program the Arduino to send the same codes to the TV.

Thanks for your thoughts. I've just finished using rawRecv to figure out the raw IR transmission.

I've then tried to test it via rawSend, like this:

/* rawSend.ino Example sketch for IRLib2
 *  Illustrates how to send a code Using raw timings which were captured
 *  from the "rawRecv.ino" sample sketch.  Load that sketch and
 *  capture the values. They will print in the serial monitor. Then you
 *  cut and paste that output into the appropriate section below.
 */
#include <IRLibSendBase.h>    //We need the base code
#include <IRLib_HashRaw.h>    //Only use raw sender

IRsendRaw mySender;

void setup() {
  Serial.begin(9600);
  delay(2000); while (!Serial); //delay for Leonardo
  Serial.println(F("Every time you press a key is a serial monitor we will send."));
}
#define RAW_DATA_LEN 18
uint16_t rawData[RAW_DATA_LEN]={
  502, 2498, 526, 994, 502, 506, 502, 506, 
  502, 506, 1010, 1006, 498, 506, 1010, 514, 
  502, 1000};

   
void loop() {
  if (digitalRead(7) == LOW){
    
    mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
    Serial.println(F("Sent signal."));
  }
}

The serial monitor gives me the 'sent signal' confirmation whenever I press the button connected to pin 7, but the slide projector still doesn't respond. Although I have no idea what the '36' is in mySender.send(rawData,RAW_DATA_LEN,36). Is there a chance it's transmitting the wrong signal?

Failing that, maybe the next step is to get a 2nd Arduino to run tests.

Hey gang. So I've been trying to figure this one out and I think I've identified the problem although don't know what the solution is.

Got myself a 2nd Arduino to run tests and make sure the LED was transmitting (it is). HOWEVER, the code that IRrecvDumpV2 is receiving from the remote is this:

Encoding : UNKNOWN
Code : CD221686 (32 bits)

And the code I've been trying to send is this:

Encoding : NEC
Code : CD221686 (32 bits)

(When I try to send the raw signal, IRrecvDumpV2 says it's 'too long'. Dealing with the raw signal seems far less straightforward too, so I'd rather stick with the hex code if I can.)

So my question is: how do I send an IR hex code with 'unknown' encoding. Can anyone help?