2.4 GHZ RC car NEED HELP! transmitter not working

Hi everyone,
I have built myself an RC car using two arduino nanos and two NRF24L01 chips. I based my project off of this rc car on this website http://meedantech.com/ and i am using the code he provided. I have come across an issue where my transmitter will work when it runs of of an external power source- it only works when it is plugged into the computer. Could anyone look over the code and tell me if there could be something wrong in it? This project must be done by FRIDAY, so any help is greatly appreciated! Thanks!

Code and instructions- http://meedantech.com/
Transmitter Code

/*
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>

Written by: Mujahed Altahle
 
 This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
 To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ 
 or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
 */

/* A simple Project for Remote Controlling with nRF24L01+ radios. 
 We have 2 nodes, the transmitter (this one) and the receiver which is attached to the Car.
 The idea is to transmit  2 parameters , one is Direction (Backward, or Forward with the speed) the other is the Steering (Left, or Right with the degree of rotation).
 The nRF24L01 transmit values in type of "uint8_t" with maximum of 256 for each packet, so the values of direction is divided by (10) at the Tx side,
 then it is multiplied by 10 again at the Rx side.
 The Rx rules is to output the received parameters to port 3 and 6 where the Servo and the ESC are are attached
 a condition is required to prevent the controller from transmitting values that is not useful (like 1480-1530 for ESC and 88-92 for Servo) to save more power as much as we can
 */

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
//
// Hardware configuration
//
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);

uint8_t data[2] ; //buffer to store received data
const uint8_t buffer_size = sizeof(data);
//pins that used for the Joystick
const int analogInPinY= A0; // 
const int analogInPinX = A1;// 
const int StearRight = 3;
const int StearLeft = 5;
const int tx_led=2;// transmission indicator
int Y_value = 0;        // values read from the pot 
int X_value = 0; 
int outputValue = 0; 
/*
const int transmit_pin=6;
 int transmit_enable;
 int ForwrdButton=2;
 int BackwrdButton=3;
 */
//
// Topology
//

// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xE8E8F0F0E1LL;


//
// Setup
//

void setup(void)
{

  Serial.begin(9600);
  printf_begin();

  //
  // Setup and configure rf radio
  //

  radio.begin();

  radio.openWritingPipe(pipe);
  //
  // Dump the configuration of the rf unit for debugging
  //

  radio.printDetails();

  //
  // Set up buttons
  //

  /*to be used later
   pinMode(ForwrdButton,INPUT );
   pinMode(BackwrdButton,INPUT);
   pinMode(transmit_enable,INPUT);
   */
  pinMode(tx_led,OUTPUT);
  digitalWrite(tx_led,LOW);
  pinMode(StearRight,INPUT);
  pinMode(StearLeft,INPUT);
  digitalWrite(StearRight,HIGH);
  digitalWrite(StearLeft,HIGH);
  
}

//
// Loop
//

void loop(void)
{

  X_value = analogRead(analogInPinX); 
  data[0] = map(X_value, 0, 1024,100 , 200); 
  Y_value = analogRead(analogInPinY); 
  data[1] = map(Y_value, 0, 1024, 135, 45);
    if(!StearRight)
      data[1]=45;
    else if(!StearLeft)
      data[1]=135;   
  //  transmit_enable=!digitalRead(transmit_pin);
  //an error ratio around +3,-3 appears  coming from the Joystick  all the time,
  //so we neglect them (using the following if statement) because they make the system transmitting data always and they are useless and waste of power

  if((data[0]>153 || data[0] <=149) ||  (data[1]>=92 || data[1]<88))
  {
    //printf("Now sending...");
    bool ok = radio.write( data, buffer_size );
    //if (ok)
    printf("ok\n\r");
    // else
    printf("failed\n\r");
    // delay(15);
    digitalWrite(tx_led,HIGH); //turn led on after transmission
  }
  else digitalWrite(tx_led,LOW);//keep led off when no transmission
}

Receiver Code

/*
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>

 Written by: Mujahed Altahle
 
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ 
or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

 */
/* A simple Project for Remote Controlling with nRF24L01+ radios. 
 We have 2 nodes, the transmitter (this one) and the receiver which is attached to the Car.
 The idea is to transmit  2 parameters , one is Direction (Backward, or Forward with the speed) the other is the Steering (Left, or Right with the degree of rotation).
 The nRF24L01 transmit values in type of "uint8_t" with maximum of 256 for each packet, so the values of direction is divided by (10) at the Tx side,
 then it is multiplied by 10 again at the Rx side.
 The Rx rules is to output the received parameters to port 3 and 6 where the Servo and the ESC are are attached
 a condition is required to prevent the controller from transmitting values that is not useful (like 1480-1530 for ESC and 88-92 for Servo) to save more power as much as we can
 */
 
#include <Servo.h> 
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
//
// Hardware configuration
//

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);

Servo servo; //steering servo declaration 
Servo esc; // Electronic Speed Contoller declaration

// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xE8E8F0F0E1LL;

//
// Payload
//

uint8_t received_data[2];
uint8_t num_received_data =sizeof(received_data);

//
// Setup
//

void setup(void)
{
  delay(3000); //wait until the esc starts in case of Arduino got power first
  servo.attach(3);  // attaches the servo on pin 3 to the servo object 
  esc.attach(6);  // attaches the ESC on pin 6 to the ese object  
  servo.write(90);
  //
  // Print preamble
  //

  Serial.begin(57600);
  printf_begin();

  //
  // Setup and configure rf radio
  //

  radio.begin(); //Begin operation of the chip.
  // This simple sketch opens a single pipes for these two nodes to communicate
  // back and forth.  One listens on it, the other talks to it.
  radio.openReadingPipe(1,pipe);
  radio.startListening();
  //
  // Dump the configuration of the rf unit for debugging
  //
  radio.printDetails(); 
}


void loop(void)
{
  // if there is data ready
  if ( radio.available() )
  {
    bool done = false;
    int ESC_value;
    while (!done)
    {
      // Fetch the payload, and see if this was the last one.
      done = radio.read( received_data, num_received_data );
      ESC_value=received_data[0]*10; //Multiplication by 10 because the ESC operates for vlues around 1500 and the nRF24L01 can transmit maximum of 255 per packet 
      esc.writeMicroseconds(ESC_value);
    //  Serial.println(ESC_value);
      servo.write((received_data[1]));
     // Serial.println(received_data[1]);
    }
  }
}

If it is working when you use the power from the USB port (I.E. plugged in to your computer) and not from an external source. It is suggesting that there is an issue with either the wiring or the power source. What voltage is the power source and how are you connecting it to the NANOs

If you can some get some pictures of the way it is wired up that would help.

Cheers Pete.

I have a 9V battery connected to the Vin pin with a rocker switch in the middle to turn it on and off. Other than that, I have everything hooked up acording to the wiring diagram on http://meedantech.com/ . The only difference is because of the limited ground wires, I have soldered the ground wire coming from the transceiver to the ground wire of the battery which is plugged into a ground pin on the nano. I can take a pic, but it is kind of a mess of wires.

Here is the transmitter

Hmmm OK . so if you load the stock "blnk" sketch does that run on the battery or only with the cable plugged in.

and where is the TX drawing its power from ?

Yes it does run off of the battery

The transceiver is drawing power from the 3.3V pin

ok so have you tested if the 3v3 pin is delivering 3v3 on battery power ?

and that the 5v rail is delivering 5v to the pot

Both pins are delivering the proper voltage

So here is where I'm at. I still dont know what the issue is but i have checked all the pins- the Vin, 5V and 3.3V and Vin- I am getting 4.9V from 5, 3.7V from the 3.3 pin and I hooked up a 9V battery to my Vin. I am getting 5V from the voltage regulator, has anyone ever come across this issue before? Also, neither the TX or RX lights go on when it runs off of external power.

OK so I found out that the FTDI chip only works when there is power coming in through the USB port. Could I take a mini USB cord, cut it in half, and connect the positive and negative wires to a 5v regulator and connect that to my battery? that would allow the FTDI chip to receive power right?

red_rider6847:
OK so I found out that the FTDI chip only works when there is power coming in through the USB port.

I don't see how that's relevant. The FTDI chip just acts as a bridge between TTL serial and USB serial. When the USB is disconnected, it's unused.