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