# A Pocket Soundbox

396

3

## Introduction: A Pocket Soundbox

This device not only fits into a pocket but also produces various musical tones similar to these of a bagpipe (in my opinion) by means of various combinations of six push buttons. Obviously, it’s just a gadget to amuse kids; however, it’s principle of working could be used (I hope) in more serious electronic music artefacts.

## Step 1: Description of Circuit

Voltage controlled oscillator (VCO)

The oscillator is built with an IC LM331 (a datasheet available here: http://www.ti.com/lit/ds/symlink/lm331.pdf), a voltage-to-frequency converter with exactly linear proportion between the input voltage (Vin) and the frequency of pulses at the output (Fout). An internal transistor at the output of the IC (pin 3) opens with the frequency that is a linear function of the input voltage. The supply voltage Vs is connected to the pin3 through the resistor R20; as a result, a train of pulses appears at the output. These pulses periodically open the external transistor Q1 which drives the speaker thus producing a sound. The input voltage comes from a voltage adder that can provide different voltages by means of different combinations of its pushbuttons. Both the oscillator and the adder are energized with one 9 volt battery.

The passive voltage adder consists of 6 voltage dividers each of which is composed of a potentiometer trimmer, a resistor and a diode. When a pushbutton is pressed, the voltage Vs from the battery is applied to the corresponding voltage divider. The output voltage of a divider corresponds to a specific frequency generated by the VCO. The frequency of the oscillations being directly proportional to the input voltage of the IC, every divider produces the voltage that is 6% higher than the voltage produced by the previous divider. The reason is that the frequencies of two consecutive notes differ by 6%; thus, six dividers produce voltages corresponding to six different notes. The resistor converts voltage into current that can be added to the currents from other dividers when several buttons are pressed. The diode does not allow the current from a divider to flow into other dividers, the current can flow only towards the summing resistor R13; thus, all dividers are independent from each other. You can read more about passive voltage adders here:

https://en.wikibooks.org/wiki/Circuit_Idea/Parallel_Voltage_Summer

https://en.wikibooks.org/wiki/Circuit_Idea/Simple_Op-amp_Summer_Design#Passive_summer

Audio mixers

http://sound.whsites.net/articles/audio-mixing.htm

That’s how I proceeded to set necessary voltages:

1) Connect a voltmeter between ground and Vin.

2) Press all VA’s pushbuttons, read the voltmeter. In my case it read 1.10 Volts. That’s the maximum voltage available at the VA’s output. The PBs' layout is shown in the picture above.

3) Take the voltage produced by the 1st divider (pushbutton 1) as ‘V1’. Being that every voltage is 6% greater than previous one, compose an equation:

V1 + 1.06xV1 + (1.06^2)xV1 + (1.06^3)xV1 + (1.06^4)xV1 + (1.06^5)xV1 = 1.10

Solving this for ‘V1’ gives V1 = 0.158V

Therefore, the voltages at the other dividers are: V2 = 0.167V, V3 = 0.177V, V4 = 0.187V, V5 = 0.199V, V6 = 0.211V. I rounded these values to second decimal: V1 = 0.16V, V2 = 0.17V, V3 = 0.18V, V4 = 0.19V, V5 = 0.20V, V6 = 0.21V.

Adjust the corresponding trimmers to get these values. If the VCO’s output frequency does not correspond to a specific note, adjust the trimmer R19 of the VCO (without touching the trimmers of the VA!) until a specific note is generated. R19 makes it possible to adjust the VCO’s output frequency without certain range without changing Vin. You can check either the notes’ frequencies with a frequency meter, or tune to a note with a sound tuner (for example, Garage Band has this feature in the ‘voice recording’ section).

According to my calculation, the VA can generate 34 independent voltages; only six of them match exact notes, the combinations of the pushbuttons give tones that are around exact notes within +/- 30 cents (one cent is a 1/100 of a semitone).

You’ll find a table with notes and their respective frequencies here:

## Step 3: Bill of Materials

SW1... SW6 – pushbuttons

R1, R3, R5, R7, R9, R11 – trimmers 5K

R2, R4, R6, R8, R10, R12 – 1K

R13 – 330 Ohm

D1...D6 – IN4001

Voltage controlled oscillator

IC 1 – LM331

Q1 – 2N3904

R14, R16 – 100K

R15 – 47 Ohm

R17 – 6.8K

R18 – 12K

R19 – trimmer 10K

R20 – 10K

R21 – 1K

C1 – 0.1, ceramic

C2 – 1.0, mylar

C3 – 0.01, ceramic

LS1 – small speaker with impedance of 150 Ohm

SW1 – switch

Socket for IC

Battery 9V

Note: power rating of all resistors is 0.125W, precision (all except R15, R17, R18) - 5%, precision of R15, R17, R18 – 1%. It would be also desirable to use high precision multi turn trimmers for more exact adjustment.

## Step 4: Instruments and Tools

I needed an x-acto knife to make the circuit board, then a soldering iron with solder and a wire cutter to build the circuit itself. A fine screwdriver is needed to adjust trimmers to set necessary voltages in the dividers. A multimeter is needed to monitor the adjusted voltages, and check the circuit in general.

You can observe the notes to which you tune the circuit with a sound tuner, like one embedded into Garage Band. You could also use a virtual oscilloscope like Academo (https://academo.org/demos/virtual-oscilloscope/) to see the oscillations. I attached a screen capture of this oscilloscope that shows the shape of the oscillations generated by my device.

## Step 5: Enclosure and Circuit Board

I used an available box made of transparent plastic and sized 125 x 65 x 28mm. I painted it white inside and made other modifications necessary to host the electronic part of my device. You are free to follow your own path in making this enclosure. As to the circuit board, I made it of copper clad glass textolite by cutting square pads in the foil and soldering components to these pads. I find this method more convenient than making a PCB when it’s about only one piece.

## Step 6: Video Participated in the
Pocket Sized Contest