instrumentation for laser physics and spectroscopy using...

8
Instrumentation for laser physics and spectroscopy using 32-bit microcontrollers with an Android tablet interface E. E. Eyler 1 Physics Department, University of Connecticut, Storrs, CT 06269, USA Several high-performance lab instruments suitable for manual assembly have been developed using low-pin- count 32-bit microcontrollers that communicate with an Android tablet via a USB interface. A single Android tablet app accommodates multiple interface needs by uploading parameter lists and graphical data from the microcontrollers, which are themselves programmed with easily-modified C code. The hardware design of the instruments emphasizes low chip counts and is highly modular, relying on small “daughter boards” for special functions such as USB power management, waveform generation, and phase-sensitive signal detection. In one example, a daughter board provides a complete waveform generator and direct digital synthesizer that fits on a 1.5”×0.8” circuit card. I. INTRODUCTION In 2011, I described a timing sequencer and re- lated laser lab instrumentation based on 16-bit mi- crocontrollers and a homemade custom keypad/display unit. 1 Since then, two new developments have en- abled a far more powerful approach: the availability of high-performance 32-bit microcontrollers in low-pin- count packages suitable for hand assembly, and the near- ubiquitous availability of tablets with high-resolution touch-screen interfaces and open development platforms. This article describes several new instrument designs tailored for research in atomic physics and laser spec- troscopy. Each utilizes a 32-bit microcontroller in con- junction with a USB interface to an Android tablet, which serves as an interactive user interface and graph- ical display. These instruments are suitable for con- struction by students with some experience in soldering small chips, and are programmed using standard C code that can easily be modified. This offers both flexibil- ity and educational opportunities. The instruments can meet many of the needs of a typical optical research lab: event sequencing, ramp and waveform generation, pre- cise temperature control, high-voltage PZT control for micron-scale optical alignment, diode laser current con- trol, rf frequency synthesis for modulator drivers, and dedicated phase-sensitive lock-in detection for frequency locking of lasers and optical cavities. The 32-bit pro- cessors have sufficient memory and processing power to allow interrupt-driven instrument operation concurrent with usage of a real-time graphical user interface. The central principle in designing these instruments has been to keep them as simple and self-contained as possible, but without sacrificing performance. With sim- plicity comes small size, allowing control instrumentation to be co-located with optical devices — for example, an arbitrary waveform synthesizer could be housed directly in a diode laser head, or a lock-in amplifier could fit in a small box together with a detector. As indicated in Fig. 1, each instrument is based on a commodity-type 32-bit microcontroller in the Microchip PIC32 series, and can be controlled by an Android app designed for a 7” or 8” tablet. An unusual feature is that the tablet interface is 5-byte packets, command+data Tablet with Parameter stor- age in internal PIC32 micro- controller Tablet, with scrolling para- meter list and pop-up keypad USB T tf di l USB age in internal program memory Built-in I/O, timers, SPI T ext for display Touch- Select new Programmable I/O: 10-bit ADCs Touch screen entry? Select new parameter or pop-up keypad Programmable I/O: ADCs, DACs, PLLs, DDS chips, etc. Serial I/O and external Slider Modify current 1. External devices, trigger lines. 2 O ti l t interrupts changed? current parameter 2. Optional rotary encoder, LCD display. FIG. 1. (Color online) block diagram of a microcontroller- based instrument communicating with an Android tablet via USB. A tablet app, MicroController, uploads parameter val- ues and their ranges from the instrument each time the USB interface cable is connected. fully interchangeable, using a single app to communicate with any of a diverse family of instruments as described in Sec. II A. Further, all of the instruments are fully functional even when the external interface is removed. When the operating parameters are modified, the val- ues are stored in the microcontroller program memory, so that these new values will be used even after power has been disconnected and reconnected. The USB inter- face also allows connection to an external PC to provide centralized control. Four printed-circuit boards (PCBs) have so far been designed. One, the LabInt32 board described in Section III, is a general-purpose laboratory interface specifically designed for versatility. The others are optimized for special purposes, as described in Section IV. The PCBs use a modular layout based in part on the “daughter boards” described in Sec. III A. They range from simple interface circuits with just a handful of com- ponents to the relatively sophisticated Wvfm32 board, which uses the new Analog Devices AD9102 or AD9106 waveform generation chips to support a flexible voltage- output arbitrary waveform generator and direct digital synthesizer (DDS). It measures 1.5”×0.8”, much smaller arXiv:1307.7160v2 [physics.ins-det] 14 Sep 2013

Upload: nguyenkiet

Post on 24-May-2018

222 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

Instrumentation for laser physics and spectroscopy using 32-bitmicrocontrollers with an Android tablet interface

E. E. Eyler1

Physics Department, University of Connecticut, Storrs, CT 06269, USA

Several high-performance lab instruments suitable for manual assembly have been developed using low-pin-count 32-bit microcontrollers that communicate with an Android tablet via a USB interface. A single Androidtablet app accommodates multiple interface needs by uploading parameter lists and graphical data from themicrocontrollers, which are themselves programmed with easily-modified C code. The hardware design of theinstruments emphasizes low chip counts and is highly modular, relying on small “daughter boards” for specialfunctions such as USB power management, waveform generation, and phase-sensitive signal detection. In oneexample, a daughter board provides a complete waveform generator and direct digital synthesizer that fits ona 1.5”×0.8” circuit card.

I. INTRODUCTION

In 2011, I described a timing sequencer and re-lated laser lab instrumentation based on 16-bit mi-crocontrollers and a homemade custom keypad/displayunit.1 Since then, two new developments have en-abled a far more powerful approach: the availabilityof high-performance 32-bit microcontrollers in low-pin-count packages suitable for hand assembly, and the near-ubiquitous availability of tablets with high-resolutiontouch-screen interfaces and open development platforms.

This article describes several new instrument designstailored for research in atomic physics and laser spec-troscopy. Each utilizes a 32-bit microcontroller in con-junction with a USB interface to an Android tablet,which serves as an interactive user interface and graph-ical display. These instruments are suitable for con-struction by students with some experience in solderingsmall chips, and are programmed using standard C codethat can easily be modified. This offers both flexibil-ity and educational opportunities. The instruments canmeet many of the needs of a typical optical research lab:event sequencing, ramp and waveform generation, pre-cise temperature control, high-voltage PZT control formicron-scale optical alignment, diode laser current con-trol, rf frequency synthesis for modulator drivers, anddedicated phase-sensitive lock-in detection for frequencylocking of lasers and optical cavities. The 32-bit pro-cessors have sufficient memory and processing power toallow interrupt-driven instrument operation concurrentwith usage of a real-time graphical user interface.

The central principle in designing these instrumentshas been to keep them as simple and self-contained aspossible, but without sacrificing performance. With sim-plicity comes small size, allowing control instrumentationto be co-located with optical devices — for example, anarbitrary waveform synthesizer could be housed directlyin a diode laser head, or a lock-in amplifier could fit in asmall box together with a detector. As indicated in Fig.1, each instrument is based on a commodity-type 32-bitmicrocontroller in the Microchip PIC32 series, and canbe controlled by an Android app designed for a 7” or 8”tablet. An unusual feature is that the tablet interface is

5-byte packets, command+dataTablet with

Parameter stor-age in internalPIC32

micro-controller

Tablet, with scrolling para-meter list andpop-up keypad

USB

T t f di lUSB

age in internal program memory

Built-in I/O, timers,p p p yp

SPI

Text for display

Touch- Select new Programmable I/O:

10-bit ADCs

Touchscreenentry?

Select new parameter or pop-up keypad

Programmable I/O: ADCs, DACs, PLLs, DDS chips, etc. Serial I/O

and external

Slider Modify current

1. External devices,trigger lines.2 O ti l t

interrupts

changed? current parameter

2. Optional rotary encoder, LCD display.

FIG. 1. (Color online) block diagram of a microcontroller-based instrument communicating with an Android tablet viaUSB. A tablet app, MicroController, uploads parameter val-ues and their ranges from the instrument each time the USBinterface cable is connected.

fully interchangeable, using a single app to communicatewith any of a diverse family of instruments as describedin Sec. II A. Further, all of the instruments are fullyfunctional even when the external interface is removed.When the operating parameters are modified, the val-ues are stored in the microcontroller program memory,so that these new values will be used even after powerhas been disconnected and reconnected. The USB inter-face also allows connection to an external PC to providecentralized control.

Four printed-circuit boards (PCBs) have so far beendesigned. One, the LabInt32 board described in SectionIII, is a general-purpose laboratory interface specificallydesigned for versatility. The others are optimized forspecial purposes, as described in Section IV.

The PCBs use a modular layout based in part on the“daughter boards” described in Sec. III A. They rangefrom simple interface circuits with just a handful of com-ponents to the relatively sophisticated Wvfm32 board,which uses the new Analog Devices AD9102 or AD9106waveform generation chips to support a flexible voltage-output arbitrary waveform generator and direct digitalsynthesizer (DDS). It measures 1.5”×0.8”, much smaller

arX

iv:1

307.

7160

v2 [

phys

ics.

ins-

det]

14

Sep

2013

Page 2: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

2

than any comparable device known to the author.Further details on these designs, including circuit

board layout files and full source code for the soft-ware, are available on my web page at the Universityof Connecticut.2

II. SYSTEM CONSIDERATIONS

In designing the new instrumentation I considered sev-eral design approaches. One obvious method is to use acentral data bus, facilitating inter-process communica-tion and central control. Apart from commercial sys-tems using LabVIEW and similar products, some excel-lent homemade systems of this type have been developed,including an open-source project supported by groups atInnsbruck and Texas.3,4 This approach is best suited tolabs that maintain a stable long-term experimental con-figurations of considerable complexity, such as the appa-ratus for Bose-Einstein condensation that motivated theInnsbruck/Texas designs.

As already mentioned, the approach used here is quitedifferent, intended primarily for smaller-scale experi-ments or setups that evolve rapidly, where a flexible con-figuration is more important than providing full centralcontrol from a single console. The intent is that mostlab instruments will operate as autonomous devices, al-though a few external synchronization and control sig-nals are obviously needed to set the overall sequence ofan experiment. These can come either from a central labcomputer or, for simple setups, from one of the boardsdescribed here, set up as an event sequencer and analogcontrol generator. This approach is consistent with ourown previous work and with recent designs from othersmall laser-based labs.5

Once having decided on decentralized designs using mi-crocontrollers, there are still at least three approaches:organized development platforms, compact developmentboards, or direct incorporation of microcontroller chipsinto custom designs. Numerous development platformsare now available, ranging from the hobbyist-orientedArduino and Raspberry PI to more engineering-basedsolutions.6 However, these approaches were ruled out be-cause they increase the cost, size, and complexity of an in-strument. For simple hardware-oriented tasks requiringrapid and repeatable responses, a predefined hardwareinterfacing configuration and the presence of an operat-ing system can be more of a hindrance than a help.

Initially it seemed attractive to use a compact develop-ment card to simplify design and construction. My initialdesign efforts used the simple and affordable MINI-32development card from MikroElektronika,7 which com-bines an 80 MHz Microchip PIC32MX534F064H proces-sor with basic support circuitry and a USB connector.This board was used to construct a ramp generator andevent sequencer very similar in design to an earlier 16-bit version.1 While successful, this approach entailed nu-merous inconveniences: the microcontroller program and

USB32 Additional

daughter board Wvfm32 Dual 16-bit

DAC

FIG. 2. (Color online) Photograph of the 5”×2.25” LabInt32PCB. It includes a Wvfm32 daughter board with requiredsupport circuitry, and a dual 16-bit DAC with one outputconnected to a card-edge SMA connector.

RAM memories are too small at 64 kB and 16 kB, the os-cillator crystal is not a thermally stabilized TXCO type,the USB interface requires extensive modification to al-low host-mode operation, and the 80 MHz instructionrate is somewhat compromised by mandatory wait statesand interrupt latency. Finally, certain microcontrollerpins that are essential for research lab use, such as theasynchronous timing input T1CK, are assigned for otherpurposes on the MINI-32, requiring laborious cutting andresoldering of traces. Tests of the event sequencer yieldedreasonably good results: the maximum interrupt eventrate of 1.5 MHz is about twice as fast as the 16-bit de-sign operating at 20 MHz, although the typical interruptlatency of 400 ns is not very different. Nevertheless, itbecame evident that the effort in using preassembled de-velopment boards outweighs the advantages.

Instead, the designs described here use low-pin-countchips in the Microchip PIC32MX250 series that are di-rectly soldered to the circuit boards, as can be seen in Fig.2. These microcontrollers, even though they are posi-tioned as basic commodity-type devices by the manufac-turer, have twice the memory of the MINI-32 processorand can operate at 40 MHz without wait states.8 Theyfeature software-reassignable pins that increase interfac-ing flexibility, as described in Sec. II B. While the re-duced 40 MHz speed is a consideration for event sequenc-ing, it does not impact the performance of any of theother instruments described here, and the absence of waitstates during memory access is partially compensatory.The processor clock and other timing references are de-rived from miniature temperature-compensated crystaloscillators in the FOX Electronics FOX924B series, whichare small, inexpensive, and accurate within 2.5 parts permillion.

Ease of construction is a major consideration for cir-cuits used in an academic research lab. To facilitatethis, the easily-mounted 28-pin PIC32MX250F128B mi-crocontroller is used where possible, and a 44-pin variant

Page 3: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

3

FIG. 3. (Color online) Typical screen view of the MicroCon-troller app on a Google Nexus 7 tablet. When a parameteris selected on the scrollable list at the upper left, its valuecan be adjusted either with a pop-up keypad or with the twoslider bars. The strip-chart graph shows in yellow the out-put voltage produced by a temperature controller card, andin blue the temperature offset from the set point (25 units ≈1 mK).

when more extensive interfacing is needed. The basicsupport circuitry for the controller is laid out to allowhand soldering, as is other low-frequency interface cir-cuitry. Nevertheless, all of the PCBs include at least afew surface-mounted chips that are more easily mountedusing hot-air soldering methods. We have obtained verygood results using solder paste and a light-duty hot-airstation.9 For rf circuits the hot-air method is unfortu-nately a necessity, because modern rf chips commonly usecompact flat packages such as the QFN-32, with closely-spaced pins located underneath the chip. Constructioncan also be made easier by including a full solder maskon the PCB, greatly reducing the incidence of accidentalsolder bridges between adjacent pins. These masks areavailable for a modest extra fee from most PCB fabri-cators, and their additional services usually also includeprinted legends that can conveniently label the compo-nent layout.

A. USB interface to an Android tablet

As previously described, a user interface to acommodity-type tablet is very appealing because it offersa fast, responsive high-resolution graphical touch-screeninterface that requires no specialized instrumentation orconstruction. Although rf communication with a tabletis possible using Bluetooth or Wi-Fi protocols, a USBinterface is a better choice for lab instruments becauseit avoids the need for extra circuitry, and it avoids theproliferation of multiple rf-based devices operating in alimited space. An interface based on an open-source de-velopment environment is important, so that programson both the tablet and the microcontroller can be freely

modified for individual research needs. Fortunately theAndroid operating system provides such a resource, theAndroid Open Accessory (AOA) protocol.10 For this rea-son, the programs described here were developed for thewidely available Google Nexus 7 Android tablet, whichoffers a 1280×800 display and up to 32 GB of memory,with a fast quad-core processor. The microcontroller pro-grams use the AOA protocol mainly to transfer five-bytedata packets consisting of a command byte plus a 32-bit integer. They also support longer data packets inthe microcontroller-to-tablet direction for displaying textstrings and graphics.

An important consideration is that the USB interfaceat the microcontroller end of the link must operate inhost mode because many tablets, including the GoogleNexus 7, support only device-mode operation. An addi-tional consideration is that for extended operation of thegraphical display, a continuous charging current must beprovided. The only way to charge most tablets is via theUSB connector, and charging concurrent with communi-cation is only possible if the tablet operates in USB devicemode. On the other hand, it is important that the micro-controller USB interface also be capable of device-modeoperation, because when control by an external personalcomputer is desired, the PC will support only host-modeoperation. For this reason, the full USB on-the-go (OTG)protocol has been implemented in hardware, allowing dy-namic host-vs-device switching. Presently the microcon-troller software supports only host-mode operation witha tablet interface, but extension to a PC interface wouldrequire only full incorporation of the USB OTG samplecode available from Microchip.11

A more subtle hardware consideration is that both ofthe tablets I have so far examined, the Google Nexus 7and Archos 80 G9, use internal switching power suppliesthat present a rapidly shifting load to the 5 V charg-ing supply. In initial designs, the 5 V power supply onthe microcontroller PCB was unable to accommodate therapidly switched load, causing fluctuations of ∼ 100−200mV which then propagated to some of the analog signallines. A good solution is to provide a separate regulatorfor the USB charging supply, operating directly from thesame 6V input power that powers the overall circuit card.With this design there is no measurable effect on the 5V and 3.3 V power supplies used to power chips on themain circuit board.

A single Android app, MicroController, supports all ofthe instruments described here by using a flexible userinterface based on a scrolling parameter list that is up-dated each time a new USB connection is established.It was developed in Java using the Android softwaredevelopment kit, for which extensive documentation isavailable.12–14 The app is available on my web page,2

both as Java source code and in compiled form. As shownin Figs. 1 and 3, the app displays a parameter list with la-bels and ranges specific to the application. Several checkboxes and status indicators are also available, also withapplication-specific labels. Once the user selects a pa-

Page 4: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

4

rameter by touching it, its value can be changed usingeither a pop-up keypad or the coarse and fine sliders vis-ible in Fig. 3. The remainder of the display screen isreserved for real-time graphics displayed using the open-source AChartEngine package,15, and can show plots ofdata values, error voltages from locking circuits, and sim-ilar information. The graphics area can be fully updatedat rates up to about 15 Hz.

While certain tasks will eventually require their ownspecialized Android apps to offer full control, particularlyarbitrary waveform generation and diode laser frequencylocking, the one-size-fits all solution offered by the Micro-Controller app still works surprisingly well as a startingpoint. For a majority of the instruments described here,it is also quite satisfactory as a permanent user interface.

B. Modular circuit design

Although this paper mentions seven distinct instru-ments, they are accommodated using only four PCBs,all of which share numerous design elements as well asa common USB tablet interface. Multiple instrumentscan also share a single tablet for user interfacing becauseit needs to be connected only when user interaction isneeded, a major advantage of this design approach.

Another common design element is a 5-pin program-ming header included on each PCB that allows a fullprogram to be loaded in approximately 10-20 seconds us-ing an inexpensive Microchip PICkit 3 programmer. Theprograms are written in C and are compiled and loadedto the programmer using the free version of the MicrochipXC32 compiler and the MPLAB X environment.16 ThePIC32MX250 processor family further enhances designflexibility by providing numerous software-reassignableI/O pins, so that a given pin on a card-edge interface ter-minal might be used as a timer output by one program, adigital input line by another, and a serial communicationoutput by a third.

To avoid repetitive layout work and to further enhanceflexibility, several commonly used circuit functions havebeen implemented on small “daughter boards” as de-scribed in Sec. III A. Two of these daughter boards arevisible on the general-purpose lab interface shown in Fig.2, as is an unpopulated additional slot. Some of thesedaughter boards simply offer routine general-purposefunctionality, such as USB power switching, while othersoffer powerful signal generation and processing capabili-ties.

With the exception of the 1”×0.8” USB interfaceboard, the daughter boards measure 1.5”×0.8”, andshare a common 20-pin DIP connector formed by tworows of square-pin headers. The power supply and SPIlines are the same for all of the boards, while the otherpins are allocated as needed. These connectors can beused as a convenient prototyping area for customizinginterface designs after the circuit boards have been con-structed, by wire-wrapping connections to the square

pins.

III. GENERAL-PURPOSE LABORATORY INTERFACE

As already mentioned, the lab interface (LabInt32)PCB was designed to allow a multitude of differing ap-plications by providing hardware support for up to twointerchangeable daughter boards, as well as powerful on-board interfacing capabilities. As shown in Figs. 2 and 4,the core of the design is a PIC32MX250F128D microcon-troller in a 44-pin package. This provides enough inter-face pins to handle a wide variety of needs, particularlyconsidering that many of them are software-assignable.Several card-edge connectors and jacks provide access tonumerous interface pins and signals, including an 8-bitdigital I/O interface, of which six bits are tolerant of 5 Vlogic levels. Two of the connectors are designed to sup-port an optional rotary shaft encoder and serial interfaceas described in Sec. IV C.

The board operates from a single 6 V, 0.5 A powermodule but contains several on-board supplies and regu-lators. These provide the 3.3 V and 5 V power requiredfor basic operation, as well as optional supplies at -5 Vand ±12 V for op amps, analog conversion, and rf signalgeneration. These optional supplies are small switchingpower supplies that operate directly from the 6 V inputpower, so that they do not impose switching transients onthe 5 V supply as mentioned in Sec. II A. There are alsoprovisions on the main board for three particularly usefulinterface components: a dual 16-bit voltage-output DACwith a buffered precision 2.5 V reference (Analog DevicesAD5689R), a robust instrumentation amplifier useful forinput signal amplification or level shifting (AD8226), anda 1024-position digital potentiometer (AD5293-20) thatcan provide computer-based adjustment of any signalcontrollable by a 20 kΩ resistor, up to a bandwidth limitof about 100 kHz.

Presently there are two demonstration-type programsavailable for the microcontroller on the LabInt card.One uses the on-board 16-bit DAC to provide a high-resolution analog ramp with parameters supplied by thetablet interface. The other operates with the Wvfm32daughter board to provide a synthesized complex wave-form with data output rates up to 96 MHz, as describedin the next section.

A. Daughter boards

The simplest of the daughter boards, the tiny 1”×0.6”USB32 board, is used on all of the PCBs. It simplyprovides the power and switching logic for a USB OTGhost/device interface, by use of a 0.5 A regulator and aTPS2051B power switch. It includes a micro USB A/Bconnector, which is inconveniently small for soldering butis necessary because it is the only connector type that isapproved both for host-mode connections to tablets and

Page 5: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

5

(only for Wvfm32).

or display

Aux power+/- 12V supply

Instrumentation amp

(can use dig. pot. on J18).Daughter board 2Gain= 1+ 49.4k/R11

Digital potentiometer3.3V regulator Analog signals

U11-5V supplyDACs16-bit

U12amp

Instrum

5V regulator Daughter board 1

6V Power in

Clock conditioning

Waveform trig/Chip select 2

I/O 2-1BI/O 2-1AI/O 1-2BI/O 1-2AI/O 1-1BAGNDTrig in/out

Ref2Ctr inTrig wvfmReset

Bourns EM14A0D-C24-L064SGated freq. countRotary encoder and switch,

SW/Int0Dual 16-bit DAC/ 2.5V ref.

External serial I/O

RX Port CTXPICKit 33.3V

GNDGND

Screw terminal blocks

RC9RC8RC7RC6RC5RC4RC3RC2

RC9RC8RC7RC6RC5RC4RC3RC2

IAcm

-12V

-12VGND

IAin+

J20

6 -12V

5 +12V

4 +6V

3 -5V

2 +5V

1 GND

IAOutR11

CC1R5-0512DF-E

U10

5COM3 -Vin 4-Vout

6TRM

7+Vout

2 RC

1 +Vin

+12V+6V1

R9AGNDIAin-

AGND

AD8226

U12

-

+

6R

ef

3 Rg

2 Rg

58

7

1

4

2V1ARef2

0.1

C15

0.1

C14+12V

1_SMT

C17

green_LEDD2

2V1B2CS2-12V

LED

D1150

R1LED2

2CS1-12V+12VSPIoutSPIclkSPIout

10_uF

C11 +

DACrefSPIclk

220

R8

DACVBRSELDACVASPI_in

0.1_SMT

C16

Dig_Pot

J18

3B

2W

1A1_uF

C123.3VMCP1702-3302EU8

3VOUT

1G

ND

2 VIN

IAoutIAcm

3.3V

AD5293-20

U13

14RDY

13SDout12SYNC

7 ExtCap

6 Vdd

3 A4 W

1 RESET

9GND

10SDin

2 Vss

8Vlogic

5 B

11SCLK

+5VIAin++12V3.3V

RSO0505S

U9

7-Vout3CTRL

1 -Vin

2 +Vin 6+Vout

IAin-

DB2

U7

20OA2out19OA2in+/CLKP18OA2in-/CLKN17OA1out16OA1in+15AGND14V2B13V2A12V1B/Out211V1A/Out110 REF1

9 CS2/Trig

8 CS1

7 SPIctrl

6 SCLK

5 OAV+

4 OAV-

3 SPIrtn

2 GND

1 +5V

+5V-5V+6VJ17

10987654321

AGND AGND

J16

1

J151 SMA

J14

NCx3

J13

21

180_SM

T

R10 AGND

0.1_SMT

C10CLKP39k_SMT

R7

22_uF

C9+

0.33_uF

C8

PJ-102AH

J12 132

SMA

J11

NCx31V1B1TRIG

V-_Select

J10

55

44

33

22

11

1V2A1CS1-5V-12V+5V

LM2940

U6

2 GND

3OUT1 IN

Power

S1

6

45

3

12

J9

21

1V2BSPIoutCLKN

100_SM

T

R6+6V

SPIclkREFCK

SMA

J8

NCx3

CLKNSPI_in

J7

21

CLKP

V+_Select

J6

4321

+12V+5V

DB1

U5

20OA2out19OA2in+/CLKP18OA2in-/CLKN17OA1out16OA1in+15AGND14V2B13V2A12V1B/Out211V1A/Out110 REF1

9 CS2/Trig

8 CS1

7 SPIctrl

6 SCLK

5 OAV+

4 OAV-

3 SPIrtn

2 GND

1 +5V

+5VRCbus

2V1B2V1A1TRIG

330

R5TRIG13.3V

1V2BTRIG11V2A

74VHC00

U3B

3.3V 65

4U1RXRSEL

1V1B

AGND

+5VU1TXLED2

USB32

U48OC

7+6V

6VBUSON

5GND4 USBID

3 D+

2 D-

1 VBUS

OC1+6VRef2SW

T1CKT1CKJ4

6 B

5 +

4 S2

3 S1

2 A

1 -SWMCLROC12CS2

J5

10987654321

74VHC00

U3A

3.3V32

12CS1SPIclk

0.01

C711k

R4REFCKSPIoutDACSELSPI_in

3.3V0.1

C61CS13.3V

FOX924B_20MHz

U2

1 NC

3OUT

4VDD

2 GND

SW

3.3VAGND

RCbusSPIout

0.01

C5

PIC32MX250F128DU1

22AN3/C1INC/RPB1

21AN2/C1IND/RPB0

20 AN1/VREF-/RPA1

5(5V)RPC9

4(5V)RPC8

3(5V)RPC7

2(5V)RPC6

38(5V)RPC5

35 (5V)RPA9

37(5V)RPC4

36AN12/RPC3

27AN8/RPC2

26AN7/RPC1

25AN6/RPC0

39G

ND

28V

DD

31 CLKO/OSC2/RPA3

43(5V)INT0/RPB744(5V)RPB8

9 D-8 D+

34 T1CK/RPA4

16A

GN

D17

AV

DD

10 Vusb3v3

11 RPB13/PMRD/(SDI2)

6G

ND

40V

DD

1(5V)RPB9

41 USBID/RPB5

33RPB4

24AN5/C1INA/PMWR/RPB3

23AN4/C1INB/RPB232 (5V)RPA8/(SDO2)

19 AN0/VREF+/RPA0

29G

ND

15 SCK2

12 PGED4/RA1013 PGEC4/RA7

42 VBUS

30 OSC1/CLKI

14 VBUSON/SCK1

7V

cap18 MCLR

DACVB

11k

R3U1RXSPIclk

AGND

U1TXDACSELDACVA

10_uF

C4+

3.3VDACref

0.1_SMT

C13

0.1

C3

0.1

C2

0.1

C1

J3

654321

J2

10987654321

J1

4321

AD5689RU1116RSTSEL15RESET13SYNC

14 SDIN

8 SDO

4 GND5 VDD

1 Vref

10GAIN

11Vlogic

3 VoutA

9LDAC

7 VoutB

12SCLK

NC

x2

10

R23.3V3.3V3.3V

MCLR

+5V

FIG. 4. (Color online) Schematic diagram for a general-purpose laboratory interface PCB, LabInt32. Only the portion outlinedat the upper left is essential for operation. The remaining optional components include power supplies, connectors, and a pairof daughter board slots, as well as a dual 16-bit DAC, an instrumentation amplifier, and a 10-bit digital potentiometer.

device-mode connection to external computers.17 As partof the USB OTG standard, an internal connection in theUSB cable is used to distinguish the A (host) end fromthe B (device) end.

The remainder of the daughter boards are slightlylarger at 1.5”×0.8”, and they all share a common 20-pin DIP connector as described in Sec. II B. They canbe used interchangeably on the LabInt32 PCB or for spe-cific purposes on other PCBs, as for the DAC32 daughterboard needed by the TempCtrl card. This section de-scribes the Wvfm32 daughter board in detail, and brieflydescribes three others.

1. Wvfm32 The Wvfm32 daughter board, whoseschematic is shown in Fig. 5, benefits from the simplic-ity of a direct SPI interface and provides an extremelysmall but highly capable instrument. It combines theremarkable Analog Devices AD9102 (or AD9106) wave-

form generation chip with a fast dc-coupled differentialamplifier (two for the AD9106), along with a voltageregulator and numerous decoupling capacitors necessi-tated by the bandwidth of about 150-200 MHz. TheAD9102/06 provides both arbitrary waveform generationfrom a 4096-word internal memory and direct digital syn-thesis (DDS) of sine waves, with clock speeds that canrange from single-step to 160 MHz. When it is used onthe LabInt32 PCB, a fast complementary clock genera-tor is not available, but the programmable REFCLKOoutput of the PIC32 microcontroller works very well formoderate-frequency output waveforms after it is condi-tioned by the simple passive network shown near the cen-ter of Fig. 4. The REFCLKO output can be clocked atup to 40 MHz using the PIC32 system clock or at upto 96 MHz using the internal USB PLL clock.18 Eventhough the PIC32 output pins are not specified for op-

Page 6: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

6

14-bit single-channel (AD9102) or 12-bit 4-channel (AD9106)

Out1NCOut2Trig

SPI outCS1

AGNDSPI CLKOA V+OA V-SPI in CLKNGND CLKP+5V

Two 10-pin headers, spaced by 0.7".

3.3V regulator

Out1

AGNDOAV-

AGND

SMAJ4

AGNDx3

J3

22

11

AGND0.01_uFC16

AGND

1kR9

100

R80.01_uF

C15AGND

AGNDOAV-AGND0.1_uF

C14OAV+

C13

Out1

14k

R70.1_uF

C12

0.1_uF

C11

0.1_uF

C10Out2Trig

CSSPIout

100

R6

SPIclkOut1

100

R5

CSCLKNSPIin

GND

AD8129

U4

-+

4 REF

3P

D

5 FB 27

681

SPIinVDDCLKPSPIout

J2

20191817161514131211

SPIclk

J1

10987654321

OAV+OAV+CLKP

5VOAV-AGND

TrigCLKN

AD9102/06U3

22 CLDO

18REFIO

24CAL_SENSE

7 SDO/DO

6 DLDO14 DLDO2

30IOUTN2

27IOUTP1

28IOUTN1

25FSADJ1

9 Reset

1 SCLK

8 CS

31IOUTP2

21 CLKP

20 CLKN

2 SDIO

32Trigger

VDDx4AGNDx2

AG

ND

x3 NCx6

AGND0.01_uFC9

1kR4

100

R3

0.01_uFC8

AGNDC7AGND

OAV+1_uF

C6

10_uF

C5 +

MCP1702-3302EU23VOUT

1G

ND

2 VIN100

R20.1_uF

C4

0.1_uF

C3

0.1_uF

C2

1_uF

C1

VDDOut2

100

R1

5VVDD

AD8129

U1

-+

4 REF

3P

D

5 FB 27

681

OAV+

FIG. 5. Schematic of a combination arbitrary waveform generator and direct digital synthesizer, using the AD9102 (14 bits,one channel) or AD9106 (12 bits, up to four channels). The output amplifiers (AD8129 or AD8130) can drive a 50 ohm linewith amplitudes exceeding ±2.5 V.

eration above 40 MHz, the 96 MHz clock seems to workwell.

The differential buffer amplifiers, AD8129 or AD8130,can drive a terminated 50 ohm line with an amplitudeof ±2.5 V. At full bandwidth the rms output noise levelis approximately 1 mV, or 1 part in 5000 of the full-scale output range. The DAC switching transients wereinitially very large at ∼80 mV, but after improving theground connection between the complementary outputsampling resistors (R5 and R6 in Fig. 5), the transientswere reduced to 6 mV pulses about 60 ns in duration,and they alternate in sign so that the average pulse areais nearly zero. The large-signal impulse response wasmeasured using an AD8129 to drive a 1 m, 50 Ω cable,by setting up the AD9102 waveform generator to pro-duce a step function. The shape of the response functionis nearly independent of the step size for 1–5 V steps.The output reaches 0.82 V after 4 ns, approaching thelimits of the 100 MHz oscilloscope used for the measure-ment, demonstrating that the circuit approaches its de-sign bandwidth of & 150 MHz. However, it exhibits aslight shoulder after 4 ns, taking nearly 8 ns to reach 90%of full output and then reaching 100% at ∼11 ns. Afterthis initial rise, the output exhibits slight ringing at the∼1% level with a period of about 100 ns, damping out inabout three cycles to reach the noise level. This ringingis caused at least in part by the response of the ±5 Vregulators to the sudden change in current on the outputline, and is not observed with smaller steps of ∼0.1 V.

2. DAC32 The DAC32 daughter board is a straight-forward design that includes one or two of the sameAD5689R DAC chips described in Section III, providingup to four 16-bit DAC outputs, together with an un-committed dual op amp. The op amps have inputs and

outputs accessible on the 20-pin DIP connector, and canbe used in combination with the DACs or separately.

3. LockIn The LockIn daughter board does just whatits name implies. It realizes a simple but complete lock-inamplifier, with a robust adjustable-gain instrumentationamplifier (AD8226 or AD8422) driving an AD630 single-chip lock-in amplifier that works well up to about 100kHz. The output is amplified and filtered, then digitizedby an AD7940 14-bit ADC. The performance is deter-mined mainly by the AD630 specifications, except thatthe instrumentation amplifier determines the input noiselevel and the common-mode rejection ratio. When usedon the LabInt32 PCB, the digital potentiometer on themain board can be tied to this daughter board to allowcomputer-adjustable gain on the input amplifier.

4. ADC32 The ADC32 board is still in the designstage. It will use an AD7687B 16-bit ADC, togetherwith a robust ADG5409B multiplexer and an IntersilISL28617FVZ differential amplifier, to provide a flexi-ble high-resolution analog-to-digital converter support-ing four fully differential inputs. In addition to offer-ing higher resolution than the built-in 10-bit ADCs onthe PIC32 microcontroller, it offers a much wider inputvoltage range and considerable protection against over-voltage conditions.

IV. SPECIAL-PURPOSE INSTRUMENTATION

A. Temperature Controller and PZT driver

The Temp32 PCB, shown in block form in Fig. 6, usesa 28-pin PIC32MX250F128B on a card optimized specif-ically for low-bandwidth analog control, with three sep-

Page 7: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

7

Tablet, with VREF, 5 ppm/C

OPA548op amp

PID10k thermistor

error voltage display

VREF

VREF/2

AD5689R16-bit DAC

SPIPIDalgorithmon 28-pinPIC32processor

22-bit - ADC(MCP3550),15 Hz rate

SPIOPA548

SecondAD5689R

SPI

10k 5 ppm/C

processorVREF/215 Hz rate

DAC

FIG. 6. (Color online) Major elements of the precision tem-perature controller. High-voltage PA340CC op amps can besubstituted for the OPA548 high-current drivers for use as adual PZT driver.

arate ground planes for digital logic, signal ground, andanalog power ground. While simple enough to be usedfor general-purpose temperature control, the board wasdesigned to allow the very tight control needed for single-mode distributed Bragg reflector (DBR) lasers, for whicha typical temperature tuning coefficient of 25 GHz/C ne-cessitates mK-level control for MHz-level laser stability.19

As shown in Fig. 6, a divider formed by a thermistorand a 5 ppm/C precision resistor provides the input toa 22-bit ADC. The Microchip MCP3550-60 is a low-cost“sigma-delta” ADC that provides very high accuracy andexcellent rejection of 60 Hz noise at low data rates (15Hz). A 2.5 V precision reference is used both for the ther-mistor divider and to set the full-scale conversion range ofthe ADC, making the results immune to small referencefluctuations. No buffering is required for the thermis-tor, although if a different sensor were used a low-noisedifferential amplifier might be desirable.20

The microcontroller program implements a PID(Proportional-Integral-Differential) controller using inte-ger arithmetic, with several defining and constraining pa-rameters that can be optimized via the tablet interface.The output V after iteration i is determined by the errorEi, gain factors GP , GI and GD, the sampling frequencyf , and a scale factor S = 8192 that allows the full 16-bitrange of the output DAC to be used:

Ii = Ii−1 + Ei ∗GI/f

if (Ii > Imax) or (Ii < Imin), set to limit.

〈D〉 = running average of (Ei − Ei−1) ∗ fV = V0 + (Ei ∗GP + 〈D〉 ∗GD + Ii)/S (1)

if (V > Vmax) or (V < Vmin), set to limit.

This output is sent a DAC32 daughter board, then am-plified by an OPA548 power op amp capable of driving60 V or 3 A. The separate analog power ground plane forthe output section of the PCB is connected to the analogsignal ground plane only at a single point.

With a conventional 10 kΩ thermistor, the single-measurement rms noise level is approximately 7 ADCunits, corresponding to about 0.3 mK near room tem-perature. Assuming a bandwidth of about 1 Hz for heat-ing or cooling a laser diode or optical crystal, the time-averaged noise level and accuracy can exceed 0.1 mK,

15 dB,GVA 62+

TabletDAT-xx-SP Digital

ADF4351,35-4000 MHz

PLL Loop filter

f7th-order

GVA-62+

ADF4351

SPIMainoutput

SPI

Digitalattenuator PIC32

Micro-controller

MHz SPI rf switch,

HMC284low-pass

7th-orderADF4351SPIcontroller

PLL Loop filter

7 order low-pass Secondary

output

FIG. 7. (Color online) block diagram of a dual 35-4000MHz frequency synthesizer, with ns-scale switching and pro-grammable output attenuation.

adequate for most purposes in a typical laser-based re-search lab.

The TEMP32 circuit board can alternatively be usedas a dual 350-V PZT controller for laser spectrum ana-lyzers or other micron-scale adjustments. To accomplishthis, the ADC is omitted and the output op amps aresubstituted with Apex PA340CC high-voltage op amps,using a simple adapter PCB that accommodates thechanged pin-out.

B. Frequency Synthesizer

The FreqSynth32 PCB, presently in the testing phase,is intended to provide accurate high-frequency rf signalsfor applications such as driving acousto-optic modula-tors. It supports up to two ADF4351 ultra-broadbandfrequency synthesizers, which can produce far higher fre-quencies than DDS synthesizers. These PLL-based de-vices include internal voltage-controlled oscillators andoutput dividers, allowing self-contained rf generationfrom 35-4000 MHz. As shown in Fig. 7, an rf switchallows ns-timescale switching between the two synthesiz-ers, or if one is turned off, it allows fast on-off switching.Signal conditioning includes a low-pass filter to eliminateharmonics from the ADF4351 output dividers, as well asa broadband amplifier and digital attenuator that pro-vide an output level adjustable from about -15 dBm to+16 dBm. The output can drive higher-power ampli-fier modules such as the RFHIC RFC1G21H4-24, whichprovides up to 4W in the range 20-1000 MHz.

It is a challenge to work over such a broad frequencyrange. Although an impedance-matched stripline designwas not attempted because this would require a PCBsubstrate thinner than the 0.062” norm, considerable at-tention has been paid to keeping the rf transmission pathshort, wide, and “guarded” from radiative loss by numer-ous vias connecting the front and back ground planes onthe PCB.

C. Laser Current Control Interface

The MPL Interface PCB, described more fully on myweb page,2 is designed as a single-purpose interface toa laser diode current driver compatible with the MPL

Page 8: Instrumentation for laser physics and spectroscopy using ...inspirehep.net/record/1245147/files/arXiv:1307.7160.pdf · lated laser lab instrumentation based on 16-bit mi-crocontrollers

8

series from Wavelength Electronics. However, this circuitmay be of more general interest for two reasons. First,it allows control and readout of devices with a groundreference level that can float in a range of ±10 V, with 13-16 bit accuracy. Second, its control program includes fullsupport for a rotary shaft encoder (Bourns EM14A0D-C24-L064S) and a simple serial LCD display (SparkfunLCD-09067), allowing the laser current to be adjustedand displayed without the USB tablet interface. Thesame encoder and display could also be attached to theLabInt32 PCB using jacks provided for this purpose.

V. CONCLUSIONS

A significant portion of the research needs of a typi-cal laser spectroscopy or atomic physics laboratory canbe met by the four PCBs described in Secs. III andIV, together with appropriate software and the daughterboards in Sec. III A. The advantages of this approach in-clude simple and accessible modular designs, a user inter-face to an Android tablet with interactive high-resolutiongraphics, and easily reconfigurable software. The circuitdesigns are intended for in-house construction, reducingexpenses and allowing valuable educational opportunitiesfor students, while still offering the high performance ex-pected of a specialized research instrument. Most of thePCBs can be hand-soldered, although a hot-air solder-ing station is required for the two rf circuits (Wvfm32and FreqSynth32). Full design information and softwarelistings are available at my website.2

Apart from these general considerations, these instru-ments offer some unusual and valuable capabilities. Oneis the single shared Android app that provides a fullgraphical interface to numerous different devices. Whenthe tablet is removed after adjusting the operating pa-rameters, the microcontroller stores the updated param-eter values and the instrument will continue to use themindefinitely. Another is the very small size of the Wvfm32waveform generator, which takes advantage of a simpledirect interface connection to a microcontroller to providevoltage-output arbitrary waveform generation and DDSon a 1.5”×0.8” PCB. Up to two of these PCBs can bemounted on a LabInt32 general-purpose interface card,itself measuring only 5”×2.25”, and only a single semi-regulated 6V, 0.5A power supply is required. Similarly,the DAC32 and LockIn daughter boards share the samesmall footprint, facilitating control instrumentation thatcan fit inside the device being controlled.

The primary usage of these instruments in our ownlaboratory is to control several diode lasers and to pro-vide flexible control of numerous frequency modulatorsneeded for research on optical polychromatic forceson atoms and molecules.21,22 Although the availablecircuits and software reflect this focus, most of theseinstruments can be used for diverse applications in theirpresent form, and all can be modified readily for specialneeds.

ACKNOWLEDGMENTS

This work was supported by the National ScienceFoundation.

1E. E. Eyler, Rev. Sci. Instrum. 82, 013105 (2011).2E. E. Eyler, web page at http://www.phys.uconn.edu/~eyler/

microcontrollers/, Microcontroller Designs for Atomic, Molec-ular, and Optical Physics Laboratories, University of Connecti-cut Physics Dept.

3P. E. Gaskell, J. J. Thorn, S. Alba, and D. A. Steck, Rev. Sci.Instrum. 80, 115103 (2009).

4T. Meyrath and F. Schreck, A Laboratory Control System forCold Atom Experiments, Atom Optics Laboratory, Center forNonlinear Dynamics and Department of Physics, Universityof Texas at Austin, http://www.strontiumbec.com/Control/

Control.html, 2013.5See, for example, M. Ugray, J. E. Atfield, T. G. McCarthy, andR. C. Shiell, Rev. Sci. Instrum. 77, 113109 (2006).

6D. Sandys, Life After PI, Digi-Key Corporation, June 14,2013, available at http://www.digikey.com/us/en/techzone/

microcontroller/resources/articles/life-after-pi.html.7MikroElektronika Corp. Visegradska 1A, 11000 Belgrade, Serbia.See http://www.mikroe.com/mini/pic32/.

8Faster 50 MHz versions are also described in the data sheets,but were not yet widely available as of July 2013. SeePIC32MX1XX/2XX Data Sheet, Document DS61168E, 2012,Microchip Technology Inc., 2355 West Chandler Blvd., Chan-dler, Arizona, http://www.microchip.com.

9Aoyue968A+, available from SRA Soldering Products, Foxboro,MA. To mount surface-mount chips a thin layer of solder pastewith flux should be applied to the PCB pads; we have obtainedgood results using ChipQuik model SMD291AX.

10Links to information and software for USB interfacing with theAOA protocol can be found at http://source.android.com/

accessories/custom.html.11Part of the Microchip Application Libraries, Microchip

Technology Inc., 2355 West Chandler Blvd., Chandler,Arizona. See http://www.microchip.com/pagehandler/en-us/

technology/usb/gettingstarted.html (2013).12W-M Lee, Beginning Android Application Development, Wiley

Publishing, Indianapolis, 2011.13Z. Mednieks, L. Dornin, G. Blake Meike, and M. Nakamura,Programming Android, O’Reilly Media, Sebastopol, CA, 2011.

14Android Software Development Kit (SDK), http://developer.android.com/sdk/index.html, 2013.

15The free AChartEngine library for Android, written in Java, isavailable at http://code.google.com/p/achartengine/.

16MPLAB XC32 Compiler, free version, Microchip TechnologyInc., 2355 West Chandler Blvd., Chandler, Arizona, http:

//www.microchip.com/pagehandler/en_us/devtools/mplabxc/.Version 1.20 was used for this work.

17On-The-Go and Embedded Host Supplement to the USB Revi-sion 2.0 Specification, Rev. 2.0 version 1.1a, July 27, 2012, avail-able for download from http://www.usb.org/developers/docs/.

18PIC32 Family Reference Manual, Microchip Technology Inc.Available for download (by chapter) at http://www.microchip.

com).19J. Spencer, Photodigm Corp., Tunable Laser Diode AbsorptionSpectroscopy (TLDAS) with DBR Lasers, Aug. 4, 2011, availableat http://photodigm.com/blog/bid/62359.

20J. Horn and G. Gleason, Weigh Scale Applications for theMCP3551, Microchip Application Note AN1030, MicrochipTechnology Inc., 2006.

21M. A. Chieda and E. E. Eyler, Phys. Rev. A 86, 053415 (2012).22S. E. Galica, L. Aldridge, and E. E. Eyler, to be published.