Player wav files on Attiny85 microcontroller

This article will look at the process of creating a very necessary and interesting electronic device that will allow you to play wav files directly from an SD, microSD or mini SD memory card. You can record a music file on a memory card, install such a device, for example, in a refrigerator, and every time you open its door, a beautiful melody will sound. Forget to close such a "music" refrigerator will no longer be possible. Another way to use the player is as a doorbell. On the Internet you can find a lot of different tunes, for all tastes. Thus, the boring sound of the factory bell can be replaced, for example, with the song you like. In addition, such a device can be used for an original gift to a loved one - just build the speaker in a beautiful box, which, when opened, will begin to sound a sound greeting. In addition to these examples, the player can find a lot of applications in everyday life.

Scheme of the player

Player wav files on the microcontroller Attiny85
The scheme of the device contains a minimum of details, its key link is the microcontroller family AVR Attiny85. When power is applied, it immediately starts reading files from the memory card and using PWM outputs to play them through the speaker. The volume at the same time turns out not too high, in many respects it depends on the sensitivity of the speaker used. To get a large volume, you need to connect the amplifier input instead of the speaker. However, the signal from the output of the microcontroller is too large to be supplied directly to the amplifier, so it is imperative to install a volume control between them, otherwise there is a risk of spoiling the amplifier itself. When you turn it on for the first time, set it to the minimum volume, then gradually increase it to the desired volume.

Memory card pinout

Pinout of memory cards is shown in the picture:
Player wav files on the microcontroller Attiny85
6 wires, two of which are power, the circuit is connected to the memory card.You can use both SD, and MicroSD and MiniSD, as long as the correct pinout is preserved. It is most convenient to use an unnecessary MicroSD adapter in SD, then it will be possible to solder the wiring to the adapter itself, into which the used memory card is already inserted, I did so. Before using in this scheme, the memory card must be formatted in the FAT file system. After formatting, wav files can be recorded on the card; they must be PCM format 8 or 16 bits, with a sampling frequency of no more than 48 kHz. There are many computer programs that allow you to convert regular mp3 files into wav format, one of which is GoldWave, I used it. If you plug in power or insert a memory card, the circuit will start playing; when you press a button, the next file is included. Memory cards require a power of 3.3 volts, so a 78L33 stabilizer is installed on the printed circuit board offered for the article (it is not indicated in the diagram). With the use of a stabilizer, the supply voltage of the circuit lies within 5-12 volts. This scheme consumes a small current, and therefore it can be powered from the battery. For this you need to take a boost converter 3.7 - 5 volts, as I did. The circuit starts working immediately, does not require any configuration, it is enough just to flash the microcontroller. You need to set the fusion bits as shown in the picture below (a check mark indicates that this bit is programmed as in the PonyProg). >

Related News:


Chest - a convenient locker for the whole family
Lemon Kvass
Sewing a green cushion for wedding rings
Knitted sweater with a teddy bear for the baby
Creative Gift