Programmable MP3-player for scale models, broadcast systems and special applications
- A brochure on the H0420 MP3 controller/player, dated 2009-09-16.
- The H0420 order form, which you can use to order small quantities of the H0420 and accessories directly from us. You may also use the on-line order form.
- The datasheet of the H0420 MP3 controller and usage notes, dated 2009-09-04.
- A list of application notes including reference material for programmers.
Latest firmware and development environment
The most recent firmware update for the H0420 programmable MP3 controller/player is version 1.10, build 4613. You may wish to install this update if you purchased your H0420 MP3 player before 12 December 2011. Devices purchased after that date already contain this latest firmware release. The most recent version of the pawn development environment is also installed with this download.
- Firmware update version 1.10, Build 4613 (December 2011)
- Release notes for version 1.10, build 4613 (December 2011)
The feature list below comes directly from the data sheet of the product (2009-09-04). For more information, see the product brochure and the order form, as well as the references at the bottom of this page.
- Solid state design.
- Easy to embed in consoles, scale models or kiosks, due to it small form factor, conveniently placed mounting holes and industry-standard connectors.
- Extended temperature range: -40 °C to +85 °C, suitable for out-door use.
- Decodes MPEG Layer 3 stereo/mono channels, supporting all MPEG sampling frequencies and bitrates up to 320 kb/s, including variable bitrate and the very low bitrates of the MPEG 2.5 extension (8 kb/s and 16 kb/s).
- High quality audio, based on a 24-bit D/A converter with 8× oversampling digital filter, low noise and low distortion.
- 16 switch inputs, with bounce-filters and schmitt-triggers.
- 16 general purpose inputs/outputs (I/O pins), individually configurable.
- 1 analogue output, software-controlled, with an optional frequency/signal generator.
- I/O pins are able to drive a LED or opto-coupler, when configured as output.
- A standard LCD module, with a HD44780 controller, is directly supported using 8-bit interface (this takes 11 of the 16 I/O pins).
- Serial interface (RS232 with software handshaking).
- MP3 audio data is read from a CompactFlash card; type 1 and type 2 cards (i.e. "microdrives") are supported. The controller supports FAT16 and FAT32, and nested subdirectories.
- Parses the ID3 tag (version 2) with support for Synchronized Lyrics, for Karaoke or for synchronizing events to MP3 music.
- Programmable by the end user through a script (in the pawn language) stored on the CompactFlash card. The developer environment is freely available and it includes a source-level debugger.
- For a "no programming required" option, the MP3 controller also comes with a set of configurable, ready-to-run scripts for a range of applications.
- Gapless and clickless sound loops are possible with this MP3 controller, which is quite unique for a hardware player (even most software players running on PCs do not support this).
- General file input/output to the CompactFlash card is supported, for logging usage, updating playlists or scripts through a serial connection, storing configuration settings, or other applications.
- Supports encrypted MP3 audio tracks; the players can be ordered with a unique 128-bit key and the matching encryption software.
- Optional extension bus with I2C, SPI and parallel buses (plus power and other signals).
Typical use of the H0420 is inside an object or apparatus where high quality audio is needed in a small and robust package. Due to its temperature range, the H0420 is suitable for outside use. As it is low energy and produces little warmth itself, it requires no ventilation. Being solid-state, it can be operational in moving or mobile objects. The player is easily embeddable in other apparatus through industry-standard electronic interfaces.
There are diverse enclosures the H0420 MP3 controller/player, from custom-design to a few standard enclosures. The picture at the top left is a custom enclosure for an MP3 controller with a bar-code wand scanner, (rechargeable) battery power and an internal audio amplifier. The picture at the top right is a standard aluminium box with an optional clip for DIN-rail mounting.
Click on the pictures for a detailed view.
The H0420 is scriptable, which implies that it is fully configurable. It can respond on various inputs: switches, digital I/O, RS232. Similarly, it can drive various outputs: an LCD, LEDs, opto-couplers, or equipment branched onto the RS232 or the digital I/O bus. Audio fragments may be selected based on various criteria that you put in the script. You can abort sound that is playing, or glue together various fragments. You may also synchronize the audio to the external events based on an internal high-precision timer.
The pawn "embedded scripting language" on which the MP3 controller is based, is a quick and small language whose basics can be learned in a few days —or a few hours if you already know C/C++. The language has the event-driven programming model built-in and through the direct support for events, the pawn simplifies the construction of reactive/interactive systems.
The MP3 controller parses the ID3 tag (version 2) in the MP3 file, if present. An ID3 tag is an attachment to an audio file (typically prepended) that contains additional relevant information about the audio file. Version 1 provided only a fixed set of fields (and with a fixed size). In version 2, each ID3 tag holds one or more variable-length chunks of information, called frames. Every frame holds a particular item: the title, the album name, the artist and/or band, the composer, the lyrics, the preferred volume and tone presets, etc.
One particularly interesting feature of an ID3 tag is the ability to store music-synchronized lyrics. This was originally implemented for karaoke, but the MP3 controller can use it for general purpose synchronized activity: the text string that is attached to a time code or synchronization point is not necessarily a part of the lyrics, it may also be a "cue" that triggers an action in the pawn script. See the application notes for an on-line article describing this feature.
With many MP3 players the audio fragments must be downloaded via a cable to a PC (e.g. USB). In information centres and kiosk applications, this is often inconvenient: the player is mounted inside an apparatus that is immobile and the maximum length of an USB cable is rather short. In our design, the audio files are stored on a CompactFlash card. This way, changing the audio fragments is a simple and quick procedure of replacing the CompactFlash card. With a cheap card reader (connected to a PC), one can store the audio on the card. Up/downloading via a cable is still possible, via RS232 or by connecting the MP3 player to the network and/or internet with an extension board.
In some applications, you may wish to protect the audio content from being copied off the CompactFlash card onto notebooks, PCs or retail MP3 players. The H0420 offers protection by allowing you to encrypt the MP3 tracks with a strong encryption algorithm, using a 128-bit key. The key is embedded in the firmware of the H0420, and the firmware is "read-protected" itself. In other words, the key is never transferred to the H0420 and it is not stored at any location that is accessible from the outside. A customer can request a unique 128-bit key upon ordering the H0420, and optionally enhance this with an additional password that the customer chooses him-/herself. Please contact us to register a unique customer key, or to get more information on this application.
The CD-ROM that comes with the H0420 contains several applications and software tools for configuration, programming and controlling the MP3 player/controller. The two (miniature) screen grabs above are of "FileLink", a utility for file transfer over a serial cable, and the programmer's IDE for pawn called "Quincy".
Click on the pictures for a detailed view.
Due to its programmability, the H0420 is a flexible fit in many designs. Below are a few examples, but this list is by no means exhaustive (see also the application notes at the end of this paper for more ideas).
- Use switches to select tracks and settings: either one track per switch or have switches to move forward and backward through the tracks; a switch press can start playing a track, or the device may keep playing as long as a switch is being held down. You may also choose to play a random track, so that the audio effect is different each time that a user pushes the buttons.
- Instead of switches, use digital input to control the H0420. This input can come from other apparatus or controllers, or from sensors (e.g. proximity sensors).
- The switch inputs can be used with a typical "appliance module" for the X-10 protocol for home automation and domotica. Applicance modules typically have a few relays corresponding to different commands, so a single applicance module may control several switch input lines.
- With a bar-code scanner on the RS232 connector, tracks may be selected on the basis of bar-codes printed on badges or tickets, in addition, perhaps, with other criteria such as button presses. We have also connected low-cost bar-code wands (pen scanners) directly on the digital I/O lines.
- The RS232 port also allows connection to many other devices, such as computers, ticket printers and professional audio equipment.
- The digital I/O pins of the H0420 can drive LEDs or opto-couplers. There is intrinsic support for displaying output to an LCD.
- With minimal extra components (an IR-receiver chip and a pull-up resistor), you can use a remote control to change tracks or adjust settings on the device. As the analysis of the IR-protocol happens in software, it can be adjusted to any protocol and any remote control.
- With a network extension board, the MP3 controller can play "live" audio streams over the internet, synchronize the contents of the CompactFlash card with that on a server, accept commands through a web browser and report its status with SNMP, for example.
- Activities, such as turning on LEDs or other equipment via its digital I/O pins, can be synchronized with time stamps embedded in the MP3 track.
Putting the H0420 MP3 controller inside a standard car radio (in place of the tape casette unit) proved to be a perfect example of the extent in which the MP3 controller is configurable and adaptable. The MP3 controller responds to the very same buttons as the radio, which is still fully functional, intercepting the commands that were originally sent to the casette drive. When a track has supplemental information in an ID3 tag, the MP3 controller shows this information on the radio LCD (with horizontal scrolling). The MP3 controller connects to the LCD through an I2C bus.
Click on the pictures for a detailed view.
A predecessor of the H0420 MP3 controller (the model H0410), runs in four "objects" in the exhibition centre "De Hoep" of PWN in the Netherlands. A summary of these objects:
- "De strandpaal" (no picture): a single MP3 player with four head phones attached to it. The user controls the player with standard vandal resistant push buttons. The MP3 player also drives the LED illumination in the switches (the "active" button lights up).
- "Water bellen" (no picture): an MP3 player with two switches (of the "door bell" class) for the choice of the audio fragment. This player is also equipped with a key switch for volume control.
- "Pompen of verzilten" (salt water level): an MP3 player that responds to impulses from micro switches that are mounted on the construction, plus a key switch for volume control.
- "Dierenduin" (animal dune): an MP3 player with 11 switches for the choice of the audio fragment (animal sounds). Because of the large number of switches, there is an extension board with a separate microcontroller mounted on top of the MP3 player (it connects to the player via a standard PCB "header" connector).
The out-door exhibition centre "Madurodam" uses both the H0410 and the H0420 models. The LEGOLAND park uses MP3 controllers of the type H0420 in a few of its attractions. The amusement park Duinrell uses a customized H0420 model that can record audio (through a microphone) as well as play it back.
The H0420 delivers standard analogue output levels, suitable for a common power amplifier. In several applications in exhibits where the output had to go through a speaker or through a head phone, we combined the MP3 player together with an audio amplifier and a power supply (mains) in a single case.
References & further reading
- H0420 order form
- Small quantities of the H0420 can be ordered directly using this order form. For larger quantities, please contact us for a quotation.
- H0420 brochure
- A general brochure of the H0420 MP3 controller/player. (Date: 2009-09-16).
- H0420 MP3 Controller - User Guide
- This is the booklet that comes with the product and introduces its features and its programming interface.
- The datasheet of the H0420 MP3 controller
- The datasheet and usage notes, in PDF format. (Date: 2009-09-04).
- H0420 MP3 Controller - Programmer's Guide & Reference
- The programmer's reference of the H0420, describing all functions and pawn language features available on the MP3 player. (Date: 2011-12-07).
- H0415A Amplifier - User Guide
- This booklet comes with the 2 × 2.1 Watt audio amplifier that can optionally be stack below the H0420 MP3 controller. (Date: 2008-02-01).
- H0415E Ethernet Network Interface - User Guide
- The extension board for the Ethernet network interface and TCP/IP stack is described in this guide. This document is for model 1 of the extension board. (Date: 2008-02-28).
- H0416E Ethernet Network Interface - User Guide
- The extension board for the Ethernet network interface and TCP/IP stack is described in this guide. This document is for model 2 of the extension board. (Date: 2008-02-01).
- Ethernet Network Interface - Programmer's Reference
- This reference documents all functions for the TCP/IP network interface. This single reference covers both the H0415E and the H0416E extension boards. (Date: 2008-12-18).
- CE declaration
- The declaration of conformance to the CE norms (EMC, safety and RoHS) as a multilingual document.
- pawn: embedded scripting language
- The pawn scripting language is fully described at its own page.
- Programming the MP3 controller/player: getting started
This article steps through the creation of a very simple program, from the installation and configuration of the tools to the evaluation of the result.
- Playing tracks sequentially
A sequel to the above tutorial, in which we develop a script that plays MP3 tracks one after another (and in a random order).
- Track and artist separation
When selecting the tracks to play at random, you will often want a form of track separation or, better yet, artist separation, so that the same track (or one of the same artist) does not play too quickly again. This article discusses how to implement track separation and artist separation.
- Synchronizing activities with music
An ID3 tag in an MP3 track may optionally contain text or commands with time stamps. These time stamps allow the text or the commands to be synchronized with the music. The H0420 supports this extension, and the article gives a complete example implementation.
- Gapless looping MP3 tracks
Due to the file format and the algorithm of MP3 tracks, creating a loop without a gap or click is a little involved, especially when using a hardware player. The H0420 and Starling MP3 controllers can play gapless MP3 audio loops, provided that special software has processed the MP3 track.
Example tracks & processing software are available from this site, as well as a detailed presentation of how it works.
- A remote-controlled MP3 player
Adding functionality to manipulate the H0420 with a common remote control only takes the IR-receiver chip and a pull-up resistor, plus a script that interprets the codes sent by the remote control. This article goes into details and provides a general purpose script for RC5 codes (other infrared protocols are supported by modifying the script).
- Connecting a bar-code wand to the MP3 controller/player
The H0420 MP3 controller supports a low-cost bar-code wand directly on its I/O pins (only a pull-up resistors sometimes needs to be added). This article describes the connections and presents a script that decodes the "interleaved 2 of 5" bar-code symbology.
- Synchronizing time with DCF77
This article describes how to synchronize the internal real-time clock of the H0420 MP3 controller on the time signal emitted by the atom clock on the DCF77 transmitter.
Most recent update: The article also discusses the MSF60 transmitter (in Great Britain) and protocol.
- Encrypted MP3 tracks
The H0420 MP3 controller is able to play encrypted MP3 tracks directly (without needing an intermediate decryption phase, and so without start-up delay). This article discusses the software and the operations necessary to create MP3 tracks with strong encryption (and how to play them back).
- A MIDI to RS232 converter
The MIDI protocol is a serial data communications protocol using on a "current loop" physical layer, and using a Baud rate of 31250 bps. This article shows the electronics needed to convert between current loop and the RS232 signal levels. The circuit can be connected directly to the RS232 port of the H0420 MP3 player. In the second part, the article covers the "software protocol" of MIDI and develops a simple script to send and receive MIDI commands.
- Power-outputs for the H0420 programmable MP3 controller/player
The programmable MP3 player has digital I/O pins with TTL-level output. This note describes how you can get more power (and/or a higher output voltage) from the I/O pins.
- A voltage inverter circuit
The H0420 directly supports LCDs with a HD44780 controller and a positive LC-driving voltage. With the voltage inverter described here, you can also attach LCDs that need a negative LC-driving voltage.
- H0420 Internals
The internals of the H0420 are briefly touched upon in this on-line article. The notes cover both the hardware and the software ("firmware").
- The STA013 MP3 decoder
This paper is a collection of hardware notes on the use of the STA013 MP3 decoder from STMicroelectronics. The paper also contains some notes on the MP3 file format.
- ID3 tags
- Informal standards, developer information, backgrounders and the history of tagging.