Help With Robotics Project. Serial Monitor Issues(Issue Resolved)

Hey Guys,

So I've been following along with an Arduino Robotics Project to build a GPS and bluetooth controlled robot as my first arduino based project using the arduino mega 2560 . I wanted to see if I could replicate the original and add my own twist to it. The original project can be found at this link https://www.instructables.com/id/How-to-Build-a-GPS-Guided-Robot/ and the Github for the project can be found here GitHub - mkconer/GPSRobot: GPS Bluetooth Robot. My edits to the original project can be found here GitHub - andrimyr/Soil-Probing-Robot The goal of the project is to drill holes in the ground with the auger and then insert a temperature and moisture sensor into the ground and do this repeatedly. The project still has a lot of wonky stuff on it (drive train, wiring, sensor dropper) which is mostly caused by budget and time restrictions but I'm still working on it and it's far from done. So far I have been able to get it driving and responding to my commands as shown in this video. The project also works with a MitAppInventor based app. This is the app I use with the robot with the original creator credited in the description http://ai2.appinventor.mit.edu/#4573106487820288

On to my actual problem. After my latest test, I lost bluetooth connection when a 9v battery got unplugged from the robot. Since then I have been unable to get serial communication from the serial monitor when I run the GPSrobot code. As in the serial monitor does not display anything at all at any baudrate. Normally, the program will atleast say "Pause for Startup " and then countdown from 5 to 1 and then search for satellites for the GPS to connect to as part of the startup final but since that test the other day I have not been able to get any result from the serial monitor. I am still able to connect to bluetooth using the app but I can not make the robot move at all. What could cause a problem like this? Is this an issue with my Arduino IDE or a more serious problem?

edit>>
I also tried running simple code to test the serial monitor and I was able to get a read out. Also I have not touched the electronics at all since they were in a functional state so everything should be as it was when the robot was driving

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
 
 
 

}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("begin");
  delay(500);
 ]
}

EDIT************

The issue was resolved when I got a new Arduino Board. It seems that my original board got fried or damaged in some way when that 9v battery came loose. I added some extra harnessing zip ties to ensure the battery is secured tightly so this issue won't come up again.

"Also I have not touched the electronics at all since they were in a functional state so everything should be as it was when the robot was driving"

Just getting back to basics, an invalid assumption is being made somewhere, and maybe this it.

You seem to have posted some code that does work but I can't see the code that you say doesn't work. That doesn't give us much to help with.

And just to check, did you run the good code on the same Arduino that the failing code runs on? Without changing any of the connections?

Steve

I forgot to include the link to my changes. Added a github link in the text. Here is the same link GitHub - andrimyr/Soil-Probing-Robot. Also to answer your question, I ran the serial test code on the same arduino that the failing code runs on without changing any connections.

For a little bit I was starting to believe that when my battery came out there was some kind of short and it permanently damaged the robot but in that case I wouldn't have been able to upload my serial test code and have it run.

On another side note I don't know if it appropriate to post the whole code with several different files on it to this forum directly into the post using code tabs or if it's better to just use github links.

I found another issue with the Arduino. When I try to burn the bootloader I get an error message saying that the programmer is not responding

Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avrdude -CC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -carduino -PCOM8 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.33.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM8
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xf1
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xf1

avrdude done.  Thank you.

Error while burning bootloader.