arduino + nrf24l01 not working with external power supply

Hello,
New member to this forum and to the world of embedded system. I am working with nrf24l01 and my problem is that one board with nrf24l01 connected to PC using USB works properly but if I power that same board with adaptor only the arduino switches on but the nrf24l01 module do not work neither as a receiver nor as a transmitter. Also the one connected to PC gives me acknowledgement of the sent packet.
I am using Arduino uno r3.
I tried googling it but could not find any answer. I even tried to do everything over and over again but no use.
Thanks.

Does the board work without the NRF24L01 when powered via the external power supply?

@Tapas08, please draw a simple diagram showing how you have everything connected and post a photo of the diagram.

Do you have a 10µF capacitor between Vcc and GND of the nRF24?

This Simple nRF24L01+ Tutorial may help. I have no problem operating my Arduinos without a PC.

...R

pert: Does the board work without the NRF24L01 when powered via the external power supply?

Yes it works

Robin2:
Do you have a 10µF capacitor between Vcc and GND of the nRF24?

This Simple nRF24L01+ Tutorial may help. I have no problem operating my Arduinos without a PC.

…R

No i don’t have. But it works when connected using usb.
Here is the circuit diagram.

Image from Reply #4 so we don’t have to download it. See this Image Guide

bcd8565c5e2de7e4b29cade22051f45f5aac7b52.png

…R

Somehow that image does not represent what I asked for

please draw a simple diagram showing how you have everything connected and post a photo of the diagram.

I can't tell from that what each connection on the nRF24 is?

No i don't have. But it works when connected using usb.

Well what happened when you tried your Arduino with a capacitor and without connection to the PC? It's rather a waste of time making a suggestion if you won't try it!

...R

Somehow that image does not represent what I asked for I can't tell from that what each connection on the nRF24 is?

That is how I am connecting, source -> https://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo One board is connected to PC and another is connected to external power supply using adaptor. Do you want me to upload a photo of that? Sorry if I could not understand what you asked for.

Well what happened when you tried your Arduino with a capacitor and without connection to the PC? It's rather a waste of time making a suggestion if you won't try it!

Sorry I don't have the capacitor with me and won't be able to buy one till tomorrow since all the shops are closed due to two days of festival. I will let you know tomorrow the result.

Thanks.

Robin2: Image from Reply #4 so we don't have to download it. See this Image Guide

Thanks for the tip.

Tapas08:
Do you want me to upload a photo of that? Sorry if I could not understand what you asked for.

I just wanted you to make a simple drawing with pencil and paper and post a photo of it. Or you could use a PC drawing program like I did for my Tutorial. In either case it is easy to write in the names of the pins so there is no confusion. Also, I found more than once when I set out to draw a diagram of my connections from looking at my hardware (rather than at some other person’s diagram) I discovered where I had made a mistake with my wiring.

…R

Robin2: Also, I found more than once when I set out to draw a diagram of my connections from looking at my hardware (rather than at some other person's diagram) I discovered where I had made a mistake with my wiring.

That really helped. I tried to what you said and found what I did wrong. I connected MOSI to Pin 12 and MISO to Pin 11. I just got the capacitor, will connect it and let you know further. Just wanted to let you know that your suggestion helped. Thanks. I will remember this for lifetime.

Here is my circuit diagram after adding 10uF capacitor

tx_rx.png

And its still not receiving.

Tapas08: And its still not receiving.

And it is still not a photo of a pencil drawing. And I still cannot tell which pin is which.

It is much too easy to misunderstand those pretty pictures made by Fritzing.

...R

Robin2:
And it is still not a photo of a pencil drawing. And I still cannot tell which pin is which.

Here it is. I am sorry I am bad at drawing so I was using software to draw one for me.
Hope this is what you are asking. I am sorry if this is not what you are expecting.

P_20170315_111017.jpg

Thanks. However you have gone to far more trouble than was necessary. Drawing the breadboard actually just confuses things - as well as being tedious to draw. Have you looked at the simple diagrams in my tutorial?

Anyway, as far as I can tell you have it wired up correctly.

If you have tried that wiring with the examples in my tutorial and the communication is not working then there is a good chance that one of your nRF24s is faulty.

To be absolutely sure please post the two programs that YOU have uploaded to your Arduinos. I presume you are using two Unos?

It would also be a good idea to monitor the output from both of them (connected to your PC) at the same time.

...R

Yes I am using Arduino Unos for both TX and RX. And I currently testing it on my PC only on serial monitor. It seems that the receiver receiving some random data, mostly the received data is “68”. I tried to swap the code on two UNOs but I get the same results. The one receives random data and the transmitter fails to transmit the data.
Here is the code.

Receiver

#include <EEPROM.h>
#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>

int led = A0;
int msg[1];
RF24 radio(9, 10);
const uint64_t pipe = 0XE8E8F0F0E1LL;

int eepAddress = 0;
int data;

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.enableAckPayload();
  radio.setAutoAck(true);
  radio.openReadingPipe(1, pipe);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
  pinMode(led, OUTPUT);
  printf_begin();
  radio.printDetails();
}

void loop() {
  printf_begin();
  if (radio.available()){
    //int done = 0;
    radio.read(msg, 1);
    Serial.print("Received Packet: ");
    Serial.println(msg[0]);
    if (msg[0] == 9028){
      Serial.println("Msg received. Writing msg to memory...");
      digitalWrite(led, HIGH);
      EEPROM.put(eepAddress, msg);
      EEPROM.get(eepAddress, data);
      Serial.print("Data at address ");
      Serial.print(eepAddress);
      Serial.print(" is \t");
      Serial.print(data);
      Serial.println("\n");
      eepAddress+= sizeof(msg);
//      delay(400);
    }else{
      digitalWrite(led, LOW);
    }
  }

And for Transmitter

#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>

int led = A0;
int msg[1];
RF24 radio(9, 10);
const uint64_t pipe = 0XE8E8F0F0E1LL;

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.stopListening();
  radio.enableAckPayload();
  radio.setPALevel(RF24_PA_MIN);
  radio.openWritingPipe(pipe);
  radio.setAutoAck(true);
  pinMode(19, OUTPUT);
  printf_begin();
  radio.printDetails();
}

void loop() {
  Serial.println("Writing...");
  printf_begin();
  
  digitalWrite(led, LOW);
  delay(500);
  msg[0] = 9028;
  Serial.println(radio.write(msg, 1));
  if (radio.isAckPayloadAvailable()){
    Serial.println("ACk received...");
    digitalWrite(led, HIGH);
    delay(2000);
  }
}

Also can I get a link to your tutorial? I tried to find it in your profile.
Thanks.

Tapas08: Also can I get a link to your tutorial? I tried to find it in your profile. Thanks.

It's in Reply #2

...R

Thanks. I tried your tutorial. And it's still not receiving. It receives just once but not sending acknowledgement back.
Here is the screen shot of both the serial monitors.

I know the tutorial code works because I have downloaded and tried it a few times.

As I said earlier, it is possible that you have a faulty nRF24 and the only way I know to check that out is to get some extra modules.

After you have uploaded the code it may help to de-power and re-power the Arduinos to make sure the nRF24 resets.

I presume you have nothing but the nRF24s connected to your Unos?

...R

I presume you have nothing but the nRF24s connected to your Unos?

Yes atm only nrf24s are connected but later I'll be adding accelerometer and GPS module to one uno and ESP8266 to another.

As I said earlier, it is possible that you have a faulty nRF24 and the only way I know to check that out is to get some extra modules.

Can you tell me why its possible to be faulty, since both can transmit and receive but the only problem is that the transmitter don't receive acknowledgement? Just wanted to know. I will buy one tomorrow and try again. But I just wanted to know the possible reason. Cause they can transmit and receive. Thanks. And sorry for being such a noob.

After you have uploaded the code it may help to de-power and re-power the Arduinos to make sure the nRF24 resets.

Yes i do that time to time just to be sure.

Thanks for all the help!