Richard J. Smythe

Advanced Arduino Techniques in Science

Refine Your Skills and Projects with PCs or Python-Tkinter

1st ed. 2021
Richard J. Smythe
Wainfleet, ON, Canada
ISBN 978-1-4842-6786-8e-ISBN 978-1-4842-6784-4
© Richard J. Smythe 2021
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company APress Media, LLC part of Springer Nature.

The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.

The Author’s Preface to Arduino Advanced Techniques in Science

Arduino Advanced Techniques in Science is written to provide an introduction to the more advanced techniques used to aid in taking basic scientific measurements. Techniques are presented that can be used by individuals to engage in hopefully more advanced experimental science. It is hoped that the book can assist students, both those new to and those with limited backgrounds in electro-mechanical techniques or the physical sciences, to devise and conduct better experiments in order to further their research or education. It is also hoped that the book will be useful where there are limited financial resources available for the development of experimental designs and experimental or educational programs.

Migrating or foraging animals and insects use daylight, near infra-red light, polarized light, celestial indicators, chemical traces in water, the Earth’s magnetic field, and other aids to navigate over the Earth’s surface in search of food or to return home to their breeding grounds. Astronomy, biology, chemistry, geology/geography, mathematics, physics, and other subjects through to zoology are human concepts and classifications entirely unknown to the travelers of the animal world. There are parallels between the animal kingdom’s usage of multiple scientific phenomena of which they have no knowledge and current scientific investigations. A significant amount of new scientific knowledge is being revealed by investigators educated in one classifiable discipline using the unfamiliar experimental techniques from another. Although written by an analytical chemist, this book is a compilation of introductory basic techniques applicable to any scientific discipline that requires the experimental measurements of basic physio-chemical parameters.

The author is an experimental analytical chemist who has worked with vacuum tubes, transistors, integrated circuits, mainframe, mini-computers, microcomputers, and microcontrollers, over a period during which computing technology transitioned from BASIC, Fortran, and variations of C into iterations of the open source systems such as Python, Processing (the basis of the Arduino microcontroller integrated development environment [IDE] language), and Linux operating systems used in the Raspberry Pi. New and revised versions of languages, IDEs, and operating systems are available free of charge from the internet and are constantly in a state of flux.

This book could be considered virtually obsolete as it is being written, but as with the science and technology that it describes, it is a starting point in an ever-changing subject. For the researcher and practicing scientist, the basic fundamentals of science are relatively constant and reasonably well understood, so a great deal of caution must be used when deciding that a concept or technique is “obsolete.” The SCADA concept and its development significantly pre-date the PC. Some of the transistor and complementary metal oxide semiconductor integrated circuit(s) (CMOS ICs) and the 7400 series of integrated circuitry that are in heavy use today date from the 1970s. Many chemical analysis and physical measurement techniques, taught and in use today, date virtually from the Middle Ages.

SCADA is the acronym for Supervisory Control and Data Acquisition. SCADA software allows a computer to supervise an electro-mechanical process and do so by acquiring data from sensors that are monitoring the process being controlled. Many of the measurement techniques to be discussed can be considered as single-element components that are now a part of the developing technology being called the internet of things (IOT) with the Node-red connectivity open source software.

HMI is the acronym for human–machine interface. The HMI can be an electronic device or construct that provides an interface between a computer, an experimental setup, and a human operator. (A graphical user interface [GUI] may serve as an HMI).

USB is the acronym for universal serial bus, which is, in reality, a written standard of specifications to which electro-mechanical hardware systems are expected to conform. The USB is a subsystem that lets a personal computer communicate with devices that are plugged into the universal serial bus.

When a personal computer runs supervisory control and data acquisition software with a human–machine interface connected via the universal serial bus system, then investigative science experiments or other processes, experimental apparatus, or equipment setups, either “in the field” miles away or “on the bench” next to the computer/workstation/laptop, can be monitored and controlled in realtime.

Laptops, stand-alone desktops, and cabled or wireless networked workstations together with internet connections now allow unprecedented flexibility in laboratory or “in-field” monitoring of investigative science experiments. The options available to the experimentalist for implementing SCADA systems can essentially be divided into three categories based upon the amount of development work required to achieve a fully functional system.

Complete, finished, working software systems that are able to measure and control virtually any electro-optical-mechanical system are available from manufactures such as National Instruments and Foxboro. Commercially available fully functional, basic, software-only systems can be expected to cost in the range of several thousands of dollars.

The author chose to develop this manuscript on three much lower-cost options for SCADA implementation on experimental setups.

A moderate-cost implementation strategy involving the following list of resources has been used to develop the exercises in this manuscript. These resources should also be adequate for further experimental development of new applications:
  1. 1)

    A PC with SCADA software. Numerous systems are available; the DAQFactory Express and the base-level DAQFactory version of the system from Azeotech have both been used in this manuscript. (Cost for DAQFactory base-level software approx. $250 CDN in 2008.) There are on-line, advanced, freeware versions of SCADA systems available for those who are able to adapt the software and may require the extended flexibility.

     
  2. 2)

    A USB HMI; again, there are many devices available from many manufacturers, and the device chosen for this monolog is the model U12 from the LabJack Corporation. (U12 cost approx. $120, a U3 was added later, approx. cost $110 USD.) The LabJack devices are provided with software in the form of a working version of the DAQFactory program called Express. The LabJack-supplied software is excellent with respect to its graphical display capabilities, and for many applications in investigative sciences is more than adequate. The DAQFactory Express is, however, limited to ten lines of script code, five script sequences, and two display pages. For some of the topics discussed and project exercises described in this manuscript, the more extensive capabilities of a commercial version of the DAQFactory software may be required. If the software is to be purchased, the reader should start with the most basic program available and add upgrades as required.

     
  3. 3)

    The third option for experimentalists is the newest and lowest-cost approach to the implementation of a SCADA system, which consists of the Raspberry Pi, its Linux operating system, and the Python programming language with its Matplotlib library and Tkinter graphical user interface. The Linux operating system, Python, and its modules are all open source projects and hence free for download from the internet. The Raspberry Pi project has made available the Raspberry Pi board that can be purchased from many large electronics supply houses such as Digikey or Newark Element 14, to name only two, for $35 USD. The Raspberry Pi board requires an HDMI-compatible TV or computer monitor, mouse, and keyboard to form a fully functional computing system. In addition to the virtually no-cost software, the Raspberry Pi board contains its own general-purpose input–output bus as well as its USB input–output connection, and hence contains its own HMI, requiring no additional circuitry or expense to be interfaced to external electronics or experimental setups. The Raspberry Pi board is manufactured with an Ethernet connection and is thus network capable.

     

In 2008, an open source project called Arduino made available a series of USB-connected microcontroller boards that allowed designers, artists, hobbyists, and non-electronics specialists to interface optical-electro-mechanical devices to a computer. The basic Arduino Uno Revn. 3 board can be purchased from any of the major electronics supply houses for $25 USD. The software to program the microcontroller board is another open source project and is freeware that can be downloaded from the internet. The Arduino board can be used with Windows or Linux-based operating systems and is fully supported with an online forum, many tutorials, and an extensive range of example programs and applications.

The costs to be expected for experimental investigations using SCADA-type implementations can thus take the form of a complete commercially available package, useable as received with no required development time, as opposed to a lesser-cost system requiring a moderate amount of programming using the DAQFactory program and commercial HMI devices such as the LabJack series of interfaces, or even an assemblage of very low-cost hardware and open source software freely available for download from the internet.

In addition to the software and hardware required to implement the monitoring and controlling system, additional ancillary equipment may be required in the form of the following list:
  1. 1)

    A solderless breadboard system, appropriate power sources such as battery- or electronic-regulated supplies, and access to various IC and passive electronic components is required.

     
  2. 2)

    For troubleshooting, a multimeter is required, and for more advanced work an oscilloscope—either standalone or an oscilloscope program for a PC—may be required.

     

It is suggested that the reader, new to this technology, work through the book in order of presentation so as to gain practice and confidence with software, wiring, and increasing project complexity. The basics of scripting software, hardware interfacing, electronics fundamentals, and IC usage will all progressively become more complex, and the basic knowledge and procedures established in the earlier exercises will not be repeated in the more advanced projects. All science is empirical in nature, and this book is no different than real-life scientific work; the investigator must progress from the simple to the more complicated facets of the project at hand, verifying and validating each intermediate step in a multi-stage measurement process.

The rate at which the individual can progress through the various topics presented will be dependent upon their knowledge of the basic physical sciences that form the core of the exercises. If difficulty is encountered, textbooks, online tutorials, and academic course outlines with exercises can be located to further aid in understanding the required base knowledge.

As the title states, this book deals essentially with monitoring and measuring physical–chemical parameters with integrated circuitry and physical computational systems. In this work, inexpensive “off-the-shelf” components are used to monitor and control experimental setups that are able to measure data in the form of basic physio-chemical parameters of interest to investigators in many of the classified sciences, in some cases astounding: sensitivity, flexibility, accuracy, and precision.

DISCLAIMER

  1. 1)

    110 volt electricity can be lethal and will start fires.

     
  2. 2)

    Soldering irons are hot enough to cause serious burns.

     
  3. 3)

    This book is for educational purposes only and presents concepts that are demonstrated through experimental formats. These experimental setups have not been tested for robustness and are not designed or intended for any form of implementation in field service. These concepts are the basis for education only and are intended as starting points for further R and D into instrumental methods of monitoring experimental scientific apparatus for the purposes of gathering data or making physical measurements.

     
  4. 4)

    The concept for this book came to the author in the mid-1960s, and in the interim years various portions of this book were developed with the technology available at the time, while other concepts were found to be unworkable. Although formal assembly of this book was begun in 2008 and 2009 using the integrated circuitry, physical computing, and internet information resources available at that time, the book continues to develop as it is being written using new integrated circuits, physical computing software, and online information sources. The continued availability of either software or electro-mechanical hardware can never be assured, and hence the practitioners of this or any science must learn the art of “a workaround.”

     
../images/503606_1_En_BookFrontmatter_Figd_HTML.jpg
Roadmap to the Exercises in Advanced Arduino Techniques in Science

As noted in the author’s preface, this book is not intended to be a first-time or ab initio introduction to the use of microprocessors as smart peripherals in scientific experiments. This text is directed to those who have some experience in working with electronic hardware and computer software and are looking to expand the capabilities of their research or experimental setup. A basic familiarity with simple electronics as well as some elementary programming knowledge in a structured language such as Python or C++ will be required to complete some of the Advanced Arduino Techniques in Science chapter exercises.

New hardware or components introduced in the chapters should be evaluated from the manufacturer’s literature to gain an appreciation or understanding of the advantages or capabilities to be realized from the implementation of the new techniques the device will enable. Online forums and application notes can also provide numerous practical applications of the hardware at hand.

This book is devoted to describing auxiliary techniques, methods, equipment, and precautions to be used in improving the application of Arduino microprocessors to scientific investigations. A large portion of the following text in this roadmap to the exercises reviews numerous topics, some of which include the terminology of specifications, suggested best practices in scientific methods, established or standardized methods for implementing SCADA unit operations, and the general precautions to be aware of while improving experimental setups. Advanced Arduino Techniques in Science is an attempt to gather together most of the additional techniques, modifications, and improvements using simple, relatively inexpensive components and materials to improve the quality and quantity of data obtained from the basic experimental setups used over the past years’ various investigations.

Several of the chapters in Advanced Arduino Techniques in Science can be considered as “unit operations.” Baking a cake is a process consisting of a number of individual steps that in chemical engineering are referred to as “unit operations.” Measuring out and blending the cake ingredients, baking, and decorating can be considered as unit operations. A cake-baking process can thus be defined in terms of the individual unit operations required to completely describe the process. A series of electro-mechanical unit operations can be combined to measure or control more complex experimental investigations. Several of the chapters and exercises are unit operations that can be assembled into existing experimental setups to better control a process or to greatly extend the sensitivity or range of measurements being made by the system.

Project Management

When altering or adding to an experimental setup, the investigator should review as much up-to-date information as is available on the intended change. If an alteration involves the addition of a self-contained unit operation such as a PID controller, the controller should be assembled and tested on a simpler but representative system to both validate controller function and ensure the controller will not damage the in-service process or experimental setup.

Prior to any alterations to an in-service experimental setup, the investigator should thoroughly test and document system performance. The documentation should be of sufficient detail that in the event of failure the original experimental setup’s configuration can be reproduced. Documentation may include noting response to a standard test, photographing circuit configuration, or recoding whatever is necessary to reestablish initial performance conditions.

For the modification of complex experimental setups, begin assembling the hardware/electronics and corresponding software from the simplest unit operations of the project, debugging the individual modules then verifying operational status until the entire project functions as designed.

In all scientific reports, the documentation must be complete to the point at which any other researchers can duplicate the original experimental work and confirm the reported observations or system performance. Newly developed or modified software code must be liberally commented for those attempting to duplicate the work being described and for the investigator to be able to modify the code as required for more efficient operation or changes made to the electro-mechanical system under development.

To duplicate the work of another, clear definitions of units must exist. Caution is required in reading schematic diagrams and attempting to duplicate their assembly as certain discrete components and integrated circuitry are constantly decreasing in physical size or are replaced with newer technology. The decrease in size means that identification markings on components are getting smaller also.

Resistance and capacitor markings may appear in several formats as combinations of numbers and letters with the magnitude symbol sometimes replacing the decimal point.

Resistors (Ω)

M is 106 or 1,000,000 ohms and typical identifications may be 1.5M or 1M5.

K is 103 or 1,000 ohms and typical identifications may be 1.2K or 1K2.

R is 100 or 1 or unity ohms and typical identifications may be 100R or just 100 as there is no decimal point to replace.

m is 1/1000 or 10-3 ohms and 0.052 Ω is written as 52 mΩ.

Capacitance units in older works were mainly limited to micro and pico Farad designations, and the range of nano was covered either by thousands of pico or thousandths of microFarads. Most current capacitor notation usage seems to adhere to the three main fractional designations listed below, but has recently been expanded to include the Farad to avoid using thousands and millions of the micro term when describing ultra- and super-capacitor devices.

Capacitors (F)

u is microFarad and is 10-6 Farads.

n is nanoFarad and is 10-9 Farads.

p is picoFarad and is 10-12 Farads.

When selecting the components or techniques intended to alter or augment an in-service experimental setup, a certain amount of caution must be exercised to ensure that the finished construct is suitable for the desired measurement. A case in point can be found in the creation of something as simple as a linearly changing voltage value. Modern electronics technology presents two simple methods for the creation of a “voltage ramp” in which the value of a voltage varies linearly with time between a lower and upper voltage value. In a linear system, the electrical potential can be deemed to “ramp up” or “ramp down.” If a four-bit digital-to-analog converter is used, the values from 0 to 24 (0 to 15 or 16 digital values) can be created as incremental voltages. A 16-volt signal applied to the digital-to-analog converter (DAC) can thus provide a series of discreet steps between the values of 0 and 15 volts in approximately one-volt increments. The one-volt steps may be adequate for positioning a robot or mirror in any one of sixteen possible positions but may not be of use in an electrochemical application. If particular chemical reactions were to occur in which several metals were deposited from a solution at several different impressed non-integer voltage levels, it may be necessary to have a smooth voltage waveform whose voltage value continuously ramps between the desired levels. The smooth transition of continuously varying voltage values is of course an analog waveform and must be generated by special methods, one of which is using a constant current source to charge a capacitor in order to produce a linear voltage change across the capacitor plates.

Although calculus demonstrates that by selecting a sufficiently large number of tiny steps we are able to mimic an analog signal with a digital, the approximation is still a digital signal that may not have the exact desired value for the application at hand, and a continuously variable analog voltage signal from a constant current-based capacitor charging methodology may be necessary. The selection of which variation technique to use will depend upon the voltage resolution required and the availability of the electronic components at hand.

In the Advanced Arduino Techniques in Science chapters and exercises, very simple electrical circuits will be assembled on a breadboard and connected to the LabJack HMI, DAQFactory Express system, Arduino microcontroller DAQFactory combination, or directly to the Raspberry Pi or RPi Arduino systems, to provide an interface between the working electronic circuit and a computer-generated GUI. Each of these combinations allows the experimenter to exercise supervisory control, acquire data, or monitor a data-stream trend through a software, user-interface screen. The modification of an in-service electro-mechanical experimental setup should be done incrementally if possible. Experimental modification actions should mechanically assemble circuits, test them, and establish their functioning before configuring software for new data acquisition or hardware-control operations. As a general rule, the hardware is assembled, tested, and validated before one moves on to interfacing and software development.

When working with electrical signals from a new sensor or experimental apparatus, ensure that the output voltage level does not exceed the input voltage capability of the electronic components being used to process the signal. Most discrete integrated circuitry is limited to 5 volts, some op-amps will operate at up to 18 volts, and most surface-mount technology operates at a nominal 3.3 volts.

As with all scientific endeavors, a logical progression should be made from the simplest to the more complex. When developing the software for the augmented project at hand, the experimenter should begin with the simplest code possible to establish communication and then consider additional software for DSP, error checking, or implementing any additional logic circuitry.

Advanced Arduino Techniques in Science uses three different programming languages: Arduino’s form of C, Python, and DAQFactory’s sequence and quick-sequence code. Follow the proper formal methodology built into the software at hand. In the DAQFactory software, creating the channels first allows DAQFactory to populate the pop-up intelligent listing of channels, variables, and constants to cut down on error-prone typing. The primary step in all troubleshooting procedures involving written coded systems that do not work is to check all spelling. Names are case sensitive.

As noted previously, when altering working experimental setups, keep detailed notes of what is being done, write down calculations, and sketch schematics and rough mechanical drawings. This is, after all, science. The formal drawing conventions for mechanical systems and electronic circuits can be found in several reference works1 , 2 , 3 that the reader is encouraged to follow.

As an experimental setup is modified from software control of the HMI to wiring of the circuitry on the breadboard, test each segment of the process modification. Work neatly; lay out the wiring parallel to the lines and rows of pins on the breadboard socket. Cross wires at right angles and only bend small copper wires to right angles with your fingers in order to achieve a relatively large radius of curvature. Recall that copper, although very ductile, “work hardens,” so use new wire where possible or make sure that a wire is re-bent to large radius, gentle curvatures no more than a half-dozen times at most.

As an example of the “unit operation” testing philosophy, it is inherently assumed that if all the component parts of a system work then the entire process will work. Remember, however, that the assumption is just that!

Isolation

Chapter 8, “Power and Noise from the USB,” discusses the structure, design and briefly describes the desired functioning of, the communication bus. When modifying an in-service experiment and additional power is required, the investigator is reminded that the USB implementation is essentially a communications standard able to provide limited power to the essentially digital peripherals joining the bus. It is reported that USB 1 and 2 can supply 500 mA and USB 3 900 mA. For experimental modifications in which more than a half Ampere of current is required or the sensitivity of an in-service essentially analog-based experiment is being increased, it is good practice for an external power supply to be used to power the new system. This book is directed at investigators and researchers working on a bench or desktop with self-contained power supplies, such as those that will be encountered in many field or laboratory experimental setups. It is important to realize that in many experimental setups in either laboratory or field, larger currents, line voltage control, and wireless SCADA software will mandate the use of external power-source control for some experimental work.

Software Scripting

All new scripting developed should be fully documented. The name of the sequence, the date the code was written, and the purpose of the new sequence should all be placed at the head of the actual code in accordance with the details for naming and commenting, as given in the various software language references. The heading should also outline what the code does, describe the algorithm in text, and define the variables used. Recall also that a variable must be declared in a scripted sequence, plus the sequence must be running for the variable to exist and be useable. DAQFactory has an auto-start option for a sequence, which will start the sequence when the page is loaded, and if required the auto-start option can be used to automatically start a sequence that declares a set of variables for use in configuring a control screen or sequence.

The RPi and Arduino auto-start their operating system, and defined software variables are available on the application of system power.

Integrated Circuitry and Surface Mount Technology (SMT)

Traditionally, experimenters bought components for mounting on breadboards during testing and project development. The successful breadboard circuit could then be transformed into printed circuit boards with single- or double-sided etched patterns. The double-sided boards often used drilled holes to connect both sides of the board. However, as integrated circuits became significantly smaller they drew less current, became faster, became significantly more sensitive, and are now at the point at which many of these miniature ICs can neither be handled manually nor be electrically connected into circuits by the average researcher.

Smaller IC size has given rise to smaller component area and surface mount technology (SMT) that in turn has made circuit boards much smaller, easier to manufacture, and less expensive. The decrease in physical size and the development of SMT has added a layer of complexity for the experimentalist. Using the advantages gained by physically decreasing the size of the integrated circuits requires adapters to convert SMT components into compatible breadboarding formats.

Electronics exercises in Advanced Arduino Techniques in Science use ICs and SMT ICs that are compatible with the readily obtainable common breadboard systems.

SMT can be used by the experimentalist in development projects, through printed circuit board adapters that can be created from the data sheets published by the IC manufacturer. Adapters often called “breakout boards” are available from several commercial suppliers, and one of the more extensive selections is available from Proto-Advantage of Ancaster, Ontario. In addition to a large collection of adapters, the company also offers an assembly service and will use SMT techniques to mount the IC on the breakout board adapter for the researcher.

SMT-to-breadboard transitions are affected by mounting the microchip on a small, printed circuit adapter board that connects the IC to a series of header pins. The square or round header pins are then used with prototyping boards, sockets, or wire wrap to provide an electrical connection for power and I/O requirements between the IC and the experiment under development.

Many SMT components are available in several different mounting patterns that are usually defined and described in detailed drawings at the end of product data sheets. Some of the acronyms used in describing the SMT devices are as tabulated below:

Capacitors – SMT capacitors are specified by their four-digit size code of length and width in 1/10 in. (1210 is 0.12 long by 0.10 wide)

CQFP – Ceramic multilayer QFP

LCC – Leadless Chip Carriers are packages that are soldered directly onto circuit boards and have no leads.

PLCC – Plastic Leaded Chip Carriers

PQFP – Plastic Quad Flat Pack

QFP – Quad Flat Package; a rectangular IC with leads on all four sides.

Resistors follow the convention of capacitors.

SOIC – Small Outline Integrated Circuit is often followed by the number of pins on the package and sometimes is even further abbreviated to SO-8, for example.

SOP – Small Outline Package has the variations Plastic Small Outline Package (PSOP), Thin Small Outline Package (TSOP), and Thin-shrink Small Outline Package (TSSOP)

TQFP – Thin QFP

More-detailed dimensions are always to be found in the product data sheets and should be reviewed carefully before deciding upon a component and the breakout board required for a given prototype or project. SMT is a rapidly changing field, and new production methods are making obsolescence a frequently encountered problem for the investigator. However, equivalent, more-powerful integrated circuits in newer and smaller packages are being brought to market virtually on a daily basis, and investigators must research the literature for the present form of the circuitry required for a given prototype.

Prototyping breadboards, jumper wires or cables, and integrated circuits are usually the format used to develop, test, modify, or validate a working experimental system. In several of the exercises and measurement techniques encountered in this book, the investigator/experimenter will find that the use of a printed circuit board will be required to enclose a working breadboard circuit in a shielded metal enclosure. Prepared printed circuit boards such as those depicted in Figure RM-1 are available for assembling circuitry into a fixed, secure, and compact format. The two boards to the extreme right are in fact the top and bottom of prototyping boards that mount directly onto the Arduino microprocessor boards to hold either test or permanently wired circuitry within the microcontroller footprint. All of the I/O and power pins are carried through from the microcontroller board underneath to the circuit board above. These boards are often referred to as “shields” and are available from several manufacturers; similar types of circuit boards are available for the RPi and are termed “HATs.”

The etched “universal” boards displayed are available from electronics supply stores and online. The copper traces are 0.1 in., spacing that matches standard dual inline package pin spacing.
../images/503606_1_En_BookFrontmatter_Fig1_HTML.jpg
Figure RM-1

Prototyping circuit boards

There are several circuit board manufacturers that provide or are able to use standardized circuit board design software to manufacture a small or large number of complex circuit boards. Multiple-layer boards and those involving multi-leaded SMT components are best produced by automated systems of commercial manufacturers. Occasionally it may be necessary for the investigator to design and make one or perhaps two simple printed circuit boards for a special application such as the mounting of special components. Figure RM-2 depicts one of a pair of small 1 in. x 1 ½ in. (2.45 cm x 4 cm) hand-drawn PCBs used to mount a pair of 30 KΩ thermistors and 33 KΩ resistors for the measurement of the hot and cold sides of a thermo-electric cooling plate test cell.
../images/503606_1_En_BookFrontmatter_Fig2_HTML.jpg
Figure RM-2

Hand-drawn PCB for mounting and wiring sensors

The basic size of the board needed and the basic simple outline of the copper traces required to hold the components essentially define the size of the board to be fabricated. In the case of the PCB illustrated in Figure RM-2, a pair of boards was needed—one for each side of the test cell—and a single board with two copper tracings was etched, drilled, and then cut in half to facilitate handling during etching and drilling. As can be seen in Figure RM-2, there is a small, brass, round-head mounting screw that holds the PCB, wiring, and mounted thermistor sensor in place on the outside surface of the two-chamber test-cell walls.

A closer inspection of the copper tracing indicates coarseness in both the shape and surface texture of the etched copper patterns. The roughness is reflective of the hand drawing and the very thin nature of the marker-pen ink forming the etchant “resist” layer. A more even and dense copper pattern can be obtained by using either several coats of marker ink or using a much more dense resist, such as a colored cosmetic nail polish. A colored nail polish is easier to see and can be removed after etching with nail polish remover or acetone.

There are several formulations available for etching the excess copper off of the epoxy-clad blank on which the desired pattern is drawn, and the author has had consistent success with a ferric chloride solution. Commercial ferric chloride etchant in 250 ml bottles is adequate for the small boards created and a half-hour to one hour are the etch times at ambient room temperatures. The boards must be clean before etching as fingerprints can act as resist if not removed. Soap and water or a mild kitchen abrasive such as Vim can be used to prepare the board before the application of the resist and etching. A shallow pool of etchant in a plastic dish can be used as an etching tank, and warming the etchant solution will decrease the time required to etch the board.

PCBs that require drilling should be center punched, and the fine drills used to make holes compatible with electrical or electronic connections should be mounted in a high-speed rotary tool such as a Dremel for drilling the copper foil or epoxy board. After preparation of a PCB for a project, test the continuity of all traces on the new board.

There are kits available that use a laser printer to create complex circuit boards from photos. A laser-printed pattern must be hot pressed or ironed on to the board blank to transfer the plastic resist pattern and is a more complex process that the investigator can use if required.

General Comments on Advanced Technologies and Improving Experiments

The following itemized list of generalized suggestions, precautions, and naturally occurring restrictions is presented here as an aid to successfully implementing a modification or improvement to experimental systems:
  1. 1)

    Temperature affects many physical parameters, and often experimental apparatus may need to be insulated, isolated, or even thermostated to minimize temperature variation.

     
  2. 2)

    Use battery power whenever possible as the line or mains power, USB, and line-driven regulated supplies are very noisy for highly sensitive work.

     
  3. 3)

    All wiring lines carrying signals of interest should be twisted and shielded against electromagnetic interference with grounded metal shielding.

     
  4. 4)

    Physical contact between triboelectric active materials can cause static electrical accumulations that interfere with high-sensitivity measurements. Static accumulations vary with room humidity that in turn can vary with the seasons in some climactic regions.

     
  5. 5)

    Prototype boards (Figure 1-3 in Chapter 1, “Arduino and Raspberry Pi”) can be used to test circuits, but for high-sensitivity measurements hard-wired or printed circuit boards should be used and encased in grounded metal cases.

     
  6. 6)

    As most scale expansions simultaneously increase both signal and noise, it is often necessary to use some form of digital signal processing (DSP) to maximize the signal-to-noise ratio.

     
  7. 7)

    Resistors create electrical noise in proportion to the magnitude of the resistance and the temperature of the resistor. Wire-wound resistors are the least noisy, and metal films are less noisy than carbon-based devices.

     
  8. 8)

    Visible, UV, and IR light can affect solid-state devices such as diodes and transistors.

     
  9. 9)

    Air currents can cause variation in temperature, pressure, moisture, and dust movement or deposition.

     
  10. 10)

    Often in trace quantity chemical analysis, greater sensitivity can be achieved by collecting and processing a bigger sample. When measuring very low values of variables such as resistance and capacitance, if discrete units are available consider measuring several units in series or parallel as required. For conductivity a larger area of contact can create a larger signal across the sample cell plates.

     
  11. 11)

    Measurements can often be divided into the two classifications of being relative or absolute. Absolute measurements require calibration of the measurement apparatus with known or defined standards. Relative measurements monitor the change in the parameter being monitored. Generally speaking, if an experiment can be devised to create a relative measurement rather that an absolute, a better measurement will result.

     
  12. 12)

    Current- and voltage-measuring systems using op-amps with very high input impedances, often referred to as electrometers, require a great deal of care in assembly and application in order to produce accurate results. Grounded metal boxes, shielded external measurement probe wires, battery power, and close adherence to the manufacturer’s recommended installation and wiring practices will greatly improve system performance.

     
Acknowledgments

Acknowledgements begin with the author’s late parents, Richard H. Smythe and Margaret M. Smythe (nee Earle), who emigrated from the remains of London England after the war with their small family of three and eventually raised four children in Canada. Our parents instilled in us the need to be educated as much as possible in order for each of us to be self-sufficient and independent. That independence has led to the comfortable retirement of the middle two, the youngest continuing in her chosen occupation for close to a decade past retirement, and the oldest still actively engaged in the business of chemical analysis consulting and the practice of civil forensic science.

Along the way, numerous individuals have served as an inspiration while teaching and mentoring this author, imparting knowledge, the art of rational thinking, tenacity, and in most cases valuable wisdom: From Merritton High School in St. Catharines Ontario, Mrs. E. Glyn-Jones, mathematics, Mr. J. A. Smith, principal, and Mr. E. Umbrico, physics. From Brock University in St. Catharines Ontario, Prof. E. A. Cherniak, Prof. R. H. Hiatt, Prof. F. Koffyberg, and Prof. J. M. Miller. From the University of Waterloo in Waterloo Ontario, Prof. G. Atkinson. From The State University of New York at Buffalo, Prof. S. Bruckenstein.

It may also be said that the seeds for the growth and development of this work began when as a parent the author made sure that both his daughters—Wendy and Christie—could read at a very early age and devised graphic teaching aids for them to learn and understand binary digital arithmetic.

Acknowledgements would not be complete without recognizing the person who has allowed me the time required to write, in spite of life’s every day chaos in the country, my spouse Linda. She has suffered through many years of papers, notes, books, breadboards, wires, electronic components, and desktop experiments scattered everywhere in our home and when she wasn’t looking, on the kitchen table! Thank You my love.

Although the author’s career consists of solving essentially chemistry-based problems and writing reports explaining how the problem came into existence, how to correct its effects or avoid its recurrence, the author has never written a book. This work would not be possible without the help and guidance of editors at Apress—Ms. Natalie Pao, Ms. Jessica Vakili, and Mark Powers.

Table of Contents
Index 271
About the Author
Richard J. Smythe
../images/503606_1_En_BookFrontmatter_Figb_HTML.jpg
attended Brock University in its initial years of operation in southern Ontario and graduated with a four-year honors degree in chemistry with minors in mathematics and physics. He then attended the University of Waterloo for a master’s degree in analytical chemistry and computing science and a doctorate in analytical chemistry. After a post-doctoral fellowship at the State University of New York at Buffalo in electro-analytical chemistry, Richard went into business in 1974 as Peninsula Chemical Analysis Ltd. Introduced in 1966 to time-shared computing with paper tapes, punched cards, and BASIC prior to Fortran IV at Waterloo, as well as the PDP 11 mini-computers and finally the PC, Richard has maintained a currency in physical computing using several computer languages and scripting codes. Professionally, Richard has functioned as a commercial laboratory owner and is currently a consulting analytical chemist, a civil forensic scientist as PCA Ltd., a full partner in Walters Forensic Engineering in Toronto, Ontario, and senior scientist for contrast engineering in Halifax, Nova Scotia. A large portion of Richard’s professional career consists of devising methods by which a problem that ultimately involves making one or more fundamental measurements can be solved by using the equipment at hand or using a readily available “off-the-shelf/out-of-the-box” facility to provide the data required.
 
About the Technical Reviewer
Roland Meisel
../images/503606_1_En_BookFrontmatter_Figc_HTML.jpg
holds a B. Sc. in physics from the University of Windsor, a B. Ed. from Queen’s University specializing in physics and mathematics, and an M. Sc. in physics from the University of Waterloo. He worked at Chalk River Nuclear Laboratories before entering the world of education. He spent twenty-eight years teaching physics, mathematics, and computer science in the Ontario secondary school system. After retiring from teaching as the head of mathematics at Ridgeway Crystal Beach High School, he entered the world of publishing, contributing to mathematics and physics texts from pre-algebra to calculus in various roles, including technology consultant, author, interactive web files (which he conceived, created, published and edited), and photography. He remains active in several organizations, including the Ontario Association of Physics Teachers, the Ontario Association of Mathematics Educators, the Canadian Owners and Pilots Association, and the Wainfleet Historical Society.

He has always had a strong interest in technology, mail-ordering his first personal computer, an Apple II with a 1 MHz CPU and 16 kB of memory, from California in 1979. At leisure, he can be found piloting small airplanes, riding his bicycle or motorcycle, woodworking, reading, or playing the piano, among other instruments.

 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.152.99