Model was working fine but refused to work after 1 hour

int state;  
const int in1 = 7;
const int in2 = 6;
const int in3 = 4;
const int in4 = 5;
void setup()
{
  pinMode(in1, OUTPUT);
    pinMode(in2, OUTPUT);
    pinMode(in3, OUTPUT);
    pinMode(in4,OUTPUT);
    Serial.begin(9600);                        // Baud rate set to 9600bps
}
void loop() {
    if(Serial.available() > 0)
    {    
      state = (char)Serial.read();  
    }
    if (state == '1')
    {
      Serial.println("A");
       digitalWrite(in1, HIGH);
       digitalWrite(in3, HIGH);
       digitalWrite(in2, LOW);
       digitalWrite(in4, LOW);
       
    }
    if (state == '2')
    {
       Serial.println("B");
       digitalWrite(in1, LOW);
       digitalWrite(in3, LOW);
       digitalWrite(in2, HIGH);
       digitalWrite(in4, HIGH);
}
if (state == '3')
    {
      Serial.println("C");
       digitalWrite(in3, LOW);
       digitalWrite(in1, HIGH);
       
}
if(state =='4')
    {
      Serial.println("D");
       digitalWrite(in2, LOW);
       digitalWrite(in4, HIGH);
       
}
if (state=='5')
{
  Serial.println("HERE");
  digitalWrite(in1, LOW);
       digitalWrite(in3, HIGH);
       digitalWrite(in2, LOW);
       digitalWrite(in4, HIGH);
}
}
        

I am making a rc car that will have a remote control on my phone that i have made using mit app inventor.........evey connection was perfect and the car was running perfectly......but after I came from having dinner and switched it on it refused to work anymore.....The char vakues sent from the app is not getting received by the arduino nano.......but works fine when i enter the characters in the serial monitor......what kind of problem is this please help :frowning:


Button 1=UpButton
Button 6=DownButton
Button 3=LeftButton
Button 4=RightButton

i need a solution asap i have to present the model day after tomorrow :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear:

Wow. !?

These two cases leave the driver open to getting unwanted input. You should define all four inputs.

  if (state == '3')
  {
    Serial.println("C");
    digitalWrite(in3, LOW);
    digitalWrite(in1, HIGH);

  }
  if (state == '4')
  {
    Serial.println("D");
    digitalWrite(in2, LOW);
    digitalWrite(in4, HIGH);
  }

https://wokwi.com/projects/374280142521833473

Disconnect the bluetooth module and try to control the car using Serial Monitor. Does that work?

Is there pairing between the radio telephone and the BT module?

If not, then carry out the pairing.

You might design and code a second serial interface for the BT modul by using the libary "SoftwareSerial".

Yess it works perfectly fine

Pairing done everything done, the model was working but stopped on it own after an hour it was unplugged too(if the problem being burning of the controllers)

That too done Software Serial1(2,3)

Everything tried

Then the problem is in the wireless phone, which drops the BT connection after an hour.

OK, good chance that the hardware is still OK.

Please show a schematic how evevrything is connected (photo of hand drawn one is fine). It should contain every connection (including power and ground). Which motor driver are you using.

Not good but understandable :blush:

16.1V to 12v?

the 7805 has 11V across it. The "7805" comes in many different packages and if its a "little " one it could overheat.
https://www.mouser.co.uk/ProductDetail/onsemi/MC78L05ACPG?qs=%252B9%2Fcbd0IE0QtJJVqZ5km9w%3D%3D&mgh=1&vip=1

Hi,
Have you got the bypass capacitors the LM7805 datasheet recommends?
image

Can you please post some images of your project?
So we can see your component layout.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.