MicroLab
Manual
Click here to go to the MTVlab manual
| Resistors | [placing the resistors] |
| SemiConductors | [placing the semiconductors, be aware of pin 1!] |
| Capacitors | [placing the capacitors; polarity!] |
| Remaing Components | [placing the rest of the components] |
| Extra modifications | [some necessary modifications] |
| Testing the Microlab | [step by step testing of the microlab] |
| Connecting the wires | [where to connect the wires to the board] |
| Keyboard | [circuit of the 16 key keyboard matrix] |
| Connector overview (37 pins and 15 pins) | [wires to the connector] |
| Microlab circuits explained | [placing the resistors] |
This text is a copy of the manual given to students who want to build their own MicroLab. They receive this manual, the components, the PCB (printed Circuit Board) and the (programmed) processor. This manual explains how to build the MicroLab yourself. It also mentions the important issues
for building a good and relatively cheap MicroLab, which will function perfectly, when built correctly.
|
(download
pdf manual)
(download pdf print layout)
Take a close look at the layout of the PCB, and the schematics section.
|
|
The
resistors (t(back to the top)
)
Mount the resistors flat on the PCB. Place the
resistors on the component side (see PCB)
and solder them on the soldering side!
| R2, R3 | 220
Ω
|
| R43 | 270
Ω
|
| R38 | 470
Ω
|
| R33 | 560
Ω
|
| R13 | 820
Ω
|
| R31 | 1 k
Ω
|
| R39 | 2K2
Ω
|
| R42, R44 | 3K3 Ω |
| R12, R24, R35, R36, R37, R41 | 10 KΩ |
| R32 | 12 KΩ |
| R1, R40 | 27 KΩ |
| R34 | 56 KΩ |
| R14 | 100 KΩ See remark (for better performance, take 47kΩ / june 2007) |
| R34 | 56 KΩ |
| AR3 (=R4, R5, R6, R7) | 100 Ω Resistor Array (Notice pin1!) |
| AR2 (=R8, R9, R10, R11) | 10 KΩ Resistor Array (Notice pin1!) |
| AR1 (=R20, R21, R22, R23) | 10 KΩ Resistor Array (Notice pin1!) |
| P1 | 1 KΩ Trim potentiometer |
Semiconductors
(Back to the top)
| The most vital component on the PCB is the processor, the PIC16F873. This is the heart of the Micro-lab. It is necessary to place this processor in a socket, which is soldered on the PCB. Do NOT solder the processor itself on the PCB, otherwise it is not possible to re-program the chip. Very important with mounting Integrated Circuits (IC's) on the PCB is to check pin 1 of the chip. On every chip the counting of the pin numbers is anti-clockwise, starting with pin 1 bolow: |
![]() |
If a chip is connected the wrong way, the circuit will NOT work and you can damage the chip and the total circuit when power is applied! |
| U1 (place in a socket!!) | PIC16C73 (A or B) JW (or OTP-version)
|
| U2 | 74LS09
|
| U3, U4 | HEF4067
|
| U5, U11 | 74LS04 (74HC04) |
| U6 | 7805 |
| U8 | NE555 |
| U9 | TL072
|
| U10 | 74HC74 (or LS) |
| T1 | BC559 |
| Transistor T1 can only be placed on the PCB in one position. Take a close look at the layout and check carefully when you solder. Also diodes only can be mounted one way! They have a positive-and a negative side (Cathode). The positive side is called Anode and the negative side Cathode. See figure below: |

| D1 | LED (MIDI indication) |
| D10 | 1N4004
|
| D13 | 1N4148 |
| A diode array is a component which contains more than one diode. In this case we use two different diode array's. D9-1A is an array consisting of 8 diodes which have one common pin, the anode. The other array, the D9-1C, has also one common pin. The cathode. | |
| D2 (=Diode Array) | D9-1A, Common Anode on pin 1 |
| D4 (=Diode Array) | D9-1A, Common Anode on pin 1 |
| D6 (=Diode Array) | D9-1A, Common Anode on pin 1 |
| D9 (=Diode Array) | D9-1A, Common Anode on pin 1
|
| D3(=DiodeArray) | D9-1C, Common Cathode on pin 1
|
| D5 (=Diode Array) | D9-1C, Common Cathode on pin 1
|
| D7 (=Diode Array) | D9-1C, Common Cathode on pin 1 |
| D8 (=Diode Array) | D9-1C, Common Cathode on pin 1 |
| With placing and soldering the capacitors you have to check the polarity. All the values smaller than (let's say) 100nF do not have polarity. Check the layout of the PCB. |
| C1, C4 | 3µ3 F (polarity!)
|
| C2, C3, C13 | 2µ2 F (polarity!)
|
| C14 | 1 µF (polarity!) |
| C5, C6, C7, C8 | 100 nF (Blue Siemens) |
| C11, C12, C15, C17 | 100 nF (MKT) |
| C16 | 12 nF
|
| C9, C10 | 33 pF |
| The last components to be added
are the headers. A header on this PCB is a row of pins onto which you can connect wires and/or jumpers.
|
H1, H2, H3, H4 10-pins header (Analog in)
J1 5-pins header (MIDI out)
J2 2-pins header (Jumper setting J2)
J4 4-pins header (Jumper setting J4)
J6 8-pins header (key-scan 4x4)
J7 4-pins header (switch inputs)
J8, J9 2-pins header (Ultrasonic output)
J10 2- pins header (Ultrasonic input)
J12 2-pins header (Power/batt connection)
X1 (X-tal 18.432 MHz version 4.x / X-tal 20MHz version 5.xF)
|
Microlab extra
modifications (Back to the top )
| Before you can start with
testing the MicroLab and using it, there are a few important things you should do first; else it will not work. First of all, the resistor R14 is shown in
the schematic, but does not exist on the layout of the PCB. Here is the solution: Solder R14 (100k) instead of
AR5, between pin 2 and pin 1 of the processor. Look at the photo: |
![]() |
| On pin 6 of the processor
an extra "pull-up" resistor is needed. A "pull-up" resistor is a resistor, which is
connected between the positive power (+5V DC!) and the actual I/O pin. A good value for the resistor is 10
KΩ.
pcb: |
![]() |
Testing the Microlab ( Back to the top)
Before connecting the power to the
Microlab PCB, it's better to check the following. Check the polarity of the capacitors.
When you connect the MicroLab for the first
time you will need some devices to measure the exact power (+5V) and to adjust the frequency of the
Ultrasonic circuit. For measuring the power you will need a simple voltmeter. For measuring and adjusting the
frequency an oscilloscope or frequency-counter will come in handy. When
you are sure everything is correct, connect the power (+7-15 V DC) on jumper J12.
The testing of the MicroLab
is actually simple. To make it easier, the circuit has 5 Test Points (TP1 till TP5). Start with TP1 and
end with TP5.
TP1 : At this point you should (if power is connected) measure the power-supply. This must be a positive DC-voltage with a value between a minimum +7V and a maximum of +18V. When connecting a battery, you should measure 9V DC. When the value is beneath 7V DC, the circuit will not work. TP2: This is the power for the circuit and
is measured after the voltage regulator (U6). This DC-value must be +5V (4,75 - 5,25). If this value is
higher, you must disconnect the power immediately! When the DC-value is lower than 5V it is likely that there
is a shortcut somewhere. Disconnect the power (or battery) and check the entire above once more.
TP3 (U1 / pin 21,22,23,24): When you are sure the power-supply is correct, you can connect a probe from a oscilloscope to TP3. At
this point you should see a square-wave. If there is NO square-wave, the processor is NOT working. At this
point you could measure the DC-value of "pin 1" (reset) from the processor. This pin should be
"high"; meaning the value is +5V. If this value is below +5V, the processor is in active
(reset-mode) and will not work. Check C1!
TP4 (U3 / pin 3): If you want to use the ultrasonic
distance measuring as well, you have to test / adjust the 80 kHz frequency, generated by the timer chip U8.
Make sure (for the testing) that NO jumpers are connected on J4! Connect a probe (from a oscilloscope) to TP4.
You should see a square-wave. Take a small screwdriver and adjust the frequency to 80 kHz exact. If the 80 kHz
works fine, connect the jumper on J4 in the middle-position.
TP 5 (U1 / pin 17): On pin 17 of the processor you can check whether MIDI is produced. Connect the probe and touch one of
the headers H1 till H4 with your finger. This should produce MIDI. If you already connected the LED (D1), the
MIDI should also be visual.
|
Connecting the Wires (back to the top)
![]() |
![]() |
![]() |
Inputs: In the three figures above, you can see how the inputs of the Microlab can be connected. In total there are 4 times 10 pins headers available for input. This means 40 pins! The outside pins of all four headers are no inputs. Means there are 32 inputs left to connect. The numbers in the picture on the right show which controller numbers represents which pin. |
| Connecting the keyboard is realised with 2 times 4 wires. 4 wires connected to Matrix input and 4 to the matrix output. Be aware that the diodes are used; very important for the readout of the matrix.Connect like this: |
Microlab
D-connector Overview
The connections given below are
not a MUST. You can connect the inputs to the Sub D connectors as you like. It
is of course convenient if you connect it the same way, so you can exchange
Microlab's if nessecary. |
| Connections 37-pins connector | Connections 15-pins D-connector | |||
| Pin |
Midi Controller Number |
Pin | Name |
Pin RISC Processor |
| 1 | 1 | 1 | Mat_in 4 | 28 |
| 2 | 2 | 2 | Mat_in 3 | 27 |
| 3 | 3 | 3 | Mat_in 2 | 26 |
| .. | .. | 4 | Mat_in 1 | 25 |
| 30 | 30 | 5 | Mat_out 4 | 24 |
| 31 | 31 | 6 | Mat_out 3 | 23 |
| 32 | 0 | 7 | Mat_out 2 | 22 |
| 33 | switch 4 | 8 | Mat_out 1 | 21 |
| 34 | Ext. adapter (+9V) | 9 | sw_1 | |
| 35 | Ground | 10 | sw_2 | |
| 36 | Ground | 11 | sw_3 | |
| 37 | +5V / VCC | 12 | US Receive | |
| 13 | Ground | |||
| 14 | US Send + | |||
| 15 | US Send - | |||
Schematics / Circuits (back to the top)
In this part the MicroLab electronic circuits are being discussed. The circuits are all drawn with Ulticap.
| Sensor inputs | [analog inputs] |
| Switch inputs | [4 times switch input] |
| Keyboard matrix | [how to connect the 16 switches] |
| Ultrasonic | [ultrasonic send and receive] |
| Powersupply | [the +5V (vcc) for the microlab] |
| Midi ouput | [midi output explained] |
| Short MicroLab explanation. The heart of the MicroLab is made by the PIC16C73 (16F873) processor. This RISC (Reduced Instruction Set Computer) runs the software to drive all external circuits. First of all it will scan the 32 analog inputs through 6 data lines. One data line for input, the other five for addressing. When the value of a certain input value is determined, the right midi controller is being sent out. The midi output could be directly connected to the pins of the processor (they can deliver enough current!), but in this case we connected it through a 74LS09 port. The second thing the processor does, is scanning a keyboard matrix of 4x4 (16 keys). When a switch is pressed, midi Note On/Off messages are generated. Two I/O lines are used to drive the ultrasonic send and receive circuit. The distance between two ultrasonic piezo's is converted into midi controller data. This can be used to measure distance. The four 'non-used' pins are used as switch inputs. The processor runs on a clock speed of 20MHz (earlier versions run on 18,4MHz). (back to the top) |

sensor inputs (back to the top)
| The 32 analog inputs are directly connected to the inputs of the HEF4067. The lines are protected against too high (or negative) voltage with diodes, connected to the positive and negative power supply (vcc and gnd). In the MicroLab there are two circuits like this, making 32 inputs in total. The input impedance of one analog input is around 10kOhm. The processor scans the lines with a frequency of around 30<x<100 Hz. The processor only generates midi when the input signal has changed. See figure below. |

Switch inputs (back to the top)
Because of some practical reasons, we decided to use the 'left over pins' of the processor as extra switch inputs. This means the four pins are connected to vcc with an external resistor. When connected to ground, through a switch, the processor will generate midi value 0; if released again, midi value 127 is generated. switch 1: midi controller number 64
|
Keyboard Matrix (back to the top)
| To be able to generate midi note on/off messages, a keyboard matrix of 4 x 4 was implemented. This means 4 scan output- and 4 scan input lines. Sixteen (16) keys can be connected this way. To avoid two or more keys being read as being ‘On’ together through back-circuits and causing ‘phantom’ notes, each key switch MUST have a series diode, type 1N4148 or similar. These diodes (which may be fitted either side of the switches, as convenient) must be wired so that the cathodes (the end with the black band) go to the input (Mat_in) side of the processor. The velocity of the keys being pressed, is static. The value is 65. The notes start with note number 60 and end with 75. |

Ultrasonic (back to the top)
| To measure the distance between two points, two ultrasonic piezo elements are used. One element sends out a burst of 40kHz; the second element receives these bursts. The time delay (distance) is converted into midi. |
Ultrasonic Send (back to the top)
| The source frequency of 80kHz is generated by a 555 timer. The combination C18 / R43 and P1, make sure the timer runs on exactly 80kHz. See figure below. The output of the timer is connected to a D-Flip Flop, which divides the 80kHz by two. Result 40kHz. The fact that we first generate the double frequency and later on divide it, is because then also the deviation is divided. The error rate will be half. too! |

| The reset input of the timer, called RUN, is connected to the processor. Send1 and Send2 are connected to the ultrasonic piezo element. Both the normal output and the inverted output are connected. This means the amplitude of the signal (40kHz burst!) is maximum. |
Ultrasonic Receive (back to the top)
| The ultrasonic receiver is connected to 'rcvr' in the schematic. The incoming 40kHz bursts are amplified with two non- inverting opamp circuits. The output of the amplifier is driven into a peak detector circuit, which in combination with the pnp transistor will generate a 'stop' pulse. This pulse will trigger the processor, so it can determine the time delay; and so the distance between sender and receiver. |
| The processor and the rest of the ttl logic runs on +5V DC. This means that all the analog inputs can vary between 0V and +5V. Nothing more and nothing less. The power supply on the pcb is made by a standard 7805 voltage regulator. The input of this regulator must be at least 7.3V. This means that an external adapter of 9V will do fine. The amount of current the Microlab can provide is totally dependent on the external adapter being used. The extra 100nF capacitors are placed near the power-pins of the different ttl ic's. |


The main output is MIDI. As mentioned before the output pins of the pic16c73 can deliver enough current to supply a MIDI loop, but we chose to connect a port in between. Just to be on the safe side. As shown in the schematic, midi is coming from pin 17 (RC6). From that point it drives two ttl ports from the 74LS09. One port is connected to the standard midi din plug (j1) and provides the midi current loop. The other port is driving a little led, to have an indication that midi has been put out. Jumper J2 drawn in between determines the midi controller value offset. If the jumper is connected (connection to ground has been made), the controller value's will start with midi number 20. If the jumper is not connected (pin 15 stays 'high') the midi controller values will start with 0. |