Raspberry Pi v1 Model B Synth Board

If you’ve been following along, you’ll know I’ve been playing around with an original Raspberry Pi v1 model B as the engine for some digital sound synthesis.  This is a slight project tangent to build an analog IO and MIDI add-on board.  Note that this does not conform to any standard for Raspberry Pi add-ons (it certainly isn’t a “HAT”).

IMG_5547

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

If you are new to microcontrollers, single board computers and electronics, then see the Getting Started pages.

Parts list

  • 25×21 hole protoboard
  • 26 way dual-row (2×13) female header (stacking optional)
  • 3x 3.5mm TRS sockets
  • DIP sockets: 6 way (2×3); 14 way (2×7); 16 way (2×8)
  • MCP3008 SPI ADC
  • 74HCT14 hex inverting Schmitt trigger
  • H11L1 opto-isolator
  • 5x 220Ω resistors
  • 1x 1kΩ resistor
  • 4x 10kΩ “thumb pot” potentiometers
  • 1x 1N4148 diode
  • 3x 100nF ceramic capacitors
  • 1x 470 uF electrolytic capacitor
  • male headers
  • connecting wires

The Circuit

The requirement is for on-board potentiometers and full MIDI IN, OUT and THRU all within a footprint suitable for plugging into a Raspberry Pi v1 model B (the one with the 26-way GPIO header).

Raspberry Pi V1 Synth Shield-v4_schem

The MIDI part of the circuit is based on the design of the Clumsy MIDI board that I’ve used with my other projects.  The analog input is based on the MCP3008 circuit I’ve used too. I’ve left the use of on-board potentiometers configurable via a set of jumpers and have space on the board for a set of 8 pin headers to allow it to hook up to external pots if required.

Raspberry Pi V1 Synth Shield-v4_bb

This is a very busy board, so I’ve split out the MIDI and analog sections in the following two diagrams.

In terms of power, the H11L1, MCP3008, pots and MIDI IN run off the 3.3V supply but the 74HCT41, MIDI OUT and THRU are tied to the 5V supply.

The MIDI IN signal goes to the H11L1 then is connected to both the RPi RX pin and one of the buffers of the 74HCT41 which is used to redirect it back out to the THRU port.  The RPi TX pin is connected to the buffer and linked to MIDI OUT as you’d expect.  Note that as the buffer is an inverting buffer, each path through it uses two buffers to ensure the output signal is the same sense as the input (i.e. it inverts it twice).  This is therefore using four of the six buffers with two of them unused (and tied to GND).

The MCP3008 runs off the RPi hardware SPI pins.

The GPIO header needs to be tall enough to allow the board to sit above the composite video out socket of the Pi. I’m using stacking headers that come with additional spacers.  The board is supported by a 15mm, M2.5 “pillar” in one of the Pi’s mounting holes.

Here are some photos of the build.  It is a little complicated.

Warning: I wired up the MIDI sockets wrong!  I was aiming for the pin-out defined in the MIDI standard, but got the pins on my sockets back to front, so the first build is using the “other (non) standard” pinout.  Part way through I reversed the connections to fix it.  The circuit diagram is correct, but you will see that the wires are connected to the wrong pins in some of the earlier photos.

1. Installing the three sockets, four 2-pin jumper headers, and four pots.

2. GND (black/bare) then 3.3V power (orange) between the chips and pots.

3. Adding resistors and the diode.  Note how the 5V end of the two 220Ω resistors for the OUT and THRU are left unconnected at present.  The yellow wires show links from the buffer to the MIDI OUT resistor, and from one of the 5V connected 220Ω resistors to the MIDI THRU.  I’ve linked the two adjacent pins of the buffer handling the MIDI OUT together with a solder bridge.  You can see here I’ve started wiring up the incorrect connections to the MIDI sockets!  Oh well.  The MIDI connections are OUT (top), IN (middle), THRU (bottom).

4. Connect the rest of the MIDI circuit (pink).  The second MIDI THRU link on the top of the board, and the second MIDI IN link on the underside of the board.  Once again, these show the original, incorrect, connections!

5. The MIDI THRU section requires another “internal” link between stages of the buffer.  This time, it is a link across the chip (in blue).  I’ve also now added two 100nF capacitors across the power connections for the optoisolator and the buffer; and I’ve now soldered down the “5V ends” of the two 220Ω resistors ready to connect up to the GPIO header.

IMG_5532

5. Next, I’m adding the RPi GPIO header – note I’ve only soldered on the pins I’m planning to use at this stage (power, GND, RX, TX) and connecting it up to 5V (red), 3.3V (orange), GND (black), RX (green) and TX (yellow).  All but the GND link are made on the top of the board, with an additional link for the RX connection to extend from the buffer to the optoisolator on the underside of the board (the new green wire).

6. At this point I was able to test the MIDI section of the board in isolation.  And that is when I realised the sockets were all wired incorrectly!  You can see my corrective action in the following “before” (left) and “after” (right) photos…

7. Once MIDI was confirmed to work ok, I wired up the SPI links to the MCP3008 (white – one on top, three underneath).

8. Followed by the signal lines to the four pots (grey) and a capacitor across the power lines.  My original circuit called for a 1uF capacitor, but I ended up using a 100nF as that is what I had to hand.

I’ve not added the extra breakout header pins at this stage.  I’m saving that for a future optional expansion.  Here is the finished board plugged into my Pi. I’ve added a 15mm M2.5 spacer to one of the Pi’s mounting holes to support the board.

Closing Thoughts

This seems to work really well for me.  For now, I’ve just used it with my “Bare Metal” Raspberry Pi Synth but there is no reason this couldn’t be used with a normal Pi installation too, so I might try it with a software synth at some point.

Kevin

Leave a comment