Advanced Applications in Wide-Area Impedance Sensing
by
Elizabeth C. George
S.B., Massachusetts Institute of Technology (2012)
Submitted to the Department of Electrical Engineering and Computer Science
in partial fulfillment of the requirements for the degree of
MASSACNUSETTS INGT TUTE
Master of Engineering in Electrical Engineering and Computer Science
j
at the
OF TECHNOLOGY
JUL 15 2014
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
1LIBRA.RIES
February 2014
@ Massachusetts Institute of Technology 2014. All rights reserved.
re redacted
Signatu
....
:..........................
..
A uthor .....................
' ...............
Depar~ent of Electrical Eng eering and Computer Science
January 31, 2014
Certified by..
Signature redacted .............. ..........
Dr. Steven B. Leeb
Professor of E.E.C.S. & M.E., MacVicar Faculty Fellow
4-.
Certified by... ....
A
gnar U rc C ac.#LCU
4
Thesis Supervisor
A
....... .....................
Al-Thaddeus Avestruz
Doctoral Candidate
Thesis Supervisor
Signature redacted
Accepted by..............
........................
Prof. Albert R. Meyer
Chairman, Master of Engineering Thesis Committee
Advanced Applications in Wide-Area Impedance Sensing
by
Elizabeth C. George
Submitted to the Department of Electrical Engineering and Computer Science
on January 31, 2014, in partial fulfillment of the
requirements for the degree of
Master of Engineering in Electrical Engineering and Computer Science
Abstract
In this thesis a wide-area impedance sensor used in hyperspectral imaging for a wide variety of applications is presented. Building on previous work, this sensor is decoupled from fluorescent lamps
and thus is used to passively detect independent sources such as fluorescent lamps and laptop control signals. The active sensing electrodes with common-mode feedback are used with a spectrum
analyzer and synchronous demodulator for source and material detection respectively. A setup
for active source multiplexing is described and used in image reconstruction and material detection.
Algorithms for image reconstruction from such ill-posed inverse problems are discussed and improvements are made. Hyperspectral techniques for extracting the occupancy values of various materials
are shown. Finally, future experiments using this sensor for gesture sensing and as a purely digital
demodulator for passive imaging are described.
Thesis Supervisor: Dr. Steven B. Leeb
Title: Professor of E.E.C.S. & M.E., MacVicar Faculty Fellow
Thesis Supervisor: Al-Thaddeus Avestruz
Title: Doctoral Candidate
3
Acknowledgements
I would like to thank everyone whose support made this thesis possible. I am extremely grateful
to my thesis supervisors, Professor Steven B. Leeb and PhD Candidate Al-Thaddeus Avestruz, for
their continued guidance and wisdom. I would also like to thank my colleagues from LEES and
friends at MIT for their help and encouragement. They include, but are not limited to, Shahriar
Khushrushahi, William Thompson, Brian Sennett, Kawin (North) Surakitbovorn, Arthur Chang,
John Donnal, Jim Paris, Shuyi James Chen and Ashley Brown.
I would finally like to thank my family, especially my parents Christine and Dan George, for
their constant support throughout my time as an undergraduate and graduate student, and beyond.
4
Contents
1
Introduction
1.1
2
15
1.1.1
Performance objectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
1.1.2
Applications
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
Previous Work
1.3
Thesis Overview
Sensor Circuitry and Setup
19
2.1
Overview
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
2.2
High Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
2.3
Sensing Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
2.3.1
Front-end Amplifier
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
2.3.2
Signal Conditioning
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
Circuit Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
2.4.1
Signal Conditioning
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
2.4.2
Signal Synthesis
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
2.4.3
HV Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
2.5
4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
2.4
3
Motivation
15
Setup .....
...
................
. .........
. .. ..............
29
Passive Scanning
31
3.1
Analog Demodulation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
3.2
Spectrum Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
3.3
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
Hyperspectral Imaging
4.1
Background ........
4.2
Previous Work
39
..
.............
.......
...
...
...........
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
39
40
5.2
T heory . . . . . . . . . . . . . . . . . . . .
. . . . . .
43
5.3
Forward Problem . . . . . . . . . . . . . .
. . . . . .
46
5.4
Inverse Problem . . . . . . . . . . . . . . .
. . . . . .
49
.
.
.
Setup ....
Constraints
. . . . . . . . . . . . .
. . . . . .
49
5.4.2
CVX . . . . . . . . . . . . . . . . .
. . . . . .
50
Image Reconstruction Algorithms . . . . .
. . . . . .
50
.
.
.
5.4.1
Linear Back Projection
. . . . . .
. . . . . .
50
5.5.2
Least Norm . . . . . . . . . . . . .
. . . . . .
52
5.5.3
2-Norm with 2-Norm Regularization
. . . . . .
53
5.5.4
1-Norm with 2-Norm Regularization
. . . . . .
53
5.5.5
2-Norm with 1-Norm Regularization
. . . . . .
53
5.5.6
Landweber/Newton-Raphson
. . . . . .
54
5.5.7
Image Segmentation
. . . . . . . .
. . . . . .
54
Improvements . . . . . . . . . . . . . . . .
. . . . . .
55
.
.
.
.
.
5.5.1
Influence Matrix
. . . . . . . . . .
. . . . . .
55
5.6.2
Subpixel . . . . . . . . . . . . . . .
. . . . . .
56
.
5.6.1
.
5.6
57
Occupancy Detection Results and System Performance
Sensor Range . . . . . . . . . . . . . . . . . . . . . . . .
57
6.2
Noise and Drift . . . . . . . . . . . . . . . . . . . . . . .
57
6.3
Object Detection . . . . . . . . . . . . . . . . . . . . . .
58
. . . . . . . . . . . . . . .
59
. . . . . . . . . . . . . . . . .
60
Scalability of Objects
6.3.2
Multiple Materials
.
6.3.1
.
.
.
.
6.1
63
Conclusion and Future Work
63
. . . . . . . . . . . . . .
64
7.2.1
Electrode Configurations . . . .
64
7.2.2
Digital Demodulation
. . . . .
64
7.2.3
Laptop Gesture Sensor . . . . .
64
7.2.4
Floor Shoe Scanner . . . . . . .
64
Future Work
.
7.2
.
.
Sum mary
.
. . . . . . . . . . . . . . . .
7.1
.
7
43
.....................
5.1
5.5
6
43
Imaging Techniques
.
5
65
A Code
Sensor Interfacing Software in
A.1.1
65
MATLAB@
readADC.m . . . . . . . . . . . . . . . . .
.
A.1
6
. . .
65
A.2
A.1.2
recorder.m
A.1.3
rangeExpt.m
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
66
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
67
A.1.4
lightpulse.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
70
A.1.5
gridExpt.m
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
A.1.6
BM atrix.m
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
78
A.1.7
AM atrixPM .m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
79
A.1.8
ImSeg.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83
Sensor Board Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
85
A.2.1
86
FullyDiff8.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B Schematics and Boards
B.1
103
High Voltage Signal Source
B.1.1
Full Schematic
B.1.2
PCB Layout
B.1.3
Bill of M aterials
104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.2 Standalone Sensor Electrodes
106
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
B.2.1
Capacitive M ode Electrodes . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
B.2.2
Resistive Mode Electrodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
111
B.3 Sensor Signal Conditioning
B.4
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
115
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
115
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
128
B.3.1
Full Schematic
B.3.2
PCB Layout
B.3.3
Bill of M aterials
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
129
Atmega32U4 Breakout Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
131
B.4.1
Full Schematic
131
B.4.2
PCB Layout
B.4.3
Bill of M aterials
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
7
8
List of Figures
2-1
A lumped element model for the capacitive sensor system [1].
2-2
Diagram of the generalized standalone occupancy sensor.
2-3
The circuit model for the PI controller and plant. vi, is taken from the output of the
. . . . . . . . . . . . .
19
. . . . . . . . . . . . . . .
20
multi-frequency source from the sensor board and v0 ,t drives the source plates directly. 20
2-4
The high voltage source board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
2-5
These figures were taken from a single frame of a digital oscilloscope. . . . . . . . . .
22
2-6
A close-up of the front-end amplifier on one of the receive electrodes. . . . . . . . . .
23
2-7
Schematic for the half circuit common mode feedback of the front end amplifier.
Feedback capacitances represent lumped T-networks. Electrode circuitry is left of the
cable and sensor board circuitry to the right.
. . . . . . . . . . . . . . . . . . . . . .
2-8
Block diagram for the common mode feedback of the front end amplifier.
2-9
The generalized block diagram for the signal conditioning circuitry.
. . . . . .
24
24
The first gain
stage is singled ended and located on each respective electrode. The following stages
are all fully differential and reside on the sensor board. The dashed box is replicated
four tim es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
2-10 One-channel circuit implementation of the synchronous demodulator. . . . . . . . . .
25
2-11 The sensor board with DDS signal creation in the bottom-right corner, microcontroller
breakout in the center-right and demodulation signal creation top-right. The frontend amplifier is at the input to the board on the left.
The signal is delivered to
the board from the active receive electrodes via driven coaxial cables to the MMCX
connectors. ..........
.........................................
26
2-12 Schematic for one channel of the high voltage source multiplexer board. Three relays
are stacked in series to standoff the 500 V peak voltage. The remaining two channels
and shield switches are not shown.
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
2-13 Revision 2.0 of the high voltage multiplexer board. Large separation between channels
and input and output provided a significant reduction in coupling capacitances. . . .
9
28
2-14 Receive electrodes placed on plastic shelves in the lab space. Sensor electronics are
beyond the shelves on the ground and source electrodes are on a table across the lab
29
............................................
space. ..........
. . . . . . . . . . . . . . . . . .
3-1
Block diagram of manual demodulation tuning test.
3-2
Gradually increasing the demodulation frequency to within 0.01 Hz of the independent
3-3
32
......................................
source frequency. .........
With the demodulation frequency within 0.01 Hz of the source frequency, the beat
frequency is observed over time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
. . . . . . . . . . . . . . . . . .
33
3-4
Block diagram of manual demodulation tuning test.
3-5
These figures were taken from a single frame of the spectrum analyzer used with our
front-end amplifier and electrodes.
3-6
32
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
These figures were taken from a single frame of the spectrum analyzer used with our
front-end amplifier and electrodes. The laptop was placed on the same shelf as the
left-side electrode.
3-7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
These figures were taken from a single frame of the spectrum analyzer used with our
front-end amplifier and electrodes.
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-1
The conductivity and permittivity of human muscle as a function of frequency [2,3].
4-2
The conductivity of aluminum as a function of frequency.
4-3
Difference between COMSOL-modeled human image at 100kHz and 20kHz
4-4
A COMSOL-modeled test case distribution with solutions by the LBP and SVD
36
39
. . . . . . . . . . . . . . .
40
. . . . .
40
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
4-5
The same test case distribution with solution by the Landweber algorithms. . . . . .
41
4-6
The experimental setup and test case for hyperspectral ECT. In this test case, pixels
algorithm s.
1 and 4 were filled with water and pixels 2 and 3 were filled with wood. On the right,
. . . . .
42
5-1
The 4x4 grid in 2D space used as the spacial reference for all imaging. . . . . . . . .
44
5-2
Partial image of the 4x4 floor grid used for all experiments.
. . . . . . . . . . . . . .
44
5-3
On the left, individual pixels are filled with dielectric material to calculate the values
the difference between the permittivity distributions at 10kHz and 100kHz.
of the sensitivity matrix. On the right, the result of the superposition of all pixels is
shown................
5-4
......................................
A pictorial representation of the linear back-project algorithm for "hard-field" tomograph ies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-5
46
51
Fitting data for measurements taken at each pixel in 13x13 grid: source position 1,
ADC 1. ...........
...........................................
10
56
6-1
The response of the sensor as a single source electrode is moved away from the receive
electrodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-2
58
The relative difference between the levels of human material calculated by the 11
algorithms with 11 regularization for two people of different sizes. . . . . . . . . . . .
60
6-3
Occupancy values in the 4x4 gridspace with two people differentiated by size. . . . .
61
6-4
The occupancy maps of human and metal presence in the lab space. In this case,
noise-free data is used in the sensitivity calibration and as the experimental data and
a perfect detection is achieved.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
62
12
List of Tables
2.1
Stray capacitance measurements at 100kHz
. . . . . . . . . . . . . . . . . . . . . . .
28
3.1
Lab Space Independent Source List . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
6.1
Noise Floor Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
59
6.2
Repeated Calibration Data
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
59
6.3
Multiple Object Data Pairs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
59
6.4
Multiple Object Data Coordinates
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
60
14
Chapter 1
Introduction
1.1
1.1.1
Motivation
Performance objectives
The need for a simple, cheap occupancy detector and material detector has motivated the research
presented in this thesis. This sensor would take precise differential current measurements to create an
accurate depiction of the material occupancy of a given space through the use of image reconstruction
algorithms. The sensor's low SNR would make it possible to reconstruct an image of a resolution
relevant to the size of an average person.
1.1.2
Applications
Several possible applications are envisioned and detailed here. Airport body-image scanners have undergone many changes in recent years, first due to legislation mandating increased security measures
at airport checkpoints following the 9/11 terrorist attacks. The introduction of full-body scanners
was followed quickly by backlash from privacy groups likening the scanners to a "virtual strip search"
with many also fearing the effects of the scanners' radiation. Many called for new legislation to protect them from such invasive technologies [4]. The capacitive sensing system described in this paper
could be used to replace existing airport x-ray scanners to provide a minimally invasive alternative
which would pick up the presence of metals, suspicious plastics used in making explosives, and other
dangerous substances.
One of the biggest areas of development in Human Interface Devices (HIDs) is in gesture recognition. Capacitive touch sensor with multi-touch capabilities have been realized in many commercial
products including mousepads, smartphones and touchscreens. The research focus has shifted towards methods of sensing without maintaining physical contact between the user and the device [5].
This idea is quite new, with only a few products currently out in the market boasting this technology.
15
However, the current implementation which requires a dedicated camera and significant processing
power could greatly benefit from integration with a low-power solution.
A touchless capacitive gesture recognition system installed on a 12" laptop screen was proposed
and built in 2006 [6] using four long metal electrodes arranged around the screen's bezel. This system
was only capable of differentiating a few gestures, with low reliability. A similar system for low cost
gesture sensing on the centimeter scale was demonstrated in 2011
[7]. Another simple touchless
capacitive user interface using an array of small electrodes in a row to track user movement has
been implemented for use in interactive textiles for patient care [8]. Combining these technologies,
a screen using multiple arrays of electrodes around its keyboard and screen could provide refined
tracking and a larger range of gestures supported. This sensor's unique ability to distinguish between
different types of materials present in an area using hyperspectral detection has not been realized
in its current applications, and will be discussed here.
Standard room sensors detect motion, not occupancy, and cannot differentiate between the presence of a human or other objects. This sensor would present a great improvement over standard
room detectors as it could tell the relative occupancy level of a space and would be able to detect human presence when stationary. The goal of this sensor is to be able to distinguish between different
objects and materials.
To obtain detailed information about the usage of potentially inefficient loads on a utility network
can be a hard problem. Smart-metering technologies can be expensive when sensors must be installed
to monitor every load in a network. Non-Intrusive Load Monitoring (NILM) is a proposed solution
to the smart-metering problem which inserts one sensor into a network and uses smart processing
to differentiate loads from one-another.
A passive capacitive scanner which takes the frequency
signature of a space with a very high frequency could perform this task in a
load-saturated
area. The
passive scanner is an exciting tool that can amplify the signals present in a room (from fluorescent
lamps to monitors refreshing) and use these signals to detect objects in the space.
1.2
Previous Work
The first iterations of this sensor were electrically coupled to fluorescent lamps. Electrodes on the
lamp would synchronously detect changes in the electric field produced by the excitation of the
fluorescent ballast and use this information to detect human presence [9,10]. The application in this
sensor was primarily in building energy management. The lamp could be turned off when human
presence was no longer detected. Previous sensors achieved capacitance measurements as low as
10fF [11].
In the latest iteration of this sensor, the sensor was decoupled from the fluorescent lamp and
a differential high voltage source was built [1].
Creating a high voltage source with controllable
16
frequency and amplitude provided the ability to perform hyperspectral imaging. Furthermore, the
absence of the fluorescent lamp removes the physical limitations on the setup posed by its fixed
location. The analog signal conditioning path was also improved in this iteration and the front-end
amplifier was redesigned to emphasize common-mode rejection.
This amplifier was relocated to
the receive electrodes of the sensor to shorten the sensing node. This made the sensing node less
susceptible to parasitic capacitances from an undriven cable and the environment.
1.3
Thesis Overview
With the improvements to the decoupled capacitive sensor discussed above, it is now possible to
perform hyperspectral imaging on a room scale. This thesis discusses various methods for object
detection using this capacitive sensor system. Image reconstruction algorithms and methods are
evaluated and optimum configurations and applications for the sensor are presented.
Chapter 2 presents changes and additions to the sensor's schematic, layout and wiring since
William Thompson's thesis. The use of the sensor as a passive room scanner to detect asynchronous
sources, such as fluorescent lamp ballasts and laptop signals, is discussed in Chapter 3. Hyperspectral
imaging techniques are introduced in Chapter 4 and image reconstruction algorithms are compared
in Chapter 5.
The overall system performance and results of the system tests are discussed in
Chapter 6. Finally, the thesis is concluded in Chapter 7 with a discussion of the results, system
limitations, and future work. The microcontroller code, Matlab code, relevant schematics and board
layouts follow in the appendices.
17
18
Chapter 2
Sensor Circuitry and Setup
2.1
Overview
The circuit model shown in Figure 2-1 depicts the electrical path from the high voltage signal source
to the active receive electrodes. A default capacitance Csen is observed between source and receive
plates and small changes in that capacitance is measured as
AC from the positive and negative
differential receive electrodes.
-AC
+AC
idl
S
id2
Zd
Zd
icrn
Zern
Figure 2-1: A lumped element model for the capacitive sensor system [1].
The capacitive sensor circuitry detailed in this chapter can be summarized by the block diagram
in Figure 2-2. A high voltage source converts a low voltage sinusoid from a digital synthesizer to a
200-500 V waveform to drive a source electrode. The source can be configured as single-ended or
differential. The source electrodes are driven, thus creating an electric field in the space between
the source and receive electrodes. Small currents are picked up by the front-end amplifier and are
converted to voltages via a transimpedance amplifier for signal processing. The signals are amplified
and sent to a demodulation block which uses in-phase and quadrature demodulation signals derived
19
from the original source frequencies. These demodulated signals are passed through a bank of lowpass filters to leave a dc value representing the amount of a given demodulation frequency and phase
in the input signal. This slowly-changing dc value is then sampled by an ADC and the digital values
are sent to a PC running Matlab to be processed.
Noise
Sources
HV
Source
+Target
(s)
+
Source HElectrodeH
Receive
Electrodes I
.Sensor
+
BoardH
PC
Figure 2-2: Diagram of the generalized standalone occupancy sensor.
Four channels of the signal conditioning circuitry are used to measure the two frequencies and
two phase components of the input signal simultaneously.
2.2
High Voltage Source
The high voltage signal source is made up of several blocks. On the sensor board itself, two DDS
chips are programmed by the Atmega32u4 microcontroller to output sinusoids of 10.4 kHz and 83.3
kHz respectively. Because both are derived from the same clock signal, they have the same phase.
The dc component is then removed and an output amplifier drives a 15 ft cable to bring this low
voltage signal to the source board across the space.
Vout
9
VIn
K(Ts + 1)
_
Power
Rd2
Cb
Figure 2-3: The circuit model for the PI controller and plant. vi" is taken from the output of the
multi-frequency source from the sensor board and v 0 t drives the source plates directly.
As is shown in Figure 2-3, the input signal is gained up by a power amplifier and autotransformer with a PI feedback network. An autotransformer has several advantages over a two-winding
transformer for this application. First, the non-isolated output of the autotransformer allows for
20
a feedback path to be wrapped around the transformer to the PI controller. An autotransformer
also requires less copper than its equivalent two-winding transformer. Finally, the autotransformer
is more efficient electrically. It experiences lower losses through the secondary leakage impedances
than a two-winding transformer.
Figure 2-4: The high voltage source board.
2.3
Sensing Circuitry
2.3.1
Front-end Amplifier
The receive electrodes, like the source electrodes, are copper planes on a printed circuit board. The
front-end amplifiers of the differential pair are placed on the electrodes themselves to prevent against
the parasitic capacitive loading of the sensing node by an undriven cable. The amplifier on these
active electrodes is configured as a transimpedance amplifier and thus will convert an input current
to an output voltage
.
(Rf-in
Vo=
(2.1)
The input current is provided by the signal source, vin, and the sensed capacitance to the receive
electrode, Cen, by
iin =
Vin
Zin
=
21
Vin "
sen.
(2.2)
Tek
Run
22 Dec 13 02:53:03
22 Dec I1302III:5II 8:0II 3 II
57 Acis Icq
HI Res
Ru
Ie~57
IIIe
Curs1 POs
800.Ons
Curs2 Pos
96.58ps
0i: 800.Ons
Z
AL:
1/6:
M 40.0ps 5.0GS&
A Ch1 r 424mnY
200rnY
10.44kHz
Pk-Pk(C1)
976.Okri
m: 968.Orn
M: 984.On
n: 57.0
p: 974.35563rn
......
Chi
96.58s
95.78P
a:
3.544m
200"
(a) The summed sinusoids at the divided output of the high voltage source
e
T k. R H
107 A'
22~ D
1
3
71
Curs1 POs
10.4kHz
Curs2 Pos
I
-
I
|-83.345kHz
T-
1
1
4kH
..
.I
..
...-
si
I
M 20.Oms 250kS/s
A Ch1 f 396mV
4.0psAx
(b) FFT taken of the divided output of the high voltage source
Figure 2-5: These figures were taken from a single frame of a digital oscilloscope.
22
Simplifying these equations gives us the theoretical relationship between the front-end transfer function and the sensed capacitance
Vo0 t _ SRf Cen
vi,,
1+sRCf
(2.3)
Another important aspect of this front-end is its common-mode feedback for common-mode
rejection. The electrodes are meant to measure the small changes in the differential signal between
them corresponding to a change in the occupation or location of materials in the space, and commonmode signals must be rejected. To do so, the output from the active electrodes, given by
Vout
=
Ad(v1 -
v2 ) + Acm
(V
1
+ V2
2
(2.4)
is sent to the sensor board; the common-mode signal is then extracted and sent back to the active
electrodes to be canceled. A circuit diagram is presented in Figure 2-7 and the corresponding block
diagram in Figure 2-8.
Figure 2-6: A close-up of the front-end amplifier on one of the receive electrodes.
2.3.2
Signal Conditioning
Once the signal is received and its common-mode component is rejected, it is ready for processing.
The diagram in Figure 2-9 summarizes this three to four channel signal conditioning block. The
synchronous detector used in this sensor design collects both the in-phase and quadrature data from
the input to the front-end. To do so, the input signal is multiplied separately by a clock signal and
a signal 900 out-of-phase. Collecting in-phase and quadrature information reduces the impact of
any phase error between the input signal and the demodulating signals. The synchronous detector
23
Cf
CS
Rf
Vi"
vin+
AD4817-1
X10
'E
Cc
R
Active Re ceive
Electro de
vo+
AD8138
__C.
IGc
vo_
CC
AD4817-1
X
Sensor Boar d
Cf
Figure 2-7: Schematic for the half circuit common mode feedback of the front end amplifier. Feedback
capacitances represent lumped T-networks. Electrode circuitry is left of the cable and sensor board
circuitry to the right.
Interference
Fig2:
B
k d
H-
g
x 10
Figure 2-8: Block diagram for the common mode feedback of the front end amplifier.
24
is realized with the MAX4523. This set of analog switches is configured in a full bridge topology
and driven by the in-phase s and quadrature s clock signals to form a square wave multiplier as in
Figure 2-10. The 900 phase shift between multiplier clock signals is generated by a chain of D flip
flops.
Vinl
-
G1
Synch. Det.
G2
G3
0
Instr. Amp.
&
-+
&
LPF
I
b
ADC
ii
Vin2
G,
--
x4
Figure 2-9: The generalized block diagram for the signal conditioning circuitry. The first gain stage is
singled ended and located on each respective electrode. The following stages are all fully differential
and reside on the sensor board. The dashed box is replicated four times.
The passive low-pass filter block following the multiplier suppresses unwanted high frequency
content.
The filter poles have been placed according to a compromise between settling time and
multiplier ripple aliasing rejection.
'
Vin+
0-
MA X4523
|
-
A
-E
SADC
|I
PC
PC
-
V
VOWt,+
r 2
I
---------
Figuire 2-10: One-channel circuit implementation of the synchronous demodulator.
Next the AD8230, an instrumentation amplifier, converts the differential signal to single-ended
and adds a reference voltage. It does so to shift the signal to the middle of the analog-to-digital
(ADC) converter rail. A configurable gain may also be added to make use of its full range. Finally,
the output of the instrumentation amplifier is sent to the ADC. The LTC2484 is a 24-bit E-A ADC
with an SPI interface for sampling and reading from the converter. A photo of the sensor board with
four channels (two frequencies with in-phase and quadrature information) is shown in Figure 2-11.
25
Figure 2-11: The sensor board with DDS signal creation in the bottom-right corner, microcontroller
breakout in the center-right and demodulation signal creation top-right. The front-end amplifier is
at the input to the board on the left. The signal is delivered to the board from the active receive
electrodes via driven coaxial cables to the MMCX connectors.
2.4
Circuit Changes
Since Version 2.0 of the sensing circuitry, there have been several changes made to cut out extraneous
hardware and add extra capabilities to the system.
2.4.1
Signal Conditioning
Along the signal conditioning path, a second differential pair of channels was added to provide the
ability to add a second pair of receive electrodes. Jumpers are used to allow either a second electrode
pair or a divided source signal input to collect drift and noise measurements.
The potentiometers at the output of the AD8230 instrumentation amplifiers were also removed
to allow for the placement of matching resistors to set the gain of this amplifier. The gain, given by
g
2
1+
RF)
RG
(2.5)
can be calculated to take advantage of the full input range of the ADC. The adjustable delay
blocks before the flip flops were also removed because they were unnecessary. The relative phase
delay between the DDS-derived source signal and the in-phase demodulation signal is unimportant
because the delay introduced between the DDS signal and the received signal is unknown. Also, when
both in-phase and quadrature measurements are used, all phase information is gathered regardless
26
of phase delay.
2.4.2
Signal Synthesis
In the signal synthesis block, several parts were removed or replaced to cut down the total BOM cost
and reduce complexity. The resistor reference summed with the two DDS outputs in Revision 2.0
was replaced here with an op-amp buffer reference. Without the op-amp buffer, the reference (used
to subtract the combined dc offset from the summed DDS outputs) would be sensitive to changes in
the gain of the summing amplifier. This would mean that without the gain of 10 originally used in
this circuit, a dc offset whose value is scaled by this gain would be added to the summed sine waves
from the DDS.
2.4.3
HV Selection
To multiplex the three high voltage source electrodes, a National Instruments DAQ device was used
with high voltage, RF relays to switch the input signal between possible combinations of electrodes.
Three relays were used in series to increase the standoff voltage to 200 x 3 = 600V. This left plenty
of room for the high voltage maximum amplitude of 500 V. The NI-DAQ device was controlled
with a Matlab interface. Each of three digital outputs were toggled in binary order to create seven
possible combinations of source electrodes, and one "off" state.
Vout
+
Vd,
VNI
Vin
Figure 2-12: Schematic for one channel of the high voltage source multiplexer board. Three relays
are stacked in series to standoff the 500 V peak voltage.: The remaining two channels and shield
switches are not shown.
Two issues arose while creating the final source setup. First, coupling was causing a signal to
appear on source electrodes that were supposed to be switched off. Second, unwanted oscillation of
27
Table 2.1: Stray capacitance measurements at 100kHz
Rev.
1.0
2.0
Cnii
3 pF
0.25 pF
Cin2
Cin3
Cgndi
Cgnd2
Cgnd3
C1 2
C2 3
C13
2.71 pF
0.23 pF
2.68 pF
0.23 pF
7.3 pF
0.2 pF
6.46 pF
0.18 pF
6.35 pF
0.18 pF
2.23 pF
0.08 pF
1.97 pF
0.08 pF
2.15 pF
0 pF
the source would occur when all electrodes were connected.
To solve these problems, several important layout and wiring changes were made. First, the
source multiplexer board was rebuilt on unplated perfboard and all components were soldered together with short pieces of wire wrap wire. Layout changes were also made. The three relays for
each channel were placed close together in series with 2" separations between each channel. The
shields of the output connectors were also switched with three relays in series and a 1" separation
was left between each channel and its respective shield. Finally, a distance of about 5" was left between the closest output and the input. With these changes made, there was an order of magnitude
improvement in stray capacitance as illustrated in Table 2.1.
Next, a ground plane in the form of a long piece of copper tape was added across the outputs of
the multiplexer board to shunt any source radiation from the input connector to the board. This is
to prevent any coupling from input to output on each channel. The new board revision is shown in
Figure 2-13.
Figure 2-13: Revision 2.0 of the high voltage multiplexer board. Large separation between channels
and input and output provided a significant reduction in coupling capacitances.
To eliminate a large ground loop from the sensor board, through the laptop running Matlab to
28
the multiplexer board through the cable carrying the digital output signals from the NI-DAQ box,
USB isolators were added between the NI-DAQ box and the computer, and the computer and the
sensor board. Ferrite beads were positioned around the circuit to suppress EMI.
The NI-DAQ box was also moved next to the high voltage source.
The NI-DAQ cable was
originally fed across the room along the floor about 15', adding an unshielded coupling path for the
source signal. With the NI-DAQ box close to the source, the signal transmission path is almost
solely along an isolated, well-shielded USB cable, blocking a previous source of coupling.
2.5
Setup
There are several experimental setups used in this thesis. The primary configuration of electrodes
in the lab space is shown in Figure 2-14
Figure 2-14: Receive electrodes placed on plastic shelves in the lab space. Sensor electronics are
beyond the shelves on the ground and source electrodes are on a table across the lab space.
29
30
Chapter 3
Passive Scanning
3.1
Analog Demodulation
When used without an active source, this system becomes a "passive scanner." By sweeping the
demodulation frequency, the contribution of asynchronous, independent sources within the frequency
range of the sensor (such as fluorescent lamps, laptop drives, etc.) can be determined. Unfortunately,
there are several issues with using an asynchronous demodulation signal. These issues and several
solutions are discussed here.
In the test depicted by Figure 3-1, an independent source was created using our source boards and
a function generator. Because this source is not synchronous with the detection circuit, it provides
a way to observe and study the effect of a controlled asynchronous source on the sensor. This source
was placed across the room and its signal was then picked up by our receiver and demodulated
using a separate function generator. The demodulation frequency was tuned by hand to be closest
to the source frequency, as in Figure 3-2. Here, only the difference in frequency between the source
and receive frequencies matters as all phase information is contained in the IQ measurements. The
difference or "beat" frequency between the independent source and demodulation frequencies is
defined as
A2
A cos(2rrfit) x A cos(2rrf2 t) =2 (cos(2rr(fi + f 2 )t) + cos(2rr(fi
-
f 2 )t))
(3.1)
where the difference frequency is given as
fbeat = Ifi -
f21.
(3.2)
The bandwidth of the low-pass filter after the demodulation block is not low enough to attenuate
this beat frequency so it is passed to the input of the ADC. Therefore, the digital output of the
31
vi(s)
High Voltage
0 Source
Differential
v,.(S)
Front-end
Amplifier
EActrives
User variable input demodulation
frequency from
signal generator
Figure 3-1: Block diagram of manual demodulation tuning test.
ADC is no longer entirely DC as shown in Figure 3-3.
2.7
x 10-
Tuning Demodulation Frequency to Independent Source
2.6
2.5
-.
..
-....-.
...
-.
.
2.3
-.
.
-...
-.
2.4
2.2
a)
a)
L)
2.1
2
1.9
1.8
.
17
0
10
20
30
40
50
60
Time (s)
Figure 3-2: Gradually increasing the demodulation frequency to within 0.01 Hz of the independent
source frequency.
Another factor effecting the ability to precisely demodulate an asynchronous source such as a
fluorescent lamp is source frequency drift. Fluorescent lamp switching frequencies in the laboratory
space range from 26 kHz to 49 kHz and have exhibited frequency drifts of at least t 1 Hz. It becomes
very difficult to demodulate a drifting source without a synchronous receive signal.
3.2
Spectrum Analyzer
A real-time spectrum analyzer (RTSA) was used with our active electrodes and front-end amplifiers
to analyze the frequency content of the lab space. Table 3.1 shows the various distinct peaks we
were able to identify in the space. The fluorescent lamps are the most prominent sources in the
32
6
X 10 3 Difference Frequency with Independent Source = 400kHz
5
.
.. .. . . . ... .. . .... . .. ..
4
......
.. . . . .
.... .....
0)
0)
3
0
0)
0
0)
2
1
... ....
.
0)
0)
0)
0~
C
0
f 0.07H
-1
-2
-31
0
200
400
600
800
1000
1200
1400
1600
1800
Time (s)
Figure 3-3: With the demodulation frequency within 0.01 Hz of the source frequency, the beat
frequency is observed over time.
space and by approaching each bank with a oscilloscope probe with pick-up loop the peak size at
each frequency was matched with its physical location in the room.
The spectrum analyzer used was the Tektronix RSA3303A 3GHz Real-time Spectrum Analyzer.
All figures below were captured in single-shot trace mode.
Vi (S)
High Voltage
Source
Differential
Acltives
FRont-end
Amplifier
Vsa (S)
Figure 3-4: Block diagram of manual demodulation tuning test.
3.3
Applications
This "passive scanner" could be an excellent companion to previous non-intrusive load monitoring
capabilities developed by Professor Steven Leeb. Our sensor provides the ability to observe the
frequency characteristics and amplitude of various high voltage electrical sources in an area with no
electrical contact required. By replacing the spectrum analyzer in this system with the electronics
described in Section 7, we would avoid the problems of asynchronous detection described above.
Additionally, this scanner could be used in conjunction with our hyperspectral EIT techniques.
By locking onto one of these sources and observing changes in signal amplitude when various objects
33
Power Spectrum Fluorescent Lamp
-30
.
.
.............
40
-
-
-.
.......
-50
-
-60 --
0
. -.
-
-
-70 - - -
-
E
-80 -.-.-
0L
.
.......... ..
- -
-.-..-
.
-100 -
.
..... ..
-9 0..
-110
2.35
2.4
2.45
2.5
2.55
2.6
2.65
Frequency (Hz)
2.7
2.75
2.8
2.85
x 10
(a) Left Fluorescent Lamp at 26.54 kHz, RBW = 5 Hz
Power Spectrum Fluorescent Lamp
...
.....
......
..........
-20
......
..
....
-
-30
...
......
..
.....
..-.
-40
.. . .
. .. .
....
. . . .. .. ..
..-..-. ..
-
-
-.
-50
.....
-
-10
- .... -
. ...
.. .. . .
.
-60
-..
-
0
CL
-70
-.... -..-.
-
-.....
-
-80
...
.....
..-..
-Mn
.
-90
4
4.12
4.24
4.36
4.48 4.6
4.72
Frequency (Hz)
4.84
4.96
5.08
5.2
x 104
(b) Front and Back Fluorescent Lamps over 41-49 kHz, RBW = 10 Hz
Figure 3-5: These figures were taken from a single frame of the spectrum analyzer used with our
front-end amplifier and electrodes.
34
Power Spectrum Laptop Touchpad
-70
-
-75 .
-
-80 - -85 - -.En
-
-90
M
-95
CL
-100
-
-
CD
-105
-110
-.-
-115 --1
5 .2
5.21
5.22
5.23
5.24 5.25 5.26
Frequency (Hz)
5.27
5.28
5.29
5. 3
x 10
(a) Laptop Touchpad Signal at 52.53 kHz, RBW
10 Hz
Power Spectrum Laptop Hard Drive
-40
....-.
.-50
En
.......-.
..-.
..-.
..-.
..-
-.
-60
- .. .-.
-.
-
M0
CD
-70
-80
-.
..........
......
-..
.
.
-90
-100
6.6297
7.0598
7.4898
Frequency (Hz)
7.9199
8.35
x 10
(b) Laptop Hard Drive Signal at 68.77 kHz, RBW = 50 Hz
Figure 3-6: These figures were taken from a single frame of the spectrum analyzer used with our
front-end amplifier and electrodes. The laptop was placed on the same shelf as the left-side electrode.
35
Power Spectrum Second Harmonics
-50
-55
-60
--
-65
---
T -70 -
---
-
-
-70 .........
-
-
-
--
.-
-..-.-.-
....
~-80
-90-
-95
--
-100---105
8.7801
8.35
10.0703
9.6402
9.2102
Frequency (Hz)
x1
(a) Fluorescent Lamps Second Harmonics, RBW= 50 Hz
Power Spectrum Third Harmonics
-G0
-55
-60
-.-.-.-
-65
T
--
---
- --
-70
-75
-83
-95
-
S-85
---
-100
1. 23
1.275
1.32
1.365
Frequency (Hz)
1.41
(b) Fluorescent Lamps Third Harmonics, RBW
1.455
1.5
x 104
50 Hz
Figure 3-7: These figures were taken from a single frame of the spectrum analyzer used with our
front-end amplifier and electrodes.
36
Table 3.1: Lab Space Independent Source List
Frequency (kHz)
26.54
Power (dBm)
-39.5
Identity
Left Lamp
42.09
-42.6
Back Lamp
43.77-45.74
45.74
~-42
-20.73
Back Lamp
Front Lamp
47.13-48.73
68.77
~-44
-43.17
Front Lamp
Laptop HDD
52.53
-46.95
Laptop Touchpad
are introduced into the lab space, the same image reconstruction could be performed without the
need for our own HV source. Preliminary experiments showed a roughly 10dB change in signal of
the closest fluorescent lamp as a person moved along the 2 meter horizontal marker in front of the
receive electrodes.
37
38
Chapter 4
Hyperspectral Imaging
4.1
Background
Many products and systems have used capacitive technologies for touchless sensing as discussed
in Chapter 1. However, this technology's unique ability to distinguish between different types of
materials present in an area using hyperspectral detection has not been realized in its current applications. This ability stems from the different permittivity responses as a function of frequency in
different materials, as shown in Figures 4-2 and 4-1. It is clear that while the conductivity of muscle
changes by orders of magnitude across this frequency range, the conductivity of aluminum is relatively constant. Similarly, the relative permittivity of muscle changes dramatically with frequency,
while the relative permittivity of metals is 1 and is not frequency dependent. To take advantage of
this property, we drive our ECT system with several frequencies and are able to differentiate humans
from metal in a 100 ft 2 area.
10"
10-0.3
10 5
103 3
10
10 5
10 4
Frequency (Hz)
106
Figure 4-1: The conductivity and permittivity of human muscle as a function of frequency [2,3].
Image reconstruction techniques are then used to locate objects. Ideally, the images produced
are sparsely populated in our 16-pixel space; this reduces the demands on reconstruction and allows
for accurate detection and differentiation of a small number of different objects in a larger space.
39
5.96
5.94
>
5.92
Q5.9
8
5.88
103
104
105
106
Frequency (Hz)
Figure 4-2: The conductivity of aluminum as a function of frequency.
In this chapter, we present an ECT system operated at several frequencies which not only produces a reconstructed image of the space occupancy, but provides information about the material
composition of occupied areas.
4.2
Previous Work
First, a COMSOL Multiphysics model for the 2D system was created and capacitance data was
derived as in a traditional ECT system described in Section 5.2.
Matlab simulations were run
then for various image reconstruction algorithms for use in an ECT system. These algorithms were
compared using COMSOL test cases for interesting permittivity distributions. Figure 4-3 shows the
modeled difference between the distributions of a test case of a human at two difference frequencies.
Clever manipulations of the permittivity vs. frequency responses of different materials can lead to
the differentiation of these materials when many types occupy one region.
-
X
010
3
10
1
2
3
4
5
6
7
8
9
101
Figure 4-3: Difference between COMSOL-modeled human image at 100kHz and 20kHz
To verify this, a simple proof-of-concept experiment was performed with help from post-doctoral
researcher Dr. Shahriar Khushrushahi. The setup, shown in Figure 4-6a, was made of a cardboard
40
Table
1:
Case
1:
c,
80
2i
Original
'IL
LBP
Image Error: 0.962, Capacitance Residual:
1.0047, CC:
0.2103
Image Error: 1.0282, Capacitance Residual: 1.0074, CC: 0.14%
SVD
Image Error: 0.7802, Capacitance Residual: 0.99M5, CC: 0.7363 1 Image Error: 0.9680, Capacitance Residual: 0.9996, CC: 0.8261
Figure 4-4: A COMSOL-modeled test case distribution with solutions by the LBP and SVD algorithms.
Landweber
a=0.006
1000 iterations
Image Error: 0.7676, Capacitance Residual: 0.9978 CC: 0.9347
Image Error:
0.9787,
Capacitance Residual: 0.9996, CC: 0.7404
Figure 4-5: The same test case distribution with solution by the Landweber algorithmis.
41
box shielded by grounded aluminum foil. Inside, four plastic boxes represented four "pixels" which
could be filled with air (empty), distilled water or solid wood blocks. The box containing the pixels
was surrounded by four copper foil electrodes. Using a impedance analyzer, the capacitances between
each pair of electrodes were found. With the capacitance matrix and sensitivity matrix construction
described in Section 5.2, the inverse problem involving these matrices was solved to produce the
distribution shown in Figure 4-6b. In this experiment pixels 1 and 4 were filled with water and
pixels 2 and 3 were filled with wood. By taking measurements of the discrete distribution at two
different frequencies, 10 kHz and 100 kHz, the location of the water in the setup could be reproduced
by using the information from both data sets in the inverse problem solution.
G(100kHz)-G(10kHz)
0.M
0
-0.02
-OM
raw# 3
(b) Resulting difference between permittivity distributions
(a) Experimental test case
Figure 4-6: The experimental setup and test case for hyperspectral ECT. In this test case, pixels 1
and 4 were filled with water and pixels 2 and 3 were filled with wood. On the right, the difference
between the permittivity distributions at 10kHz and 100kHz.
42
Chapter 5
Imaging Techniques
This chapter will discuss the theory of tomographic imaging and the algorithms employed in this
research. Given prior knowledge about the nature of the of the space, it is much easier to narrow
down the possible solutions to an ill-posed inverse problem and pick a "most-likely" solution.
5.1
Setup
First, an experimental setup was constructed so that absolute position of objects in the space could
be precisely recorded. Between the two rows of electrodes (three source plates and one differential
pair of receive plates) the floor tiles formed a 4 x 4 grid. Each group of 4 tiles formed a square and
each square marked a pixel in the vector representing the occupancy of the space.
Objects were
positioned in the middle of each square while data was collected.
5.2
Theory
In this section, the theory behind conventional electrical capacitance tomography (ECT) systems is
described. Our approach to this problem is to abstract away the physics and use a binary occupancy
value that will be described in Section 5.3.
To derive the capacitances between two electrodes relative to ground, we can first express the
charge on each electrode as a linear combination of the voltages on all electrodes. The coefficients
of these combinations are known as the coefficients of capacitance, and can be expressed in terms of
the circuit capacitances. In a system with two electrodes, the measured capacitances of the circuit
43
X direction
_____
x1
p
!
r2
x4
... n
C
0
X13
S1
X 16
S2
32_
Figure 5-1: The 4x4 grid in 2D space used as the spacial reference for all imaging.
Figure 5-2: Partial image of the 4x4 floor grid used for all experiments.
44
are related to the charges and voltages of the electrodes in the following way:
Q1 = c 11V 1
+ c 12 V 2
(5.1)
Q2 = c 2 1V 1
+ c 22 V 2
(5.2)
Because of the symmetry of the problem, C 1 2 = C 2 1 , meaning that there are only three unique
coefficients.
+ 0G
C 1 2 (V1
-
C2G2 + C 12(V 2
-
Q1 = C
Q2
=
C1
72) = (CIG + C12) V1
VI) =
= C 1G
-0121 1
(02G
-
C122
C12)2
+ 012
(5.4)
(5.5)
(5.6)
C12 = -C12
C22 = C2G +
(5.3)
012
(5.7)
Finally, it becomes clear that the coefficients of self-capacitance, cil etc., provide no new information about the system and thus are generally ignored in our calculations.
The capacitance is measured by sending an ac signal to the source electrode and grounding
the receive electrode. The induced current from the receive electrode is proportional to the actual
capacitance between the two plates I, = jwVC, including any intervening dielectric material.
To retrieve the original permittivity distribution from these capacitance measurements, it is
necessary to solve an inverse problem. An inverse problem is one that requires a solution for x in
the matrix equation Ax = b. With an overdetermined or underdetermined system, this problem
becomes impossible to solve exactly because A has no inverse. Indeed, ECT most often presents
underdetermined problems because of the nature of the setup. In ECT systems, the unknown values
are the permittivitties of each pixel in the desired image and the known values are the capacitances
measured as detailed above. Thus, the inverse problem can be described by the equation Sg = c
where c is a vector containing all capacitance measurements, g is the vector of unknown permittivities
and S is a sensitivity coefficient matrix which linearly relates these values. To calculate the sensitivity
matrix for a particular configuration, a function of the space and range of permittivities desired, the
pixels of the space are individually filled with blocks of the material one wishes to sense. Solving for
each value in the sensitivity matrix individually as in this 3 pixel, 2 electrode system gives
45
AC2T
12
AC1 2
I==[AE
1
AC
AE1 2
2
AC 12
Ac
I
AE 3 I
AC1 2m
Aci
1
AC1 2 m
-
S 11
AE1
Here, the complete result is a superposition of the results of filling each pixel with a dielectric
permittivity. The configuration is first measured "empty" and a displacement current I, is observed.
Subsequently, each pixel is filled one-by-one and the changes in current corresponding to changes in
capacitance are recorded and used to fill in the sensitivity matrix: Im - 1, = jWV1AC1 m. Once the
2
sensitivity matrix for a given configuration is calculated, an inverse problem, as described above, must
be solved to find the permittivity distributions from the sensitivity matrix and given capacitance
measurements. Various methods of choosing these distributions for underdetermined systems are
discussed in Section 5.5.
[AC I
AC12
12
]QlaX
AC1 2
[EAC 12
AE2
AE3
A6 1
A1
Ac
AE 3
I
Ad
I
A
-
I II
IL-L
Ac,-f
I. =
(a Cluain
I-A , -4= IV
tesnivtym
ix
S= jrol AC1
(b) Superposition of all pixels
filled
Figure 5-3: On the left, individual pixels are filled with dielectric material to calculate the values of
the sensitivity matrix. On the right, the result of the superposition of all pixels is shown.
5.3
Forward Problem
In our forward model, we would like to abstract away the physics described above. It is easier to
think of a vector x as x = f(c, m, S, etc.) where c, m, S, etc. are permittivity, mass and surface
area,
46
etc. of an object in the space respectively. Thus, each x value represents a value we will henceforward
call the "occupancy" of each pixel, which is a function of many parameters. Our goal is detection,
defined as the ability to determine which pixels in a space are occupied, and eventually, by which
material. Here we will focus solely on detection of occupancy. In Chapter 4 material detection will
be discussed.
The linear system relating system voltage measurements and occupancy is given by
Ax = y
(5.8)
with xi c 0, 1
(5.9)
where A is an m x n sensitivity matrix, x is the
n x 1 pixel occupancy vector and y is the m x 1
measurement vector. Specifically, in our experiment as described in Section 2.5
a 1, 1
a1 ,2
a1 , 3
-.
-
a2,1
a 2 ,2
a 2 ,3
...
a2,n
22
Y2
a3,1
a 3 ,2
a 3 ,3
...
a3,n
X3
Y3
am,
am,1
...
am,1
Xn
Ym
m,1
l,n
/
X2
Y1
The A matrix is filled column-by-column from the calibration measurements using single pixel occupancy; i.e. if only pixel x 1 is filled, the equation becomes
C
amx I
2mx1
3m X1
..- anmX
1
Y1
0
Y2
0
Y3
0
Ym
where aimx is one vector of calibration measurements. From the above equation, it becomes clear
that a1 =
Q.
In our experimental setup, m = 28 and n = 16 in our 4 x 4 grid. The 28 measurements
taken are in-phase and quadrature measurements at each of two frequencies and seven possible
source combinations (2 x 2 x 7 = 28). All combinations of the three source electrodes are expressed
in binary below with a "0" designating a source electrode which is undriven and a "1" representing
47
a driven source electrode. The linear system
Y001,10.4k,I
Y001,10.4k,Q
Y001,83.3k,I
Y001,83.3k,Q
Y010,10.4k,I
Y010,10.4k,Q
a,28x1
a228x1
a328x1
X1
Y010,83.3kI
X2
Y010,83.3k,Q
X3
Y011,10.4k,I
2
...
a1 6 8xl
Y011,10.4k,Q
X16
Y011,83.3k,I
Y011,83.3k,Q
Y111,10.4k,I
Y111,10.4k,Q
Y111,83.3k,I
Y111,83.3k,Q
I
describes our forward model, where the first subscript of y refers to which of the 3 source electrodes
are used, the second subscript is the source and demodulation frequency of the sensor and the third
subscript denotes an in-phase (I) or quadrature (Q) measurement in regards to the phase of the
demodulation signal.
In our model, we make several assumptions.
1. Pixel occupancies are uncoupled. This is an idealization because of the effect of the unavoidable
mutual capacitances between nearby objects. Section 5.6 discusses an improved model with
respect to this non-ideality.
2. The columns of AT are linearly independent.
If there is a high degree of symmetry in the
system, e.g. single-source in the middle, the columns might not be independent.
Once the sensitivity matrix is created as above, we are left with a linear system of equations. Given
information about the environment and the distribution of added material in the space, the values
measured by the sensor electronics are well-defined. Assuming that the occupancy of each pixel will
be independent from that of any other pixel, we can use linear indexing of the pixel grid to create
48
an occupancy vector, as below.
Xi
<1
X2
X5
X6
X3
.
4
X2
X3
'
Xg
X16
16
The forward problem can be formulated similarly in the multi-material case. In our experiment,
humans and aluminum are detected. Thus, two sensitivity matrices (Ap is the human sensitivity
and Am is the aluminum sensitivity) are constructed as above and place together on the left side of
the equation below.
Yi
Y2
Ap
Xp
Y3
Ym
5.4
5.4.1
Inverse Problem
Constraints
Unfortunately, as with most imaging problems, our measurements are given and we would like to
find the added material distribution that produced those measurements. An inverse problem such
as this is often ill-posed. Well-posed problems must satisfy three constraints:
1. Stability: The solution must depend continuously on the initial conditions.
2. Existence: The problem must have a solution.
3. Uniqueness: There must be only one solution.
Inverse solutions can be very unstable. Small perturbations in measurements can result in large
changes in the estimated model. These problems are ill-conditioned. The process of regularization
by which other constraints to the problem can add stability to the solution.
Typically, the desired resolution in our space is greater than the number of measurements will
allow with absolute certainty. More precisely, the length of
is greater than that of y. This means
that the sensitivity matrix A is not full-rank and the system is underdetermined. There are infinite
solutions to this system, and this violates the uniqueness constraint.
To further constrain this inverse problem and ease the choice of a solution, all occupancy values
are considered to be non-negative, as the actual occupancy of a pixel is either positive or zero. The
49
-Yo
data is also preconditioned to negate the effect of the background measurement of the space without
any additional objects. Therefore
(5.10)
Yi
Y
and all measurement vectors yi are expressed as a difference in voltage between the absolute measurements and the background measurement.
5.4.2
CVX
Convex functions are those that, if any two points in the Euclidean function were connected by a
line, will always have the line above the graph. Because of this property, any local minimum of
these functions must be the global minimum. Convex optimization is the process of finding the
minimum of a convex function over a convex set, through iteration. The program CVX, developed
by Stephen Boyd of Stanford University, performs convex minimization on finite-dimensional normed
spaces [12, 13].
This program is used in image reconstruction as choosing the "best" solution often involves
minimizing the energy of the occupancy vector or the distance between the data vector and Ax. In
the algorithms which use this program, each will first be presented as an optimization and then the
occupancy will be given as a formula if one exists.
5.5
Image Reconstruction Algorithms
Several image reconstruction algorithms were investigated for use in this application. Many were
taken from cited sources while others were developed for use in our specific application.
5.5.1
Linear Back Projection
The most straightforward algorithm for single pixel detection is linear back-projection (LBP) which
uses the values of the projection of the measurement vector
Q onto each
column of A' where AT is
the sensitivity matrix where every column is normalized to 1 as shown in Figure 5-4. The columns
of A are normalized so that each product is a true projection of a vector onto a unit vector, with a
maximum value of 1 as follows in Equation 5.11.
T A
50
cos 0
(5.11)
The LBP solution is given by the optimization
Maximize pi
subject to
P=
(5.12)
(5.13)
AN.
In a noise-free case, this method would produce the correct answer, a vector of numbers < 1 and a
single xmax = 1 in the position of the object. However, with each measurement vector so similar and
noise pushing a measurement vector away from the original intended pixel, this method becomes
very poor at picking out the occupied pixel.
A
Y1\
Yi
b
Y2
Pi
y3
Figure 5-4: A pictorial representation of the linear back-project algorithm for "hard-field" tomographies.
In the N-pixel detection case, the N pixels with the largest projections onto the columns of AN
are occupied, and are chosen by the optimization
Maximize
where
PkN
P1, P2,P3 ...
Pi
(5.14)
subject to P = AND.
(5.15)
PkN = maxpk
(5.16)
is the set of N largest elements of p.
51
5.5.2
Least Norm
For an underdetermined system, a least norm approach finds the solution out of the infinite set
that minimizes the 2-norm of the occupancy vector. This solution is analogous to the least squares
solution to an overdetermined system where m > n. In this case the least squares solution is one
that has the smallest euclidean distance from the data points taken. It minimizes the 2-norm of the
residual Ax - b and has the largest projection onto the column-space of A. The least norm solution,
then, is the "shortest" solution of Ax = b. This solution may be appealing if we are given prior
knowledge regarding the sparseness of the occupancy.
Minimize JlxJJ
(5.17)
subject to Ax = b
(5.18)
Axl, = y
(5.19)
AT Axi, = ATy
(5.20)
xln =AT(AT
(5.21)
A)-ly
Given Ax = b and x k xl,:
(x - xn)T
Thus, x and
xin
(AAT -1b
(5.22)
= (Ax - Ax 1n)T (AAAT)-b
(5.23)
= 0
(5.24)
xin = (x - xin)T AT
must be orthogonal.
(5.25)
2
||xJ|2 = ||X - x 1n + xi~n|
2
= ||x - xin||
+ 2(x
=
+ ||xian 12
x-xin2
> lxn|1 2
- xin )T xin
+
||xin|\
2
(5.26)
(5.27)
(5.28)
(5.29)
ixH| > |ixi~nJ
This proves that any other solution x will have a larger 2-norm than the least norm solution xln.
52
5.5.3
2-Norm with 2-Norm Regularization
The least norm solution minimizes I xJ
a weighted sum of the two: IfAx - bl
|
2
with I|Ax - b
12
= 0. Another approach looks to minimize
+ piffxff2. This approach is commonly referred to as the least
squares solution with Tikhonov Regularization and is the most commonly preferred solution because
of its convergence stability and relatively small computation time. However, when the 2-norm is
applied to the regularization term it acts as a low-pass filter and chooses solutions which are spatially
smooth. Similarly problematic is the fact that because the residual is squared, the 2-norm solution
for the data term becomes sensitive to errors in the data.
Minimize | IAx - b| 1
[||x||
(5.30)
subject to x > 0
x,
As /p -+
5.5.4
0,
xY -*
= (AT A +
I) -A Ty
(5.31)
(5.32)
xi.
1-Norm with 2-Norm Regularization
This solution suppresses the affect of outliers in the data caused by electronic glitches or the movement of an object in the space. It is able to do so because the residual, or error term is no longer
squared so it does not have as large an impact on the optimization problem.
This solution minimizes the expression
Minimize ||Ax - bH 1 + [
2|xfl|
subject to x > 0
5.5.5
(5.33)
(5.34)
2-Norm with 1-Norm Regularization
Using a 1-norm instead of a 2-norm for the regularization term means that this solution is more
likely to pick out sharp transitions in the occupancy (i.e. from air, to person), a characteristic that
our experiments exhibit. Out of the possible least squares solutions with regularization, this solution
is preferred for this reason.
53
This solution minimizes the expression
(5.35)
Minimize I Ax - bI'+ plx1
(5.36)
subject to x > 0
5.5.6
Landweber/Newton-Raphson
The Landweber iterative algorithm is a different approach to regularization of the least squares
problem.
Xk+1 = Xk
+ oAT
(5.37)
(y - Axk)
This iterative algorithm starts with an initial guess for the distribution (usually an "empty" space)
and adds to this distribution to approach the closest solution. If the prior distribution is removed
from this solution, it becomes the linear back projection algorithm.
Therefore, the Landweber
algorithm is a direct improvement upon the initial approximation of ECT as a hard-field tomography.
Optimum number of iterations and step size value will need to be found if an iterative algorithm
such as Landweber is to be used. This may take less computational power than the optimization
problems described above.
5.5.7
Image Segmentation
Image segmentation algorithms have been used in extracting useful information from given images.
Images can be segmented according to gray-level, color, texture, motion or depth [14]. In this case,
we will start with an initial image found by applying the least norm solution and apply this solution
to increasingly small segments of the image until each pixel is resolved and an object is found. Using
this branch-and-bound algorithm means the number of located objects must be given as an initial
condition so that the correct number of best branches of the solution tree are maintained through
all iterations.
Algorithm 1 Image Segmentation algorithm with least-norm optimization
1: for All pixels do
while quadchosen == quadcorrect do
2:
Find least-norm solution
3:
4:
if sizegrid <size, then
5:
Use Least-squares solution
else
6:
7:
Shrink grid
end if
8:
9:
end while
return
11: end for
10:
sizegrid
54
The algorithm steps are described in
1.
First, the image is split into n large, overlapping
quadrants and the m quadrants with the highest occupancy value after minimizing the norm of the
occupancy vector I xJ are chosen. The occupancy value of a quadrant is given by the energy in each
quadrant shown below. The chosen quadrants are each split into
n sub-quadrants, and the process
is repeated. The iteration ends when the variance of the m remaining occupancy values is below
some threshold value
Ec = (X1)2 + (x 2 ) 2 + (X3)
2
+ ... + (x,)2 < E.
(5.38)
This method introduces a rigorous way to find the maximum resolvable pixel size for a given level
of SNR. Five randomly generated Gaussian white noise vectors are added to noise-free data of each
pixel and run through the algorithm for different levels of SNR. In this way, the largest quadrant
size that still contains the correct solution is considered the best resolution for this SNR, averaged
over the five random noise vector inputs.
5.6
Improvements
Several improvements upon the above described algorithms were proposed. In conjunction with the
chosen algorithm, they can increase the resolution and improve image quality.
5.6.1
Influence Matrix
Though ideally this system would be completely linear in permittivity distributions, this is not
the case. For example, when two object are positioned next to each other on the grid, we would
want, but not expect their capacitance measurements to add linearly. Instead, because we expect
this physical non-linearity, we create an influence model to account for it. Without the influence
model, the geometry of the permittivity distribution (a 13x13 grid) has no effect on our solution.
By optimizing the equation
ABXb = Y
(5.39)
where the influence matrix B
1
6
62\
6
1
6
62
6
1
we should observe smoother permittivity distributions that account for the proximity of certain
pixels to their nearest neighbors. The influence matrix is constructed according to pixel proximity.
55
For each row, a 1 represents the pixel in question and a 6 represents a bordering neighbor. Influence
falls off by distance meaning that pixels that border on a diagonal will have V2 influence and pixels
that are horizontally or vertically two away from the pixel in question will have 62 influence.
5.6.2
Subpixel
A method to improve the resolution of the reconstructed image involves dividing each pixel into
multiple.
The sensitivity matrix is then updated using a 5-degree polynomial fit to interpolate
between points.
Using this updated sensitivity matrix in the Ax
b problem will produce a
permittivity distribution of greater resolution than the original.
-
001
U.05 -
j
-a
-0.016---0 .015 - -
.....-.....
-21
ydsta
xdata.
Figure 5-5: Fitting data for measurements taken at each pixel in 13x13 grid: source position 1, ADC
1.
56
Chapter 6
Occupancy Detection Results and
System Performance
In this chapter, results concerning the range, noise rejection and performance of this sensor as an
occupancy and material detector are presented.
The data was collected with the sensor circuitry
described in Chapter 2 and the image reconstruction algorithms used are those detailed in Chapter 5.
6.1
Sensor Range
As previously noted, the range of the sensor with a single-ended source physically parallel with (on
the same shelving as) the differential receive electrodes was 11ft.
In the configuration described
in this thesis, the source electrodes are placed across the room and the response is recorded in
Figure 6-1.
6.2
Noise and Drift
In order to measure the noise floor of this sensor, measurements were taken with the spectrum
analyzer in various configurations. First, the spectrum analyzer noise floor was measured using a
50 Q terminator input. Next, the noise floor of the analyzer with attached probe was measured
by shorting the differential input of the probe.
Finally, the noise floor of the front end amplifier
itself was measured by probing the differential output of this amplifier yo the demodulation block.
The results in Table 6.1 show that these measurements are consistent and increasing with added
potential noise sources. If the ADC has 21 effective number of bits (ENOB) and a range of
57
0-5V,
0.4
0.3
C.)
0.2
0.1
0
0 L
1
2
3
4
5
7
6
8
9
10
11
Distance from receive electrodes (ft)
Figure 6-1: The response of the sensor as a single source electrode is moved away from the receive
electrodes.
the largest signal delta detectable is given by
5
2
=
2.38
(6.1)
V.
In converting power measured by the spectrum analyzer to noise spectral density, a low bound on
the noise level at the input of the ADC can be calculated with Equation 6.3.
P = 101ogio 1 "
?2
dBm
(0.001
Vn-o =
\
(6.2)
- RBWi
10o R - 0.001
nV/v Hz
(6.3)
Combining equation 6.1 and data from Table 6.1 shows that the noise floor of the amplifier is less
than the minimum signal detectable by the ADC, as shown below.
2.38pV = 476
/25Hz
6.3
nV/V Hz > 224.14
nV/viiz
(6.4)
Object Detection
Three types of measurements were taken of the space.
First, a measurement was taken with no
objects of interest in the space. This measurement was taken between each piece of data, and will
be referred to as the background measurement.
transmitting was taken.
Next, a measurement with no source electrodes
This offset measurement was taken right before the data was collected
58
Table 6.1: Noise Floor Measurements
Measurement
50 Q
Probe
Amplifier
Power (dBm)
-140
-106
-100
-106
RBW (Hz)
5
10
5
10
Noise (nV/VHz)
4.47
112.07
224.14
223.61
Table 6.2: Repeated Calibration Data
Measurement
Aluminum
Human A
Human B
Human A + Aluminum
Human A + Copper
(front)
(by side)
(out at side)
Number of sets taken
3
3
2
2
2
2
2
because an object's presence does not change its value; it is based purely on the performance of the
electronics. Finally, the seven pieces of data corresponding to each combination of electrodes was
taken. All final data measurements are normalized and scaled and are of the form
data - background
background - offset
(6.5)
where data here refers to the raw data values.
The calibration data taken is shown in Table 6.2 and the individual data points taken with
multiple objects are shown in Tables 6.3 and 6.4.
6.3.1
Scalability of Objects
Two people of different mass and dimensions were measured in the lab space. When the person of
larger mass, Person A, was used to calibrate the space, his location at pixel one with an average
Table 6.3: Multiple Object Data Pairs
Object 1
Human A
Human B
Human A
Aluminum
Object 2
Human B
Human A
Aluminum
Human A
59
Table 6.4: Multiple Object Data Coordinates
Coordinate 1
(1,1)
(1,2)
(3,1)
(1,1)
(4,2)
(2,3)
(2,2)
(1,2)
(4,3)
Coordinate 2
(4,4)
(4,3)
(2,4)
(1,2)
(4,3)
(2,4)
(2,3)
(1,3)
(4,4)
1.5
Q
Person 1
F-7 Person 2
1
Q
0
0.5
0
1
2
3
4
x pixel
Figure 6-2: The relative difference between the levels of human material calculated by the 11 algorithms with 11 regularization for two people of different sizes.
occupancy value of 0.964 over two trials was found with the above algorithm. Person B of smaller
mass could also be located at pixel one with an average occupancy value of 0.583.
We are also able to locate and differentiate between Person A and Person B when both are in
the same space. Figures 6-3a and 6-3b show the results of the image reconstruction using the 11
solution with 11 regularization.
6.3.2
Multiple Materials
Several experiments were performed with two materials. Unfortunately, we are currently unable to
reliably distinguish between aluminum and a human of roughly the same surface area with noisy
data. Figure 6-4 shows a noise-free object detection, but even then all noise-free data corresponding
60
I1
I
I
1
0.8
2
0.6
3
0.4
A-
0.2
4
i
I
1
2
_____________
3
4
0
X direction
(a) Person A in pixel 1, Person B in pixel 16.
1
1
0.8
>
2
0.6
3
0.4
0.2
4
1
3
2
4
0
X direction
(b) Person B in pixel 1, Person A in pixel 16.
Figure 6-3: Occupancy values in the 4x4 gridspace with two people differentiated by size.
61
to a human or aluminum piece in the space only guarantees a detection in the overdetermined
case (all 28 measurements for 16 pixels). When only 12 measurements are used to make the system
underdetermined, it is impossible to resolve a detection with an object within the four middle pixels.
Human 1i/li
Metal
li/li
1
|
0
C
2
C
C
2
-C
*tS
3
4
4
1
2
.3
1
4
2
3
X direction
X direction
Figure 6-4: The occupancy maps of human and metal presence in the lab space. In this case, noisefree data is used in the sensitivity calibration and as the experimental data and a perfect detection
is achieved.
62
4
Chapter 7
Conclusion and Future Work
7.1
Summary
The system presented in this thesis has the potential to be used in many exciting applications,
including room-scanning and body-scanning. We have shown that the use of hyperspectral detection
in ECT can provide valuable information about the material content of detected objects.
This sensor would be a powerful tool for touchless gesture sensing when used in parallel with a
camera or IR sensor to create a complete picture of the sensed object. A future iteration of this
sensor will include an FPGA FFT-implementation to increase the number of frequency measurements
made. The use of more source and receive electrodes and their optimum configuration will also be
explored.
Chapter 2 presented additions and changes to the sensor electronics. Specifically, the high voltage
multiplexer board was added and many unnecessary components were removed. The high voltage
board layout and wiring to the board were optimized to prevent unwanted coupling, interference
and ground loops.
Chapter 3 included a study of asynchronous sources in the lab space using a
spectrum analyzer. Fluorescent lamps and laptop hard drive and touchpad signals were picked up
by the front-end amplifier and measured. The locations of the fluorescent lamps were confirmed by
toggling their switch banks.
Hyperspectral imaging theory and preliminary results were discussed in Chapter 4. Image reconstruction algorithms using hyperspectral data were compared in Chapter 5 and improvements
were discussed. For this application, algorithms that favor sparse solutions such as the 11 solution
with 11 regularization will work best. Finally, the results of several detection experiments and the
characterization of the system are discussed in Chapter 6.
63
7.2
Future Work
The research presented in this thesis is far from complete, and could take many paths in the future.
Topics to consider next are touched on here.
7.2.1
Electrode Configurations
In the current revision of the board, it is possible to use two pairs of differential receive electrodes.
With this capability, it would be interesting to analyze the benefit to using multiple receive plates
over multiple source plates. The effect of using differential source and receive electrodes instead of
single-ended electrodes could also be quantified.
The position of these electrodes in relation to each other should also be studied for the best
resolution. Finally, the optimal shape and size of these electrodes should be reviewed. Using Comsol
Multiphysics to model various set-ups with different electrode shapes, sizes and locations would be
a controlled way of verifying the optimal values for these parameters.
7.2.2
Digital Demodulation
A future iteration of this sensor should include an FPGA FFT-implementation to increase the
number of frequency measurements made. In doing so, an entirely digital demodulation could be
performed to collect information about the spectral location of all asynchronous sources in a given
space. In this way, a true passive scanner without the need of a spectrum analyzer could be realized
in the sensor electronics. With this tool, object and material detection could be performed without
an active source.
7.2.3
Laptop Gesture Sensor
With the ability to see two distinct laptop control signals using this wide-area sensor, it would
be interesting to observe the gesture recognition capabilities of this sensor with many electrodes
positioned around a laptop LCD screen. Integrating this sensor with the laptop video camera would
be an important project for research exploring the improvement of touchless sensing in laptops,
smartphones and other devices.
7.2.4
Floor Shoe Scanner
In the same vein as the airport body-scanner, an floor shoe scanner would be able to image an
object, but at a smaller scale. This would be used at airports to avoid the need to remove shoes
when going through security. A shoe scanner would be able to distinguish between different types
of plastics in order to identify those used in bombs and be able to pick out metals.
64
Appendix A
Code
A.1
Sensor Interfacing Software in Matlab®
A.1.1
readADC.m
% Inputs:
s
%
5
10
intialized serial port
chan = ADC channel to be read from
% Output:
% val = raw data value in decimal
function val = readADC(s, chan)
%% Send the coninand to the sensor if necessary
fprintf (s, '%s',strcat('A',chan));
%% Read from the board
15
% matrix = fscanf(s.'%s'):
raw = fscanf(s,'%02x*);
matrix = rot90(raw);
%% Print channel and received data
20
fprintf ( '%c:-, chan);
25
for k=1:4
fprintf
end
%02X9,matrix(k));
%X% Interpret data received from the board and print and return read value
65
30
if bitget(matrix(1),6)
result = matrix(1)*2^24+matrix(2)*2^16+matrix(3)*2^8+matrix(4);
result = bitshift(result,-5);
result = bitand(result,16777215);
val = result*5/(2^24-1);
35
fprintf (' ,%'(f\n', val);
elseif bitget(matrix(1),6) == 0
result = matrix(1) *2^ 24+matrix(2) *2 ^16+matrix(3) *2 8+matrix(4);
result = bitshift(result,-5);
result = bitand(result,16777215);
val = -(16777215-result)*5/(2^24-1);
fprintf(' ,%f\n', val);
40
end
end
A.1.2
recorder.m
% Inputs:
5
%; port: port to collect (lata from
% pts: unmlber of points to record
% ADC: array argument to select ADCs to read
%
should be in the form: ['0','1]
%
file : target file to save data to
/ Taikes ini a numiber of point to record. Usually used to observe the
10
% response of the system to demodulating one frequency over a long period
%Xof tine to check consistancv.
function recorder(port,pts,ADC,file)
15
%X Open Data Link to Board
s = openser(port);
%%IX
20
Initialization
% Set drive frequencies
% - xl: 10.416 kHz
% - x2: 83.333 kHz
% fprintf(s,9%s ' p2'): %X PWM frequency for denodulation
%e fprintf( s .%(Xs '., d ): % DDS source drive frequency
25
(Y% Open Target Save File
f id = fopen(f ile,'w*); '% Open file with write access
fprintf (fid, %s\r\n',datestr(now)); , Record starting t ime
66
and date
30
% Write colunin headers
for k = 1:2:length(ADC)
fprintf (f id,*%c., ADC(k));
fprintf (f id, '%c,', ADC(k+1));
fprintf (f id, iq%d. ,k);
35
end
fprintf (f id,'\r\n'); % New line for the recorded data
%%{ Main plot loop
40
for 1 = 1:pts
%c Print current point to screen
fprintf ('%vd:-\r\n',1)
X Read one channel from board
for k = 1:2:length(ADC)
% Read a pair of ADCs and find sqrt of the sum of the squares
sample-i = readADC(sADC(k));
sampleq = readADC(s,ADC(k+I1));
sample = sqrt(sample-i^2 + sample-q^2);
45
50
% Print results to screen and write to file
fprintf ('%2.6f-.2.6f,%2.6f\r\n',sample-i,sample.q,sample);
fprintf (f id, '%10. 18f,% 10. 18f,%10. 18f, ,sample _i,sample -q,sample);
end
55
%X Create new line for after each datapoint
fprintf (f id,'\r\n');
%A\\ait sufficient tne to resamnple
pause(1/6.7);
60
end
fprintf (fid,'%s',datestr(now)); % Record time and date at the end of recording
65
% Close file and serial port upon termination
fclose (f id);
stopasync (s);
fclose (s);
70
end
A.1.3
%c Inputs:
%: port
%
pts
rangeExpt.m
= port to collect data fron (usually 10)
= numnber of range points to record (16-24)
67
5
%, avgpts = number of samples to average at each point (usually 10)
% ADC = array argument to select ADCs to read
%A
should be in the form [0',1']
% file
= target file to save data to
% Ouput:
response = length(ADC) x pts matrix of raw data
10
%
15
function response = rangeExpt(port,pts,avgpts,ADC,file)
%% Open Data Link to Board
s = open-ser(port);
%% Initialize
%4 Preallocate space for result
response = zeros(length(ADC),pts);
20
standdev = zeros(length(ADC),pts);
rmsv = zeros(length(ADC),pts);
% Set drive frequencies
25
%A- xl: 10.416 kHz
A - x2: 83.333 kHz
%fprintf(s,'%s
*.
p3l): % PWM frequency for demodulation
%fprintf(s,'%s ', d3");
DDS source drive frequency
(%%3 Open Target Save File
30
fid = fopen(file,w'); 54 Open file with write access
fprintf (f id,'%X3s\r\n*,datestr(now)); %Record starting time and (late
(,
WArite cohumn headers
for k = 1:2:length(ADC)
35
fprintf (f id,%c.', ADC(k));
fprintf (f id, %3,(,
ADC(k+1));
fprintf (f id,'iqc,',ADC(k));
end
40
fprintf (fid,'\r\n"); W New line for the recorded data,
(,
Record from board
f 1 = figure(1);
waitforbuttonpress; %4 Press button to start recording
45
for k = 1:pts
% Press button before
waitforbuttonpress;
each point
fprintf (I "Xs',repmat (sprint f('\n *) ,1,10));
50
, (Re)-Initialize sample array
68
pt-vals = zeros(length(ADC),avgpts);
55
%. Poll ADCs and discard result to flush
% each ADC before recording.
for 1 = 1:length(ADC)
readADC(s,ADC(1));
end
% Pause sufficient time before beginning to sample (150 is)
60
pause(1/6.7);
for 1 = 1:avgpts
% Sample each ADC once
for n = 1:length(ADC)
pt-vals(n,1) = readADC(s,ADC(n));
end
(X Pause before resanipling (150 ins)
pause(1/6.7);
65
end
70
for m = 1:length(ADC)
%/Average sampled values
response(m,k) = mean(pt.vals(m,:));
% Standard deviation calculation for error bars
stand-dev(m,k) = std(pt-vals(m,:));
75
%
RMS calculation at each point--could be useful
%rnmsv(m,k) = rms(pt-vals(m.,:)):
80
V Write sampled values to file
fprintf (f id,'%c,', ADC(m));
fprintf (f id, %10.18f,',pt_vals(m,:));
fprintf ( fid ,' X10. 18f ', response(m,k)):
fprintf (f id,'\r\nu);
85
end
%XPrint separators
90
fprintf ('%s\n',repmat(sprintf('=i),1,50));
fprintf ( '%s\n',repmat(sprintf('='),1,50));
fprintf ( '%s\n",repmat(sprintf('='),1,50));
fprintf ( '%s\n',repmat(sprintf('='),1,50));
fprintf ('%/,s\n'i,repmat(sprintf('='),1,50));
95
% Plot first channel in figure
figure (1) ; clf;
plot (1: length(response(1,1:k)) ,response(1,1:k));
fprintf (*POINT-%1 .Of\\n\n,k);
69
100
for i = 1:(length(ADC)-2)
fprintf ( ChanieL%1 .OLaverage:i ,i);
fprintf ( '%f\n',response(i,k));
end
105
% axis([1 pts -0.5
0.5]):
axis ([1 pts mean(response(1,1:k))-10e-3 mean(response(1,1:k))+10e-3]);
end
110
%% Write averaged samples (response) to file
fprintf (f id,'%s\r\n','Average(s)');
for k = 1:Iength(ADC)
fprintf (f id,'%10.18f,',response(k,:));
115
fprintf (f id,'\r\n');
end
fprintf (f id,'%s\r\n','STD(s)');
120
for k = 1:length(ADC)
fprintf (f id,'%10.18f,' , stand-dev(k,:));
fprintf (f id,'\r\n);
end
response = [response' stand-dev']';
125
% fprintf( fid ,'%s\r\n '.' RMS(s)'):
% for k = 1:length(ADC)
%
fprintf (fid ,'%10.18f ,, rmsv(k.:)
%
fprintf ( fid ,'\ r\ni):;
130
% end
%% Close file and serial port
135
%fclose(fid)
stopasync(s);
fclose (s);
delete(s);
clear s;
close all;
140
end
A.1.4
lightpulse.m
% Inputs:
% port = number of COM port
70
%Y, pts
%
5
= nuiber of points in plot butffer
count = end of frequency count nmge
W
% Adapted from liveGraph, this plots the frequency response of the space
10
%
% in order to confirim existance of sources at certain frequencies.
% After each increment in frequency. it takes 10 ADC readings and averages
% over them, then plots the value in realtime.
function iq = lightpulse(port,count ,length,f ile)
s = open-ser(port);
15
x1 = zeros(1,length);
x2 = zeros(1,length);
iq = zeros(1,length);
time = zeros(1,length);
20
start
=
clock;
hex = dec2hex(count,4);
fprintf (s, '%s',strcat(f',hex));
25
30
35
f id = fopen(f ile,'w');
fprintf (f id, '%s\r\n',datestr(now));
% Associate an ADC reading with a timestamp
for i=1:length+1
current = etimne(clock,start);
time(1,i) = current;
a = readADC(s,(Y0);
b = readADC(s,.l');
if i ~= 1
xl(1,i-1)
a;
x2(1,i-1)
b;
iq(1,i-1) = sqrt(xl(1,i-1)^2 + x2(1,i-1)^2);
plot (time(1:i-1),x1(1:i-1))
40
45
50
% Quit the loop if 'q' is pressed, close figure as well if Q'
if strcmp(get(1,'currentcharacter'),'q')
strcmp(get(,'currentcharacter'),'Q)
% Close serial port
stopasync(s);
fclose (s);
delete(s);
clear s;
if strcmp(get(1, currentcharacter'),'Q')
close all;
break
71
else
break
end
end
end
drawnow
pause(1/6.7);
end
% Write sampled values to file
fprintf (f id,'\r\n\n');
fprintf (f id,'%oc
, 0')
fprintf (f id,'\n');
fprintf (f id, %10.18f,',xl (1,:));
fprintf (f id,'\r\n');
fprintf (f id,'\r\n);
fprintf (f id,'%1,
fx'1');
fprintf (f id,'\n');
fprintf (f id,'%/c10.18f.' ,x2 (1,:));
fprintf (f id,'\r\n') ;
fprintf (f id,'\r\n');
fprintf (f id,'%s , ' IQ');
fprintf (f id,'\n') ;
fprintf (fid,%10.18f,',iq(1,:));
fprintf (f id,"\r\n');
%c fprintf( fid,'%10.18f', response(m,k)):
end
A.1.5
gridExpt.m
%AInputs:
= port to collect data from
= number of x points to record
%
port
xpts
= number of y points to record
ypts
avgpts = number of samples to average at each point
ADC = array argument. to select ADCs to read
should be in the form ['0,'lj]
= target file to save data to
%X file
%AOutput:
response = length(ADC)*(2^nuuimsrc-1) x ypts*xpts matrix of raw data
%A
=length(ADC)*(2^munsre-1) x vpts*xpts of data with nothing in
%Y back
%A
%
5
10
the space
72
15
20
=flength(ADC) x ypts*xpts matrix of data with no sources on
%A off
%e
% Last modified 16 Dec 2013 by Lizi George
function [respl,resp2,resp3,back,off] = gridExpt(port,xpts,yptsavgpts,numsrc,ADC,f ile)
%% Open Data Link to Board
s = open-ser(port);
%Xs=serial('COM4','BaudRate', 9600, 'DataBits', 8., 'Parity', 'none'. 'StopBits', 1, 'terminator
', 'LF' timeout ',2);
%set(s, Timeout',1):
%Open serial port defined above
%fopen(s);
25
% Initialize and Set Up Experiment
% Preallocate space for result
30
35
response = zeros(ypts,xpts,legth(ADC),2^numsrc-1,3); %to do
respi = zeros(length(ADC)*(2^numsrc-1),ypts*xpts); %to (1o
resp2 = zeros(length(ADC)*(2 ^numsrc- 1),ypts*xpts); %to (1o
resp3 = zeros(length(ADC)*(2^nmsrc-1),ypts*xpts); %to do
background = zeros(ypt s,xpt s,length(ADC) ,2 ^numsrc- 1);
back = zeros(length(ADC)*(2 ^numsrc- 1),ypts*xpt s);
of f set = zeros(ypts,xpts,length(ADC));
of f _temp = zeros(length(ADC),ypts*xpts);
% Setup beep on completion of each point
40
f s = 8000;
T = 0.25; % seconds duration
t = 0:(1/f s):T;
fpt = 450; % frequency in Hz
fbk = 300;
a = 0.25; %X, volume
45
point-beep = a*sin(2*pi*fpt*t);
back-beep = 2*a*sin(2*pi*fbk*t);
% Set drive and chop frequencies
50
% - xl: 10.416 kHz
% - x2: 83.333 kHz
% - x3: 10.416 & 83.333 kHz Drive
CIl: 10.416 kHz, Ch2: 83.333 kHz Chop
%
fprintf (s, '%s','p3'); % PWVM Chop
fprintf (s, '%s','d3'); % DDS
55
% Set up NI-DAQ using Session-based (new) interface
myDaq = daq.createSession('ni);
myDaq.addDigitalChannel('Devl',
Port0/Line0:2','OutputOnly')
73
60
X% Open Target Save File
f id = fopen(f ile,'wN); % Open file with write acces
fprintf (fid,'%s\r\n',datestr(now)); % Record starting time and date
fprintf (f id,'%s\r\n',ADC); % Record ADC
fprintf (f id, Grid:-%d-x-%d\r\n',xpts,ypts); % Record grid size
65
%% Record Data from Board
figure (1); clf;
70
myDaq.outputSingleScan ([0,0,0])
% Turn off all sources to begin to do
waitforbuttonpress; % Press button to start experiment
% Iterate through each column of every row in grid, and ALSO over nunmsrc
% source boards. For each grid position. we'll do all the sources at once
for k = 1:ypts
75
for 1 = 1:xpts
waitforbuttonpress;
% Take offset measurement.
80
myDaq.outputSingleScan ([0,0,0])
offsetvals = zeros(length(ADC),avgpts);
85
% Flush ADCs before each point
for m = 1:length(ADC)
readADC(s,ADC(m));
end
pause(1/6.7)
90
%/ Sample each ADC at each point
for m = 1:avgpts
for n = 1:length(ADC)
offset-vals(n,m) = readADC(s,ADC(n));
end
95
pause(1/6.7);
end
for
m = 1:length(ADC)
of f set(k,1,m) = mean(of f setvas(m,:));
100
% Write each sampled value to file
% This will write length(ADC) rows per point.
105
% There will be xpts*ypts*length(ADC) rows total,
%4 as there will be a new row for each point.
fprintf (f id,'%s,' , strcat(' 6ffset ',ADC(m)));
fprintf (f id, '%10.18f,' of f set vals(M,:));
fprintf (f id,'\r\n );
74
end
110
% Take background measurenent between each point now! (changed
% 12/16) Store in back.
for j = 1:2^numsrc-1
115
%nyDaq.outputSingleScan (de2bi(2^(j-1).iiuinsrc))
myDaq.outputSingleScan (de2bi(j,numsrc))
backvals = zeros(length(ADC),avgpts);
120
% Flush ADCs before each point
for m = 1:length(ADC)
readADC(s,ADC(m));
end
pause(1/6.7)
125
% Sample each ADC at each point
for m = 1:avgpts
for n = 1:length(ADC)
back-vals(n,m) = readADC(s,ADC(n));
end
130
pause(1/6.7);
end
for m = 1:length(ADC)
background(k,1,m,j) = mean(back-vals(m,:));
135
% Write each sampled value to file
% This will write length(ADC) rows per point.
% There will be xpts*ypts*length(ADC) rows total.
% as there will be a new row for each point.
fprintf (f id, %s. ,strcat ('back',ADC(m)));
fprintf (f id, '%10.18f,',backvals(m,:));
fprintf (f id,'\r\n');
140
end
145
end
sound(back-beep, fs);
for d = 1:3
150
waitforbuttonpress;
V Take actual data measurement
for j = 1:(2^numsrc-1)
%AWrite source number out to corresponding DIO pins on NI-DAQ
%iuyDaq.outputSingleScan (de2bi(2^(j-1),nmunsrc())
155
myDaq.outputSingleScan (de2bi(j,numsrc))
75
% Press button before each point
% (Re)-Initialize sample array
160
pt-vals = zeros(length(ADC),avgpts);
% Flush ADCs before each point
for m = 1:length(ADC)
readADC(sADC(m));
165
end
pause(1/6.7)
% Sample each ADC at each point
for m = 1:avgpts
for n = 1:length(ADC)
pt-vals(n,m) = readADC(s,ADC(n));
end
170
pause(1/6.7);
end
175
180
for m = 1:length(ADC)
% Average the sanpled values for each point
response(k,1,m,j,d) = mean(pt vals(m,:)); %to do
%4 switched order of x and y for ease of use (changed 12/16).
%o Still have to change ImSeg code to adjust.
%, Write each sampled value to file
% This will write length(ADC) rows per point.
%o There will be xpts*ypts*length(ADC) rows total.
%A as there will be a new row for each point.
fprintf (f id,'%c, ,ADC(m));
185
fprintf (f id,'%(,10. 18f,, pt _vals~m:)
fprintf (f id,'\r\n');
end
190
%, Print separators
fprintf ( %s\n,repmat(sprintf('=),1,50));
fprintf ( %s\n',repmat(sprintf('='),1,50));
195
fprintf ('%s\n',repmat(sprintf(='),1,50));
fprintf ('%s\ii',repmat(sprintf('='),1,50));
fprintf ( "4s\n',repmat(sprintf('='),1,50));
%APlot first channel in figure
figure (1); cIf;
200
iinagesc(1:ypts,1:xpts,response (:,:,2,2,1)); %4todo
fprintf ( POINTX%1.f\n\n\n,1*k);
76
for i = 1:(length(ADC)-2)
205
fprintf ('Channel-%I.Of-aver age:-',i);
fprintf ('%f\n",response(k,1,i,2,d)); %Xtodo
end
% axis([1 pts -0.5 0.5]):
% axis([1 pts niean(iesponse(1,1:k))-10e-3 imean(response(1,.1:k))+10e-3]);
end
sound(point-beep, fs);
210
end
215
end
end
220
%%1/, Write final (averaged) respones to file
fprintf (f id, '%s\r\n', Response');
for k = 1:ypts
for 1 = 1:length(ADC)
fprintf (f id, 'X10.1Sf, , response(k,:,m));
fprintf (f id,' \r\11)
end
225
end
230
for i=1:ypts
for j=1:xpts
back(:,j+(i-1)*xpts) = reshape(background(i,j ,:,:),length(ADC)*(2 numsrc- 1),1);
respl(:,j+(i-1)*xpts)
reshape(response(i,j,:,:,1),1ength(ADC)*(2^numsrc-1),1); %to
(10
resp2(:,j+(i-1)*xpts) = reshape(response(i,j,:,:,2),length(ADC)*(2^numsrc-1),1);
resp3(:,j+(i-1)*xpts) = reshape(response(i,j,:,:,3),length(ADC)*(2^numsrc-1),1);
offtemp(:,j+(i-1)*xpts) = reshape(offset(i,j,:),length(ADC),1);
235
end
end
off = [off._temp' off temp' off-temp' off temp' off-temp' off-temp' off-temp']';
save('current.. mat',resp Y, 'back', ' off) %to do
240
myDaq.outputSingleScan ([0,0,0])
%% Close file and serial port
felose (f id);
245
250
stopasync(s);
fHose (s);
delete(s);
clear s;
% close all:
end
77
A.1.6
BMatrix.m
%o Inputs:
S( = delta base used
nx
%
N
number of pixels across in the x direction
number of pixels
/
5
%
% This function creates the influence matrix for the AMatrix-PM function
% with a specific delta and a maximum Euclidean distance between pixels of two.
10
function B = BMatrix(d,nx,N)
B = zeros(N,N);
15
for i=1:N
row = zeros(1,N);
row(1,i) = 1;
if (mod(i,nx) -= 1)
row(1,i-1) = d;
if (i > nx)
20
row(,i-1-nx) = d^(1/sqrt(2));
end
if (i <= (N-nx))
row(1,i-1+nx) = d^(1/sqrt(2));
end
25
end
if (mod(i,nx) ~= 0)
row(1,i+1) = d;
if (i > nx)
30
row(,i+1-nx) = d^(1/sqrt(2));
end
if (i <= (N-nx))
row(1,i+1+nx) = d^(1/sqrt(2));
end
end
35
if (i > nx)
row(1,i-nx) = d;
end
if (i <= (N-nx))
row(1,i+nx) = d;
end
40
%[1 d (1^2 0 0 0 0 0 0
0 0 0 0 0 (1 (sqrt
(2) ]:
B(i ,:) = row;
45
end
78
end
A.1.7
AMatrixPM.m
,
%
Example Usage:
[ANlb-pmnAVMv-pm,B-pnmdistrilpmI] =A\aitrixPM(lizi,pvcal,lackiizibackpvcalc,
%X
V,
testVector(:, pixel) -back -lizi(:,pixel),6,1,4,7);
(7
5
10
15
20
25
The input values are:
ANp = ADC*source-by-nx*ny occupancy sensitivity matrix, whose columns are made of
raw (or modified) data vectors
AM-m = ADC*source -by-nx*ny occupancy sensitivity natrix. whose columns are made of
raw (or modified) data vectors
(A,
back-p = ADC*source-by-nx*ny
backm = ADC*source-by-nx*ny
constant factor used in 11 and 12 regularization optimizations
(7, alpha
%7
lambda
ADC*source-by-1 measurement vector for unknown occupancy
nx
= number of pixels in the x-dimension (defined as left -to-right in
front of the sensing electrodes)
number of pixels in the y-dimension (defined as front-to-back in
(7, 1y
front of the sensing electrodes)
(7
(X ADC = number of ADC measurements taken (channels)
source = number of sources measurements taken: could be numlber of
V,
source places or
(7,
%7 The output values are:
(7 AMb
=ADC*source - by -nx*ny occupancy sensitivity matrix minus background
(% WM
= ADC*source-by-nx*ny weighted occupancy sensitivity
(7, B
= nx*nv-by-nx*ny influence matrix
(7% distribI = nx-by-ny pixel occupancies
(
distrib3 = nx-by-ny pixel occupancies
function [AM,WM,Bdistribl]
source)
AMatrixPM(AMp,AMm,backp,backm,alpha,ambda,nx,ny,ADC,
30
(7 # of grid pts
N = nx*ny; (7, 14*13 = 182
N2 = 2*N;
35
WM = zeros(source*ADC,N*2);
AM = [AM-p AM-m];
background = [back-p back-m];
AMb = AM - background;
40
for x = 1:N
79
WM (:, x)=AMb(:,x)/sqrt (sum(AMb(:,x). ^2)); % Equation 2
WM (:, x+N) = AMb(:,x+N)/sqrt(sum(AMb(:,x+N).^2));
end
45
%% Building the B influence matrix
dp = 0.001;
dm = 0.001;
50
dpm = 0;
B = zeros(2*N,2*N);
Bp = BMatrix(dp,nx,N);
Bm = BMatrix(dm,nx,N);
55
%Bpm = BMatrix(dpm,nx.N):
Bpm = zeros(N,N);
B(1:N,1: N) = Bp;
60
B(N+1:2*N,N+1:2*N) = Bm;
B(1:N,N+1:2*N) = Bpm;
B(N+1:2*N,1:N) = Bpm;
%% Sub-pixel code
65
p00 = -0.001581;
p1O = 0.0001897;
p01 = 0.006957;
p20 = -3.42e-05;
p11 = -0.001315;
70
p02
p30
p21
p12
p03
p40
p31
p22
p13
p04
=
=
=
=
=
=
=
=
=
=
p50
p41
p32
p23
p14
p05
= 1.637e-08;
= 4.00le-08;
= -3.434e-08;
= 5.044e-07;
= -1.737e-08;
= -5.848e-07;
75
80
85
-0.0005672;
1.216e-05;
4.652e-05;
0.0002608;
-0.0001756;
-1.048e-06;
2.971e-07;
-1.085e-05;
-1.135e-05;
2.087e-05;
f = zeros(2*nx,2*ny);
for x=0.5:0.5:nx
80
for y=0.5:0.5:ny
f(2*x,2*y) = p00 + p10*x + pOl*y + p20*x^2
90
+ pl1*x*y + p02*y^ 2 + p30*x^3 + p21*
x^2*y ...
+
p12*x*y^2 + p03*y^3 + p40*x^4 + p31*x^3*y + p22*x^2*y^2 ...
+ p13*x*y^3 + p04*y^4 + p50*x^5 + p41*x^4*y + p32*x^3*y^2 ...
+ p23*x^2*y^3 + p14*x*y^4 + pO 5 *y^5;
end
95
end
%X CVX code
100
c = alpha;
/ least norm
cvx-begin
variable distrib(N)
105
minimize(norm(distrib,1));
subject to
distrib >= 0;
AMb*distrib == lambda;
cvxend
110
% 11
cvx-begin
variable distribl(N)
115
minimize(norn(AMb*distribl -lambda,1));
subject to
distribi >= 0;
cvxend
120
% 11/11
cvx-begin
variable distrib2(N)
minimize(norm(AMb*distrib2-lambda,1)+c*norm(distrib2,1));
subject to
distrib2 >= 0;
125
cvxend
% 12/11
cvx-begin
variable distrib3(N)
130
minimize(norm(AMb*distrib3-lambda,2)+c*norm(distrib3, 1));
subject to
distrib3 >= 0;
cvxend
135
% 11/12
cvx-begin
81
variable distrib4(N)
minimize(norm(AMb*distrib4-lambda,1)+c*norrn(distrib4,2));
subject to
140
distrib4 >= 0;
cvxend
% entropy
cvx-begin
145
variable distrib5(182)
maximize(sum(entr(distrib5)))
subject to
1 >= distrib5 >= 0;
WM*distrib5 == lambda;
150
cvxend
%%) Plotting
% One figure is plotted here, but any number of the above solutions may be
% plotted by following the format below.
155
colormap(gray)
f ig = figure(1);
set (f ig, ' Position', [200 150 1000 400])
cm=flipud(gray);
160
colormap(cm)
subplot (1,2,1)
165
image(reshape(256*distrib1 (1:N)/max(distrib1),nx,ny)');
title ('Li/L1-Person*,'FontSize',14)
xlabel('X-directioni,'Font size',12)
ylabel ('Y-direction' , Fontsize' ,12)
%zlabel("Occupancy value," Fontsize '12)
set (gca,' XTick',[1 2 3 4])
170
set (gca,'YTick',[1 2 3 4])
v=get(gca,'XLin);
line ([1.5 1.5], v, 'Color',*k', *LineStyle','-')
line ([2.5 2.5], v, Color', 'k', 'LineStyle', -)
line ([3.5 3.5], v, 'Color', 'k', 'LinieStyle',-')
w=get(gca,'YLim');
180
line ([0.5
line ([0.5
line ([0.5
4.5],[1.5
1.5], w, 'Color',*k',
4.5],[2.5
4.5],[3.5
2.5], w, 'Color', *k', 'LineStyle',
3.5], w, 'Color','k', 'LineStyle',
"LineStyle*, ')
-'
)
175
-')
subplot (1,2,2)
image(reshape(256*distrib1 (N+1:N2)/max(distrib1),nx,ny)');
title ('L1/L- Metal','FontSize',14)
xlabel( X-direction' , 'Fontsize ,12)
ylabel("Y-direction', aFontsizei* ,12)
82
185
set(gca,'XTick',[1 2 3 4])
set(gcaYTick',[1 2 3 4])
line ([1.5
line ([2.5
'
4.5],[2.5
4.5],[3.5
1.5], w, 'Color', 'k', 'LineStyle', '2.5], w, 'Color', *k', 'LineStyle', ' 3.5], w, 'Color', 'k', 'LineStyle' ,
)
line ([0.5
line ([0.5
)
line ([3.5 3.5], v, 'Color','k', 'LineStyle',
w=get(gca,*YLim');
line ([0.5 4.5],[1.5
)
190
1.5], v, 'Color','k*, 'LineStyle',
2.5], v, 'Color', 'k', LineStyle',
)
v=get(gca,'XLhm');
195
end
ImSeg.m
A.1.8
%/ Input:
%c
VM = Weighted sensitivity matrix
noise
level
.
5
%, This function performns the inage segmentation algorithm on data with
% specified added noise to find the radius of resolved pixels for a given
function final-pixel = ImSeg2(WM)
10
N_in = 169;
meas = 12;
pixelorder =1N_i; % [1 2 ... N]
15
random = zeros(meas,5); %7 this can be changed to add different noise levels
Xrandomn = .05.*randn(mneas,5);
f inal-pixel = zeros(1,N-in);
for i=1:1
20
noise = random(:,i); %, Pick a noise vector
for j=1:Nin
iteration= j
W = WM; %Xnornalized sensitivity matrix by column data
25
N = N-in;
grid-size = 13;
quad-size = 8;
pixels = reshape(1:N,grid.size,grid.size); % [1 14 . .
%X2 15
30
%A.
stop = 0;
83
y =
W(:,j)+noise; % Add chosen noise vector to each pixel in data
35
x = W'*y; % Apply LBP equation
%figure(2)
%o grid = reshape(x.grid-size, gridsize
%imagesc(grid);
40
% Continue optimizing until incorrect quadrant found
while stop == 0
45
grid = reshape(x,grid-size,grid-size); %c Reshape LBP solution into 13x13 image
%figure(2):
%iiagesc(grid);
% Store the indices of our known pixel
j
[row,col] = ind2sub(size(pixels),find(pixels ==
j));
50
j is in => TEST THIS
quad-list = zeros(1,4);
if ((row <= quad-size) && (col <= quad-size))
% Store which quadrant(s) our known pixel
55
60
65
70
75
quad-list = quad-list 1 [1 0 0 0];
xstart = 1; % col
y-start = 1; % row
end
if ((row > grid-size-quad-size) && (col <= quad-size))
quad-list = quad-list 1 [0 1 0 0];
x-start = grid-size-quad-size+1;
y-start = 1;
end
if ((row <= quad-size) && (col > grid.size-quad-size))
quad-list = quad-list 1 [0 0 1 0];
xstart = 1;
y-start = grid-size-quad-size+1;
end
if ((row > grid-size-quad-size) && (col > grid-size-quad-size))
quad-list = quad-list 1 [0 0 0 1];
xstart = grid-size-quad-size+1;
y-start = grid-size-quad-size+1;
end
%7 Quadrant divisions
quadi = grid(1:quad-size,1:quad-size);
quad3 = grid(1:quad-size,(grid-size-quad-size+1):grid-size);
quad2 = grid(grid-size-quad-size+1:gridsize, 1:quad-size);
quad4 = grid (gridsize-quadsize+1:end,grid-size-quadsize+1:end);
84
sumvec = [sumn(sum ((quad1))) sum (suni((quad2))) sum(sum((quad3))) sum(sum((
quad4)))];
80
~ index] = max(sumnvec);
if size (find(sumnvec==max(sum-vec)),2) > 1 % To do: deal with 2 equal maxima
f inal-pixel(1,j) = size(pixels,1);
85
pixell = size(pixels,1);
stop = 1;
elseif quad-list(index)
1
f inal-pixel(1,j) = size(pixels,1);
size (pixels,1)
stop = 1;
90
else
pixels
-1);
95
pixels(x start:xstart+quadsize- 1,ystart:y-start+quad size
% Print for lists
x-quad = reshape(x,grid-size,grid-size);
x-quad = x-quad(x start:xstart+quadsize-
,y_start:y.start+quad-size
-1);
grid-size = quad-size;
quad-size = quad-size/2;
100
x = reshape(x-quad,grid-size^2,1);
if quadsize == 0.5
stop = 1;
end
105
end
end
end
110
end
final-pixel;
figure (3)
images(reshape(f inal-pixel,13,13)');
save ('LiageSeg2. mat','ranidomi');
end
A.2
Sensor Board Software
The software below can be compiled from a fresh installation of Ubuntu with the following commands.
sudo apt-get install build-essential subversion git gcc-avr avr-libc dfu-programmer
cd $HOME
svn checkout https://bucket.mit.edu/svn/StandaloneSensor/
mkdir $HOME/atmega32u4/
85
5 cd $HOME/atmega32u4/
git clone https://github.com/abcminiuser/luf a-lib.git
cd lufa-lib/
git checkout acd92983
cd $HOME/StandaloneSensor/Sensor\ and\ Code/code/FullyDiff/
The command
make
will compile the software. The command
make dfu
will program the ATmega32U4 microcontroller breakout board with the makefile included here. The
breakout board must be reset with the HWB button held down, in order to enter the bootloader,
and program the microcontroller.
A.2.1
FullyDiff8.c
Passive Scan: Fully Differential Standalone Sensor Code
MIT 01/2013
5
10
Lizi George
Rev. 1
Adapted from:
LUFA Library
Copyright (C) Dean Camera, 2012.
15
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
20
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
25
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
86
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
30
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and f itness. In no event shall the author be liable f or any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
35
40
*
*
/** \f ile
45
50
Main source file for the Fully Differential Standalone Sensor board.
This file contains the main resources for using the board:
- hardware configuration and initialization
- USB and virtual serial communication
#inldude "FullyDiff8.h"'
#include <stdlib.h>
/**
*
55
*
LUFA CDC Class driver interface configuration and state information. This structure
is
passed to all CDC Class driver functions, so that multiple instances of the same
class
within a device can be differentiated from one another.
USBClassInfo_CDCDevice_t FullyDiffCDCInterf ace =
{
.Conf ig
60
65
=
{
.ControlInterfaceNumber
=
.DataINEndpointNumber
.DataINEndpointSize
.DataINEndpointDoubleBank
= CDCTXEPNUM,
= CDCTXRXEPSIZE,
= false,
0,
.DataOUTEndpointNumber
= CDCRXEPNUM,
.DataOUTEndpointSize
= CDCTXRXEPSIZE,
.DataOUTEndpointDoubleBank = false,
70
.NotificationEndpointNumber = CDCNOTIFICATIONEPNUM,
.NotificationEndpointSize = CDCNOTIFICATIONEPSIZE,
.NotificationEndpointDoubleBank = false,
87
75
/** Standard file stream for the CDC interface when set up, so that the virtual CDC COM
*
80
port can be
used like any regular character stream in the C APIs
static FILE USBSerialStream;
/* Global Variables */
char ADCbuf[5];
//Array to consolidate ADC conversions
85
char lastPress = 0;
bool debugFlag = true;
//
90
Generic bad input message
char *ErrStr
BadlInput.\r\nf;
uint16_t sweep-count = 1;
uint8_t dds-chan = 0;
/**
95
*
Main program entry point. This routine contains the overall program flow, including
initial
setup of all components and the main program loop.
int main(void)
{
SetupHardware(;
100
/* Create a regular character stream for the interface so that it can be used
with the stdio.h functions */
CDCDeviceCreateStream(&FullyDif
f _CDCInterf ace,
&USBSerialStream);
//LEDs-SetAllLEDs(LEDMASKUSBNOTREADY);
105
seiO;
for (;;)
{
110
CheckPE2(;
/* Must throw away unused bytes from the host, or it will lock up while waiting
for the device */
uint16_t BytesReceived = CDCDeviceBytesReceived(&FullyDiff _CDCInterf ace
115
if (BytesReceived)
{
88
int16_t recByte
switch (recByte)
120
CDCDeviceReceiveByte(&FullyDiffCDCInterf ace);
{
case 'A':
//
ADC Command
{
int16_t ADCrec = 0;
125
if (debugFlag)
{
7/ Echo received command byte
CDCDeviceSendByte(&FullyDiff CDCInterface,
recByte);
CDCDeviceSendString(&FullyDiffCDCInterfacej ":\i\
ii");
}
130
//
Receive channel byte and check if valid
ADCrec = waitf orByte(;
135
// Select a single ADC
if (ADC-rec >= '0' && ADC-rec <= '7')
{
uint8_t chan = ADCrec-'0';
ADC-flushO;
ADCread(chan);
ADC-responseo; // Responds with 4 bytes
140
}
7/
145
Select all ADCs
else if (ADCrec == 'a' 11 ADCrec == 'A')
{
for (int i = 0; i < 7; i++)
{
ADC_flushO;
150
ADC-read(i);
ADC-response(;
//
Responds with 4*6=24 bytes
}
}
155
/7
(Re)Conf igure ADCn
else if (ADCrec == 'w')
{
/7
placeholder for writing to ADC
}
160
/7
Invalid input
else
89
reportError(;
}
165
break;
case 'd
{
170
int16_t DDS-rec = 0;
extern uint8_t ddschan;
DDSrec = waitforByte(;
if (checkHex(DDS-rec))
{
175
if (DDSrec == '1')
{
DDSConf ig(dds_chan,0x00 100000);
DDSConf ig(dds-chan+1,0x00100000);
}
180
else if (DDS.rec == '2')
{
DDSConf ig(dds_chan,0x00800000);
DDSConf ig(dds-chan+I1,0x00800000);
}
185
else if (DDS.rec
'3')
{
DDSConfig(ddschan,0x00100000); // set chan to 10.4
kHz
DDSConfig(dds-chan+1,0x00800000); // set chan to
83.3kHz
}
190
else if (DDS-rec == '4')
{
DDSConfig(ddschan,0x00010000); // set chan to 1.3kHz
DDSConfig(dds.chan+1,0x00100000); /7 set chan to
10.4kHz
}
195
else if (DDS-rec == '0')
{
DDSConf ig(dds-chan,0);
DDSConf ig(ddschan+1 ,0);
}
200
}
else
{
reportError(;
break;
205
}
90
7*
CDCDeviceSendByte(&FullyDif f _CDCInterf ace,DDS-rec);
CDCDeviceSendString(&FullyDif f _CDCInterf ace," r\\n");
210
}
break;
215
7s7
case
sweep frequencies
{
0x17;
77 16E6/(2*8*(1+23))
41.6kHz
OCR1A = sweep-count; // 16E6/(2*2*96)
41.6kHz
OCR4C = sweep-count++; // 16E6/(2*192)
41.6kHz (SOURCE)
OCR4B = OCR4C/2; // set PWM to 50%
//delay.ms(10);
OCROA =
220
}
break;
225
case 'f ':
{
uint8_t list[]
for (uint8_t i
{0,0,0,0};
0; i < 4; i++)
{
230
uint8_t f req
waitf orByte();
if (freq >= '0' && freq <= '9')
list[i] = freq - '0';
else
235
list[i] = freq - 55;
}
OCR1A = (list[0] << 12) + (list[1] << 8) + (list[2] << 4) + list[3];
}
break;
240
case p
{
int16_t pwm-rec = 0;
245
pwmnrec = waitforByteO;
if (checkHex(pwm-rec))
{
if (pwm-rec == '1')
{
250
/7
Set PWM chans to 41.6kHz
OCROA = Ox17;
/7
OCR1A = 0x0060; 77
OCR4C = OxCO;
77
OCR4B = OCR4C/2; 77
16E6/(2*8*(1+23))
= 41.6kHz
16E6/(2*2*96) = 41.6kHz
16E6/(2*192) - 41.6kHz (SOURCE)
set PWM to 50%
i
255
else if (pwmrec =='2')
91
77
Set PWM chans to 333kHz
{
OCROA
OCR1A
OCR4C
OCR4B
260
0x02;
OxOOOC;
0x18;
OCR4C/2;
//
/7
/7
//
16E6/(2*8*(3)) = 333.3kHz
16E6/(2*2*12)
333.3kHz
16E6/(2*24) = 333.3kHz (SOURCE)
set PWM to 50%
}
else if (pwm-rec == '3') // PWM1: 41.6kHz, PWM2: 333kHz
{
OCROA
OCR1A
OCR4C
OCR4B
265
0x02;
/7 333.3kHz
0x0060; /7 41.6kHz
0x18;
OCR4C/2;
7/ 16E6/(2*24)
7/ set PWM to
= 333.3kHz (SOURCE)
50%
I
else if (pwm-rec == '4')
270
//
PWM1: 5.208kHz, PWM2: 41.6kHz
{
OCROA
OCR1A
OCR4C
OCR4B
275
= 0x17;
= 0x1800;
= OxCO;
= OCR4C/2;
/7 41.6kHz
/7
5.208kHz
/7
16E6/(2*192) = 41.6kHz (SOURCE)
set PWM to 50%
/7
}
}
else
{
reportError(;
break;
280
}
}
break;
}
}
285
else if (BytesReceived > 1)
{
char recBytes[BytesReceived+1];
290
for (int i = 0; i < BytesReceived; i++)
{
recBytes[i] = CDCDeviceReceiveByte(&FullyDiff _CDCInterface);
I
295
CDCDeviceSendString(&FullyDif f _CDCInterf ace,recBytes);
}
CDCDeviceUSBTask(&FullyDif f _CDCInterf ace);
USBUSBTask(;
}
300
void delay-ms(uint8_t count)
{
92
while (count--)
305
{
_delay-ms(1);
}
I
310
bool checkHex(int16_.t data)
{
if (data >= '0' && data <= '9')
{
return true;
315
}
else if (data >= 'a'
&& data <= 'f')
{
return true;
}
320
else if (data >= 'A' && data <= 'F')
{
return true;
}
else
return false;
325
I
void reportError(void)
{
330
debugCheck(;
//Clear
CDC buffer and exit if
input not valid
CDCDeviceFlush(&FullyDif f _CDCInterf ace);
CDCDeviceSendString(&FullyDif f _CDCInterf ace,ErrStr);
335
}
int16_t waitforByte(void)
{
/7Wait
f or an incoming byte
while (!(CDCDeviceBytesReceived(&FullyDiff _CDCInterf ace))) {continue;}
340
// Receive incoming byte
return CDCDeviceReceiveByte(&FullyDiff _CDCInterf ace);
345
}
/* Configures the board hardware and chip peripherals */
void SetupHardware(void)
{
350
/* Disable watchdog if enabled by bootloader/fuses
MCUSR &= ~(1 << WDRF);
93
*7
wdtdisableo;
MCUCR = (1 << JTD);
MCUCR = (1 << JTD);
355
/* Disable clock division */
clock-prescale-set(clock-div_1);
/* Hardware Initialization
//LEDsInit(;
360
*7
USBInitO;
SPIInito;
/* Set up pin direction for button *7
DDRE &= ~(1 << PE2);
365
DDRE &= ~(1 << PE6);
PORTE 1= (1 << PE2) I (1 << PE6);
/* Set up pin directions for CS and disable all chips
DDRD = 0xFF;
PORTD = 0xFF;
DDRF 1= (1 << PFO) I (1 << PF1);
PORTF 1= (1 << PFO) | (1 << PF1);
370
/* Set up PWM for chopper channels *7
375
PWMInit();
DDSInitO;
/* Set up PWM on Status LEDs
380
*/
LEDsPWMInit(;
/*
Set up Debug Mode
*7
DDRF &= ~(1 << PF7);
PORTF 1= (1 << PF7);
385
debugCheck(;
}
/* Set up PWM pins on board */
390
void PWMInit(void)
{
/* Set up directions for PWM pins */
395
DDRB 1= (1<<PB6) I (1<<PB5);
//DDRB &= ~(1<<PB5); // tri-stating
DDRC 1= (1<<PC6);
PB5
/* Set up PWM for 8-bit TCO
OCOA on PB7 connected, toggle on compare match
WGM = 1 (0b010), TOP=OCRA0
94
*7
400
405
410
Prescaler: CLK/8
TCCROA = ObO1000010;
TCCROB = ObOO000010; */
/* No prescaler: 0x00
8MHz, OxFF = 31.2kHz
* CLK/8:
OxOO
1MHz, OxFF = 3.94kHz
* CLK/8:
0x02 333kHz, 0x18 = 40kHz
* CLK/8:
0x17 41.6kHz
TCCROA
0;
TCCROA
(1<<WGM01);
TCCROB
(1<<CS01);
OCROA = 0x02;
TCCROA 1= (1<<COMOA);
/* Set up PWM for 16-bit TC1, OClA on PB5
Use frequency and phase correct mode:
- Mode: Toggle OClA on compare match (OC1x disconnected)
- WGM: Mode 9 (1001)
- Prescaler:CLK/1(none)
- TCCR1A = ObO1000001;
420
425
- TCCR1B = ObOO010001; */
/* OCR1A: 400kHz = OxOA, 333.33kHz = OxOC, 40kHz
0x64, 41.6kHz
// Chan: 40kHz
TCCR1A = 0;
TCCR1A = (1<<WGM10)1(1<<COMAO)1(1<<COMBO);
TCCR1B = (1<<WGM13)j(1<<CS10);
OCR1A = 0x0060;
OCR1B = OxOC;
430
/*
Set up PWM for 10-bit TC4, OC4B on PB6
Use frequency and phase correct mode:
- Mode:
- WGM:
- Prescaler:CLK/1(none)
ObOO100000
TCCR4B = ObOO000001
TCCR4C = ObOO100000
- TCCR4A =
435
-
*/
/* OCR4C (TOP): 400kHz = 0x14, 40kHz = OxC8,
- TCCR4D = ObOO000001
440
77
445
OCR4C (TOP): 333.33kHz = 0x18, 41.6kHz = OxCO,
OCR4B (MATCH): 50% Duty Cycle = OCR4C/2 */
Chan: 400kHz
TCCR4A
(1<<COM4B1) (1<<PWM4B); //Enable PWM on OC4B
TCCR4A
(1<<COM4A1)j(1<<PWM4A); //Enable PWM on OC4B
TCCR4B 1= (1<<CS40);
95
0x60
*
415
//TCCR4C = (1<<COM4BS);
TCCR4D 1= (1<<WGM40);
OCR4C = 0x18;
OCR4B = OxOC;
OCR4A = 0xOC;
450
/* Set up PWM f or 4MHz DDS clock on TC3,
455
* Using OC3A on PC6 CTC mode,
* OCR3A: 0x01 = 4MHz, Ox02 = 2.67MHz,
* THIS IS FOR THE DDS CLK!
Ox18
320kHz
*/
460
TCCR3A = 0;
TCCR3B = (1<<WGM32)I(1<<CS30);
OCR3A = 0x02;
TCCR3A 1= (1<<COM3AO);
465
}
void SPIInit(void)
{
/* Set up SPI Data Directions:
470
!SS (PBO): output
- MOSI (PB1): output
- SCK (PB2): output
-
- MISO (PB3): input
explicitly set !SS as output to ensure SPI configuration
//DDRSPI = (1<<DDMOSI)j(1<<DDSCK);
DDRB = ((1 << PBO) I (1 << PB1) I (1 << PB2));
PORTB 1= (1 << PBO);
PORTB &= ~(1 << PB5); /7
475
480
/* Enable SPI as Master with clock rate f ck/16
Transmit MSB f irst (DORD=0), SCK low when idle (CPOL=0)
Sample data on trailing (falling) edge (CPHA=1) *7
//SPCR = (1<<SPE)1(1<<MSRT)1(1<<CPHA)1(1<<SPRO);
SPCR = 0b01010101;
485
}
uint8_t SPItransmit(uint8_t data)
{
490
/* Send data
SPDR = data;
*/
/* Wait for transmission complete
while (!(SPSR & (1<<SPIF)));
*/
495
96
*7
/*Return received byte */
return SPDR;
}
500
void ADCread(uint8_t chan)
{
/* Sample data on trailing edge (CPHA=1)
May need to reconfigure sample edge depending on how MOSI data works
//SPCR = ObO1010101;
SPCR = ObO1011101;
505
/* Chip Select Enable *7
PORTD &= ~(1 << chan);
/* Send dummy bytes over SPI and read back 4 byte conversion
for (int i = 0; i < 4; i++)
510
{
ADC-buf [i] = SPI-transmit (OxOO);
}
515
/* Chip Select Disable *7
PORTD 1= (1 << chan);
}
520
void ADC_flush(void)
{
/* Clear ADC temp bytes and buffer*/
for (int i = 0; i < 4; i++)
{
ADCbuf [i] = 0;
525
}
void DDSSet(uint8_t chan, uint16_t data)
530
{
unsigned char dataH = (data >> 8);
unsigned char dataL = (data & OxFF);
/* Shift data on FALLING edge of SCK
535
SCK idles HIGH when FSYNC/CS goes low (mode 3)
SPCR = ObO1011001;
/* Chip Select Enable *7
PORTF &= ~(1 << chan);
540
/* Send DDS setup data (no data to read back) *7
SPI_transmit(dataH);
SPI_transmit(dataL);
97
*/
*/
*7
/* Chip Select Disable *7
545
PORTF 1= (1 << chan);
}
void DDSFreq(uint8_t en, uint16_t reg, uint32_t freg)
{
/*
*
550
* freg is the 28 bit result of the following:
* freg = (fout/fmclk)*2^28
555
*/
reg =(reg
560
+ 1) & 0x03;
uint16_t fregL = (reg << 14)
uint16_t fregH = (reg << 14)
(Ox3FFF & freg);
(Ox3FFF & (freg >> 14));
DDSSet (en,fregL);
DDSSet(en,fregH);
565
//DDSSet (en,0x4000);
//DDSSet (en,0x4040);
}
570
void DDSPhase(uint8_t en, uint16_t reg, uint16_t preg)
{
7*
* The phase registers are written to with a 16-bit word.
* D15 and D14 are always 1, D13 selects PHASEO or PHASE1
* registers. D12 doesn't matter. The remaining 12 bits
575
*
* are preg.
* preg is the 12 bit result of the following:
* preg = (phase-shift*2^12)/(2*pi)
*/
580
reg = (reg & Ox0l) << 13; // picking PHASE1 register
preg = (3 << 14) 1 reg I (OxOFFF & preg); // writing "preg" to a phase register
585
DDSSet(en,preg);
}
/* Configures DDS with a 10kHz and 100kHz sine wave on Ch. A and B
void DDSInit(void)
590
{
98
*7
DDSSet(PFO,
//
Ox2100);
Reset first
DDS, set for loading a complete word into
either frequency register (B28 bit
DDSSet(PF1,
/*
Write to frequency register (Fout,Fin):
* Fmclk
595
of control register)
0x2100);
320kHz:
10kHz
0x00800000,
*
*
* Fmclk
2.67MHz:
10.416kHz
OxOO100000,
83.3kHz
0x00800000,
125kHz
Ox00CO0000,
*
600
*
*
*
* (~10khz, 4MHz) = OxOOOA3D70, (~100kHz, 4MHz) = 0x00666666
* (~1OkHz, 5MHz) = 0x00083126, (~100kHz, 5MHz) = 0xOO51EB85
*/
605
DDS_Freq(PF0,0,0x00800000);
*7
/* Write PHASEO Reg
DDSPhase(PFO,0,0);
//
DDSPhase(PF1,0,0);
610
just added to synchronous the phase of second channel on
startup
/*
Exit Reset and Begin Output
DDSSet(PFO,
DDSSet(PF1,
615
*7
0x2000);
0x2000);
}
void DDSConf ig(uint8_t chan, uint32_t f req)
{
DDSSet(chan,0x2000);
//
take this out
--
no need to reset, making unnecessary offset
DDSFreq(chan,0,freq);
DDSPhase(chan,0,0);
620
//DDSSet(chan,0x2000); //take
this out --
redundant
}
625
void debugCheck(void)
{
uint8_t PF7Stat = (PINF & (1 << PF7));
if (!PF7Stat)
630
{
debugFlag = true;
I
else
debugFlag =
635
false;
}
99
void CheckPE2(void)
{
uint8_t PE2Stat = (PINE & (1 << PE2));
char* ReportString = NULL;
static bool ActionSent = false;
640
if (!PE2Stat)
{
645
ADCflushO;
ADCread(1);
ReportString = "ButtoinDowi\r\n";
}
650
else
ActionSent = false;
if ((ReportString != NULL) &&
(ActionSent
false))
{
ActionSent = true;
655
CDCDeviceSendString(&FullyDiffCDCInterf ace, ReportString);
ADCresponse(;
660
}
}
void ADCresponse(void)
{
char ADC-chars[5];
665
//
//
There are two methods for sending data over serial:
Method 1: Using the CDCInterf ace
for (int i = 0; i < 4; i++)
{
670
sprintf (ADC-chars,j%02X",ADC-buf [i]);
CDCDeviceSendString(&FullyDiffCDCInterf ace, ADCchars);
}
CDCDeviceSendString(&FullyDiff _CDCInterf ace," \r\n");
//
675
Method 2: Using the USBSerialStream
/*for (int i = 0; i < 4; i++)
{
f printf (&USBSerialStream,"%XX",ADCbuf [i]);
}
CDCDeviceSendString(&FullyDif f _CDCInterf ace," \r\n);*/
680
}
/** Event handler for the library USB Connection event. */
void EVENTUSBDeviceConnect(void)
100
685
{
//LEDsSetAllLEDs(LEDMASKUSBENUMERATING);
LEDsSetBrightness(LEDSBLULOW);
}
690
/** Event handler for the library USB Disconnection event.
*/
void EVENTUSBDeviceDisconnect(void)
{
//LEDs_SetAllLEDs(LEDMASKUSBNOTREADY);
LEDsSetBrightness(LEDSBLUHALF);
695
}
/**
Event handler for the library USB Configuration Changed event.
*7
void EVENTUSBDeviceConf igurationChanged(void)
{
700
bool Conf igSuccess = true;
Conf igSuccess &= CDCDeviceConfigureEndpoints(&FullyDiff _CDCInterf ace);
//LEDs _SetAllLEDs(ConfigSuccess ? LEDMASKUSBREADY : LEDMASKUSBERROR);
LEDsSetBrightness(LEDS BLUConf igSuccess ? LOW : HIGH);
705
I
/** Event handler for the library USB Control Request reception event.
void EVENTUSBDeviceControlRequest(void)
710
{
CDCDevice_ProcessControlRequest (&FullyDif f _CDCInterf ace);
I
101
*/
102
Appendix B
Schematics and Boards
103
High Voltage Signal Source
Full Schematic
B.1.1
<[
-
-0
-- ---
w
-
-
B.1
:
U
T2
T
0
0)
0 M
CU)
--l-- -r
Oj
C4
--
42
>1
to)
Ln
0 -4
ru D
C -C
(U ON
>N
0)
oo
)
j>-i a 0
M,
DH
AI
Hh
4-44
In
0)
0
z
U-)
C
LI
9/3/12 11:32 PM f=0.92 /home/bjthom28/Projects/StandaloneSensor/Sensor and Code/pcband schematic/HVrev2/HVrev2.:
104
C)
Se
INI
CD
3
r
CA
0
0
1
2
CB5
IC4
------------a,
9
CB4
01
PS
...........
..................
....................
-15V
IN2
66
......... .......
2
10
0
7
0
........... ...... ... ...
.....
..... = 4
P6
+35U
....................
. .................
z
.....
15V
P2
0
CD
IC6::
0
13
GAIN3
0
0
"ON3
........
0
...........
........ ..........
0
U
a)
Ln
...................................................................................................
High Voltage Source Board
Standalone Sensor
:,:BJ Thompson
+50V :-,5::
MIT 02/2012
Pev. I
.............
............................................................
.........................................................
.........................................................................o.............................
0
0
0
+15
11
Q.
c8i
01
........... ... ........................
... ...................
.......... ....
C 2
10
0
0
0
CON2
CONI
0
:7
U)
CD
U)
Q
:3
CD
0)
0
CL
0
3
r%)
00
0
=r
0
3
Ln
W
N)
(A)
7
B.1.3
Qty
Bill of Materials
1
8
1
1
1
13
Value
15mH
DIODE-DO-214AC
10
Jumper
Terminal
.lu
2
2
1
6
2
1
1
1
2
8
1
1
2
2
2
2
4
1
4
4
2
6
.1uF
iM
1k
lu
luF
2.2uF
10
10k
10k
lou
22uF
50
50k
317T
330pF
337T
OP27P
OPA452/3S
R1
R2
BNC
TPT-SMD
Parts
Li
Dl, D2, D3, D4, D5, D6, D7, D8
ROPTI
SJ2
PWR
CB1, CB2, CB3, CB4, CB5, CB6, CB7, CB8, CB9, CB10, CB11,
CB12, CB13
CT3, CT5
R1, R16
R14
C3, C7, CIO, C13, CB14, CB15
CT2, CT6
CT4
R5
RP1
R2, R17
C2, C4, C5, C6, C8, C9, C11, C12
CT1
R15
R3, R4
IC4, IC6
CCl, CC2
IC5, IC7
ICd, IC2, IC8, IC9
IC3
R7, R9, R10, R12
R6, R8, R11, R13
CON1, CON2
GAIN2, GAIN3, HVDIV, IN1, IN2, OP2
106
CMP
(
)
Pequired 'ifF/4pF = 2.5 x 10-4
min. resolution
/ < background cap. to drive electrode
both coax lengths for both channels for best phase matching
Match
-
-
:33
-
2
Both shields grounded, no ground loop if cables tuisted and pairs of jacks in close proximity
_L
L
-
E Notes:
C
B
A
1
ffi.
6
7/15/12 10:28 PM
Date: 7/15/12 1S:2B PM
Date:
Sheet:
Sheet:
1/1
1/1
Document Author(s): Al-Thaddeus Avestruz PEU:
BJ Thompson
2-Mica
File: diff-platesmica
Title: Sense Electrode (1 of 2)
Fully Differential Standalone Sensor
-Th
5
1
!E
D
C
B
A
(D
Ow
e+
C)
CI)
C
CD
Ct2
PCB Layout
.
...............
..
9/3/12 05 PM f=1.04 /homelbjthom28/Projects/StandaloneSensor/Sensor and Code/pcb-and-schematic/diff-a/diff plate-
108
0
0
W
.
9/3/12 11:05 PM
f=3.51
/home/bjthom28/Projects/Standalone_Sensor/Sensor and Code/pob and schematic/diff_aI/diffplate_
109
Bill of Materials
Qty
5
2
2
1
1
1
3
1
1
1
1
2
1
Value
.lu
.01u
lu
10, 1%
10k, .01%
22-23-2031
51, .05%
500, .05%
ADA4817-1
LT1806
MICA
MMXC-CUT
SMA-ONLY
Parts
CB3, CB4, CB6, CB7, CB9
CB5, CB8
CB1, CB2
R5
R1
PWR
R3, R4, R6
R2
ICd
IC2
C1
CON1, CON2
DRIVE
110
-
-
(
CMrP Pequired 'lfF/pF = 2.5 x 10-min. resolution ) / ( background cap. to drive electrode>
both coax lengths for both channels for best phase matching
Match
-
3
Both shields grounded, no ground loop if cables tuisted and pairs of jacks
C
-A
TA[
J_____
-
E Notes:
D
C
B
A
2
in
close proximity
F
5
5
i
---0
I
-;
6
Date: 7/15/12 10:28 PM
Date: 7/15/12 10:28 PM
Sheet:
Sheet:
1/1
I/I
Document Author(s): Al-Thaddeus Avestruz PEU:2
BJ Thompson
File: diBfplate
Title: Sense Electrode (1 of 2)
Fully Differential Standalone Sensor
___-
j _ _
................
...
..
.
44
E
D
C
B
A
e+
Ci2
C
PCB Layout
-
.........................................................
.................
:-- 7I...........
.............
.....................
I
I.............................................
..........................
a
0
0
0
0
0
0
0
0
0
0
o
o
0
0
o
o
0
o
0
0
.....................
0
0
........................................
0
0
o
0
0
0
0
............................................ ......................... ....................................... ...................... .................... .....................
C
R
9/3/12 10:58 PM f=1.04 /home/bjthom28/Projects/Standalone-Sensor/Sensor and Code/pcb-and-schematic/diff-al/diff plate.1
112
0
o9
*
0
0
03
*
u.
L&~
*
(A
CL.
9/3/12 11:04 PM f=4.22 /home/bjthom28/Projects/StandaloneSensor/Sensor and Code/pob and schematic/diff-aI/diff-plate.
113
Bill of Materials
Qty
Value
Parts
5
2
1
2
1
1
1
3
2
1
1
1
2
1
.lu
.01u
.01u, 1%
lu
10, 1%
10k, .01%
22-23-2031
51, .05%
220p, 1%
500, .05%
ADA4817-1
LT1806
MMXC-CUT
SMA-ONLY
CB3, CB4, CB6, CB7, CB9
CB5, CB8
C3
CB1, CB2
R5
R1
PWR
R3, R4, R6
C1, C2
R2
ICd
IC2
CONI, CON2
DRIVE
114
B.3
B.3.1
Sensor Signal Conditioning
Full Schematic
115
E Notes:
C
B
A
1
I
_
_
0-
z2
27+,
I74
--
3
---
-- -----
4
-4
-t
.1 .
6
6
Date: 11/19/2013 4:51:29 PM
I-PEU:1
Sheet: 1/12
Al-Thaddeus Avestruz
Document Author(s): BJ Thompson, Lizi G
File: diff sensor_8
Title: Fully Differential Front End
Standalone Sensor
-AI-
5
5
IE
110
B
.J
E
B
A
Notes:
1
-----------
1~
2
2
AN3
4y
HN+
3
_3 ......--------4
4
-~
I-;L
__j_
_6_
Date: 11/19/2013 4:51:29 PM
Sheet: 2/12
Document Author(s): BJ Thompson, Lizi 6 PEU: 1
Al-Thaddeus Avestruz
File: diff-sensor_8
Title:FulLj Differential Front End
Standalone Sensor
7
H;
5
E
D
C
B
A
......
E
D
C
A
Notes:
1
1
- --
-L--__ ._.__..22
...........................
.....
...
...
+
3
--
wv
------
w---
--
LP
_ _ 1 _ ..
_ _..
_...
__.
.44 _
Date: 11/19/2013 4:51:29 PM
Date: 11/19/2013 4:51:29 P11
|Sheet:
Sheet:
3/12
3/12
Document Author(s): BJ Thompson, Lizi G REU:1
Al-Thaddeus Avestruz
File: diff-sensor_8
Title: Chopper and IAmp (1, 2)
Standalone Sensor
v -
3
6
6
I
E
C
B
A
E
B
Notes:
A
C~~~~
NCN
sii
.AA
I
-J
AI}F
w
Vw-
D
3
Document Author(s): BJ Thompson, Lizi 6 JPEU: 1Al-Thaddeus Avestruz
4/12
M
,Sheet:
4
Date: 11 / 1 9/
File: difL. sensor-8
Title: Chopper and lAmp (3, 4)
Standalone Sensor
wV---
-+i
ID
B
E
D
B
A
Notes:
'c
......
......
1
27
T
P8;
2
___J_
- - --- --- -
2
S
N
t
i
01
4A
__ _
47h
-:Y
%
4
0L--IK
16
3
N
A N
ik.
PI
iW
|
6
___
iDate: 11/19/2013 4:51:29 PM
|Sheet:
5/12
Document Author(s):BJ Thompson, LiziG IPEU: I
Al-Thaddeus Avestruz
File: diff-sensor-8
Title: Chopper and IAmp (3, 4)
Standalone Sensor
p
5
E
01
C
B
A
B
A----------
L,
W
E--AVVA
-~
-- ---- ---
+-
---
-- - 2
L2
.
-oum
LF1-
..
-
1
--
......
6
Dae
11/01
:12
M
he:61
T-leChperanOAm
HL
Stnaln Senso
Note-- Fie
AIffsnso8
--Tompon,-izi--P--:n Auhr-)
A--Thadd-us-A----r-
IE
5.... ___ _
claueet
lB
A....
D
C
B
A
......
......
..
....
............
.
Notes:
1
IT
22
NA
44
---~ ~ -----
33
.1
4
4
-a
_ i_
2
GNO N
___
6
6_ _
_____
IDate: 11/19/2013 4:51:29 PM
Date: 11/19/2013 4:51:29 P11
ISheet:
7/12
Sheet: 7/12
Document Author(s): BJ Thompson, Lizi G PEV:1
Al-Thaddeus Avestruz
File: diifsensor-8
-4)
Standalone Sensor
Title: ADC (4 o
ATT
5
5
E
!D
C
B
A
L~Q
E Notes:
C
B
11
,I-
I-
ND
2
2
nT
A
N
~ i
-
I-- --
M
1>L
NII
r
T
------
t
G-N-
-F ;
6
6
Date: 11/19/2013 4:51:29 PM
ISheet:
8/12
Lz1PEU:1I
Al-Thaddeus Avestruz]
Document Author(s): BJ Thompson,
File: diff-sensor_
Standalone Sensor
Title: ADC (4 of 4)
IIo a
I
5
b
E
ID
B
A
i1
E
B
........
........
4f
22
'50%
duty cycle
10/20 kHz Chop:
P74 = inf, P 5 = 0, PP5 = 250k, lou ppm high stability
100kHz Chop:
P74 = 976, P75 = 102, PP5 = 250k, lou ppm high stability
Notes:
11
33
- -R
I-1
50%
----
2f,
-
duty
c---
777
GNE
f,
duty cycle
duty cycle
6
6__
1__
JDate:
11/19/2013 4:51:29 PM
ISheet:
Document Author(s): BJ Thompson, Lizi G
Al-Thaddeus Avestruz
----------- ---------------
File: diff-sensor_8
50%
f, 50%
Title: Clock Drive 10kHz
Standalone Sensor
ycle
I
9/12
-
iREU:
E
D
!B
A
.........
.
NJD
-Z
10/20 kHz Choh
P74 = inf, P 5
100kHz Chop:
P74 = 976, P75
E Notes:
C
A
1
I
=
=,
259k,
59% duty
lou ppm high stabilitj
2
102, PP5 = 250k, lou ppm high stabilty
PP5
6--.
II
cycle
'0
a2f,
3
3
50% duty
44
X
>
t
C,
cycle
6
6
Date: 11/19/2013 4:51:29 PM
-
REV:1
Sheet: 10/12
Al-Thaddeus Avestruz
Document Author(s): BJ Thompson, Lizi S
File: diff-sensor-8
50% duty
-L
f , 50% duty cycle
,
Title: Clock Drive 100kHz
Standalone Sensor
cle
5
5
E
ID
l8
E
D
B
Notes:
1
Tl
L1F
_I
F;
C3
NO
-
L.0
---
F41
2
1
3
-
1-1
J
D
/
A
613-
P,
C2
-C
GO
--2 ---
-4
,I 2E
Z7
FcK/T
5'
'/TO
BD~
tD/ n-C ZnM
--
::'
Microcontroller
P
D
4'3
' --
6
Date: 11/19/2013 4:51:29 PM
PEU: i
Sheet: 11/12
Al-Thaddeus Avestruz
Document Author(s): BJ Thompson, Lizi G
Breakout (ATMEGA32U4)
Digital Synthesizer
Standalone Sensor
File: diffsensor_8
Title:
--- 4-------------
PL
USCK
F';
P STS
F--
6
E
D
C
B
......
E Notes:
D
C
B
A
1_
__
22
I-L
33
I-1
AND
AeD
U.
Test Points
AI-
AN
Ji %Tr
N7
9
MD-
T3
44
I
._NA+
_EN
. .....
Spectrum Analyzer Header Connections
C'
6
r-
Uoltage Peference and Pegulators
11
J
_6 _ _
LLT
r
6
DB;fB5+L
T- -
1
Date: 11/19/2013 4:51:29 PM
Sheet: 12/12
Document Author(s): BJ Thompson, Lizi G IPEU:1
Al-Thaddeus Avestruz
File: diff-sensor_8
Title: Uoltage Pegulators and Peference
Standalone Sensor
5
5
E
D
C
B
A
IN2-
Spe
=A
L
0-6
P
P.
.......................
C-ND
Ln
.....
........ *
Ch 1,2
+
+
C h 31
0
C',
0
G
H
Sense Input
Test Points
This Pou
Fully Differential Siandalone Sensor
BT Thompson
MIT 11/20133
Pev. 3
F ) Avestruz
7
7
....... .......... '....'.'...'.'....'....'....: ......
7
0
7
in-
................
........
ti
6
......
...............
.................
7"
................. --------------
6w6
....
9 w
......
........
77
......
............................... ......................................
.............................. ......
-15V.. ...... ...
......
GNO
+15V
...............
..................
.........
............................
77 - 7................
7
................................................................................................. ................................................... .................................... ....... ........................................................................ I ...........
B.3.3
Bill of Materials
Qty
Value
6
10k Pot
18
Gain Adj.
1
5 MHz
6
Jumpers
Parts
RPI, RP2, RP3, RP4, RP6, RP7
R22, R23, R36, R37, R50, R51, R64, R65, R74, R75, R94, R95, R108, R109,
R114, R115, R116, R117
Xi
SJ1, SJ2, SJ3, SJ4, SJ5, SJ6
C76, C78, C80, CB1, CB2, CB4, CB5, CB7, CB8, CB10, CB11, CB13, CB14,
CB16, CB17, CB18, CB19, CB20, CB21, CB23, CB24, CB25, CB26, CB27,
63
.lu
CB28, CB30, CB31, CB32, CB33, CB34, CB35, CB337, CB338, CB39, CB40,
CB45, CB46, CB47, CB58, CB59, CB60, CB361, CB63, CB64, CB65, CB66,
CB67, CB68, CB70, CB71, CB72, CB73, CB76, CB77, CB78, CB79, CB80,
CB81, CB87, CB89, CB90, CB92, CB93
8
.Au
24
.lu, PPS
C4, C5, C10, Ci1, C16, C17, C22, C23, C29, C31, C34, C36, C39, C41, C44,
C46, C52, C53, C58, C59, C65, C67, C70, C72
14
.01u
C77, C79, CB3, CB6, CB9, CB12, CB15, CB22, CB29, CB36, CB62, CB69,
CB88, CB91
24
.01u, 1%
C6, C7, C8, C9, C12, C13, C14, C15, C18, C19, C20, C21, C24, C25, C26, C27,
C54, C55, C56, C57, C60, C61, C62, C63
12
.01u, 2%
C28, C30, C33, C35, C38, C40, C43, C45, C64, C66, C69, C71
1
iM
2
1N4148S
4
1k
R76, R77, R78, R79
21
lu
C32, C37, C42, C47, C48, C49, C50, C51, C68, C73, C74, C75, CB41, CB42,
CB48, CB50, CB51, CB52, CB53, CB55, CB56, CB84
R7
D3, D4
CB43, CB44, CB49, CB74, CB75, CB82, CB85
2
10k, .01%
R1, R2
R14, R15, R16, R17, R18, R19, R20, R21, R28, R29, R30, R31, R32, R33, R34,
R35, R42, R43, R44, R45, R46, R47, R48, R49, R56, R57, R58, R59, R60, R61,
60
10k, 1%
R62, R63, 1166, R67, R68, R69, R70, 1171, R72, R73, R86, R87, R88, R89, R90,
R91, R92, R93, RiOC, R101, R102, R103, R104, R105, R106, R107, R11O, R111,
R112, R113
1
10n, 1%
1
22-23-2031
C3
PWR
129
4
30, .1%
2
33u
CB54, CB57
2
33u
CB83, CB86
2
34, .1%
R81, R119
14
50, .1%
R3, R5, RIO, R12, R24, R26, R38, R40, R52, R54, R82, R84, R96, R98
2
51, .05%
R8, R9
6
74VHC74
IC22, IC23, IC37, IC38, IC40, IC41
1
loop, 1%
C2
2
110, .1%
R80, R118
1
180p, 1%
Ci
3
250k
10
500, .05%
1
7805
IC26
1
7905
IC27
7
AD8138
IC, IC5, 1C8, ICl, IC14, IC29, IC32
6
AD8230
IC7, IC1I, IC13, IC16, IC30, IC33
2
AD9837-10
1
ADR441
1
ATM32U4
5
LT1806
6
LTC2484
3
LTC6994-2
IC21, IC36, IC39
6
MAX4523
IC6, IC9, IC12, IC15, IC28, IC31
4
MMXC
5
SMA
CLKJN_40K, CLKIN-400K, CLKINVAR, DDSOUT, HVDIV
7
TPT
AGND1, AGND2, AGND3, AGND4, AGND5, GND1, GND2
R83, R85, R97, R99
RP5, RP8, RP9
R4, R6, R11, R13, R25, R27, R39, R41, R53, R55
IC42, IC43
IC25
ATMEGA32U4-BREAKOUT
IC2, IC3, IC4, IC44, IC45
IC17, IC18, IC19, IC20, IC34, IC35
CONI, CON2, CON3, CON4
130
B.4
B.4.1
Atmega32U4 Breakout Board
Full Schematic
<r
I
I
m
I
LU
0
___
LU
.C
Ln
C:
27
0
N
0
LU
LC
0
:3C--
T
j
0
N
0)
-C
8
8
(U
j
8
U
0
0O
LU
OD
CO
1 ,I71
T
T~
L
0
-M
-- -
--
U
T
0
I-
LUi
9/3/12 10:35 PM f=0.92 /home/bjthom28/Projects/StandaloneSensor/Sensor and Code/pcband schematic/atmega32u4/atm
131
B.4.2
PCB Layout
Og
*
0*
gO
so
OS
Og
So
go
Ug
*
gO
0
Og
Og
*5
*0
Os
Og
soS
Og
So
S.
Os
S
S.
S.
S.
gO
0
so
.5
*5
so
Og
US
*
*5
IS
S.
Sg
so
so
*
0
*5
*5
@5
@0
Og
So
S.
So
50
so
*5
Os
0S
Os
so
SO
So
so
0*
S
0~
S.
so
*
0
05
*
0*
*5
OS
us
S
*5
.5
Og
OS
*
*5
gO
50
go
0
So
Sg
S.
0,
SO
50
S
*
.5
Os
S.
5.
Og
S.
S.
S.
*
*
S
5.
5.
so
0*
@0
Os
Os
gO
0
o
OS
* ...........................
s....
S.
5,
0
9/3/12 10:16 PM f=6.29 /home/bjthom28/Projects/StandaloneSensor/Sensor and Code/pob and schematic/atmega32u4/atrn
132
B.4.3
Bill of Materials
Qty
Value
Parts
1
1
1
3
2
1
2
2
I
I
2
I
2
I
.Au
0
1k
lu
lop
16MHz
22
100
ATMEGA32U4-AU
LDO3.3
LED
MICRO-USB-ZX62-B-5PA
SW-C&K-KSC-JWING
TC2050-IDC-NL
C2
RI
R4
C1, C5, CB1
C3, C4
X1
R2, R3
R6, R7
ICi
LDO
DI, D2
USB1
HWB, RST
ISP
133
134
Bibliography
[1] William H. Thompson.
A standalone capacitively coupled occupancy sensor.
M.eng. thesis,
Massachusetts Institute of Technology, Cambridge, Massachusetts, September 2012.
[2] Daniele Andreuccetti, Roberto Fossi, and Caterina Petrucci.
Dielectric Properites of Body
Tissues, 2010. http://nirmf.ifac.cnr.it/tissprop/.
[3] Camelia
ties
of
Gabriel
Body
and
Tissues
Sami
at
RF
Gabriel.
and
Compilation
Microwave
of
Frequencies,
the
Dielectric
1997.
Proper-
mirrored
at:
http://niremf.ifac.cnr.it/docs/DIELECTRIC/home.html.
[4] Transportation security administration authorization act. H.R.2200, June 2009.
[5] Samsung Group, Samsung Town, Seoul, South Korea. Samsung GT-19500 User Manual, 2013.
[6] R. Wimmer, P. Holleis, M. Kranz, and A. Schmidt.
Thracker-using capacitive sensing for
gesture recognition. In Proceedings of the 26th IEEE International Conference Workshops on
Distributed Computing Systems, 2006.
[7] F. Aezinia, Y. Wang, and B. Bahreyni. Touchless capacitive sensor for hand gesture detection.
Sensors, IEEE Journal of, pages 546-549, October 2011.
[8] J. Cheng, D. Bannach, and P. Lukowicz.
On body capacitive sensing for a simple touchless
user interface. In Medical Devices and Biosensors, 2008. ISSS-MDBS 2008. 5th International
Summer School and Symposium on, pages 113-116, February 2008.
[9] J.J. Cooley. Capacitive Sensing with a Fluorescent Lamp. M.eng. thesis, Massachusetts Institute
of Technology, Cambridge, Massachusetts, February 2007.
[10] J. J. Cooley, A.-T. Avestruz, S. B. Leeb, and L. K. Norford.
A uorescent lamp with inte-
gral proximity sensor for building energy management. In Proc. IEEE PESC, volume 7, page
11571163, June 2007.
135
[11] J. Cooley. Analysis, Modeling and Design of Energy Management and Multisource Power Systems. Ph.d. thesis, Massachusetts Institude of Technology, Cambridge, Massachusetts, June
2011.
[12] M. Grant and S. Boyd. CVX: Matlab software for disciplined convex programming, version 2.0
beta. http: //cvxr.com/cvx, September 2013.
[13] M. Grant and S. Boyd. Graph implementations for nonsmooth convex programs. In V. Blondel,
S. Boyd, and H. Kimura, editors, Recent Advances in Learning and Control, Lecture Notes
in Control and Information Sciences, pages 95-110. Springer-Verlag Limited, 2008.
http:
//stanford.edu/-boyd/graph-dcp.html.
[14] R. Zhang, X. Bresson, T. Chan, and X. Tai. Four color theorem and convex relaxation for image
segmentation with any number of regions. Inverse Problems and Imaging, AIMS, 7(3):1099
1113, September 2013.
[15] D. Tao and A. Adler. Electrical impedance tomography image reconstruction with 11 data and
image norms. In Engineering in Medicine and Biology Society, 2008. 30th Annual International
Conference of the IEEE, pages 2721-2724, August 2008.
[16] D. Vickery.
Breaker.
A Retrofit Current Sensor for Non-Intrusive Power Monitoring at the Circuit
M.eng. thesis, Massachusetts Institute of Technology, Cambridge, Massachusetts,
September 2011.
[17] M. Carminati, M. Sampietro, G. Ferrari, and F. Gozzini.
Instrumentation with attofarad
resolution for electrochemical impedance measurements on molecular biosensors. In Research
in Microelectronics and Electronics, 2009. PRIME 2009. Ph.D., pages 316-319, July 2009.
[18] N. Flores, J. C. Gamio, C. Ortiz-Aleman, and E. Damian.
Sensor modeling for an electri-
cal capacitance tomography system applied to oil industry. In COMSOL Multiphysics User's
Conference 2005 Boston, 2005.
[19] W.Q. Yang and L. Peng. Image reconstruction algorithms for electrical capacitance tomography.
Measurement Science and Technology, 14(1):R1-R13, January 2003.
[20] C.G. Xie, S.M. Huang, B.S. Hoyle, R. Thorn, C. Lenn, D. Snowden, and M.S. Beck. Electrical capacitance tomography for flow imaging: system model for development of image reconstruction algorithms and design of primary sensors. In Circuits, Devices and Systems, IEE
Proceedings G, volume 139, pages 89-98, February 1992.
[21] G. Ferrari, F. Gozzini, A. Molari, and M. Sampietro. Transimpedance amplifier for high sensitivity current measurements on nanodevices. Solid-State Circuits, IEEE Journal of, 44(5):1609-
1616, May 2009.
136
[22] L Fumagalli, G Ferrari, M Sampietro, I Casuso, E Martnez, J Samitier, and G Gomila.
Nanoscale capacitance imaging with attofarad resolution using ac current sensing atomic force
microscopy. Nanotechnology, 17(18):4581, 2006.
[23] A Heidary, R Taherkhani, and G.C.M. Meijer. A capacitance measurement system with milliwatt power and attofarad resolution. In 20th Iranian Conference on Electrical Engineering,
May 2012.
[24] S Wu and J Yu.
Attofarad capacitance measurement with scanning microwave microscopy,
April 2012. Agilent Technologies.
[25] Ferroxcube. 3C81 Material specification, 2008. Datasheet.
[26] Ferroxcube. P42/29 P cores and accessories, 2008. Datasheet.
[27] Analog Devices.
AD9837 Low Power, 8.5 mW, 2.3 V to 5.5 V, Programmable Waveform
Generator, 2011. Rev. 0.
[28] Texas Instruments. OPA452,OPA452: 80V, 50mA Operational Amplifiers, 2003. Rev. C.
[29] Linear Technology.
LTC2484 24-Bit AE ADC with Easy Drive Input Current Cancellation,
2005. Rev. D.
[30] Analog Devices.
AD8230 16V Rail-to-Rail, Zero-Drift, Precision Instrumentation Amplifier,
2007. Rev. B.
[31] Analog Devices. ADA4817-1/ADA4817-2
Low Noise, 1 GHz FastFET Op Amps, 2008. Rev. 0.
[32] Analog Devices. AD8131 Low Distortion Differential ADC Driver, 2006. Rev. F.
[33] Analog Devices. AD8620 Precision, Very Low Noise, Low Input Bias Current, Wide Bandwidth
JFET Operational Amplifiers, 2008. Rev. F.
[34] Maxim.
MAX4521/MAX4522/MAX4523 Quad, Low-Voltage. SPST Analog Switches, July
2007. Rev. 6.
[35] Linear Technology. LT1806/LT1807 325MHz, Single/Dual, Rail-to-Rail Input and Output, Low
Distortion, Low Noise Precision Op Amps, 2010. Rev. C.
[36] KSM. RG178 Coaxial Cable to Mil-C-17 Specification, 2011.
[37] John Ardizzoni and Jonathon Pearson. AN-0990 Terminating a Differential Amplifier in SingleEnded Input Applications. Analog Devices, 2009. Rev. 0.
137