Microcontroller Designs for Atomic, Molecular, and Optical Physics Laboratories
Last updated on September 26, 2015: New lock-in and 16-bit ADC daughter boards
During the past few years, I have been designing several PCBs using 32-bit PIC32MX series microcontrollers with a USB interface to an Android tablet. The tablet provides an inexpensive touch-screen interface with the capacity for fast high-resolution graphics. The app available below provides a general-purpose interface, into which specific parameter values and their limits are loaded from the microcontrollers each time a connection is established. The general approach and a description of some of the new designs is described in a recent article, Review of Scientific Instruments 84, 103101 (2013). A brief summary was also presented as a poster at the June 2013 DAMOP meeting of the American Physical Society: download poster.
The Java code for the tablet app has been developed using a Google Nexus 7 tablet, on which it works extremely well. It has also been tested with a Nexus 9, on which it performs well, and on an older Archos 80 G9, which performs adequately but with some degredation of the touch interface is slightly less smooth on this device. Data plots are produced using the public-domain “AChartEngine” package for Android.
The microcontrollers are programmed entirely in C, using the free version of the Microchip XC32 compiler (V. 1.34), using the MPLAB X development environment (V. 2.30) and a legacy version of the Microchip USB drivers for Android ADK (included in the source files for each project). An inexpensive Microchip PICKit 3 programmer (about $45) is used to transfer the resulting .hex file to the device via a six-pin header that is a part of the PCB design. You may want to change the default compiler options to make it easier to create your own new versions of the programs, as described here: MPLAB_configuration_instructions.pdf .
If you wish to duplicate one of these devices, all that is really essential is the .apk package for the Android tablet, the .hex file for the programmer, and the Gerber files for the printed circuit card, which can be sent to a PC board prototyping company such as Alberta Printed Circuits, which we have used with consistently good results. The Gerber files are a universal format that should be usable by any such company, although there may be minor issues with the availability of certain drill diameters. The diameters specified in the ".nc" files are the actual tool diameters prior to plating.
The microcontrollers, Microchip PIC32MX250F128B (28 pins), PIC32MX250F128D (44 pins), or PIC32MX270F256D (a newer upgraded version of the 250F128D), are available for about $5 and come in relatively convenient packages for manual assembly. The circuit designs were produced using low-cost Winqcad schematic capture and autorouting software, which is no longer maintained, although my Winqcad design files are available on request. If you want to create your own designs, there are public-domain Unix-based alternatives that might be a good choice, and the moderately priced Eagle program seems to be popular.
Most of the surface-mount components can be hand-soldered with a fine-tip soldering iron if necessary, with the exception of QFN/LFCSP packages such as the AD9102/AD9106 chip on my WVFM32 daughter board. It’s much easier, though, to solder all of the surface-mount chips with a hot-air soldering station such as the inexpensive Aoyue 968A+, using a very small amount of solder paste, ChipQuik SMD291AX or similar. Accidental solder bridges between pins can be fixed by using a fine copper braid with rosin flux to remove the excess (Soder-Wick 80-2-5 or similar). I highly recommend the hot-air method, especially it if you plan to make more than just one board or if you need to solder QFN-type packages, for which it’s almost impossible to use a soldering iron successfully.
Please provide appropriate credit to me (Edward Eyler) and to the University of Connecticut if you benefit from these designs, which were produced with partial support from the National Science Foundation and the UConn Research Foundation. If you make significant improvements to the designs or software, I'd appreciate a copy by email to email@example.com. Thanks!
Before installing, be sure to set the tablet security options to allow installation of apps from “Unknown sources” (i.e., not the Play Store)
The Nexus 7 screen image shows the app after connecting to a TempCtrl32 circuit board. The parameter list at the upper left is scrollable, and the selected value can be adjusted with slider bars or with a pop-up keypad. The plot shows the response of the output voltage (yellow) and temperature error (blue) after a setpoint change. Full scale on the plot is about 0.5 degrees C. Horizontal data points are plotted at 0.533 second intervals (every eighth sample).
This PCB is intended as a general-purpose interface. It supports up to two interchangeable daughter boards, and also has an optional on-board instrumentation amplifier, digital potentiometer, and dual 16-bit DAC. Connectors are also provided for an optional rotary shaft encoder and serial display.
The designs below are slightly older ones that use Microchip dsPIC30F series processors. They are interfaced to a custom OLED/keypad device, also documented below, which uses a PIC24F processor. A descriptive article that describes several of these instruments was published in 2011 by the Review of Scientific Instruments, and a preprint is available here.