# IR receiver doesn't work on arduino mini pro, but does work on a nano and uno

#### flash01694

Joined Mar 7, 2018
26
hello guys,

So lately I've been experimenting with IR receivers for a project and have been using a HX 1838 module bought from aliexpress. The issue is that I use it without any kind of problem on my arduino uno and nano, but If I use the exact same code with the exact same wiring on the 3.3v arduino mini pro it no longer works.

to clarify what I mean, the mini pro does detect that some kind of infrared is being sent but it prints only question mark in the serial monitor instead of the number of the received signal. voltage shouldn't be a problem as far as I understood, I also tried using it with 3.3v only my uno and the receiver works just fine.

Anyone can help me understand why it doesn't work?

thank you very much

Last edited:

#### Raymond Genovese

Joined Mar 5, 2016
1,658
Remember, the pro mini 3v is 8MHz while both the nano and uno are 16MHz.

Can you post your code with the pins you are using for the IR connection?

#### flash01694

Joined Mar 7, 2018
26
Remember, the pro mini 3v is 8MHz while both the nano and uno are 16MHz.

Can you post your code with the pins you are using for the IR connection?

I'm using pin 6 for the IR receiver, so the fact that is 8 Mhz can be the cause? I just thought it was slower xD

here is the code, it basically turns off a led when one of the the two buttons on the emitter is received, but from serial I can tell it doesn't decode the signal
C:
/*******************CODE BEGINS HERE********************/

#include <IRremote.h>

int IRpin = 6;
int pinR = 4;
IRrecv irrecv(IRpin);
decode_results results;

void setup()
{
Serial.begin(9600);
pinMode(pinR, OUTPUT);
digitalWrite(pinR, LOW);
delay(2000);
digitalWrite(pinR, HIGH);

}

void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, DEC);
if (results.value == 2704 || results.value == 16753245) {
// Print the Serial 'results.value'
digitalWrite(pinR, LOW);
delay(300);
}

irrecv.resume();
}
digitalWrite(pinR, HIGH);

}

#### Raymond Genovese

Joined Mar 5, 2016
1,658
I'm using pin 6 for the IR receiver, so the fact that is 8 Mhz can be the cause? I just thought it was slower xD

here is the code, it basically turns off a led when one of the the two buttons on the emitter is received, but from serial I can tell it doesn't decode the signal
Try changing it to pin 2 or 3 on the pro mini - it could be that the pro mini does not have interrupts on 6 - too lazy to look...but I know it does on 2/3

#### flash01694

Joined Mar 7, 2018
26
Try changing it to pin 2 or 3 on the pro mini - it could be that the pro mini does not have interrupts on 6 - too lazy to look...but I know it does on 2/3
tried and still doesn't work

#### be80be

Joined Jul 5, 2008
2,051
Put a 100 uf cap across the power too that will help if the power rail is lagging.

But your getting a ? sounds like you don't have serial monitor set right.

Last edited:

#### flash01694

Joined Mar 7, 2018
26
Put a 100 uf cap across the power too that will help if the power rail is lagging.
still same output

#### Raymond Genovese

Joined Mar 5, 2016
1,658
ok, let me test it out for ya here...ok

On a pro mini 3v I get a series of numbers consistently when using a cheapo transmitter keypad...e.g.
16597183
4294967295
16580863
4294967295
16580863
4294967295

Moving to an Uno, I get the same.

I think you have to look elsewhere....double check the wiring. The receiver on the pro mini connections are + to Vcc / gnd to gnd and out to 6. I am getting power from a USB serial board.

Hope this helps

Last edited:

#### flash01694

Joined Mar 7, 2018
26
ok, let me test it out for ya here
thank you but I fixed it!

just had to put a 4800 baud rate instead of 9600... xD

#### be80be

Joined Jul 5, 2008
2,051
thank you but I fixed it!

just had to put a 4800 baud rate instead of 9600... xD
I said that, Glade you fixed it.

#### Raymond Genovese

Joined Mar 5, 2016
1,658
thank you but I fixed it!

just had to put a 4800 baud rate instead of 9600... xD
good deal!

#### Raymond Genovese

Joined Mar 5, 2016
1,658