Recently I have been considering making a special gift for my family. The other day I happened to see that one of my friends bought a photo album as a present, which gives me inspiration for my handmade gift. I am gonna make something with a photo album, how about creating an interactive photo album, sounds great!
The photos in my old photo album always remind me of the past. What makes me feel moved is not only the things that change constantly as time goes by, but the precious moments fixed by the photos, behind which there are a lot of stories. Why not let the photos tell their stories by themselves?
This idea of making an audio photo album keeps lingering in my mind. Then I saw the FireBeetle M0 launched by DFRobot, I found it just ideal for my project.
First, let me tell you why it is perfect for my audio photo album. This FireBeetle M0 main-board is based on the ATSAMD21G18 ARM Cortex M0+ high-performance 32bit processor, and comes with a digital to analog converter(DAC), which means that my audio file can be analyzed by its MCU and then played out.
There is 16MB SPI Flash integrated onboard that can be used to make a 12MB virtual U-disk for storing data. That is to say, I can directly store audio files in Flash by USB. I calculated that it can store a 5 minutes mono WAV file, which is enough to tell a few stories.
With a FireBeetle M0 board and necessary GPIOs as input, my project can be completed.
For more details about FireBeetle M0, please refer to: https://wiki.dfrobot.com/FireBeetle_Board_M0_V1.0_SKU_DFR0652
The actual effect of my audio photo album is as below:
I bought a 16-inch self-adhesive photo album with the cover of the Celia Thaxter's Garden, Isles of Shoals Maine, created by the Impressionist painter Childe Hassam in 1890.
Software
1. Arduino IDE
2. Audacity Audio Editor
3. voice_album.ino Code
Download and install Arduino IDE, and test FireBeetle M0 Board.
Download the latest IED at Arduino Official Web: https://www.arduino.cc/en/Main/Software
When Arduino IDE is installed, open it, download and install FireBeetle M0 SDK.
Click File->Preferences
1) Click the icon marked with red circle 1, then the box for inputting URL will pop up.
2) Copy the following address to the box:
http://download.dfrobot.top/firebeetle/
3) Click OK to save it.
4) Click OK in Preferences interface to save the setting.
Click Tools->Board->Boards Manager
Then we can see the SDK of the FireBeetle SAMD Board, click “Install”.
After that we can see the FireBeetle M0 board in Board interface, select it.
Connect the FireBeetle M0 board to a PC with a USB cable, then a new COM can be found by the OS.
To test whether the board can work properly, let’s run a simple P13 LED blink program.
Click the arrow button in the upper right corner, the LED flashing program will be compiled and burned into the main-board. In the process of burning and writing, the LED on the main-board P13 flashes quickly. When the lower right corner of the IDE displays done uploading, it indicates that the program download is completed.
If the green LED on the FireBeetle M0 P13 flickers according to the rhythm of one second on and one second off, it means that the board works well, and we have set up the development environment.
Weld the audio power amplifier, loudspeaker, and five buttons together. The wires for connecting the buttons should be about 15cm.
Connection Diagram
Prepare the photos and the stories we wanted to tell. Recording audio files of 5 stories with mobile phones, please speak loudly, by which the signal-to-noise ratio can be improved.
When finished that, transfer these files to the PC. They are usually. M4a files and we need to rename the files. Because the numbers of five keys in the program are from 0 to 4, so name our files as 0, 1, 2, 3, 4.
These files are compressed dual channel. We need to convert them into WAV mono files that can be decoded by software on FireBeetle M0.
Use the software Audacity to convert m4a file into mono WAV file, it is free and open source.
Download Address: https://www.audacityteam.org/
After we installed the Audacity, we have to download a free ffmpeg-win-2.2.2.exe plug-in.
When installed the ffmpeg-win-2.2.2.exe, click Edit->Preferences in Audacity.
Click Libraries ->FFmpeg Library -> Location
Select the installation path of FFmpeg and click OK.
Click Audacity software file > Open to open the 0.m4a file just recorded.
Click the drop-down button above the track and select “Split Stereo to Mono”.
Click the mute button of a channel. Set Project rate as 44100HZ.
Click File -> Export -> Export as WAV, export the WAV file.
Select Unsigned 8-bit PCM at Encoding, and save the 0.wav file.
Convert the rest 4 .m4a files into. Wav files as the way above.
Connect the FireBeetle M0 board to the computer through a USB cable. Double click the RST button on the side. At this time, the RGB light on the main-board turns green and the computer pops up a U-disk. Copy the 5 .WAV files to the U-disk. The transferring speed is slower than the usual U-disk, so please wait patiently.
After that, hit the RST button to enter programming mode.
Open Arduino IDE, click Sketch -> Include Library -> Add .ZIP Librar to add the AudioZero.zip library.
Click File->Open in Arduino IDE
Open voice_album.ino, click the upload icon to upload the audio photo album codes into the FireBeetle M0 board.
If we test that when pressing the five buttons, the corresponding song can be played, then the programming and circuit parts are finished. Next, we just need to install the hardware circuit into our photo album.
There are three screws in the album. Remove the bottom screw so we can install the circuit conveniently.
The first page of the album.
Remove the screw on the last page of the photo album.
Use tweezers to make the button wires go through the book axis.
Get the circuit connected, and then recover the screw of the album.
Fix the battery box, FireBeetle M0 board and speaker on the album with double-sided adhesive tape.
Put the photos in the album.
Now, all done! You can give it a try if you are interested.