Close
0%
0%

OPL2 Audio Board for Arduino & Raspberry Pi

An easy to use audio board with a YM3812 OPL2 chip like used in the Adlib and SoundBlaster cards from back in the day...

Similar projects worth following

I've had a soft spot for OPL2 music ever since I was a kid playing DOS games on my parents' computer. Hearing the Apogee fanfare tune after typing in the exe always meant I was gonna have a great time and I fondly remember the music from games like Commander Keen, Hocus Pocus, Bio Menace and many more!

The music is produced by the Yamaha YM3812 audio chip that was used in the Adlib and SoundBlaster sound cards. After reading through the datasheet of the YM3812 it seemed easy enough to hook it up to an Arduino and play some tunes. I started by adding a 74595 to serve as a serial interface to the YM. I send data to it using SPI. At first I overlooked that the YM requires an external Y3014B DAC and an OPAMP for you to actually hear anything, so I became a bit confused as to how to get the audio out of the chip. I started looking around for schematics that could show me how others did it. I found several.

The first one I found linked in a forum post on the EEVblog. It seems to be from a C64 sound expander. I copied the filtering stage on my breadboard, but all it did was produce terrible hissing and other noises. With a bit more searching I found the reconstructed schematic of the actual Adlib card. The filter used in that one was also quite involved and also didn't work for me. So I started to poke around with the speaker wire until for the first time I could hear some OPL2 music through the noise that this circuit was producing. From there I started experimenting by adding and removing components until I settled on an LM358 OPAMP and two 10 uF caps which give me great audio, as you can hear form the demo video.

I drew the schematic and PCB layout in Fritzing and sent it to them to have my PCB produced. I turned out really nice. Note that the board does need an external amplifier. The code in the video is playing a DRO file (IMF is also supported) from an SD card that was captured using DosBox from the game Stunts. You can find the OPL2 library that I wrote for this project on my GitHub page.

Enclosure.zip

STLs for the enclosure

x-zip-compressed - 225.35 kB - 08/21/2022 at 18:54

Download

OPL2_Arduino_Final.fzz

Fritzing schematic and PCB layout

fzz - 98.13 kB - 12/16/2016 at 21:22

Download

  • 1 × YM3812 OPL2 Audio Chip
  • 1 × YM3014B Data Converters / Digital to Analog Converters (DACs)
  • 1 × 7404 Electronic Components / Misc. Electronic Components
  • 1 × 74595 Inductors, Chokes, Coils and Magnetics / Pulse, Signal, Datacom, Telecom Transformers
  • 1 × LM358 Amplifier and Linear ICs / Operational Amplifiers

View all 12 components

View project log

Enjoy this project?

Share

Discussions

Nander ... wrote 01/08/2021 at 23:07 point

It seems it didn't like me accidentally feeding it phantom power...

  Are you sure? yes | no

smaroman2007 wrote 09/16/2020 at 05:56 point

Hi i am very new to this and just want to play back dro files or other files on this device. I already installed the board and built the files and heard the test sound.  Im using a raspberry pi 3b. are there any tutorials or commands on how to play dro files? im so lost (im a noob lol) im so glad i can re-live my child hood memories with genuine adlib hardware :)

  Are you sure? yes | no

chrisleewoo wrote 01/27/2020 at 03:38 point

Can this work with a board that uses 3.3v logic? I have a 3.7v battery connected and wonder if that will be enough to power the unit?

  Are you sure? yes | no

Maarten Janssen wrote 01/27/2020 at 16:25 point

Yes, 3.3v is enough to make the board work. The audio will be less loud though.

  Are you sure? yes | no

Mechamilk wrote 05/15/2019 at 14:13 point

Hello, i'm maybe late but i would like to buy some boards!

  Are you sure? yes | no

jamie hewitt wrote 05/13/2019 at 21:02 point

How easy would it be to use this with a MinnowBoard? I'm looking to run DosBox native rather than emulated with an x86 board and was hoping to get this working too!

  Are you sure? yes | no

zingus wrote 12/14/2017 at 18:08 point

I am so happy you went trough all this, so I don't have to even try to. :)
Also I'm happy I grabbed what seemed to be the last kit on sale. Will there ever be a restock?

  Are you sure? yes | no

mikednm123 wrote 03/21/2017 at 03:34 point

Great project for quality sound.  My suggestion is that the schematic be more representative of the functionality of each block, not the physical body of the chip.  

  Are you sure? yes | no

Bruce wrote 03/15/2017 at 13:03 point

Nice work! I'd really like one of these! Do you have any extra boards for sale? Where did you find the Yamaha parts?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates