Arduino coummication between two 2.4 GHz wireless modems

Hello everyone,

Materials:

2 x Arduino Uno

2 x RS232 - TTL conversion modules (https://www.optimusdigital.ro/ro/interfata-convertoare-de-niveluri/161-modul-convertor-rs232-la-ttl.html?search_query=rs232&results=13)

2 x ICP DAS RFU-2400 wireless modems. (home > product> solutions > industrial wireless communication> Wireless Modem > RFU-2400)

I’m trying to send data from one arduino to the other one using the wireless modems. The arduino is connected with the modem with the help of RS232- TTL conversion module.

Currently I’m stuck at sending data from the first arduino to the first wireless modem.

Here is my code:

void setup() {
  //start serial connection
  Serial.begin(9600, SERIAL_8N1);  
  
  pinMode(2, INPUT_PULLUP); //manual
  pinMode(3, INPUT_PULLUP); //buton
  pinMode(4, INPUT_PULLUP); //MIN
  pinMode(5, INPUT_PULLUP); //MAX 
  pinMode(6, INPUT_PULLUP); //automat
  pinMode(13, OUTPUT);
  

}

void loop() {
  
  int manual = digitalRead(2);
  int buton = digitalRead(3);
  int minim = digitalRead(4);
  int maxim = digitalRead(5);
  int automat = digitalRead(6);
  
  if(manual== LOW && automat== HIGH)  //pompa trecuta pe manual
  { if(buton== LOW) //buton apasat
    Serial.println("1");
    else
    Serial.println("0"); 
  }
    
  else if(manual == HIGH && automat== LOW) //pompa trecuta pe automat
  {

    if(minim== LOW && maxim==LOW) // in caz de defectiune senzori nivel
    Serial.println("0"); 
    else{
    if(minim == LOW) //s-a atins nivelul minim
    Serial.println("1");

    if(maxim == LOW) //s-a atins nivelul maxim
    Serial.println("0"); 
  }}
  else if(manual == HIGH && automat == HIGH) //cheie pe pozitia 0
  {
    Serial.println("0"); 
  }

}

The program works fine with arduino serial monitor but it doesn’t send data to the wireless modem. ( the Tx led on the modem does not light up).

I’ll be glad if you could point me into the right direction.

I also attached the configuration for the modems ( master and slave).

Thank you.

master.PNG

slave.PNG

Try swapping RX and TX at the modem.

The program works fine with arduino serial monitor but it doesn't send data to the wireless modem.

How would the code you posted send data to the modem ?

Thank you for you response jremington. I've already tried swaping RX and TX. Sadly no luck.

UKHeliBob: How would the code you posted send data to the modem ?

Thank you for your response.

Via the serial (rx and tx pins that are conected to the RS232-ttl converter).

Serial.println("0");

I don't have much experience with arduino. Am I missing something?

I don't have much experience with arduino. Am I missing something?

One thing that you are doing is to use the same pins for the modem and the Serial monitor. Try using SoftwareSerial for the modem on two other pins.

Have you set the Baud rate on the modems to 9600?

I've tried using SoftwareSerial for my modem on pins 10 and 11.

The baud rate on the modems is set to 9600.

I've also tried to read data from arduino to my laptop using a serial monitoring software, it works. Because of that I think the problem is not with the arduino but with the comunication between the modem and the rs232-ttl converter.