Introduction

  • In this article I will explain about measuring Voice Speed with Arduino Mega 2560.
  • It can be used to identify the voice of the speed.
  • This works in the same way a bat uses high pitched tones to navigate in the dark.
Parts
  • Arduino Mega 2560
  • Ultrasonic Transreciever
  • Hookup wires
Ultrasonic Sensor (HC-SR04):
Figure 1: Ultrasonic Sensor
  • It is used to produce the high-frequency sound effect.
  • It can measure the signal from the sender to the receiver.
  • The echo to be determined from the object.
We can fix the Ultrasonic Sensor (HC-SR04):
  • Hospital for medicine,
  • Industry,
  • Home etc.
Connection:
  • Connection from Sensor to Arduino Board:
  • Connect the Trigger pin to digital pin 03 of the board.
  • Connect the Echo pin to the digital pin 04 of the board.
  • Connect the Vcc pin to the 5V of the board.
  • Connect the GND pin to the Gnd of the board.
Programming:
  1. int trigPin=03; //Sensor Trip pin connected to Arduino pin 13
  2. int echoPin=04; //Sensor Echo pin connected to Arduino pin 11
  3. float pingTime;
  4. float speedOfSound;
  5. int targetDistance=6; //Distance to Target in inches
  6. void setup() {
  7. // put your setup code here, to run once:
  8. Serial.begin(9600);
  9. pinMode(trigPin, OUTPUT);
  10. pinMode(echoPin, INPUT);
  11. }
  12. void loop() {
  13. // put your main code here, to run repeatedly:
  14. digitalWrite(trigPin, LOW); //Set trigger pin low
  15. delayMicroseconds(2000); //Let signal settle
  16. digitalWrite(trigPin, HIGH); //Set trigPin high
  17. delayMicroseconds(10); //Delay in high state
  18. digitalWrite(trigPin, LOW); //ping has now been sent
  19. pingTime = pulseIn(echoPin, HIGH); //pingTime is presented in microceconds
  20. speedOfSound = (targetDistance*2)/pingTime*(1000000)*3600/63360; //converts to miles per hour
  21. Serial.print("The Speed of Sound is: ");
  22. Serial.print(speedOfSound);
  23. Serial.println(" miles per hour");
  24. delay(1000);
  25. }
Explanation:
  • In this article I have explained about measuring voice speed.
  • It can work under the trig condition side.
  • When the distance is in the over level it can measure the distance in the target inches.
  • If the target is 6 inches they need 12 inches.
  • The target place is 6 and return place is 06.
  • The speed of the range is displayed in the serial monitor.
Output:
Figure 2 : Output
Read more articles on Arduino: