Help to define the Wireless Comunication.

Hey!

I'm a beginner and I'd like to ask you guys to help me find out which wireless comunication I should use on my project.

I want to use a hall sensor module to measure the speed and a voltage sensor module to measure the battery level of a Remote Control Car. One Arduino UNO stays on the Car to get these information of the sensors and then a wireless module send them to another Arduino UNO(near to the Car) that receives with a wireless module and display the information in a LCD 20x4

This Remote Control Car is going to operate only in short distances(like inside a house).

Which of these modules should I use priorizing the facility to work with?

RF nRF24L01+; Wireless ESP8266; RF 433Mhz (transmissor e receptor) + PAR HT12D e HT12E; Xbee; Any other suggestion?

Thanks in advance!!

IMHO..

I would suggest trying to use an NANO or Pro-Mini instead of an UNO on the RC car.. (Pro-Mini's are super tiny and wont add much weight)

To give more advice... more info is best..

What type of scenario will this all play out in? (inside? outside? line of sight?)

What distances are we talking about here? 10 feet? 100 feet?

Ok, thanks.

Inside a house, short distances like 33 feet. Just to simulate as if it were in a real car.

The first thing to do is learn how to measure the speed and battery voltage.

Assuming you will be monitoring wheel revolutions, the car can be suspended on the bench (so the wheels can spin freely), while the Arduino is still connected to the computer.

When you have all that working, then decide between the many ways to send the data wirelessly to a remote computer. Some act just like a serial connection to your computer, which is trivial to implement.

jremington For sure! Thanks for the advice! I have to estimate how much I'm going to spend, that's why I need to know.

I have to estimate how much I’m going to spend

You don’t need to spend more than about $3 on the radio modules, about the price of a good coffee drink. Or even less.

Ok, I'm thinking to use the RF nRF24L01+ module. Is it too hard to work with sensors?

I'm concerned about having problems with interferences, the nRF24L01+ operates with 2.4GHz and the car's remote control with 27MHZ, is there any problem?

Interference from the 27 MHz R/C won't be a problem in any case.

  • side note:

you could use bluetooth as well.. (I believe its valid within that range still).. (and heck just even from the endpoint Arduino to 'broadcast out')..

then you could make a little mobile app to visualize the 'data' on a smart phone/tablet..etc

** (MIT APP INVENTOR 2 is a great place for noobs (like me) to make some nice Android apps with some decent functionality)

Any of the options in the Original Post should work. However I think using the ESP8266 and a web server would require the most complex programming.

I like the nRF24L01+ modules. They are cheap and effective. I am using them for radio control for 00 Gauge model trains. The locomotive can send its battery voltage back to the controller. One "master" can easily communicate with several locomotives.

This Simple nRF24L01+ Tutorial should help get you started. For my model trains I am using the second examples using the ackPayload feature.

...R

Hey! Thanks guys. I'm using the nRF24L01+ module with an arduino UNO and I can see the speed and battery voltage in a LCD sent from another arduino with nRF24L01+ module and sensors.

I made it! Just like I wanted.

And now I want to see these information on my computer. I thought to use a SD Card, but is there a way to comunicate the nRF24L01+ module straight to the computer?

I really appreciate the help!

"is there a way to comunicate the nRF24L01+ module straight to the computer?"

Not unless your computer has an SPI port that you can control.

There was another Thread recently in which the OP had a USB device that would connect an nRF24 directly to a PC - but he did not seem to know how you could program it from the PC so that it could communicate with an nRF24 on an Arduino.

The simplest thing may be to connect an Arduino with an nRF24 to your PC using the USB cable.

...R

Thank you for the help!

I'm going to use the micro SD Card, but I made a research and I found a lot of people having trouble to make the nRF24L01+ module work with the micro SD Card.

Is it possible or not?

WalysonMachado: I'm going to use the micro SD Card, but I made a research and I found a lot of people having trouble to make the nRF24L01+ module work with the micro SD Card.

Assuming the SD Card uses SPI then it should be possible to use both it and an nRF24. SPI is designed for multiple devices.

If you have a problem, post your code.

...R

Hi,

And now I want to see these information on my computer. I thought to use a SD Card, but is there a way to comunicate the nRF24L01+ module straight to the computer?

Can your receiver Arduino remain connected to the PC, and use the USB Serial to communicate with a GUI on the PC?

Tom.... :)

Tom No, It can’t be connected. I’m using the SD card.

Hi!
I’m having some trouble to make the nRF24l01 work with the micro card SD.

After the line lcd.print(“Iniciando…”); my lcd just freezes and nothing happens.
Before I included the micro card SD it was working pretty fine.

I put the chipSelect for both and made it HIGH an LOW when using them.

PIN 13 - SCK , 12 - MISO and 11 - MOSI the same for both. PIN 9 for nRF CS and PIN 10 to SD CS.

Give me some advice please!

Thanks.

#include <SD.h>
#include <SPI.h>
#include <RF24.h>
#include <LiquidCrystal.h>

RF24 radio (8, 9);

byte enderecos[][6] = {"1node"};

const int chipSelectnRF = 9;
const int chipSelectSD = 10;

File dataFile;

LiquidCrystal lcd(3, 2, 7, 6, 5, 4);

String dadosrecebidos[2];

void setup () 
{
  SPI.begin();
  
  pinMode(chipSelectnRF, OUTPUT);
    
  radio.begin();
  radio.openReadingPipe(1, enderecos[0]);
  radio.startListening();
  lcd.begin(20, 4);
  lcd.clear();
  lcd.setCursor(5, 0);
  lcd.print("Teste 1.6");
  delay(5000);
  lcd.setCursor(3, 2);
  lcd.print("Carregando...");
  delay(5000);
  lcd.clear();
  
  digitalWrite(chipSelectnRF, HIGH);
  
  pinMode(chipSelectSD, OUTPUT);
    
  if (SD.begin(chipSelectSD))
  {
    lcd.setCursor(0, 0);
    lcd.print("Cartao presente!");
    lcd.setCursor(0, 1);
    lcd.print("Pronto para gravar.");
    delay(5000);
    lcd.setCursor(3, 3);
    lcd.print("Iniciando...");
    delay(5000);
  }
  else
  {
    lcd.setCursor(0, 0);
    lcd.print("Insira o cartao!");
    lcd.setCursor(0, 1);
    lcd.print("Se ja inseriu,");
    lcd.setCursor(0, 2);
    lcd.print("verifique o");
    lcd.setCursor(0, 3);
    lcd.print("cartao");
    delay(5000);
  }
  
  dataFile = SD.open("datalog.txt", FILE_WRITE);
  if (dataFile)
  { // if the file is available, write to it:
  dataFile.println("Tensão e velocidade");
   //I often print many extra lines of text in file headers, identifying details about the hardware being used, the code version that was running, etc
  dataFile.close();
  }
  else 
  {
    dataFile.println("Erro");
  }
  digitalWrite(chipSelectSD, HIGH);
  digitalWrite(chipSelectnRF, HIGH);
}

void recebido ()
{
   digitalWrite(chipSelectnRF, LOW);
   
   if (radio.available())
   {
    while (radio.available())
    {
      radio.read(&dadosrecebidos, sizeof(dadosrecebidos));
    }
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("TENSAO");
    lcd.setCursor(7, 0);
    lcd.print(dadosrecebidos[0]);
    lcd.print("VOLTS");
    lcd.setCursor(0, 1);
    lcd.print("VELOCIDADE");
    lcd.setCursor(11, 1);
    lcd.print(dadosrecebidos[1]);
    lcd.print("KM/H");
   }

  digitalWrite(chipSelectnRF, HIGH);
} 


void gravar()
{
    digitalWrite(chipSelectSD, LOW);
    
  // make a string for assembling the data to log:
  String dataString = ""; //this line simply erases the string
  dataString += "Tensao ";
  dataString += (dadosrecebidos[0]);
  dataString += " VOLTS";
  dataString += " / ";     //puts a comma between the two bits of data
  dataString += "Velocidade ";
  dataString += (dadosrecebidos[1]);
  dataString += " KM/H";
 
  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  dataFile = SD.open("datalog.txt", FILE_WRITE);
 
  // if the file is available, write to it:
  if (dataFile) 
  {
    dataFile.println(dataString);
    dataFile.close();
    // print to the serial port too:
  }
  // if the file isn't open, pop up an error:
  else 
  {
    dataFile.println("Erro");
  }
    digitalWrite(chipSelectSD, HIGH);
}

void loop () 
{
  recebido();
  gravar();
}

You should set the pinMode()s once in setup().

I don't think you are controlling the nRF24 correctly. It has two control pins CE and CSN. CE is used to turn the radio on and off. It must be HIGH if it is to listen or transmit. You seem to be using pin 8 for CE but I see no code to set that pin HIGH.

The CSN pin is used for SPI communication. From the nRF24 datasheet "Every new command must be started by a high to low transition on CSN".

Have you studied the examples in the link I gave you in Reply #9?

...R

Hey Robin.

I've read your post, but I didn't pay the porper attention to this.

So

define CE_PIN 8 // RF

define CSN_PIN 9 //RF

define SS_PIN 10 // SD

RF24 radio(CE_PIN, CSN_PIN);

setup

pinMode(CSN_PIN, OUTPUT); // RF pinMode(SS_PIN, OUTPUT); // SD

When I want to comunicate with nRF, do I do this?

digitalWrite(CE_PIN, HIGH); // enable nRF digitalWrite(CSN_PIN, HIGH); // enable nRF digitalWrite(SS_PIN, LOW); // disable SD

TEST

digitalWrite(CE_PIN, LOW); // disable nRF digitalWrite(CSN_PIN, LOW); // disable nRF digitalWrite(SS_PIN, LOW); // disable SD

Thank you!

WalysonMachado:
When I want to comunicate with nRF, do I do this?

digitalWrite(CE_PIN, HIGH); // enable nRF
digitalWrite(CSN_PIN, HIGH); // enable nRF
digitalWrite(SS_PIN, LOW); // disable SD

This is an oversimplification. As I mentioned earlier CSN_PIN is used interactively.

AFAIK your SD card should work regardless of the state of CE_PIN but CSN_PIN would have to be low when you are communicating with the SD card.

…R