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

Thread Starter

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:

Thread Starter

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);
  irrecv.enableIRIn(); // Start the receiver
  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);
         // Receive the next value
      }
     
   
      irrecv.resume();
    }
  digitalWrite(pinR, HIGH);

}
 
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
 

be80be

Joined Jul 5, 2008
2,004
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:
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:
Top