RC Car

Greetings,

I have created an rc car with the following modules and i need a help :

  1. Transmitter “NRF24L01” with two joysticks all connected to arduino nano ( 9v power supply ), all work perfectly in this module.

  2. Receiver “NRF24L01” with 1 servo and H-bridge L298n + DC motor all connected to arduino nano (power supply 9v) which works very well with 9v. Now the issue in this module if i extend the power supply to 12V and try to move the joystick to rotate the motor then the motor keeps running and doesn’t stop and you have to reset the arduino or disconnect power. what is the issue ? I have tried changing cables to thicker ones with good quality.
    By the way i am supplying the power to servo through the 5V h-bridge and connected the 12V to arduino + h-bridge port.

** Please check the attached quick receiver module.

Highly Appreciated,

Any Help ???

blackhawk85: Any Help ???

No, but a real schematic rather than a simple block diagram might give a clue.

Paul

Maybe you could try putting decoupling capacitors on the Vin pin (and other supply pins) .... and just see if there's any improvement on the situation. Maybe focus on the power supply.... since things are obviously working with the other one.

Show us the specs of both power supplies.

Hello,

I have used the decoupling capacitors but unfortunately it didn't work, shall i use a regulator,diode ?

can't see anything wrong with the schematic.

Measure all the pins and check the voltages.

Okay,

Here what i found , if you move the joystick up slowly then it works just fine , keep in mind that
i am applying FORWARD & BACKWARD on the same motor but if you move the joystick whether UP/DOWN quickly then the arduino reset.

So is it the code issue ?

///////////////////////////////////////////////////////////////////////////

// GND : GND
// VCC : 3.3V
// SE : pin 9
// CSN : pin 10
// SCK : pin 13
// MOSI: pin 11
// MISO: pin 12

// ESC : pin 6
#include <SPI.h>
#include “nRF24L01.h”
#include “RF24.h”
#include <Servo.h>
#define SServoMIN 30 // Don’t go to very end of servo travel
#define SServoMAX 170 // which may not be all the way from 0 to 180.

#define enB 3
#define in4 5
#define in3 6

struct dataStruct {
unsigned long _micros; // to save response times
//Servo
int SXposition; // The Joystick position values
int SYposition;
bool SswitchOn; // The Joystick push-down switch
//Motor
int MXposition; // The Joystick position values
int MYposition;
bool MswitchOn; // The Joystick push-down switch
} myData;

Servo myServo;

int ServoPosition;
int motorPosition;

RF24 radio(9,10);
int ReceivedMessage[1] = {000};
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void)
{

Serial.begin(9600);
radio.begin();
radio.setRetries(15,15);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(1,pipe);
radio.startListening();

myServo.attach(8);

pinMode(enB, OUTPUT);
pinMode(in4, INPUT);
pinMode(in3, INPUT);

digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

}

void loop(void)
{

if (radio.available()){
while (radio.available()) // While there is data ready to be retrieved from the receive pipe
{
radio.read( &myData, sizeof(myData));
// Servo block
ServoPosition = map(myData.SXposition, 0, 1023, SServoMIN , SServoMAX);
myServo.write(ServoPosition);

//Serial.print(F(" Servo X= “));
//Serial.print(myData.SXposition);
//Serial.print(F(” Servo Y= “));
//Serial.print(myData.SYposition);
//Serial.print(F(” Servo Button= "));
//Serial.println( myData.SswitchOn);
////////////////////////////////////////////////////////////////

// Motor Block

int pwmOutput = map(myData.MYposition, 460, 0, 0, 255); // Map the potentiometer value from 0 to 255
int pos=myData.MYposition;
// Send PWM signal to L298N Enable pin
Serial.println(myData.SswitchOn);

if(pwmOutput<-30 & (myData.SswitchOn==1))
{

analogWrite(enB, 0);
analogWrite(enB, pwmOutput*-1);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

}
else if(pwmOutput>30 & (myData.SswitchOn==0))
{

analogWrite(enB, 0);
analogWrite(enB, pwmOutput);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);

}
else
{

analogWrite(enB, 0);

}

//////////////////////////////////////////////////////////////////

}

}

}

Show us the specs of both power supplies.

If you use the supply that works.......and it works every time..... then better focus on what's happening with the 'other' supply. Eg.... specifications.... etc.

Hi,

Please check the attached , I only have 1 power supply to the whole module “Receiver”, i also have tried 9v and 12V and only happens if you move the joystick upward/backward quickly!

How i can avoid the voltage when it goes instantaneously when moving the joystick UPWARD or BACKWARD quickly and that what raise the issue indeed ?

***Specs :

Arduino : Nano

Transceiver : “NRF24L01”

1 servo : TowerPro 9g

H-bridge: L298n

1 Power Supply : 9V or 11.36V or 12 V

When we mean specs..... we mean power supply details...... voltage rating and current rating, power rating etc.

You previously wrote..... "2) Receiver "NRF24L01" with 1 servo and H-bridge L298n + DC motor all connected to arduino nano (power supply 9v) which works very well with 9v".

It's important that your details stay consistent. If for some reason that you change your details..... then that needs to be indicated. Otherwise, people need to try to figure out what the actual problem is. And they might not be able to figure it out - due to inconsistent details.

I didnt change any details all the specs are correct, except clearing more details for the issue.

So what is the issue with the circuit ?

You asked for both power supplies and as you notice in the schematic figure i only have 1 power supply !

In addition the battery is "Kodak 9v 6LR61"

blackhawk85: You asked for both power supplies and as you notice in the schematic figure i only have 1 power supply !

Below.... you wrote....

blackhawk85: 2) Receiver "NRF24L01" with 1 servo and H-bridge L298n + DC motor all connected to arduino nano (power supply 9v) which works very well with 9v. Now the issue in this module if i extend the power supply to 12V

9V and 12V .... that's two power supplies. Two individual power supplies. Your post indicated that everything works very well with the 9V supply. But you also said that when you used the 12V supply (instead of the 9V supply) ..... then that's when things did not work. Right?

Additionally, when you wrote everything works 'very well' with the 9V supply, then why are you now changing the story to some issue with forward and reverse control? This just means..... get your story together. Otherwise, if the situation is different from your original story, then attempt to indicate it.

Also .... you still haven't provided required details about the power supplies you're using ... voltage rating and current rating, power rating etc.

Right,

Would you please keep your posts informative and to the point ! Or at least try to check the schematic figure attached and give some solutions!

I am trying to help the users to get the big picture of the problem so they can give solutions, i cannot put all together when many cases come up with me!

I am awaiting straight forward replies !!

Anyway,Thank you for your help ...

When somebody persists with the habit of doing the 'not registering' or 'nobody at home' thing, then that makes it difficult to help in an efficient way.

You still haven't provided a circuit diagram, and haven't provided voltage/current/power specifications of your power supplies..... the 9V one, and the 12V one. You also haven't described the situation clearly.

OPs image
d2a6df72d1353129a59be1f789bd48a3f5bedf04.jpg

This is not an adequate diagram. It leaves out critical detail.
Most servos I know have 3 wires. Power. Ground. Signal.
We need to know where all 3 are attached.
All the wires for all the components.
You mention a battery. The schematic does not show a battery or where it is connected.
You mention that you have decoupling caps. But they are not on the diagram, and we have no information in what values you used.