Talking Distance With Arduino Uno, the Ultrasonic Sensor HC-SR04 and the WTV020SD Sound Module

Introduction: Talking Distance With Arduino Uno, the Ultrasonic Sensor HC-SR04 and the WTV020SD Sound Module

About: I studied Electrical Engineering and a lot of other things. I'm always driven by my passions. Please visit also my Youtube channel.

Welcome to my Instructable #31, aka one of the most popular Arduino projects.

If you like this project, please become one of my followers on Instructables and subscribe to my Youtube channel... www.youtube.com/rcloversan

Anyway, for this project you need:

1x Arduino Uno
http://www.banggood.com/UNO-R3-ATmega328P-Developm...

1x WTV020-SD-16P Sound Moudule

https://www.banggood.com/WTV020-Audio-Module-MP3-P...

1x Ultrasonic module

http://www.banggood.com/UNO-R3-ATmega328P-Developm...

1x Breadboard

http://www.banggood.com/Mini-Solderless-Prototype...

Jumper Wires

http://www.banggood.com/UNO-R3-ATmega328P-Developm...

1x Speaker (8 Ohm)

1x LED

1x Resistor 470K

1x SD card (Sandisk)* 2GB!!!

*Finding the right SD (the WTV020SD module works just with the original Sandisk), drove me literally crazy.
There are so many fake models on Ebay, that I had to buy 3 of them, to get the right one.

Step 1: Preparing the Audio Files

This is the most tedious part of the project....

Anyway, download WavePad Audio Editing Software
http://www.nch.com.au/wavepad/index.html

and launch the software.

Using your voice, record the .wav files pressing the red button (2nd from the left bottom). Every file should contain the distance (in centimeter) you want to hear, according to the position of the object in front of the ultrasonic sensor. You should have "a beep" sound (less than 5cm), 10cm, 15cm, 20cm, 25cm, 30cm and so on (the limit of the ultrasonic sensor used for this project is 200!).

Open the files you want to put on the SD card, save the .wav with these attributes:

Format: PCM Uncompressed

Attributes: 32000Hz, 16 bits, Mono

Naming the files: Voice1, Voice2, Voice3... and so on.

I saved the files putting them in a directory on the desktop (voice), so it was easy to find them.

Now, download the ad4 converter software...

https://docs.google.com/file/d/0B4p82-pNB6o7QXFwZ...

to convert the .wav file into ad4.

Remember to save this file in the same directory of the sounds you intend to use for your project (directory voice). Launch the ad4 software clicking on the .EXE file, the MS-DOS window will pop-up immediately.

At the prompt (C:\>) write cd desktop/voice

(please note that my complete path was C:\>cd users/user/documents/desktop/voice).

Now write: ad4converter -E4 voice1.wav

The software will create automatically the file voice1.ad4.

Repeat this operation for all the other files, until you have all the .wav converted in the ad4 format.

Now you can copy all these files on the sd card, using the slot available in the most of the PC and the SD card will be ready to be put inside the WTV020SD-16P module.

Step 2: Test the WTV020SD-16P Module

An important thing that can affects the functionality of the WTV020SD is the volume of your sounds/voices.

If you don't listen the sounds, try to lower it (using the proper command: wtv020sd16p.setVolume(6);)

If it doesn't work, the problem is a wrong/fake SD card.

If you have some problems you can read this amazing tutorial written by Build Circuit...

http://www.buildcircuit.com/how-to-convert-mp3-and...

Step 3: Wiring...

Please wire the circuit, following the diagram in the picture.

Step 4: Coding...

Please subscribe to my Youtube channel and you'll receive the code shortly.

www.youtube.com/rcloversan

Microcontroller Contest

Participated in the
Microcontroller Contest

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    16 Discussions

    0
    alinazzer
    alinazzer

    8 weeks ago

    Hello, I've just subscribed your channel. You're making really nice things!
    I would appreciate if you could share the code with me :)) Thank you!

    0
    Keajin
    Keajin

    8 months ago

    Hi! I just subscribed to your youtube channel! Can i please have the code?

    0
    RC Lover san
    RC Lover san

    Reply 3 months ago

    Hi there, the link for the code is in the description of my YouTube video...

    Best regards,
    G.

    0
    RC Lover san
    RC Lover san

    Reply 3 months ago

    Hi there, the link for the code is in the description of my YouTube video...
    Best regards,
    G.

    2
    asiaafiq96
    asiaafiq96

    9 months ago on Step 4

    Hi there. I have subscribed ur youtube channel , can i get the code,, im very happy if you willing to help me bro

    2
    calton1999
    calton1999

    9 months ago

    i need code.i hve subed

    0
    yaqiucheng
    yaqiucheng

    9 months ago

    Hi! I subscribed the channel. May you send me the code? Many thanks.

    1
    JoanaB3
    JoanaB3

    Question 11 months ago

    Hi! I subscribed the channel. May you send me the code? Thanks

    1
    NoranT
    NoranT

    1 year ago

    Hi bro I have subscrbed to your channel . could you plz send me the code ?and can I put DFplayer mini insted of the one you used ?

    1
    NAziraN
    NAziraN

    1 year ago on Step 4

    Can i get the code?

    1
    edwardjoseph
    edwardjoseph

    1 year ago

    the codes not working . wtv020sd16p.setVolume(6);

    1
    RC Lover san
    RC Lover san

    Reply 1 year ago

    The code works! You should test your WTV020sd16 module first, to check
    if it's not faulty, or if you haven't bought an original Sandisk (2GB),
    as this module works just with a genuine SD card.