Skip to content

Audiobox for Kids: Sound tracks can be started by placing a RFID Card on top of the box.

Notifications You must be signed in to change notification settings

grimmpp/audiobox-for-kids

Repository files navigation

AudioBox for Kids (Arduino and DFMiniPlayer Project)

This project is about an audiobox which allows small kids, who cannot read, don't understand signs, or don't know which button to push, an easy way to choose sound effects, audio books, or music tracks. Playing tracks can be done by putting small items on the top of the audiobox. Those items are related to the e.g. audio book kids want to play and can be e.g. small figures or labelled cards or other NFC tags.

Content

What can it do?

The audiobox plays a mp3 file which is storage on a TF card (small SD Card) after a RFID/NFC Tag was placed on top of the box. This is the basic function of the audiobox. You can also use the button on top of the audiobox in order to change the volume, switch to the next or previous track, or to pause a audio track.

Play Modes

  • Audio Book
    After placing a tag on top of the audiobox it starts playing a random track out of the defined folder which is stored on the RFID Tag. After finishing the track the audiobox stops playing other tracks.
  • Album
    Plays all track from the defined folder in the order in which the tracks are stored on the TF Card.
  • Party
    Plays tracks randomly from the defined folder. It does not stop until another RFID Tag is placed or the pause button was pushed.
  • Single Track
    By placing a NCF Tag on the audiobox it will play only one single track which is configured on the NFC Tag and stops afterwards.
    Button next song and previous song is disabled in this mode.
    Button play/pause pauses, continuous, or restarts the track after it was finished.
  • Audio Book with Bookmark
    After placing a tag on top of the box it starts playing an episode. After finishing an episode it stores the number of the next episode on the EEPROM (Arduino's internal persistent memory) so that it can proceed from there next time when the same tag is placed. If not interrupted by the pause button or another tag it will continue playing the next episode.

Features

  • Plays tracks, albums, songs, audio books, ... by placing NFC Tags on the box.
  • Bookmarks for audio books
  • Random track selection
  • Menu to configure and map the NFC Tags
  • Timeout for menus (default 60s)
  • Start sound which plays after arduino is initialized
  • Button combination to restart Arduino
  • Pin-compatible to original TonUINO.
  • Keep alive logic for power banks (See PowerBankKeepAliveManager.h)
  • Delay for button for long press mode (See ButtonManager.h)
  • Beep which will be played if a button is pushed (planned)

Administration

Copy mp3 files on TF Card (Micro SD Card)

Before you can start you need to copy the mp3 files which you want to listen to onto the TF card. Therefore have a look how the structure of the TF Card must look like. In addition to the sound file you want to listen to you need to copy some file for the menus. For deteails have a look here.

Configure NFC Tag

Before a tag can be used you need to tell the audiobox what should be played. After placing the tag on top of the audiobox the first time the audiobox will ask you and guide you through a menu in order to configure the tag. The following relevant infromation will be stored on the tag: folder number, mode, special field. You need to select a folder in which the mp3 is placed and the Arduino will store the folder number on the tag. After that you need to choose a play mode which is Audio Book, Album, Party, Single Track, Audio Book with Bookmark, or Admin. If you choose Single Track or Admin mode the menu will ask for another track or informaiton that will be stored into the special field. (Bookmarks will be automatically stored direktly on the Arduino's EEPROM so that you can continue listening furhter tracks of an audiobox. Bookmarks don't require space on the tag.)

Hardware

Schema

Case

The case is a simple wooden cube (20cm x 20xm x 20cm). It has three buttons at the top, a speaker at the front, 4 feet at the bottom, and a power jack and a power on/off switch at the back. Inside there is a power bank, the board containing Arduino Nano, DfMiniPlayer, ... and some cable to connect everything.

You can find further pictures from the box in folder /pics and the drawing in folder /case.

NFC Tags

In the Part List you can find the used NFC Tags. I've created as well small figures from an old wooden puzzle and disassembled NFC Tags which I just fixed with ordenary tape.

How to imprint RFID Cards

For printing the pitures and lables on the RFID Cards I bought self adhesive foil for color laser printers. After printing and cutting them out you can stick them on the RFID Cards.

I found those following nice images, which are free for personal use, on clipart-library.com.

Arduino Software

I used PlatformIO and VS Code in order to develop the software for this project which runs on an Arduino Nano.

Why did I choose VS Code and PlatformIO?

  • VS Code is a proper IDE
    • Shows instantly compiler information
    • Has autocompletion
    • Shows documentation of libraries and functions
    • Shows e.g. what a library supports by using autocompletion
    • Terminal is attached below code window part
    • ...
  • PlatformIO
    • Can really easily resolve C-dependencies (dependent libraries)
    • Can be used independently from IDE in command line.
    • Code verification in docker container possible.
      • Independent of local environment and easy reproducable
    • Supports a lot of controllers and ICs.
    • Code can be easily split up.
    • Projects can be organized.
    • Upload and monitoring to/of Arduino Nano easily possible.
    • ...

PlatformIO commands

  • Build code: pio run
  • Build and upload code: pio run -v -t upload
  • Open serial monitor: pio device monitor -b 115200

Build with Docker

docker build -t audiobox /docker/Dockerfile
This command builds a docker image based on ubuntu. It contains platformio, downloads this git repo and builds the code and audio files for the audiobox. Building everything the first time takes quite a while until all dependencies are downloaded and everything is built. Please, be a bit patient. :-)

Upload binaries onto Arduino with docker

After creating the docker image, which also builds the project automatically, you can start the docker container and upload the binaries onto an Arduino Nano by using the following command:
docker run -w /home/audiobox-for-kids --privileged audiobox pio run -v -t upload
PlatformIO will automatically search for the usb port in which your Arduino Nano is plugged in.
--privileged is used in this case because we need access to the usb ports. Alternatively you can also enable the usb ports by specifying an argument which maps the host usb ports to container usb ports.

Docker commands

  • Build docker image: docker build -t audiobox /docker/Dockerfile
  • Run docker image: docker docker run -it audiobox
  • Upload to Arduino Nano: docker run -w /home/audiobox-for-kids --privileged audiobox pio run -v -t upload

Inside the docker image you can e.g. run the platformIO commands.

Sound Tracks

Beside music and audio books which you own, I was interested in sound effects e.g. for the start sound or when a button gets pushed. Below you can find a list of links where I was able to find the one or other nice sound effect which answered my purpose.

Animal Sounds

I've created some little wooden figures with RFID Tag on the back. The corresponding sound files I've used you can find on the following listed page:

Sound Effects

Free Audio Books

Cutting Tool Recommendation

Sometimes sound tracks start with a little silence in the beginning, especially if it is a sound effect or animal sound I want the audiobox to respond directly on the ncf tag. That's why I often remove this little silence in the beginning or end of sound tracks. Often it is also needed to adapt the volume of a sound track. I haven't tried out a lot of tools but I'm quite happy with mp3DirectCut and that's why I recommend it here.

There is also a nice tool for renaming and copying sound files onto the TF Card. See TinoTool (Original GitRepo: TinoTool). I really like this tool because it reduces a lot of unwanted effort and it is very convenient to have for this case a GUI.

Reconsideration and Outlook

In this section I want to highlight what went good and bad and maybe more interesting what would I change next time or could be done in addition.

The good things

TODO: ...

  • Detection of NFC Cards
  • Building the electronics
  • Following Thorstens guide

What went not so well

TODO: ...

  • Broken chip on DfMiniPlayer
  • Different chips for DfMiniPlayer
  • White noise because of bad wiring

What could be done differently?

  • External USB Port: Unfortunately I was not able to find a nice USB jack that I could mount at the back of case. That's why I just use a simple 5V power jack to charge the audiobox. I'd really love to have an external USB connection to the Arduino Nano because now I need to remove all the time the back if I want to upload the code again.
  • External Interface for TF Card: I decided to keep the TF Card internally so that the kids cannot remove it. The downside is if I want to copy new mp3s on the card I need to remove the whole back.
  • Better Speaker The quality of the speaker and DfMiniPlayer turned out to be quite good, especially in comparison to the price. Knowing that I would have spent more money for a better or bigger speaker to get a even better sound quality. The bass could be a bit stronger.

Reconstruction thoughts

TODO: ... ESP? ... GitRepo: ESP8266Audio

Thanks to Thorsten Voß

Thorsten Voß had the brilliant idea to build such a audiobox for little kids. He realized his idea also with almost the same parts. His tutorial and big community is really great and inspired me a lot.

In the community a lot of hard- and software issues are discussed and solved. There is also a big variety of ideas how to build a case. Thorsten also offers a board on which you can put the Arduino Nano, DfMiniPlayer, and to which you can connect the RFID Reader. (Wake up logic for Power Bank is not included.)

Links

About

Audiobox for Kids: Sound tracks can be started by placing a RFID Card on top of the box.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published