gravimetric determination of the porosity of porous silicon€¦ · 20.1 noise analysis ... they...
TRANSCRIPT
Gravimetric Determination of the Porosity
of Porous Silicon
Alexander Meegan
Bachelor of Mechatronic Engineering
October 2011
1
2
Letter to the Dean
Alexander Meegan
3b Rye Place
Nollamara, WA, 6061
Australia
October 2011
The Dean
Faculty of Engineering Computing and Mathematics
The University of Western Australia
35 Stirling Highway
Crawley, WA, 6009
Australia
Dear Sir,
I submit to you this dissertation entitled Gravimetric Determination of
the Porosity of Porous Silicon in partial fulfilment of the requirement of
the award of Bachelor of Engineering.
Yours Faithfully,
Alexander Meegan
3
Abstract
The aim of the project was to build a microgram scale in order to
determine the porosity of porous silicon.
The physical characteristics of porous silicon are dependent on its
porosity. In developing manufacturing methods which produce porous
silicon of predictable characteristics it is important to be able to
accurately measure porosity.
The project builds on the work of Matthew Schubert started in
2010 which concluded „…that gravimetric testing was the most
appropriate method due to its accuracy, directness, cost effectiveness and
simplicity.‟(Schubert, 2010) In gravimetric testing the weight of the
silicon wafer is measured before and after anodising and the change in
weight is used to determine the porosity.
In completing the project the device designed and built by
Matthew Schubert was tested, refined and completed so that it can be
used for weight measurements
4
5
Acknowledgements
This thesis would not have been possible without the support of others.
Firstly I would like to thank Professor Adrian Keating whose knowledge,
experience and enthusiasm for this project made all of this possible.
Secondly I thank Matthew Schubert for his excellent work and helping
me get up to speed. Also I would like to thank my father Peter, mother
Christine and brother Isaac whose love and support kept me going.
6
Contents
Letter to the Dean ...................................................................................2
Abstract ......................................................................................................3
Acknowledgements ....................................................................................5
i. Introduction ......................................................................................10
1 Background Knowledge ...............................................................11
1.1 Porous Silicon ........................................................................11
1.2 Porosity ..................................................................................11
1.3 Determining Porosity by Mass ..............................................11
2 Project Overview ..........................................................................12
2.1 Aim ........................................................................................12
2.2 Motivation .............................................................................12
2.3 Safety .....................................................................................12
ii. Prior Research ..................................................................................14
3 Magnetic Levitation Balances ......................................................15
4 The Matthew Shubert Microgram Scale .......................................18
iii. Design ...........................................................................................21
5 Design Overview ..........................................................................22
6 Weighing Pillar .............................................................................24
6.1 Requirements .........................................................................24
6.2 Solution Overview .................................................................24
6.3 Weighing Pillar Design .........................................................26
7 Electronic boxes ............................................................................27
7.1 Requirements .........................................................................27
7.2 Solution overview ..................................................................27
7.3 Diecast Aluminium Boxes .....................................................28
8 Connectors ....................................................................................29
7
8.1 Requirements ......................................................................... 29
8.2 Solution overview.................................................................. 29
8.3 Controller............................................................................... 32
8.4 Converter ............................................................................... 33
8.5 LED Driver ............................................................................ 34
8.6 Solenoid Driver ..................................................................... 35
8.7 Photo Detector ....................................................................... 36
8.8 Current Sensor ....................................................................... 37
8.9 Charger Switch ...................................................................... 38
9 Cables ........................................................................................... 39
9.1 Requirements ......................................................................... 39
9.2 Solution overview.................................................................. 39
9.3 Shielded cables ...................................................................... 40
10 Outer Case ................................................................................. 42
10.1 Requirements ......................................................................... 42
10.2 Solution overview.................................................................. 42
10.3 Instrument case ...................................................................... 43
10.4 Instrument case modifications ............................................... 44
12 Redesigned Printed Circuit Boards ........................................... 48
12.1 Requirements ......................................................................... 48
12.2 Solution Overview ................................................................. 48
12.3 LED Driver ............................................................................ 49
12.4 Charger Switch ...................................................................... 50
13 Current Sensor .......................................................................... 51
13.1 Requirements ......................................................................... 51
13.2 Solution overview .............................................................. 51
13.3 Current Senor PCB ................................................................ 51
8
iv. Fabrication ....................................................................................54
14 Electronic Assemblies ...............................................................55
14.1 Printed Circuit Board Manufacture .......................................55
14.2 Soldering ................................................................................56
15 Mechanical Assemblies .............................................................57
15.1 Weighing Pillar ......................................................................57
15.2 Outer Housing .......................................................................59
15.3 Electronics Boxes ..................................................................61
15.4 Vibration Isolation .................................................................65
v. Results & Discussion ........................................................................67
16 Continuity Testing .....................................................................68
17 Charger switch functionality .....................................................69
18 LED Driver Characteristic ........................................................70
19 Current Sensor ...........................................................................72
vi. Conclusions & Future Work .........................................................73
20 Recommendations .....................................................................74
20.1 Noise Analysis .......................................................................74
20.2 Control Loop Development ...................................................74
20.3 Current sensor ........................................................................74
20.4 Calibration .............................................................................74
20.5 Graphical user interface .........................................................74
21 Conclusion.................................................................................75
References ................................................................................................76
vii. Appendices ....................................................................................78
Install Eclipse: ..........................................................................................87
Install eclipse plugins: .............................................................................88
Zylin CDT: ...........................................................................................88
9
GNU ARM Eclipse: ............................................................................. 89
Install Codesourcery GCC lite: ................................................................ 90
Copy files into workspace: ...................................................................... 91
Example Project Descriptions: ............................................................. 92
Important build properties: .................................................................. 93
Creating a new project: ........................................................................ 93
Setting up Debug Configurations: ........................................................... 95
Building OpenOCD: ................................................................................ 96
Debugging: .............................................................................................. 96
Running OpenOCD as an external tool in Eclipse: ............................. 98
Usbser Driver Installation: ..................................................................... 102
10
i. Introduction
11
1 Background Knowledge
1.1 Porous Silicon
Porous silicon is silicon with pores introduced into its microstructure[1].
Porous silicon can be prepared by chemical or electrochemical etching
processes and consists of nano- or microcrystalline domains with defined
pore morphologies[2]. It can be manufactured to have specifically
designed optical, mechanical, thermal, chemical and electrical
characteristics by controlling the size and orientation of the pores[3-9].
The diameter, geometric shape, and direction of the pores depend on
surface orientation, doping level and type, temperature, the composition
of the etching solution, and the current density during the etching
process[2].
1.2 Porosity
Porosity is a measure of the empty spaces in a material and is expressed
as a fraction of the volume of the empty space over the total volume.
Note that is does not take into account the homogeneity of the material in
question.
1.3 Determining Porosity by Mass
The density of the silicon remaining after pores have been introduced is
unchanged by the etching process, remaining at 2330 Kg∙m3. Thus
porosity can be determined as a proportion of the loss in weight over the
total weight before anodising, as seen in equation 1.3.1
(1.3.1)
Equation 1.3.1: Expression of porosity with respect to mass before and
after the introduction of pores. Where ma is the mass of the silicon wafer
before pores are introduced and mb is the mass after.
12
2 Project Overview
2.1 Aim
The aim of the project was to design and build an enclosure to house and
shield the circuitry of the Matthew Shubert designed microgram scale as
well as update and characterise the existing electronics. In keeping with
Matthew Shubert‟s design principals, the device was required to have the
following characteristics:
Cheap: The total cost of materials used to build the microgram scale
should be under $500 AUD. Running and maintenance costs should be
minimal.
Simple: The microgram scale should be easy to build, repair and
maintain. An undergraduate with minimal training should be able to
operate it.
Timely: Measurements should be obtained in only a few seconds.
Accurate: Porosity measurements should be accurate to within 1%,
repeatable within the same margin and unaffected by environmental
factors.
2.2 Motivation
Porous silicon‟s material properties are dependent on its porosity. In
order to characterise porous silicon and develop methods for its
manufacture it is important to be able to determine the porosity of porous
silicon wafers and match it to the predictive models for porous silicon
manufacture.
2.3 Safety
During the project safety was a chief concern. Constant vigilance was
maintained and risks were mitigated as much as possible. The hazards
were:
Chemical: Several chemicals where used during the project. For the
creation of printed circuit boards sodium peroxide and ammonia
persulphate solutions where used. The solvents glue, methanol, ethanol
13
and acetone where also used during the course of the project. All care
was taken when using chemicals, gloves and safety goggles were worn at
all times.
Equipment: Several dangerous pieces of equipment were used during the
course of the project, they include a soldering iron, a bench drill, hand
drill and jig saw. All care was taken when using dangerous equipment
and protective clothing, safety goggles and gloves, were worn at all
times. When using the drill no long sleeves were worn to prevent
clothing accidentally catching any spinning metal which could
potentially cause major injury.
Electrical: Exposure to electrical hazards was minimal during the course
of the project as only low voltage direct current power sources were used.
Care was taken to avoid short circuits to protect equipment and the risk
of burns.
14
ii. Prior Research
15
3 Magnetic Levitation Balances
According to Earnshaw‟s theorem, stable suspension of a ferromagnetic
body in a magnetic field is feasible and it can be applied to
gravimetry[10] as shown in the following figure 3.1.1.
Figure 3.1.1: A functional diagram of a magnetic force compensation
balance. The feedback controller keeps the magnetic object at a set
vertical position, using its position in the light beam to regulate coil
current. The weight of the sample coupled to the magnetic object is
determined from the resultant change in coil current.
The material to be weighed is attached to a ferromagnetic object which is
freely supported by the magnetic field of a solenoid situated above the
magnetic object. The vertical position of the ferromagnetic object is
maintained by the automatic regulation of the current through the
solenoid while its horizontal position is determined by the symmetrically
diverging magnetic field of the solenoid[11]. Light is focused on and
16
around the suspended body in such a way that the light reaching the
adjacent differential photo-detectors is obscured in order to determine the
suspended body‟s vertical position[1] as seen in figure 3.1.1. The
controller holds the suspended body at the desired vertical position by
regulating the current through the solenoid. Now if the mass attached to
the suspended body is increased or decreased, the body move up or down
in the light beam, respectively. The controller will compensate by
adjusting the current through the solenoid. The increase or decrease in
current through the solenoid required to bring the body back to its
original position then gives a measure of the mass added to or subtracted
from the body[11].
Several configurations of the magnetic levitation balance exist. An
overview of the literature surrounding them is explored in table 3.1.1.
Author Technique
Gast[10] The suspension of a permanent magnet was achieved by
monitoring its position using a differential photo-detector
and then adjusting the current through a solenoid coil
positioned above.
The sample to be weighed was then coupled to the
permanent magnet.
Beams
et al. [11]
The position of a ferromagnetic object was determined by
measuring the light reflected by the object up through the
centre of the solenoid placed above it by a photo-detector.
A controller would maintain the ferromagnetic object‟s
position by adjusting the current through the solenoid.
Once the sample was coupled to the ferromagnetic
object its weight would be determined from the current
required to bring the object back to its equilibrium
position.
17
Anufriev
et al.[12]
A sample tray was attached to a permanent magnet by a
filament. The position of the permanent magnet was
determined from two light beams and photo-detectors,
once place above, the other below its equilibrium set point.
Two solenoids were used, one to compensate for the
weight of the magnet and weighing tray the other to
compensate for the sample to be weighed. The output of
the photo-detectors was fed into a PID (proportional,
integral, differential) controller which adjusted the current
through the second solenoid to maintain equilibrium.
The weight of the sample was determined from the
current through the two solenoids
Codina[13] A magnetic body with a material receiving cavity is placed
below a solenoid. The position of the magnetic body is
monitored using a differential photo-detector and
maintained by an analogue controller.
To determine the weight placed in the magnetic sample
tray it suggested that the current through the solenoid be
used.
Table 3.1.1: An overview of the literature surrounding magnetic
levitation balances.
18
4 The Matthew Shubert Microgram Scale
In 2010 Matthew Schubert designed the electronics for a microgram
scale based on the magnetic levitation balance principal. It levitates a
permanent magnet beneath a solenoid and measures its position using a
differential photo-detector. The design also utilises two 6V batteries in
order to deliver stable direct current power to minimize electromagnetic
noise. The electronics and a test rig were built and it was proven
successful. An image the Matthew Schubert‟s microgram scale is shown
in figure 4.1. The components of Matthew Schubert‟s microgram scale
are described herein.
Figure 4.1: An image of Matthew Schubert‟s microgram scale test rig.
The electronic components of the microgram scale consist of several
printed circuit boards; a commercially available controller, the
Blueboard-1768-h, and several custom-made boards, a converter, a LED
driver, a solenoid driver, a photo-detector, and a charger switch.
The mechanical assembly of the microgram scale consists of a prototype
frame which houses the solenoid, lens assembly and photo-detector.
Controller: The controller is constructed from a programmed Blueboard-
lpc1768-h available from NGX Technologies. The Blueboard is a
development board utilising the LPC1768 which is an ARM Cortex-M3
based microcontroller[14] and features a I2S interface which is required
19
to communicate with the converter board. The Blueboard is
programmable with the use of the ft2232h mini module JTAG adaptor
programming dongle seen in figure 4.2.
Programming: Open source tools were used to program the Blueboard.
Eclipse IDE (Integrated Development Environment) provides the
graphical user interface for programming. The Eclipse IDE was extended
with the Eclipse CDT (C development tools), Zylin CDT and GNU ARM
plugins to allow embedded C programming and compiling through
CodeSourcery™‟s GNU Compiler Collection (GCC) tool chain. Open
On-Chip Debugger was utilised for flashing the compiled program to the
controller. A detailed tutorial on how to get started was created by the
author and is available in the appendix.
Converter: The converter printed circuit board features a digital to
analogue and analogue to digital converter. It acts as a translator between
the controller and the analogue parts of the microgram scale.
LED Driver: The adjustable LED driver is used to create the light stream
used for position sensing. It converts a 0 to 3.3V signal from the
controller to a 0 to 700mA signal to the bright LED housed in the lens
tube assembly.
Solenoid Driver: The solenoid driver drives the solenoid as the name
suggests. It takes a 4 part differential current signal from the digital to
analogue converter and outputs a -500mA to 500mA signal to the
solenoid.
Solenoid: Simply a spool of enamelled copper wire.
Photo-detector: The differential photo-detector features two photo
detecting diodes and outputs a voltage signal between -2.8V and 2.8V to
the analogue to digital converter
Charger Switch: The charger switch takes a digital signal from the
controller and, using a relay, switches the charger off when the
microgram scale is in operation
20
Batteries: The microgram scale uses two 6V 12Ahr batteries connected in
series. The scale has +6V, 0V and -6V power rails.
Charger: The 12V charger plugs into mains power in order to charge the
batteries. The charger and batteries are connected through a double pole
switch allowing the microgram scale to be turned off and still retain the
ability to charge the batteries.
21
iii. Design
22
5 Design Overview
The following items were required to complete the project aims and bring
the microgram scale to a more complete state:
A weighing pillar: The user needs a place to put the sample to be
weighed. This assembly will feature the solenoid, lens tube
assembly and photo-detector like the prototype assembly built by
Matthew Schubert.
Electronics boxes: The printed circuit boards must be
electromagnetically shielded to reduce electromagnetic noise and
protect them from shorts.
Inter-box connections: Once the printed circuit boards are inside
boxes their connections must be made through them. This will
require connectors and cables which must also be shielded.
Outer case: An outer case should be designed to protect the inner
componentry and allow the user to interact with the microgram
scale safely and correctly.
Passive Vibration Damper: To reduce the effect of external
vibration and increase the accuracy of the microgram scale a
dense base plate with vibration absorbent pads should be
designed.
Redesign printed circuit boards: The LED driver and charger
switch, which on the Matthew Schubert prototype were built on
vector boards should be redesigned onto printed circuit boards.
Current sensor: A current sensor to monitor the current through
the solenoid for the purpose of weight determination should be
designed.
Lens tube assembly redesign: The lens tube assembly should be
redesigned to reduce the overall cost of the microgram scale.
23
The design principals used in keeping with the project aims were:
Cheap: Commercial scales with microgram accuracy run into the
tens of thousands of dollars. It is the author‟s desire that this
microgram scale be manufactured for as little cost as possible.
Modular: To keep maintenance costs and time down the
components of the microgram scale should be modular to allow
faulty components to be picked out and replace. This also reduces
potential down time of the microgram scale.
Simplicity: In order to keep the microgram scale cheap and easy
to maintain the design should be kept as simple as possible.
Replaceable: Parts should be commercially readily available so
that components can be easily replaced in the event of damage or
malfunction. Keeping maintenance costs and downtime low.
Noise resistant: The microgram scale should be resistant to all
forms of environmental noise. This includes electrical noise
emanating from mains power and electronic devices commonly
found in laboratories such as computers, monitors and mobile
telephones, and physical vibration noise traveling through the
physical structure of any building the microgram scale is situated
in.
24
6 Weighing Pillar
6.1 Requirements
The weighing pillar is the assembly in which the user will place the
sample tray laden with the object whose weight is to be determined. The
weighing pillar will house the solenoid and position sensing components.
The following requirements were identified for the weighing pillar
design:
Safety: It is important that the user is able to place the sample tray
into position to be weighed easily and without injury, meaning
that sharp edges and tight spaces are to be avoided.
Useability: Is should be simple enough to interact with so that an
undergraduate can be trained in its use in a short amount of time.
Durability: As this is the component which will be subject to a
considerable amount of handling by the user it is important that it
can withstand a feasible amount of misuse without risk of
damage.
6.2 Solution Overview
The design of the weighing pillar was constrained by the following
factors:
The solenoid coil, of a diameter of 30mm and length 40mm, must
be positioned above the light stream with enough room remaining
for the sample tray and permanent magnet to suspend freely.
The distance between the light stream and the solenoid must be
considered, too close and placing the sample tray will become
25
awkward, too far and the force on the permanent magnet exerted
by the solenoid become less responsive to changes in coil current.
The size the hand of the typical must be considered when
designing the internal width of the weighing pillar. Too narrow
and again placing the sample tray becomes awkward, making the
microgram scale less useable.
Integration into the larger external box was also considered at the
design stage and both design tasks were completed
simultaneously.
The externally attached components, the light source and photo-
detector must appear below the top level of the outer case.
Based on the design goals and given the design constraints the following
design decisions were made after conducting ergonomic tests with scale
models made from cardboard:
The internal width should be 75mm which would comfortably
accommodate the hand of a male of approximate 6ft tall in a
pinched position using thumb and forefinger as would likely be
the case when holding the sample tray.
The internal height should be 100mm which passes the same
condition described above.
26
6.3 Weighing Pillar Design
The weighing pillar is designed to be assembled from 5 pieces. An
isometric drawing of the weighing pillar design is shown in figure 6.3.1.
The light source will be attached to the left side (when viewed from the
front) and the photo-detector the right.
Figure 6.3.1: An isometric drawing of the assembled weighing pillar
design. It is made from 5 pieces which slot and glue together to form the
weighing pillar.
A detailed schematic of the weighing pillar design can be found in the
appendix.
27
7 Electronic boxes
7.1 Requirements
The following requirements were identified before designing the housing
for the electronics.
RFI and EMI shielded, to decrease external noise pressure on the
circuitry thereby increasing accuracy.
Protects circuitry from dust and circuitry failures associated with
air born contaminants.
Protect circuitry from liquid spills. The possibility exists that in
the course of its product life that the microgram scale, being in
research laboratories, may be subject to accidental spills. It is
hoped that the housing for the electronics will prevent shorts or
any other damage to the circuitry in such an event.
7.2 Solution overview
It was felt that the printed circuit boards should be housed separately to
reduce the effects of electromagnetic cross chatter.
Many shielded and non-shielded electronic boxes exist on the market.
The author also explored the possibility of building sheet metal boxes or
plates. An externally shielded enclosure was also explored.
The solution reached was to house the printed circuit boards in separate
aluminium diecast boxes with connector plug-ins. This will allow the
printed circuit boards to be shielded from external electromagnetic noise
as well as from local noise.
28
7.3 Diecast Aluminium Boxes
The aluminium diecast boxes chosen for the microgram scale came in
two sizes as can be seen in figure 7.3.1. The larger of the two will house
the larger boards, the controller, converter, LED driver and solenoid
driver. The smaller of the two box types will house the photo-detector,
charger switch and current sensor.
Figure 7.3.1: Schematic of the diecast aluminium boxes used in the
Microgram Scale. The table has been edited to only include the relevant
dimensions. G0124F boxes house the controller, converter, LED driver
and solenoid driver boards, while G047F boxes house the smaller photo-
detector, charger switch and current sensor boards.
29
8 Connectors
8.1 Requirements
The following requirements were identified before designing the
connectors
The connectors should be relatively inexpensive, due to the
number of connectors needed to connect the various signals
between boxes the price of connectors soon adds up.
The connectors should be readily available to allow for easy and
cheap maintenance and repair.
The connectors should be non-reversible. To decrease the risk of
faults and possible damage associated with crossed connections it
is important that the connectors be non-reversible and that pins in
the connector are the same at either end of the cable.
Be able to be integrated into the diecast aluminium boxes
described in section 7.3.
8.2 Solution overview
Because of the expense of milling the metal boxes it was decided that the
connectors should be round. This negates the need for complicated CNC
(Computer Numeric Control) milling programs which would be
associated with non-round connector cut-out profiles, leading to long set
up times. By using round connectors instead much simpler CNC milling
program creating several holes of equal size is needed, decreasing set up
times and the overall cost of the box.
Of the round connectors available the DIN male plugs and female sockets
were chosen for the following reasons:
30
They offer different numbers of connections with the same cut-
out profile.
They are inexpensive, retailing at around $2.00 AUS for both
plug and socket.
They are readily available at most speciality electronics stores.
For the power to each board 3 pin DIN connectors were used. For all
other signals between boards 5 pin DIN connectors were used. This is
done to reduce the chance that DC power will be placed across sensitive
output pins.
For the power coming into the instrument case and into and out of the
charger switch 2.1 mm male plugs and female sockets were chosen for
the following reasons:
The 2.1 mm plug cannot be put into any of the DIN sockets,
preventing the charger power going directly into any of the
boards.
They are inexpensive and readily available.
They cannot be placed in the wrong way, reversing voltage
coming from the charger and potentially damaging the equipment.
The connectors are labelled as described in sections 8.3 – 8.9. The pin
numbering convention is as shown in figure 8.2.1.
31
Figure 8.2.1: A schematic diagram showing the pin numbering
convention. Each board is given a letter A through G. Each connector is
given a number from 1 going from left to right and then down in rows.
Each pin is numbered in sequence from 1 going left to right.
32
8.3 Controller
The controller, the Blueboard lpc-1768, requires five connections as seen
in figure 8.3.1. The pin list is shown in appendix XX.
A1.2 Features connections to two places on the Blueboard; the first is to
the ground of the 2.1mm right angle jack powering the board, the other
goes to the ground pin on the J5 pin cluster on the controller.
Figure 8.3.1: Connector schematic for the controller box.
33
8.4 Converter
The converter board requires 6 connections as seen in figure 8.4.1. B1
powers the board, B3, 4 and 5 are signals in and B2 and B6 are signals
out. The pin list is shown in appendix XX.
Figure 8.4.1: Connector schematic for the converter box.
34
8.5 LED Driver
The LED driver board requires three connectors as seen in figure 8.5.1.
C1 powers the board, C2 in the input from the controller and C3 is the
output to the LED. The pin list for the LED Driver board is shown in
appendix XX.
Figure 8.5.1: Connector schematic for the LED driver board.
35
8.6 Solenoid Driver
The solenoid driver requires three connectors as shown in figure 8.6.1.
D1 powers the board, D2 is the four way differential current inputs from
the converter and D3 is the current output to the solenoid. The pin list for
the solenoid driver can be seen in appendix XX.
Figure 8.6.1: Connector schematic for the solenoid driver board.
Note that the connector plug D3 has an internal connection to ground
because at this time there is no return to ground of the solenoid driver
board.
36
8.7 Photo Detector
The photo detector board requires two connections as seen in figure
8.7.1. The pin list for the photo detector board is shown in appendix XX.
Figure 8.7.1: Connector schematic for the photo detector board.
37
8.8 Current Sensor
The current sensor requires two connectors as seen in figure 8.8.1. The
pin list for the current sensor is shown in appendix XX.
Figure 8.8.1: Connector schematic for the current sensor board.
38
8.9 Charger Switch
The charger switch requires only one DIN connector but also requires
two 2.1mm jack sockets as seen in figure 8.9.1. The pin list for the
charger switch is shown in appendix XX.
Figure 8.9.1: Connector schematic for the charger switch board.
39
9 Cables
9.1 Requirements
The cables transmit the signals between the various boxes via the
connectors. The following requirements were identified for the
connecting cables:
Electromagnetic interference shielded. Due to the sensitive nature
of the circuitry of the microgram scale it is important to shield the
cables from local and environmental electrical noise such as 50Hz
and associated harmonics generated by mains power.
Feature enough connections to transmit signals along single
cables.
9.2 Solution overview
Four types of cables were used in the microgram scale, they are:
Two wire twisted pair shielded cable was used for signals from
the photo-detector and current sensor to the converter as well as
from the solenoid driver to the solenoid. The twisted pair
topology makes the cable very resistant to external noise. It is
also shielded.
Four wire consisting of two twisted pair shielded cable was used
for the power to the boards and for the four part differential signal
from the converter to the solenoid driver. While the power cable
does not benefit from the twisted pair it still benefits from the
shielding giving stable steady power to the boards increasing
accuracy.
Nine wire shielded data cable was used for the data signals
between the controller and the converter board. One for the digital
to analogue side and one for the analogue to digital side of the
converter board. The nine wire shielded cable features no twisted
40
pairs however the digital nature of the signals within these cables
are not suitable to take advantage of twisted pairs. The shielding
on this cable protects these signals from external noise as well as
protecting the other components of the microgram scale from the
noise generated by these high speed digital signals.
9.3 Shielded cables
In interfacing the cables with the DIN connector plugs care must be taken
to ensure firm connections and avoid the danger of shorts across
connectors.
For shielding to be effective the cables must be grounded at one end to
avoid ground loops causing unwanted currents. The interior of the DIN
connectors are metal with a hole in the clamp which secures the cable,
the grounding wire is placed through this hole at one end and soldered
into place as seen in figure 9.3.1. The metal of the plug is in contact with
the metal of the connector which is in contact with the metal case which
is ground through a wire to the ground terminal. Heat shrink is used at all
connection points.
41
Figure 9.3.1: Shielded cable and connector assembly schematic. The
shielding of the cable is grounded through the metal of the DIN
connector to the diecast aluminium box, at one end of the cable. The
diecast aluminium box is connected to the ground terminal by a wire.
42
10 Outer Case
10.1 Requirements
The following design requirements were identified for the outer case.
Protect the internal componentry from accidental spills. As the
microgram scale is to be placed in a lab next to potentially
hazardous chemicals it is not impossible that the device will come
into contact with them in the event of an accident. The outer
housing should mitigate the risk of a catastrophic failure in the
event of such an accident.
Protect the internal componentry from knocks and other physical
hazards. It is usually true that if there is a flat surface at some
point someone will put something on it. The outer case should be
able to withstand a reasonable amount of external weight without
risking failure. Some of the more likely objects it may come into
contact with are a full cup of coffee, up to approximately 500
grams, or a text book, up to 1.5 to 2 kilograms.
Protect the internal componentry from tampering. While it is
unlikely someone would tamper with the microgram scale on
purpose it is not unheard of for people to „borrow‟ plugs and
cords form unattended equipment with the intention of returning
it later, which may or may not happen. The outer case should
remove the temptation and risk to untrained operators by placing
components beyond reach.
10.2 Solution overview
Several options were explored including manufacturing a custom case;
however this was abandoned after cost made its one off manufacture
prohibitive. It was decided that the most cost effective solution was to
purchase an off-the-shelf instrument case and modify it suit the
requirements of the microgram scale.
43
The product purchased for the task was the ABS black/grey instrument
case of the dimensions, 355x250x122mm, available from Altronics® for
the RRP $36.95 AUD. This instrument case was chosen for the following
reasons.
It was constructed from ABS plastic and therefore easily
modified, cut and drilled.
It was relatively inexpensive when compared to metal cases of
similar size such as a 3U 19” rack case which retails for $79.00
AUD.
Available off-the-shelf and sourced locally.
10.3 Instrument case
The instrument case has outer dimensions of 355x250x122mm and is
made of ABS (acrylonitrile butadiene styrene) plastic which will remain
stiff over a wide temperature range[15]. It is also hard and stiff enough to
be able to be cut by high speed machinery such as drills and saws. Figure
10.3.1 shows and image of the instrument case before modifications have
been made to integrate it into the microgram scale.
Figure 10.3.1: Image of an instrument case. Image provided by
Altronics® and is available from their online catalogue[16].
44
The instrument case is assembled from four separate parts which slot in
and then screw together a base, top, front and back pieces. The pieces of
the instrument case can be disassembled during modification to make the
process easier and faster.
10.4 Instrument case modifications
Cuts should to be made in the front and top of the case to allow the pillar
to protrude through. The cut in the front plate can be seen in figure
10.4.1. The cut in the top piece can be seen in figure 10.4.2.
Figure 10.4.1: A schematic of the front panel of the instrument case
showing the cut-out made for the weighing pillar to protrude through, as
seen from the front.
45
Figure 10.4.2: A schematic of the top of the instrument case showing the
cut-out made for the pillar protrusion, as seen from above.
A hole of 12mm in diameter should be made in the back plate to allow
power conduit from the batteries to enter the case. The position of the
hole is shown in figure 10.4.3.
Figure 10.4.3: A schematic of the back panel of the instrument case
showing the hole made for the battery conduit, as seen from the rear.
46
Holes should be made on the right side of the base piece to protrude the
on/off switch and the charger jack. The positions of the 12mm diameter
switch hole and the 13mm diameter charger jack holes are shown in
figure 10.4.4.
Figure 10.4.4: A schematic of the base panel of the instrument case
showing the holes made for the on/off switch and the charger jack.
As the instrument case is designed to hold electronic boards its internal
topography is not flat. A base board was designed to give a flat surface
for the mounting of the electronics and weighing pillar. The design of the
base plate is shown in figure 10.4.5.
47
Figure 10.4.5: A schematic of the base plate, to be placed inside the
instrument case as seen from above.
48
12 Redesigned Printed Circuit Boards
12.1 Requirements
The design task for the redesign of the LED driver and the charger switch
was simply to replicate the circuits designed by Matthew Schubert and
implemented on strip boards and recreate them on printed circuit boards.
The following requirements for the printed circuit boards were identified:
Simplicity: Consideration should be given to soldering
complexity which is greatly increased when surface mounted
devices are used. Where ever possible through hole components
should be used, with the aim to decrease fabrication complexity
and hence time.
12.2 Solution Overview
The freeware software EagleCAD lite to was used to design the footprint
of the circuits using their circuit designs.
The LED driver and charger switch circuits designed my Matthew
Schubert have proven effective, hence there was no need to change them.
No surface mounted devices were necessary in the design of the LED
driver or charger switch circuit boards.
49
12.3 LED Driver
The circuit diagram for the adjustable LED driver designed by Matthew
Schubert is shown in figure 12.3.1. The circuit features an amplifier, a
transistor and several resistors. The LED Driver will be made using a
single sided board. The layout for the redesigned PCB is shown in figure
12.3.2.
Figure 12.3.1: A schematic diagram showing the adjustable LED driver
circuit.
Figure 12.4.2: The layout for the LED Driver PCB.
50
12.4 Charger Switch
A circuit diagram for the charger switch is shown in figure 12.4.1. It
features a 12V relay switch, a transistor, a diode and 3 2-wire terminals.
The charger switch will be made using a single sided board. The layout
for the charger switch is shown in figure 12.4.2.
Figure 12.4.1: A schematic diagram of the charger switch circuit.
Figure 12.4.2: The layout for the charger switch PCB
51
13 Current Sensor
13.1 Requirements
The following requirements for the current sensor were identified:
High accuracy
Cheap
Simple
13.2 Solution overview
A single chip solution was found using the AD8217. The surface
mounted chip monitors the current through a shunt resistor and outputs a
voltage as a function of the current, shunt resistance and an internal gain
of 20 as shown in equation 13.2.1.[17]
(13.2.1)
13.3 Current Senor PCB
A circuit diagram for the current sensor is show in figure 13.3.1. It
features only the AD8217 chip and a 10mΩ shunt resistor. The current
sensor will be made on a single sided board. The layout for the current
sensor PCB can be seen in figure 13.3.2.
52
Figure 13.3.1: A schematic diagram of the current sensor circuit.
Figure 13.3.2: The layout for the current sensor PCB.
53
54
iv. Fabrication
55
14 Electronic Assemblies
14.1 Printed Circuit Board Manufacture
The printed circuit boards were made through a process known as
photoengraving.
First the circuit board is designed using EagleCAD, a software package
which allows the user to design a circuit board layout from its circuit
diagram.
The circuit board layout is then printed onto an overhead transparency.
A copper clad PCB sheet, covered in photoresist, is cut to size.
In dark room conditions the transparency mask is placed on the blank
PCB sheet which is then put into an ultraviolet lightbox where it is
exposed for 80s
Once the exposure cycle is complete the board is taken out of the
lightbox and placed in a developer solution consisting of 10g/L sodium
hydroxide. The photoresist will dissolve in the developer solution where
ever it was exposed to the ultraviolet light. Hence photoresist will remain
only where covered by the transparency mask, copper will be exposed
elsewhere.
Next the board is placed in the etchant tank, in a solution of 200g/L
ammonia persulphate, which is heated to 60°C and agitated with a fish
tank bubbler for 15 minutes. At the end of this time the copper will be
etched away where ever it is exposed, hence only the copper protected by
the photoresist will remain.
The circuit board is removed from tank and rinsed in water. The
remaining photoresist is then removed using acetone.
Finally holes for the through-hole components and vias are drilled using
a bench press drill.
56
When making printed circuit board‟s safety is always considered. When
using chemicals safety goggles and gloves are worn, all chemicals are
disposed responsively and any spills cleaned immediately.
14.2 Soldering
Many of the components populating the circuit boards of the microgram
scale a surface mount necessitating soldering to be conducted using a fine
tipped soldering iron under a binocular microscope.
Figure 14.2.1: An image showing the completed LED driver circuit
board.
57
15 Mechanical Assemblies
15.1 Weighing Pillar
The weighing pillar prototype was made from a 10mm thick ply wood
board. This material was chosen because it was stiff, easily cut and
drilled and was available gratis to the author as it was an offcut discarded
by a cabinet maker.
The 5 panels of the weighing pillar prototype were measured and drawn
directly on the wood before being clamped down and cut with a jigsaw.
During the cutting safety was a chief concern, protective gloves, goggles
and ear plugs were worn and all care was taken while the jigsaw was
powered up.
The edges of the panels were sanded smooth using 180p grade
sandpaper. The panels were then cleaned with methylated spirits to
prepare the surface to be glued. The panels of the weighing pillar were
glued together using Weldbond®, a universal bonding adhesive for wood
among many other materials[18], by applying to both surfaces to be
glued before firmly pressing together. Once the pillar was complete it
was left for 24 hours for the glue to set. The MSDS (Material Safety Data
Sheet) for Weldbond® can be viewed at [19]. The gluing was conducted
in a well-ventilated area to mitigate the risk of breathing harmful
chemicals, gloves were worn and care was taken to avoid contact with
skin or eyes.
Once the weighing pillar‟s glue had set, holes were drilled using a high
speed electric hand drill in the left, right and rear panels for the lens tube
assembly, photo-detector and solenoid wire respectively. Again safety
was considered whilst using the high speed drill and protective gloves,
goggles and ear plugs were worn and all care was taken.
58
Figure 15.1.1: An image of the assembled weighing pillar.
The outside of the weighing pillar prototype was painted with three coats
a clear wood vanish for aesthetics. The varnish should prevent the wood
from collecting dirt and finger marks. The painting occurred in a well-
ventilated area to reduce exposure to harmful fumes.
The solenoid, made from a small spool of enamelled copper wire, was
soldered onto the solenoid cable, the solder joints were then covered with
heatshrink. The solenoid glued into place on the underside of the top
panel using Weldbond®. The weighing pillar was then left upside-down
for 24 hours for the glue to set. The gluing occurred in a well-ventilated
space to mitigate the risk of breathing harmful chemicals and case was
taken to avoid contact with skin and eyes.
The solenoid wire was feed through the hole in the rear panel and
trimmed in preparation for being integrated into a connector.
Finally the lens tube assembly and photo-detector were screwed into
place using M3 polycarbonate nuts and bolts.
An image of the assembled weighing pillar can be seen in figure 15.1.1.
59
15.2 Outer Housing
The instrument case had to be modified to before it was suitable for the
microgram scale. The as discussed in section 10 the instrument case is
made of four separate pieces. The top and front pieces needed to be cut
for the weighing pillar to protrude and the base and back sections need to
be drilled.
For the various holes in the base and back pieces of the instrument case,
the piece was simple clamped and drilled using a hand drill with a drill
bit of the appropriate size. All drilling safety procedures were observed
while drilling.
To make the cut in the top piece first a wood cut-out was made by
stapling together a few off-cuts to be used as a guide for the cuts. The
wood cut-out was then taped down to the top of the piece.
A jigsaw was used to make a rough cut. Then a router used to make the
fine cut and finally a file was used to square the edges.
The same process was used to make the cut-out in the front panel
however the final step was skipped and the corners were left rounded.
An image of the assembled outer housing can be seen in figure 15.2.3.
60
Figure 15.2.3: An image of the assembled microgram scale.
61
15.3 Electronics Boxes
The centres of the desired holes are marked with pen on the top of the
box.
A centre punch, a metal tool with a pointed tip and a blunt base, is placed
at the positions marked for holes and hit with a hammer. This will create
a dimple which will guide the drill bit and stop it from slipping across the
surface.
Figure 15.3.1: An image of the controller box with 3mm pilot holes
drilled in it. Pilot holes are drilled to guide and centre the larger holes and
are made in centre punched holes.
3mm pilot holes are then drilled using the centre punches as a guide.
Tool oil is applied to the surface and the drill bit before drilling. Pilot
holes in the controller box can be seen in figure 15.3.1.
Then 13mm holes are drilled using the pilot holes as a guide. Because the
cut is much more substantial more tool oil is required and is applied
before and at times during the drilling process. The completed 13mm
holes in the controller box can be seen in figure 15.3.2.
62
Figure 15.3.2: An image of the controller box with 13mm holes drilled
in it. The 13mm holes are made using pilot holes as a guide in order to
prevent slipping and to be centred correctly.
Next a drill file is used to widen the holes to the required 14.2mm. Again
tool oil is used both before and during the process. The holes in the
controller after they have been filed are shown in figure 15.3.3.
Figure 15.3.3: An image of the controller box showing the widened
holes. The 13mm holes are filed using a drill file to increase their
diameter to 14.2mm.
The DIN connectors are then wired to header connectors to interface with
the printed circuit boards to be placed within them. Heatshrink is used to
ensure no shorts will occur across the connectors.
Finally the connectors are press fit into holes as shown in figure 15.3.4.
63
Figure 15.3.4: An image of the controller box with the connectors
inserted.
The inter-box connector cables were made by soldering the appropriate
cables into the appropriate connector plugs as discussed in sections 8 and
9 respectively. The solder joints were covered with heatshrink and the
grounding wire soldered to the connector at one end of the cable as
discussed in section 9.
The DIN connectors come in four parts, the pins, the bottom half shell,
the top half shell and the plastic sleeve. The wires are soldered into the
back of the pins and cover with heatshrink. The pins then slot into a
groove in the bottom half shell, which features a crimping flange, used to
secure the cable. The grounding wire is soldered into a hole in the
crimping flange where appropriate. The top half shell is then placed on
the pins and bottom half shell, an extrusion on the pins fits into a groove
in the top half shell, there is also a pair of tabs which secure the top and
bottom half shells. Finally the plastic sleeve is slid over the top and
bottom half shells to secure and complete the connector.
Due to space issues the tails of the DIN connectors were trimmed to
allow more flexibility in the cables closer to the connector.
A thin rubber sheet was cut to fit inside the electronics boxes to prevent
short circuits occurring across the base surface of the boxes.
64
65
15.4 Vibration Isolation
In order to decouple the microgram scale from building vibration,
typically in the order of less than 300Hz and caused by traffic and other
heavy machinery[20] a passive vibration attenuation system consisting of
a mass and damper was fabricated.
The vibration isolation is achieved by gluing Sorbothane feet to the base
of a piece of stone approximately 450x300mm provided gratis by
AuroraStone®. The vibration isolator can be seen in figures 15.4.1 and
15.4.2.
Figure 15.4.1: An image of the vibration isolator viewed from above.
66
Figure 15.4.2: An image of the vibration isolator showing the Sorbothane
pads glued to its base.
67
v. Results & Discussion
68
16 Continuity Testing
The connectors were meticulously tested to ensure continuity and no
shorts.
The connectors were taken out of the boxes and placed on the plugs at
either end. Header pins were placed in the header sockets as seen in
figure XX. Continuity was then tested using a digital multimeter.
To test continuity the multimeter was set to continuity test mode which
makes an audible beep whenever continuity is detected. A multimeter
probe was placed on a header pin at one end of the cable and the other
probe was placed on the header pins at the other end of the cable in
sequence, the first probe was then moved to the next header pin and the
process was repeated. A successful test was one in which the continuity
beep was heard only at the intended header pin and no other, indicating
continuity from header socket to header socket and no shorts to any other
pins.
All discontinuities and shorts were repaired and retested.
Figure XX: A schematic diagram of the set up for the connector test.
Sockets were placed on the plugs outside the boxes and header pins
placed in the header sockets and tested using a multimeter.
69
17 Charger switch functionality
The redesigned charger switch was tested to ensure proper functionality.
A voltage of 6V was applied across ground and high side of the relay
switch by a constant voltage source, the voltage level was set to 6V
measure by a multimeter. This voltage is used to switch the relay as can
be seen from the circuit diagram shown is figure XX in section XX.
The input voltage was set by another constant voltage source using a
common ground.
The voltage of the second voltage source was measured using a
multimeter as it was increased from 0V until the relay switched. The
relay state was monitored by a second multimeter set to continuity mode
with its probes connected to the negative terminals to the battery and
charger respectively.
The charger switch functioned correctly with the switch closed at 0V and
open at 3.3V, the logic high from the controller. Switching was observed
to occur at 1.2V when traversing from low to high input voltage, opening
the relay switch, and at 0.7V when traversing from high to low input
voltage.
70
18 LED Driver Characteristic
The redesigned LED driver was tested to ensure functionality.
The LED was driver powered by a constant voltage source set to series
mode to output +6V, 0V and -6V, verified by a multimeter.
The input voltage set by a second constant voltage supply which was
ramped up from 0V to 3.3V in 50mV increments as measured by a
multimeter.
The output of the LED driver was determined by measuring the voltage
across a 5 watt 1 ohm resistor connecter across its output. The resistance
verified using a multimeter and used to calculate the current using ohm‟s
law, shown in equation XX.
(XX)
Equation XX: Ohm‟s law.
The test was repeated three times and show a strong correlation between
expected and observed results leading to the conclusion that the LED
driver is operating correctly. The results of the test can be seen in figure
XX.
71
Figure XX: LED driver test results showing output current against input
voltage. Data points were generated from the average of three tests; error
bars were calculated using the maximum spread of 3mA.
72
19 Current Sensor
The current sensor was tested to investigate the linearity and scale of its
output.
A constant current source was connected to the input of the current
sensor in series with a multimeter, used to measure the current. A second
multimeter was used to measure the voltage output of the current sensor
as the input current was increased from 100mA to 800mA. The test
showed a high degree of linearity as can be seen in the results in figure
XX.
The results do however deviate from the expected output by a significant
margin; it is suspected this is due to a combination of deviation from
labelled values for the shunt resistor and chip gain, and measurement
equipment errors.
Figure XX: The results of the current sensor test. Measurements were
repeated three times, the data points show the average value and the error
bars indicate the maximum spread of 2mV.
73
vi. Conclusions & Future Work
74
20 Recommendations
20.1 Noise Analysis
A thorough noise analysis should be conducted to confirm the effect of
the electronic boxes. Comparative studies of the output profiles, using an
oscilloscope, of each board whilst the shielding is ground and
ungrounded should demonstrate the effect it has on noise attenuation.
20.2 Control Loop Development
A frequency response for the system should be determined, and it should
be used to develop an effective control strategy. Using a system
identification adaptive algorithm a FIR (finite impulse response) filter
could be attained to represent the system. It is recommended that the
transfer function of the system be attained through experimentation as the
calculation of magnetic force at these distances requires complicated
finite element analysis to determine.
20.3 Current sensor
Further design work is required for the current sensor. Its output profile
should match the 0V to 2.8V range of the digital to analogue converter.
20.4 Calibration
Once the current can be accurately measured, current through the
solenoid should be matched to weight. Masses of known size and density
should be weighed should be measured to perform this calibration. The
possibility of an auto calibration feature should be investigated to
maintain accuracy and to prevent errors caused by slight changes in
gravity, which will happen if the microgram scale is to be used some
distance away from the location it was calibrated in.
20.5 Graphical user interface
A LCD display and function buttons should be incorporated into the
design to allow a user a simple and obvious way to interact with the
microgram scale.
75
21 Conclusion
This thesis while not completing the microgram scale has moved the
project closer to completion.
The case, weighing pillar, and electronics boxes were all designed and
built in accordance with the aims of keeping the microgram scale cheap
and efficient. The robust modular design means that in the next stage of
development individual components can be tested, refined and improved
separately from the rest of the microgram scale componentry.
76
References
1. Schubert, M., Gravimetric Determination of the Porosity of Porous Silicon, in MCE2010, University of Western Australia: Perth. p. 148.
2. A. Janshoff, K.S.D., C. Steinem, D.P. Greiner, V.S. Lin, C. Gurtner, K. Motesharei, M.J. Sailor, and M. R. Ghadiri, Macroporous p-Type silicon Fabry-Perot layers, fabrication, characterization, and applications in biosensing. Journal of the American Chemical Society, 1998. 120(46): p. 8.
3. ASTROVA, E. and V. TOLMACHEV, Effective refractive index and composition of oxidized porous silicon films. Materials Science and Engineering, 2000. 69-70: p. 142-148.
4. C. Pickering, L.C., and D. Brumhead, Spectroscopic ellipsometry characterisation of light-emitting porous silicon structures. Applied Surface Science, 1993. 63(1-4): p. 4.
5. R. Herino, G.B., K. Barla, C. Bertrand, and J.L. Ginoux, Porosity and pore size distributions of porous silicon layers. Journal of The Electrochemical Society, 1987. 134(8): p. 6.
6. Saren, A.A., et al., On the Relationship between the Optical Transmission and Photoluminescence Characteristics of Porous Silicon. Technical Physics Letters, 2001. 27(4): p. 3.
7. Sokolov, V.I. and A.I. Shelykh, Some characteristics of porous silicon (Reflection, scattering, refractive index, microhardness). Technical Physics Letters, 2008. 34(3): p. 3.
8. Tolmachev, E.V.A.a.V.A., Effective refractive index and composition of oxidized porous silicon films. Materials Science and Engineering: B, Jan. 2000. 69-70: p. 6.
9. Victor M. Bright, E.S.K.a.D.M.S., Reflection characteristics of porous silicon surfaces. Optical Engineering, 1997. 36(4).
10. Gast, T., Measurement of masses and forces with the aid of free magnetic suspension. Australasian Instrumentation and Measurement Conference, 1989: Advances in the Science, Technology and Engineering of Instrumentation; Preprints of Papers, 1989: p. 3.
11. J. W. Beams, C.W.H., W. E. Lotz, and R. M. Montague, Magnetic Suspension Balance. Physical Review, 1955. 26(12): p. 4.
12. K.M. Anufriev, V.F.K., and A.V. Razumov, A fast magnetic-levitation balance. Instruments and Experimental Techniques, 2000. 43(1): p. 2.
13. Codina, J.G., Automatic electronic microgram scale, U. patent, Editor 1967: USA.
14. NXPSemiconductors, LPC 17xx user manual. 2010. 15. Plast, P. Parma Plast as, material descriptions. Available from:
http://www.parmaplast.no/gml/uk/technical/PPmatr.htm#ABS. 16. Altronics, Instrument Case 355x250x122mm ABS Black/Grey. 2011. 17. Neil Zhao, W.L., Henri Sino, High-Side Current Sensing with Wide
Dynamic Range: Three Solutions, in Analog Dialogue2010, Analog Devices. p. 5.
18. Weldbond. Application Uses. 2011; Available from: http://www.weldbond.com/application_uses.
19. Weldbond, Weldbond MSDS. 2011.
77
20. Norsonic. Ground Induced Building Vibration. [cited 2011; Available from: http://norsonic.com/index.php?sideID=7195&ledd1=7181.
78
vii. Appendices
79
80
Pin Value Type Connected to
A1.1 VCC+ 6VDC +ve terminal
A1.2 GND 0VDC 0 terminal
A2.1 LED Driver control signal Analogue C2.1
A3.1 Charger switch control signal Digital G3.1
A4.1 ADC Data Digital B2.1
A4.2 ADC BCLK Digital B2.2
A4.3 ADC LRCK Digital B2.3
A4.4 ADC MCLK Digital B2.4
A4.5 ADC Enable Digital B2.5
A5.1 DAC LRCK Digital B3.1
A5.2 DAC Data Digital B3.2
A5.3 DAC BCLK Digital B3.3
A5.4 DAC MCLK Digital B3.4
A5.5 DAC Enable Digital B3.5
The pin list for the Controller box.
Pin Value Type Connected to
B1.1 VCC+ 6VDC +ve terminal
B1.2 GND 0VDC gnd terminal
B1.3 VCC- -6VDC -ve terminal
B2.1 ADC Data Digital A4.1
B2.2 ADC BCLK Digital A4.2
B2.3 ADC LRCK Digital A4.3
B2.4 ADC MCLK Digital A4.4
B2.5 ADC Enable Digital A4.5
B3.1 DAC LRCK Digital A5.1
B3.2 DAC Data Digital A5.2
B3.3 DAC BCLK Digital A5.3
B3.4 DAC MCLK Digital A5.4
B3.5 DAC Enable Digital A5.5
B4.1 Current Sensor input (Vout) Analogue F2.1
B4.2 GND 0VDC -ve terminal
81
B5.1 Photo detector input (V1) Analogue E2.1
B5.2 Photo detector input (V2) Analogue E2.2
B6.1 Solenoid driver output (R+) Analogue D2.1
B6.2 Solenoid driver output (R-) Analogue D2.2
B6.3 Solenoid driver output (L+) Analogue D2.3
B6.4 Solenoid driver output (L-) Analogue D2.4
The pin list for the converter box.
Pin Value Type Connected to
C1.1 VCC+ 6VDC +ve terminal
C1.2 GND 0VDC gnd terminal
C1.3 VCC- -6VDC -ve terminal
C2.1 LED driver control signal Analogue A2.1
C3.4 LED current out Analogue LED anode
C3.5 LED current return Analogue LED cathode
The pin list for the LED Driver box.
Pin Value Type Connected to
D1.1 VCC+ 6VDC +ve terminal
D1.2 GND 0VDC gnd terminal
D1.3 VCC- -6VDC -ve terminal
D2.1 Solenoid driver output (R+) Analogue B6.1
D2.2 Solenoid driver output (R-) Analogue B6.2
D2.3 Solenoid driver output (L+) Analogue B6.3
D2.4 Solenoid driver output (L-) Analogue B6.4
D3.4 Current out Analogue F1.1
Pin list for the solenoid driver.
Pin Value Type Connected to
E1.1 VCC+ 6VDC +ve terminal
E1.2 GND 0VDC gnd terminal
E2.1 Photo detector input (V1) Analogue B5.1
E2.2 Photo detector input (V2) Analogue B5.2
Pin list for the photo detector box.
82
Pin Value Type Connected to
F1.1 Current in (from solenoid driver) Current D3.4
F1.2 GND (to solenoid driver) Current D3*
F1.4 Current out (to Solenoid) Current Solenoid
F1.5 GND (from Solenoid) Current Solenoid
F2.1 Vout Analogue B4.1
F2.2 GND 0VDC gnd terminal
Pin list for the current sensor box.
*Note that F1.2 connects to the ground through the connector plug D3
but does not connect to any pin on the D3 connector socket.
Pin Value Type Connected to
G3.1 Charger switch control signal Digital A3.1
G3.2 GND 0VDC gnd terminal
Pin list for the charger switch box.
83
84
85
86
87
Blueboard lpc1768h - Eclipse IDE - OpenOCD Tutorial
Contents
Install Eclipse: ......................................................................................................................... 87
Install eclipse plugins: ............................................................................................................. 88
Zylin CDT: ........................................................................................................................... 88
GNU ARM Eclipse: ............................................................................................................. 89
Install Codesourcery GCC lite: ................................................................................................ 90
Copy files into workspace: ...................................................................................................... 91
Example Project Descriptions: ............................................................................................. 92
Important build properties: .................................................................................................. 93
Creating a new project: ........................................................................................................ 93
Setting up Debug Configurations: ........................................................................................... 95
Building OpenOCD: ................................................................................................................ 96
Debugging: .............................................................................................................................. 96
Running OpenOCD as an external tool in Eclipse: ............................................................. 98
Usbser Driver Installation: ..................................................................................................... 102
Install Eclipse:
All that is needed to run eclipse is to copy „eclipse-cpp-helios-SR2-
win32.zip‟ from tute files folder to your computer, unzip it and run the
88
eclipse application found within, I recommend placing a shortcut on your
desktop.
Downloadable from www.eclipse.org; “Eclipse IDE for C/C++
Developers” –helios package, windows 32bit.
Install eclipse plugins:
Zylin CDT:
Zylin CDT is a plugin which allows you to debug your embedded
controller.
Run eclipse
(The first time you run eclipse from a new workspace a welcome screen
is shown; close that to get to the standard screen.)
Click on help, install new software
In „work with:‟ put „http://www.zylin.com/zylincdt‟
Ensure that zylin cdt checkbox is checked and complete the installation
process: (next, next, accept terms, finish)
89
Restart eclipse.
GNU ARM Eclipse:
GNU ARM Eclipse is a plugin which allows for building through
CodeSourcery‟s GCC tool chain.
First download GNU ARM Eclipse plugin in from
sourceforge.net/projects/gnuarmeclipse
Click on help, install new software
In „work with:‟ click on add, then archive and then navigate to the zip file
contained in „/tute files/Eclipse GNU ARM plugin‟ and then open.
(org.eclipse.cdt.cross.arm.gnu_0.5.3.201010141144.zip is downloadable
from fourceforge.net/projects/gnuarmeclipse)
90
Ensure that the CDT GNU Cross Development Tools checkbox is
checked and complete the installation process: (next, next, accept terms,
finish)
You may get a warning about authenticity, click „continue‟.
Restart eclipse
Install Codesourcery GCC lite:
To install simply run the „arm-2011.03-42-arm-none-eabi‟ application
found in „../tute files/CodeSourcery G++ lite‟
(The latest version can be downloaded from www.codesourcery.com,
download the „EABI‟ for use on a Windows OS)
Allow the installer to change the system‟s PATH so that eclipse can
utilise it.
91
Copy files into workspace:
Create a file called “tute workspace” on the c drive
Copy the files from ExampleWorkspaceFiles into the your newly created
tute workspace
Open Eclipse and choose tute workspace as your workspace when it asks
(if you have previously checked do not ask, the workspace can be
changed from the File menu)
In the project explorer window right click and select import, select
„Existing Projects into Workspace‟ under General and then click next
Under „Select root directory:‟ browse to tute workspace and click okay.
Make sure all the projects are selected and click Finish.
You can now build the LED projects, the other projects are libraries that
are linked and will build automatically.
92
If your tute workspace is not located at „c:/tute workspace‟ the linker will
not be able to find the script file.
To change this edit the LED project properties by selecting them in the
project explorer window and pressing Alt+Enter.
Expand C/C++ Build and select Settings and then General under ARM
Sourcery Windows GCC C Linker.
Browse for the script file „ldscript_rom_gnu.ld‟ in the respective project
file.
Example Project Descriptions:
Simple_LED_Flash: Is a simple program that turns LED D8 on and off
using a for loop as a delay. (main.c was provided by Sagar on GV‟s
Works hobby electronics blog available at
gvworks.blogspot.com/2010/11/hellow-world-on-lpc1768.html I
recommend taking a look it has many useful lpc1768 tutorials)
Interrupt_LED_Flash: Uses a system tick interrupt to time delays to
dim and brighten two LED‟s in a sinusoidal pattern.
USB_Serial_LED_Flash: Is a version of Simple_LED_Flash which
uses the usb_serial library in order to communicate with a pc via the usb
virtual com port. Use a terminal program such as teraterm to
communicate with the Blueboard. An installer for teraterm is included
with the tute files.
(See the usbser driver installation section of the tutorial if there is a
problem with automatically downloading the drivers when the program is
run)
CMSIS( _core & _drivers): Are part of the Cortex Microcontroller
Software Interface Standard, libraries which is a vendor independent
hardware abstraction layer for the Cortex-M series processors (the
93
lpc1768 is a Cortex-M3 processor) enabling simple software interfaces to
the lpc1768 processor and peripherals.
LPCUSB & usb_serial: Are libraries which allow for communication
with a pc through a usb virtual com port.
Important build properties:
A project‟s properties can be accessed by selecting a project in the
explorer window and pressing Alt+Enter or by right clicking on the
project.
C/C++ Build -> Settings -> ARM Sourcery Windows GCC C
Linker -> General: „Script file (-T)‟ should contain
„ldscript_rom_gnu.ld‟ and „Do not use standard start files (-nostartfiles)‟
should be unchecked.
C/C++ General -> Paths and Symbols: This used to link to the
libraries used by the project. See the Includes, Libraries and Library
Paths tabs in the USB_Serial_LED_Flash project to see linking to the
CMSIS and USB libraries.
Project References: Check projects in the workspace which are
referenced by the current project.
Creating a new project:
To create a new lpc1768 project,
Press the new button on the toolbar at the top left of the screen.
Select c project.
Set „Project Type‟ to ARM Cross Target Application, empty project, and
set „Toolchains‟ to ARM Windows GCC(Sourcery G++ Lite), give the
project a name and click finish.
94
Copy the script file „ldscript_rom_gnu.ld‟, which can be found in all of
the LED projects, into your new project.
Change the project preferences as described in the section above and,
once you have completed you main c source file, the project will build.
95
Setting up Debug Configurations:
Set up the debugger configurations by selecting one of the projects and
then selecting Debug Configurations which can be found by pressing the
arrow next to the bug button on the toolbar.
Select „Zylin Embedded debug (Native)‟ on the left and then press the
„create new‟ button.
Under the debug tab change the GDB debugger from „arm-elf-gdb‟ to
„arm-none-eabi-gdb‟.
Under the Commands tab set up the cammands as shown in the following
figure.
96
The commands will connect to openocd, reset the target, load the project,
set a break point at main and then move to that break point.
Finally under the „Common‟ tab check the box labelled „debug‟ under
„Display in favourites menu‟.
Building OpenOCD:
Follow the step by step guide „How to build OpenOCD with FTDI's CDM
driver for Windows’ on http://piconomic.co.za/fwlib/index.html.
Once you have built openocd copy „ft2232h-mini-module.cfg‟ and
„lpc1768.cfg‟ from „/tute files/OpenOCD config files‟ to the file
containing the openocd executable, “C:/cygwin/tmp/openocd-0.4.0/src”.
Debugging:
97
In debugging OpenOCD sets up communication with the Blueboard
through the mini-module and then Eclipse through ARM GDB
communicates with OpenOCD through telenet port 3333.
To start a debugging session first connect the mini-module to your
computer (via usb) and then to the Blueboard.
Next power up the Blueboard (via usb).
Now open a command prompt window, navigate (via the „cd‟ command
to the location of openocd.exe)
(If you are unfamiliar with command prompt, „cd ..‟ will go up a folder
level and „cd “file name”‟ will go into a file).
Type the command „openocd -f ft2232h-mini-module.cfg -f lpc1768.cfg‟
a connection should be established and the following output obtained.
Open Eclipse and run the debug configuration for the project you are
currently working on.
Eclipse will change to its debug perspective which allows you to both run
and step through your code. To change the perspective back to C/C++
press the perspective button located at the top right of the screen.
98
Note: Terminate the debug session by pressing the stop button before
running another.
Running OpenOCD as an external tool in Eclipse:
Alternative OpenOCD can be run from Eclipse by setting it up as an
external tool.
First open the external tools configurations menu by clicking the down
arrow by the button shaped like a play button next to a tool box and
select it from the drop down menu.
Next click on „Program‟ and then click the „New launch configuration‟
button
99
Then fill out the main tab as shown in the following image. „Location‟
should point to the OpenOCD executable, „Working Directory‟ should
point to the folder holding the configuration files and the „Arguments‟
are the same as when using OpenOCD manually through command
prompt.
100
101
Finally, in the Common tab, check the box next to „External Tools‟ in the
„Display in favourites menu‟ box and click apply
OpenOCD can now be run by dropping down the menu which was used
to get to the „External tools configurations‟ menu, the play button next to
a toolbox.
102
Usbser Driver Installation:
(No driver is currently available for windows 7 at the time this was
written.)
Copy the „usbser.sys‟ file from „ /tute files/usbser‟ into
„C:\WINDOWS\system32\drivers‟.
Copy the „usbser.inf‟ file from „/tute files/usbser‟ into any convenient
folder.
Plug in the Blueboard (with the USB_Serial_LED_Flash code loaded).
A Hardware Update Wizard opens up. „Install from a list or specific
location (Advanced)‟ and Click Next.
If the wizard does not open up automatically then go to the „Device
Manager‟ window and right click on the device and select „update driver‟
Set the new hardware Wizard to search a specific location for the driver,
and specify the folder containing usbser.inf
The Wizard will prompt for the location of usbser.sys. Specify its
location (i.e. C:\WINDOWS\system32\drivers) and Click Next.
The installation should now complete and indicate the device has been
installed. The device should now get enumerated under “Ports(COM &
LPT)” option in „Device Manager‟ window.