microlab manual

 

Microlab manual


Resistors

pcb_layout_foto

microlab_inputs


SemiConductors


Capacitors


Remaing Components



Testing the Microlab


Connecting the wires


Keyboard


Connector overview (37 pins and 15 pins)


Schematics

 

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. The “Microlab building pack” comes together with a Printed Circuit Board (PCB), manual and the RISC-processor PIC16C73. This processor is fully programmed and ready to go. The only thing you have to do is to assemble the PCB and mount it into a cabinet of your choice. It is quite easy to build and complete the PCB. Just double-check everything you do before soldering the components onto the PCB.  If you are NOT sure, do NOT slder, but first think again.

It's a nasty job to remove soldered components!

Take a close look at the layout of the PCB, and the schematics section.

 

 ml_layout

 

 

 

 

The resistors
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ΩΩ

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

back to the top



 

 

 

 

The semi-conductors (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:

Pin_one_indicator

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


 

 

The Capacitors (back to the top)

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 3u3 F  (polarity!)

C2, C3, C13

2u2 F  (polarity!)

C14

1uF    (polarity!)
C5, C6, C7, C8

100 nF (Blue Siemens)

C11, C12, C15, C17

100 nF (MKT)
C16 12 nF
C9, C10 33 pF






 

 

 

Remaining components (back to the top)

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)
The pins on the outside are connected to the power. The remaining pins are the inputs. This means 8 x 4 inputs in total. From these 32 inputs you can solder wires to a connector of your choice.

J1                                              5-pins header (MIDI out)
The MIDI output is connected with 3 wires. The header-pin, which is directly connected to R3, has to be connected to pin 4 of the MIDI DIN connector. The header-pin, which is directly connected to R2, has to be connected to pin 5 of the MIDI DI connector. Pin 2 of the MIDI-connector is ground (see schematic!).                  

J2                                              2-pins header (Jumper setting J2)
This jumper (is a direct connection, or shortcut) determines the "base-address" of the MIDI controllers. If J2 has a jumper (shortcut) the controller’s numbers starts at 20. If J2 does NOT have a jumper (open), the controller number starts at 0.

J4                                              4-pins header (Jumper setting J4)
A jumper must be connected over the middle two pins (shortcut between pin 2 and 3). This is necessary for the Ultrasonic distance measuring to function ok. The fact that 4 pins header is used, has got to do with former MicroLab versions.

J6                                              8-pins header (key-scan 4x4)
This is the connection for the 16-input key scan. The pins directly connected to pins 25, 26, 27 and 28 are the Matrix Inputs (Mat_in). The other four are the Matrix Outputs (Mat_out). The appendix shows a schematic of the keyboard connections.

J7                                              4-pins header (switch inputs)
On these 4 pins a switch can be connected. A closed switch generates controller MIDI, value 127. An open switch generates controller MIDI value 0.

J8, J9                                         2-pins header (Ultrasonic output)
The Ultrasonic Transmitter has to be connected to these pins (often the S from Sender is written on the Transmitter). There are two headers: one normal 40 kHz signal and one 40 kHz signal inverted. The transmitter has to be connected to both. Always use shielded wire

J10                                            2- pins header (Ultrasonic input)
The Ultrasonic receiver connection : One pin to ground and one pin to the signal. The R from Receiver is written down on the receiver itself (receiver and transmitter look alike!). Always use shielded wire.

J12                                            2-pins header (Power/batt connection)
Connection for the power supply or 9V battery. The power-supply at this point has to be between 7V-12V DC. Check the polarity! The pin closest to the black diode (D10) is the positive (+) connection.

 

X1                          (X-tal 18.432 MHz version 4.x / X-tal 20MHz version 5.xF)
This is a Crystal Oscillator. This component generates the clock for the processor. Without this component the microlab will NOT work. It's important that the exact frequency is used (18.432 MHz), otherwise the MIDI will not have the right timing! Do not mount the Crystal directly on the board, but leave (1mm) space between the Crystal and the PCB.

SW1                                          2-pins header (Reset switch)
Connect a simple switch (make contact) to this header. It generates a total reset for the processor.


 

 

 

 

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Ω.

The best place is to mount the resistor on the solder side or back side of the
pcb:

 


 

 

Testing the Microlab (back to the top)

Before connecting the power to the Microlab PCB, it's better to check the following.
Take a close look at the solder-side of the PCB and make sure that there are NO Shortcuts.

Check the polarity of the capacitors.
Check the "pin 1" of all the IC's
Check the polarity of all diodes.

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! If you do see a square-wave, it means that the software inside the processor function ok.

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)

ml_inputs

Inputs:
32 inputs in total. This is realized with two HEF4067 chips, both having sixteen inputs. Which input represents which MIDI controller number, can be seen on the right figure. From all 10 ins headers, the outside pin is NOT connected (see left figure). The outside pins on the both headers in the middle (see left figure) are connected to the power supply; ground(-)  and 5V (+)

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.


 

 

 

Keyboard (back to the top)

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 (back to the top)


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.
Note 1: Pin 1 of the 37p Sub D connector is connected to controller input number one. The first MIDI controller numer is 0. This input is connected to pin 32.
Note 2: The connections of the Keyboard Matrix are also linked to the pins of the processor. Four of these connections are not directly linked to the chip, but through a resistor array. It's just a indication!

 

 

 

 

 

Connections 37-pins connector Connections 15-pins D-connector
Pin

 

Midi Controller
Number

 

Pin

 

Name

 

Pin RISC
Processor

 

1 1 1 analog 1 28
2 2 2 Mat_in 3 27
3 3 3 Mat_in 2 26
.. .. xx xx 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).

 

ml_sch8

 

 

 

sensor inputs (back to schematics)

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.

ml_sch5

 

 

 

Switch inputs (back to schematics)

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
switch 2:  midi controller number 65
switch 3:  midi controller number 66
switch 4:  midi controller number 67

 

 

 

 

Keyboard Matrix (back to schematics)

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.

ml_sch7

 

 

 

 

 

Ultrasonic (back to schematics)

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

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!

ml_sch8

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

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.

ml_sch9
 

 

 

 

PowerSupply (back to schematics)

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.

ml_sch10

 

 

 

 

 

 

Midi output (back to schematics)

 

ml_sch11

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.

(back to schematics)

Last Updated on Thursday, 06 January 2011 14:45
 
ipson, Powered by Joomla! and designed by SiteGround web hosting
ankara kiralık minibs ankara kiralık oto ankara minibs kiralama