Sonar system problem

Hello, I do the same hardware connection and programming but my servo motor doesn’t rotate but show my ultrasonic sensor value…
Here is the link to the same project.


What is the problem I couldn’t figure out
Note: 1. I have written the same code and the hardware connection is the same.
2. My motor works fine

The problem I am facing which I GUESS is

  1. Arduino Code (library Problem)
  2. Hardware Connection among arduino and Bolt WiFi Module
  3. what is bolt cloud pro(Do I required it)

Here is the Arduino code
// Includes the Servo library
#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0,1);
// Defines Tirg and Echo pins of the Ultrasonic Sensor
const int trigPin = 9;
const int echoPin = 10;
// Variables for the duration and the distance
long duration;
int distance;
Servo myServo; // Creates a servo object for controlling the servo motor
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600);
myServo.attach(11); // Defines on which pin is the servo motor attached
}
void loop() {
// rotates the servo motor from 15 to 165 degrees
for(int i=15;i<=165;i++){
myServo.write(i);
delay(30);
distance = calculateDistance();// Calls a function for calculating the distance measured by the Ultrasonic sensor for each degree

Serial.print(i); // Sends the current degree into the Serial Port
Serial.print(","); // Sends addition character right next to the previous value needed later in the Processing IDE for indexing
Serial.print(distance); // Sends the distance value into the Serial Port
Serial.print("."); // Sends addition character right next to the previous value needed later in the Processing IDE for indexing
}
// Repeats the previous lines from 165 to 15 degrees
for(int i=165;i>15;i–){
myServo.write(i);
delay(30);
distance = calculateDistance();
Serial.print(i);
Serial.print(",");
Serial.print(distance);
Serial.print(".");
}
}
// Function for calculating the distance measured by the Ultrasonic sensor
int calculateDistance(){

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH); // Reads the echoPin, returns the sound wave travel time in microseconds
distance= duration*0.034/2;
return distance;
}

here is the hardware connection pic

I hope I get the doubts clear as soon as possible

this is the error message coming
Arduino: 1.8.13 (Windows 10), Board: “Arduino Uno”

Sketch uses 5398 bytes (16%) of program storage space. Maximum is 32256 bytes.

Global variables use 348 bytes (16%) of dynamic memory, leaving 1700 bytes for local variables. Maximum is 2048 bytes.

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x68

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x68

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

please help me !

@vinayak.joshi

Can you check this?

Hi,

The issue you are facing is an issue with uploading the code.

This issue generally shows up if you didn’t select, or if you selected the wrong entry in tools>port.

Please connect your Arduino to the PC, them go to the tools menu, in the tools menu select Port, and in the port sub menu, select the entry which has Arduino/Gunuino under written next to it

hello @vinayak.joshi I am still getting the same error ( Sonar system problem) can’t getting

And one more thing I have check the tools (Port and Board both) by doing simple project it works fine but not in this sonar project

Or if anyone have same or alternate project like this one(https://www.hackster.io/pranaypandit10/smart-sonar-system-830b69) Please provide me
Note:-1. Also have alert message or email
2. Also using Processing software like Sonar-System
3. hardware connection

Hi,

Are you keeping the Bolt WiFi module connected to the Arduino when you upload the code?
If yes, than this is where you will face an issue. Standard Arduino’s tend to face issues if you try to upload a code to them while the Bolt WiFi module is connected.

Try keeping the WiFi module disconnected while uploading the code. You can connect it later on.

Hello Sir @vinayak.joshi Still getting the same error :frowning:
According to your guidance… i am getting the same error

Hello @yeshwant.naik and @vinayak.joshi Please look at this project!
I am trying this for many days but don’t get any output

I am still waiting for your reply @yeshwant.naik and @vinayak.joshi
Please take a look! And solve this as soon as possible.

Hi @chandanapappularsmc1,
Please confirm are you using an Arduino(Blue, Green, or Blue and White) or a Boltduino (Full white)?

The issue you are facing is not due to the project. It is a communication issue between your computer and the programmer present in the Arduino.

Please share a screenshot of the port selection that you have done.

Please go to File>Examples>01 Basic> Blink.
The blink example code will open up. Try uploading this code to your Arduino. If you face the same issue with it, then it is an issue with your Arduino, and you might want to look into getting it replaced.

If you don’t face the same issue, then please use loom.com to take a screen recording while uploading the example code, and also while uploading the code from the project, and share the same with us.

Here is the ScreenShot of Program as you said it(BLINK LED)

Here is the Photo of tool (PORT AND BOARD)

Here is the photo of led