The Electronics of a Stylophone

From Makerpedia
Jump to navigation Jump to search

by Stylophone


Project Overview

A stylophone is an analog electronic instrument invented in 1967 by Brian Jarvis. It is similar to an electronic keyboard but a stylus is used to “press” the keys rather than the keys being physically pressed. When a key is “pressed” a circuit is completed that results in a note being played. In this wiki entry you will learn the basic operating principles of a stylophone as well as a step by step tutorial on how to construct the electronics needed for a stylophone. At the heart of a stylophone is a type of circuit known as a voltage controlled oscillator, or VCO for short. A VCO is a type of circuit that outputs an oscillating electrical signal whose frequency depends on the voltage at the input. In a stylophone a VCO is used to create an oscillating signal that is amplified and outputted to a speaker resulting in a sound of a specific frequency being played. The frequency of the sound depends on the voltage input to the VCO. The input voltage to the VCO is determined by a series of voltage dividers that are selected using the stylus.

Tools and Materials

  • Breadboard or prototyping board
  • Wires
  • DC Power supply capable of outputting 4.5-9V
  • Oscilloscope
  • Screwdriver for adjusting trimpots (if using trim pot)
  • 12 x 10k trim-pot or potentiometer (for resistor bank)
  • 1 x 10k trim-pot or potentiometer (for volume control)
  • 1 x 10k trim-pot or potentiometer (for octave selector)
  • 2 x MCP 602 dual op-amp IC (2 op-amps per chip)
  • 1 x LMC 386
  • 2 x SPDT switch (tone and octave selector)
  • Capacitors: 1 x 10 nF, 1 x 100 nF, 1 x 50 nF
  • Resistors: 1 x 1 MΩ, 3 x 100 kΩ, 3 x 49.9 kΩ, 1 x 10 kΩ, 1 x 10 Ω


Project Files

Step-by-Step Instructions

The resistor bank makes it so that each key inputs a different voltage to the VCO, thus outputting signals of different frequencies. Although it has a fancy name, the resistor bank is composed of many voltage dividers in parallel, each of which corresponds to a key on the stylophone. I recommend using potentiometers or trimpots to create the voltage dividers so that each key is tunable. I used 10k trim pots, but the resistance of the voltage divider is not very critical. Soon you will tune each voltage divider to match a specific note but for now, make 12 voltage dividers in parallel and verify that each one can go between 0V and maximum voltage of your circuit. The picture shown only has 3 dividers shown but you can have as many as you like. I made 12 notes so that I can tune my stylophone like an equal tempered piano, but the possibilities are endless. If you have an idea for an exciting tuning go for it, have fun!

There are many VCO circuits, but in this tutorial we will focus on building a dual op-amp VCO. As shown in the circuit diagram this circuit has two outputs. Output 1 is a triangle wave while output 2 is square wave. The input controls the frequency of these outputs. There are many choices when it comes to op-amps for this circuit, but the stylophone is meant to be portable and powered by batteries, so I recommend using single supply op-amps. A single supply op-amp can function with only one positive supply voltage (as is the case with battery powered electronics). In my circuit I used an MCP602, a versatile single supply dual op-amp that is available in the makerspace. The resistors were chosen to work well with a supply voltage of 3-9V and ensure that the output signals are symmetric square and triangular waves. The value of the capacitor influences the maximum frequency that can be outputted. I used a value of .01µF so that the maximum output frequency is ~720 Hz. If a different frequency range is desired the following equation can be used to calculate the capacitance needed to achieve a specific maximum frequency: C = (½)*[(1-R2/R2+R4)/(R1fmax)]*(1+R7/R6).

The role of the stylus in the circuit is simple; it connects the input of the VCO to a voltage divider in the resistor bank. The voltage of the divider results in a VCO output with a specific frequency. The simplest way to achieve this is to have a wire going between the input of the VCO and one of the voltage dividers. While this works, it forces you to be careful with what voltage dividers you use, as the VCO can significantly load the divider and result in unexpected behavior. Because of this, I recommend using an op-amp buffer when connecting the VCO input to any of the voltage dividers. The circuit diagram for an op-amp buffer is shown to the right. This circuit is useful because it isolates the current of the input and output, allowing for much more flexibility in combining different circuits together. Throughout this tutorial I connect different circuits with an op-amp buffer in between so that I don’t have to worry about how different circuits load each other. For my op-amp buffers I used the MCP602.

After connecting one of the voltage dividers to the VCO input, going through an op-amp buffer, you should observe oscillating signals on outputs of the VCO. To verify the VCO is working as expected you should measure the frequency of one of the VCO outputs as well as the voltage at input voltage. As you vary the wiper resistance on the voltage divider you should see that the input voltage goes from 0V to your maximum voltage, and the frequency of the output goes from 0 to the maximum frequency value set by the value of the capacitor. You should also observe that your VCO outputs two different signals depending on which output you look at. One output should be a square wave and the other a triangle wave. Both signals should be of the same frequency and phase and be on the same order of magnitude as your rail voltage.

Now that you have a functioning VCO, you should be able to output a specific frequency for each voltage divider that you connect the stylus to. You can tune the stylophone in any way that you would like by changing the wiper resistance of the potentiometers/trimpots in the resistor bank. Regardless of how you tune the stylophone, you will want to know the frequency that you want outputted from VCO for each voltage divider that the stylus connects to. I tuned my stylus like an equal tempered piano, making each voltage divider correspond to one of the 12 notes in an octave going from C3 to C4. The frequencies needed to achieve this can be found online.

You now have a working VCO that can output notes, but you can’t hear them since they are electrical signals. This is no fun, let's get those signals playing out loud on a speaker. To amplify the output of the VCO I used an LM386 audio amplifier. The circuit diagram for the amplifying circuit is shown to the right. The potentiometer on the output of the LM386 acts as a volume control.

The final step is to integrate all the circuits into a functioning stylophone. The circuit diagram for the whole circuit is shown to the right. I also added an octave selector and tone selector option. The tone selector is accomplished by connecting the VCO outputs to the audio amplifier via a SPDT switch. The octave selector uses a SPDT switch, a voltage divider, and an op-amp buffer to make it possible to change the voltage of all the notes with one switch. The octave selector is located in the top left of the circuit diagram. I made my octave selector half all the frequencies (in order to go down one octave), but by adjusting the resistance of the potentiometer you can go down more than one octave.