-1

On Arduino Nano I plugged a RF 433 MHz receiver. Everything works fine until I turn on PWM on other ports. Then the RF signal gets lost. It seems to be electromagnetic interference (?) but adding an antenna doesn't help. Do you know about this issue? Do you know a way to solve it?

Kind regards,

Romain

Specifications:

RF 433 MHz plugged on interrupt 1 (the interrupt 0 being already used)

Library RC-Switch

PWM ports are 5, 6, 10, 11

Here is the receiver code

#define MOTOR_PIN 5
#define MOTOR_SPEED 60
#define INT_PIN 1 // interrput=1 is pin=3

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(INT_PIN);
  pinMode(MOTOR_PIN,OUTPUT);
  analogWrite(MOTOR_PIN,MOTOR_SPEED);
}

void loop() {
  if(mySwitch.available()){
    Serial.println(mySwitch.getReceivedValue());
    mySwitch.resetAvailable();
  }
}

And here is the emitter code

#define RADIO_PIN 10 // Transmitter is connected to Arduino Pin #10
#define PULSE_LENGTH 185 // Optional set pulse length
#define NB_REPEAT 5 // Optional set number of transmission repetitions

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

void setup() {
  //Serial.begin(9600);
  mySwitch.enableTransmit(RADIO_PIN);
  mySwitch.setPulseLength(PULSE_LENGTH);
  mySwitch.setRepeatTransmit(NB_REPEAT);
}

void loop() {
  mySwitch.send("000000000001010100010001");
  delay(100);
  mySwitch.send("000000000001010100010100");
  delay(100);
}
  • 1
    Please edit your question then add the sketch you're using. – VE7JRO Oct 20 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.