Autonomous Ground Vehicle (AGV) @ Self-Driving Toy Car (SDTC)

Hello,

i’m doing a project using toy car that controlled by gps and electronic compass. I also added bluetooth modul in the project that controlled by android. So here is the problem:

  1. My SDTC cant reach the destination (Latitude & Longitude),the SDTC went wrong direction, not sure either hardware or programming problem. By the way, electronic compass and gps have been configured and calibrated.

  2. When i’m trying to give command via android to bluetooth to get the gps data and run the motor, the loop in programming stuck. By the way, other command work fine.

Here i attach my coding. Thanks in advance.

p/s : i’m new to programming and arduino, thanks for advice and guide.

project_test3_bluetoothv2.ino (13.7 KB)

Addition : My hardware is : 1) GPS : FV-M8 2) Electronic Compass : HMC6352 3)Microcontroller : ATmega 2560 4) Bluetooth module : HC-05 (gomcu)

What do your debug prints tell you is happening?

Hello, thanks for the reply.

Did you mean the Serial Monitor? For my 1st problem which is the SDTC didnt reach the location, the Serial monitor print correct distance, gps heading and compass heading. I'm afraid that certain part in programming not written correctly.

For my 2nd problem which is the programming flow stuck in loop, the serial monitor only print once the distance,gps data and compass heading and the programming flow stuck ( i guess in the gps function). The serial monitor should keep print the distance, gps data and compass heading which is every 0.25second. The programming didnt stuck in the loop if i exclude bluetooth coding.

Thanks again for the reply.

hey. i'm even newer to arduino than you, and i'd like to see the way you're making it. Could you make a guide or something or post your source? I'm trying to build that and need some help. I am using an uno though.

goacego: hey. i'm even newer to arduino than you, and i'd like to see the way you're making it. Could you make a guide or something or post your source? I'm trying to build that and need some help. I am using an uno though.

Hi there, you try visit this website. It is a good way to start a autonomous vehicle.

http://letsmakerobots.com/content/fundamentals-gps-guided-vehicle

Hello, i would like to ask what wrong with this switch case coding

case 'C' :          // Run Motor
               while(c!='D') {
                 c = (char) Serial2.read();
                    if (newdata)
                    {
                  gpsdump(gps);
                  lcd.setCursor(1,0);
                  lcd.print("Acquired Data");
                  lcd.print("-------------");
                  lcd.setCursor(15,0);
                  lcd.print(u);
                  u++;
                  Serial.println("-------------");
                  Serial.println(c);
                  Serial.println(); 
                 }
                 c = (char) Serial2.read();
               }
              break;

The program should get out from the loop when Button D is press, but it didnt

You've got two reads in the loop; if the first one sees a 'D', the second one will overwrite 'c'.

Thanks for your explanation, i got another question. How i can get out from the gpsdump function without have to wait the gpsdump function finish it's work.

Well, the short answer is put a "return" in gpsdump at the point you want to leave, but the longer answer is "why?"

Ok,thanks…i will try