The Waveshield board for Arduino
The Waveshield board for Arduino
The sound card is a shield for Arduino that grafted on top of it. Programs created for the Arduino may well play wav file using a special library to add to the sketch. Wav files must be stored in a SD card (blue in picture) inserted into waveshield card.
This arduino shield screen is provided by an american society Adafruit Industries (www.adafruit.com), in kit and must be installed following the instructions of site http://www.ladyada.net/make/waveshield/index.html .
It is very easy to make, but one must be careful to mount properly following the instructions that each component are described step by step with pictures on the website. In the project I did, This card is not mounted on the Arduino so; as suggested by the manufacturer but to the side as visible in the photos.
Unfortunately, the library provides for the use of much of memory of a standard Arduino. This is the reason why I had to use a second Arduino I2C connected to the first in order to free up the memory of the first Arduino.
This Arduino shield dedicated through the library Waveshield plays audio files. The audio output of the shield is connected to a small amplifier 10 watts RMS that driver 4 speakers located on each floor.
Splitting the program into pieces to make them work on cards Arduino different is the main complexity of the program. The Arduino connected to the sound card must receive every I2C command file name and store to play a buffer for avoid losing them. A special routine then play the files in the sequence of arrival.
But for the file 099 there is special handling. This sound file contains only few seconds of a siren alarm. When it comes the fle 099 to playing, while it is played it is automatically regenerated in the buffers queue. In this way the file is played continuously, intervals with other sound files that may come later. The alternative to use a sound file of a few seconds was to stop the alarm file for play the new sound file arrived. But this would have resulted in the abrupt cessation of alarm files.
Therefore, the number 99 is continuously regenerated after its execution in the buffers queue and therefore the arduino playing a siren continuously. Upon arrival a the file named 098 that contains a pre-recorded voice “alarm off”, a routine eliminates all occurrences 099 in the buffer and then the system stops to sound the alarm siren.
Finally, a routine is responsible for removing from the buffer numbers identical files, so the program does not play twice the same audio file.
The program on the Arduino board that is connected the shield, also sets his pin used to control a relay that powers the amplifier. In this way it is always off, but turns when playing audio files and goes off after 5 seconds from the last file playing. So the amplifier, in addition to not consuming current, prevents to produce the sound of alternating current with very low volume and almost imperceptible, is still annoying.
To amplifier is connected in series several speakers, one for each floor of the house. Through this with Arduino waveshield is thus possible to play different wav file depending on what bell is activated. In the present case is played a sound file DIN DON classic for house main bell. A ring formed by a number of notes for living bathroom bell and other notes for bell of other bathroom.
But at the same Arduino play some wav files that are digital recordings of the voice of my daughter and gives an indication on witch sensor is activated. For example, “bathroom night area windows.”
For example, the opening of the security door plays the recorded voice that says “blast door” opening of the pedestrian gate on the outer perimeter of the property says “gate”.
Before concluding I would like to illustrate the main reason adoption of an Arduino waveshield dedicated to the screen. Initially the main Arduino shield also controlled waveshield. But the more you increase the program and more instability problems were obtained so I opted to split the on two programs Arduino in a distributed processing that uses the bus i2c to communicate with each other.
This solution increases the processing capacity of system since the load is divided on two CPUs and against a cost of more cards you get the advantage of a system more powerful.
In the general picture we can see that this Arduino is connected to the same I2C bus that connects all the cards presented in this project.