Token Announcement System

About: An Electronics engineer and a hobbyist. I love to keep experimenting with microcontrollers.

In the previous instructable we saw how to make your Arduino to Speak. Today we will explore a bit more on the same topic. We all must have at some point in life came across a Announcement system maybe in a bank or a train station. Have you ever wondered how those announcement systems work? Well they work on the similar principle as our last project. So today in this tutorial we will make a Token Announcement System capable of announcing tokens from 1 to 999 i.e. a total of 999 tokens (1000 if you include 0). So let's get to the building process!!!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Gather the Supplies

Hey if you are looking for an online store to buy the components then UTSource.net is the site you need to check out. They have a huge variety of electronics modules and components at affordable rates. They also provide PCB Services for up to 16 layers. Do check their website.

Let's take a look at the modules we need for this project -

1. Arduino Uno Board

2. 4 * 4 Matrix Keypad

3. SD Card Module

4. 3.5 mm Audio Jack

5. Speaker with built in amplifier and an AUX cable

6. Some Header Wires

Most of these components were used in our previous projects.

Step 2: Circuit Diagram

The circuit diagram for this project is exactly the same as in the Talking Arduino project. The only difference is the Keypad. Interfacing a keypad is quite simple. Just connect the keypad rows to the pins of the Arduino as shown above.

(They keypad I used in this project is not as same as in the circuit because I did not find the right one in Fritzing's part list. So ignore the first and last pins of the keypad in the circuit.)

Connect the left and right channel of the Audio Jack to the digital pin 10 of the Arduino. And the ground pin to Arduino's ground.

Follow the diagram to do the rest of the connections.

Step 3: Preparing the Audio Files

Now you have to keep this in mind that when using the SD card module and the TMRpcm library you can only use the .wav audio format. No other audio format will work.

So to convert your recorded audio files or the files which you intend to install on the SD card, you have to use this online audio converter >> CLICK HERE

Keep the settings for the conversion as shown in the image above.

And if you want cool digitized voices that we hear on the real systems, then check this website which converts the written text to speech. And then we can download it in mp3 format which can then be converted into .wav format from the site mentioned above.

CLICK HERE TO VISIT THE SITE

You can also download the audio files which I used from below. So with that done its time to program the board.

Step 4: Coding

Download the .ino file from below. Compile and upload the program to your Arduino Board. If you face any problem uploading the code then feel free to contact me or drop a comment below. I would be happy to help you.

#include <Keypad.h>
#include "SD.h" #define SD_ChipSelectPin 4 #include "TMRpcm.h" #include "SPI.h" TMRpcm tmrpcm; char myNum[4]; int i; const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {A0, A1, A2, A3}; //connect to the row pinouts of the keypad byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup() { tmrpcm.speakerPin = 10; Serial.begin(9600); if (!SD.begin(SD_ChipSelectPin)) { Serial.println("SD fail"); return; } /* tmrpcm.setVolume(5); tmrpcm.play("three.wav"); //Used for testing(Do not include in final code) delay(1000);*/ } void loop() { Serial.println("Enter three-digit num -"); for ( i = 0; i < 4; ++i) { while((myNum[i] = keypad.getKey())==NO_KEY) { delay(1); // Just wait for a key } // Wait for the key to be released while(keypad.getKey() != NO_KEY) { delay(1); } Serial.print(myNum[i]); } if(myNum[3]=='A') { Serial.println("Token Sent"); tmrpcm.setVolume(5); tmrpcm.play("tokenno.wav"); delay(2000); check(); } if(myNum[3]=='B') { Serial.println("Token Not Sent"); i=0; } if(myNum[3]=='*') { Serial.println("Reg desk"); tmrpcm.setVolume(5); tmrpcm.play("star.wav"); i=0; } if(myNum[3]=='#') { Serial.println("closing"); tmrpcm.setVolume(5); tmrpcm.play("hash.wav"); i=0; } if(myNum[3]=='D') { Serial.println("Sub"); tmrpcm.setVolume(5); tmrpcm.play("D.wav"); i=0; } } void check() { for(int c=0;c<3;c++) { if (myNum[c]=='0') { tmrpcm.setVolume(5); tmrpcm.play("zero.wav"); delay(1000); } if (myNum[c]=='1') { tmrpcm.setVolume(5); tmrpcm.play("one.wav"); delay(1000); } if (myNum[c]=='2') { tmrpcm.setVolume(5); tmrpcm.play("two.wav"); delay(1000); } if (myNum[c]=='3') { tmrpcm.setVolume(5); tmrpcm.play("three.wav"); delay(1000); } if (myNum[c]=='4') { tmrpcm.setVolume(5); tmrpcm.play("four.wav"); delay(1000); } if (myNum[c]=='5') { tmrpcm.setVolume(5); tmrpcm.play("five.wav"); delay(1000); } if (myNum[c]=='6') { tmrpcm.setVolume(5); tmrpcm.play("six.wav"); delay(1000); } if (myNum[c]=='7') { tmrpcm.setVolume(5); tmrpcm.play("seven.wav"); delay(1000); } if (myNum[c]=='8') { tmrpcm.setVolume(5); tmrpcm.play("eight.wav"); delay(1000); } if (myNum[c]=='9') { tmrpcm.setVolume(5); tmrpcm.play("nine.wav"); delay(1000); } } tmrpcm.setVolume(5); tmrpcm.play("star.wav"); }

If you change the names of the audio files then make sure you edit them in the code also. With that done your project is ready to be tested. Let's see how it works.

Step 5: Working of the Project

I have uploaded a video of the project below. You can check that out. The project worked as per my expectations. The only limitation I faced was the absence of a separate display for the project. We can't keep the laptop connected all the time. Its other case if you work on laptop entire day and have plenty of USB ports available.

So I want you guys to add a lcd (any will do) in this project and send me a link of that project.

This project can be used in your offices at the reception desks if you have a lot of people visiting on daily basis.

Adding a separate power supply and lcd will make this project stand alone. I entrust that task to you guys.

If you like my work then help me by sharing my projects on your social media handles. That's it for now. See you soon with another project soon.

Be the First to Share

    Recommendations

    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    Discussions