0

I'm using the apc220 rf modules. Now I'm having the following problem:

My receiving arduino uno only receives data when the tx pin on the arduino (rx pin on the rf module) is disconnected. As soon as I connect the tx pin my serial monitor receives only the value 0.

Is my rf module broken, or can someone help me with this?

  • Which Arduino board are you using? – Raceimaztion Jun 2 '15 at 9:10
  • 1
    The Uno only has a single hardware UART. Are you attempting to use it to connect to both the USB-UART bridge and the RF module at the same time? – Ignacio Vazquez-Abrams Jun 2 '15 at 9:19
1

To have two serial ports on Arduino board like Uno use SoftwareSerial.h.

Example

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3); // RX, TX

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);


  Serial.println("Hello!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

Now after opening Serial monitor you should see Hello! and then you can test SoftwareSerial.

DO NOT FORGET!!!

When you connect to pins 2,3 or etc, this is TTL voltage level. You can't connect direct to RS232.

  • I know about Software Serial. The problem is that I use the rf modules for a quadcopter project and I need the memory of the rx pin, I think (correct me if I'm wrong). – Michael Jun 2 '15 at 9:38
  • Ok, so if you know more than i expected :) Clear for me this: How you connect RF module and debug it at the same time having only 1 serial port? Remember that : pins 0 and 1 ar Tx, Rx for USB. You can use them only without USB attached – Martynas Jun 2 '15 at 9:51
  • 1
    And yes it takes more than memory. I would go for HW serial. replacing with Mega maybe – Martynas Jun 2 '15 at 9:54
  • Haha, I'm starting to know arduino bit by bit. :) Whem I'm uploading the code I always disconnect the rf module. After uploading the code I connect the rf module again. If I open the serial monitor it seems to work on 1 serial port. But I just ordered my arduino Mega because the serial communication is a big pain in the ass with the uno... :) – Michael Jun 2 '15 at 16:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.