Notifications
Clear all

Wireless joystick for Arduino car with nRF2401+

39 Posts
3 Users
1 Likes
9,801 Views
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

Need help for 8 year old grandson.

I bought him the following:

2 - 2560 mega ( yellow in color )

2 - nRF2401 adapter modules

2 - nRF2401

He wired both the same.

GND to ground

VCC to 5v pin

CE to pin 8

CSN to pin 53

SCK to pin 52

MOSI to pin 51

MISO to pin 50

He downloaded nRF24_client to one and nRF24_server to the other.

When we hook up the " client " side to the serial monitor we get " init failed " then a repeating " no reply to nRF24_server "

When we hook up the " server " side to the serial monitor we get " init failed " and nothing else.

Can some one help? I don't know any thing about this.

 


   
Quote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

Hi,

  1. Go to Preferences in the IDE, and click "compilation" next to Show verbose output during:
  2. Run compile!
  3. Click button "Copy Error Messages" and paste them into a text file.
  4. Post both  .ino and .txt files as attachments to your next post here.

Then we can see what we can do!

The more information, the better!


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 
Posted by: @chickenhawk

I don't know any thing about this.

Then with all due respects I don't know why you would take on a complicated project. What exactly is the project anyway? I would choose a project within a tutorial and do that first as a learning experience.

https://dronebotworkshop.com/nrf24l01-wireless-joystick/

 


   
ReplyQuote
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

I sorry " complicated project " ???? run 6 wires on each and download 2 sketches.  He did follow the tutorial step by step from the  Wireless Joystick for Arduino Robot Car with nRF24L01+


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

Sorry I didn't realise you were following Bill's project.  Apart from mentioning the nRF24_client and nRF24_server code,  which I now see is where the code came from,  I was completely in the dark.  If you follow the instructions and check all the wiring it should work although you say you are using the Mega not the Uno so maybe there is an issue there?

Suggest you post the error messages as suggested by Pugwash and I am sure the problem can be resolved.

Apologies again if I came across harshly.  We all love electronics here and welcome all comers whatever your starting level is and there are talented people here more than willing to help.  Nice to have a grandfather interested in electronics.  When I was young I was actively discouraged from wasting time on the hobby instead of concentrating more on the family business.

 

 


   
ReplyQuote
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

@pugwash

He did steps 1 and 2 but after " done compiling " there were no error messages.

It seems to me that the " client "  side is sending to the " server " side but the server side is not receiving or is receiving but not answering back. Does that seem right.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

Some others had issues with the Mega?

https://forum.arduino.cc/index.php?topic=71574.0

 

 


   
ReplyQuote
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

@casey

No problem at all, I'm 67 and trying to get my grandson away from video games. I come from the land of remote control airplanes/heli's . I checked the continuity of all the wires and they all checked out, but don't know how to check the output on the 2560 mega pins.  The pin lay out is a bit confusing they way they are printed on the board. It appears that ( reading from left to right ) the pin numbers printed on the board don't line up with where the pins plug in, the first number printed on the board is " 22 " and seems to line up with the second hole and 50 and 52 seem to line up with the third and second holes on the far right, the last hole seems to have no number printed next to it. I hope I'm explaining this properly.

 


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@chickenhawk

If there are no errors showing after compilation. then you are having runtime errors and runtime errors are not reported in the Arduino IDE.

I suggest you add

Serial.begin(9600);
Serial.println("Upload successful");

in the setup() section, to prove that compilation and upload are not the problems.

If this is OK, then a complete rebuild of the wiring is necessary, as I find it difficult to believe that Bill's code is wrong.

Let us know how you get on!!

 

The pin designations are not only on the board but also on the sides of the pins themselves. I've got the same problem, "need reading glasses and magnifying glass" to see these damned numbers! ? 


   
ReplyQuote
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

@pugwash

These 2560 mega are yellow so I'm guesing they are a off shore clones.  We double checked the wiring and it is right. Got the super super magnifying glass out and nothing printed on the side where the pins plug in.  But on the right hand side the first pin spots appear to be ground and the next 2 should be pins 52 then 50. After my grandson finishes he home work I will get him to add you suggest.  Now I see that " Casey " posted that on his 2560 mega he had to hook up " CE " to pin 53 and "CSN " to pin 48 or should I just leave things alone?


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

No problem at all, I'm 67 and trying to get my grandson away from video games.

Good luck with that one.  My two sons only used the computers for games.  One used to have LAN parties where all his mates would bring over their computers link them up and play war games of some kind.  A shock to me because I never had any real interest in computer games although I was a computer nerd when it came to programming and electronics.

The numbers line up for me maybe you are looking at an angle to the pins?

megaPins

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 
Now I see that " Casey " posted that on his 2560 mega he had to hook up " CE " to pin 53 and "CSN " to pin 48 or should I just leave things alone?

No I haven't posted that!  I don't have the nRF2401 so I can't do the project myself.

As I found out recently when I misaligned the pins of a module any mistake in the wiring can be fatal.

 


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@chickenhawk

I have just noticed something in your original post!

You may have fried the nrf24l01 modules, as you said that Vcc was connected to 5V, it should be connected to 3.3V and in conjunction with a 10µF capacitor from 3.3V to Gnd.

Only the data pins are 5V tolerant not Vcc!


   
ReplyQuote
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

@casey

Games on my computer, games on my wife's tablet, games on our phones. Had to put put a stop to it as school work was paying the price.  Top pins are not labeled 5v we did not know that.   It kind of looks like our board where the 22 pin spot does not line up up with the hole in the board. We may have plugged pins into the wrong spots the first time around ( hope we did not hurt any thing by doing this)  This looks like how we had it wired

CE to 8

CSN to 53

SCK to 52

MOSI to 51

MISO to 50

 

 


   
ReplyQuote
(@chickenhawk)
Member
Joined: 4 years ago
Posts: 44
Topic starter  

@pugwash

nRF24l01 are hooked up to nRF24L01 adapters that has a regulator to take from 5 volts to 3.3  volts. Hope we did not fry any thing


   
ReplyQuote
Page 1 / 3