Setup and Procedure
The wave shield is interfaced with the Arduino Mega 2560 as normal. A couple of pins were remapped because the wave shield was initially made for a different device. The DAC pins were remapped to pins 22,23,24 and 25 on the Arduino board. The WaveHC library also has to be modified to accommodate these changes. It is self-explanatory. The SD card communications pins MISO (Master-in-slave-out), MOSI (Master-out-slave-in), CS (chip select) and SCK (clock) are unchangeable and specific for every microcontroller used. For this project, they are pins 50,51,52 and 53. Refer to the pin mapping diagram for details.
Only four data pins were connected from the LCD to the Arduino. This is the 4-bit data transfer mode. The 4-bit mode is efficient for simple alphanumeric data transfer. The RW (Read/Write) pin was grounded because data is only being sent to the LCD and not read from it. RV1 is contrast control for the LCD.
U2 is a hex Schmitt inverter IC used in this case for debouncing the button. The RC time constant = 0.1s which is good enough for the debounce. This could have also been achieved by software easily. Note: In my project, all the buttons were debounced using U2. Software debouncing could have been used as well, I only had a few problems doing that.
The sounds could have been achieved using a voice synthesizer but that incurs some cost. Instead, the sounds were recorded and converted to forms easy to process by the microcontroller.
Each individual audio track was recorded in Audacity and converted to WAV files understandable by the computer. The track properties were set to 16-bit PCM and rate was set to 22 KHz. It is not the best audio quality but the DAC can certainly handle the processing fairly well. The tracks were converted to mono because there is only one speaker. Stereo works but would be ambiguous and pointless.
An easy procedure is to record all the tracks on a single WAV file and export selected WAV’s. Every audio track is saved to the root directory on the SD card with relatively simple files names such as ’01.WAV’ for quick access to the root folder by the microcontroller.
The SD/MMC card must be formatted with the FAT file system before any recording is stored in it. FAT16 and FAT32 file systems are common and compatible with almost every system including cameras and microcontrollers.
*Check the English and Yoruba folders for recordings.
Language and Recordings
Recordings for English
The following were recorded in English and converted to WAV files.
-[0, 1, 2…10, 11, 12 …20, 30, 40, 50]
-[am, pm, good morning, good afternoon, good evening, o’clock]
-[The time is…].
[Download the English recordings: Download]
Recordings in Yoruba (It is a bit complicated)
|Oru||Midnight (12am – 4am)||Kan||1|
|Aaro||Morning (5am – 11am)||Meji||2|
|Osan||Afternoon (12pm – 5pm)||Meta||3|
|Irole||Evening (5pm – 6pm)||Merin||4|
|Ale||Night (7pm – 11pm)||Marun||5|
|Merindin logun||16||Merindin logbon||26|
|Metadin logun||17||Metadin logbon||27|
|Mejidin logun||18||Mejidin logbon||28|
|Mokandin logun||19||Mokandin logbon||29|
1:15 – Ago kan koja isheju marundin logun
1:30 – Ago kan abo
1:45 – Ago meji ku iseju marundin logun
2:00 – Ago meji
Download the Yoruba recordings>> Download Yoruba
Arduino Mega 2560
USB Serial Programming Cable
Wave Shield kit v1.1
2GB SD card
Waterproof 8-ohm speaker
10K plastic potentiometer
Push button SPNO
Schmitt Trigger Inverter
*Ensure you buy cheaper push buttons and Arduino board. These prices are outrageous.
This project is for intermediate arduino users. If you have no idea about using an arduino, please check www.arduino.cc for quickstart guides and tutorials. The website also explains the Arduino C functions. Long live open-source!
Download the program codes from here >> Download Codes
ISR(TIMER3_COMPA_vect) //timer3 interrupt service routine //Overflows every second
-The first section of that software ISR reads the LM35 temp sensor and converts the value into degree celsius, every two seconds. Note, the timer overflows every second. Read about AVR interrupts if you need any clarification. This website offered a lot of help: http://www.engblaze.com/microcontroller-tutorial-avr-and-arduino-timer-interrupts/
-The second section of the ISR calculates the second, minute and hour based on this simple order:
Which shows the time format as: 00:00:00
where hr = hour, mn = minute, sec= second.
Other codes come with the WaveHC library. Please check: http://www.ladyada.net/make/waveshield/libraryhcplay6.html for details.
Thanks to the Adafruit community for the help and FAT16Lib.
Please endeavour to give credit to my work if you do use any of my codes.
Oluwatobi Babatunde, University of Sheffield.
Long live open-source!!!