Circuit Cellar #296 2015 03

Download as pdf or txt
Download as pdf or txt
You are on page 1of 84

ROBOTICS

MARCH 2015
circuitcellar.com ISSUE 296
CIRCUIT CELLAR | ISSUE 296 | MARCH 2015

INTERNET OF THINGS
INNOVATION
Build a Microcontroller-Based
Monitoring System

Base Unit Design, Sensor


Unit Integration, Software
Development, & More
Q&A: Cutting-Edge Haptics Research | Editors’ Picks: Robotics Projects
Plug-In Sweep Generator Board | How to Mimic IR Control Signals
| The Sentry Monitoring Project | Sensorless Maximum Power Point Tracking
Cooling Awareness for HPC | Achieve Electromagnetic Compliance
circuitcellar.com

| Handle Startup Transients | More Solid-State Lighting Tips


| E-Compassing for Mobile Robotics The Future of Flexible Circuits
Sponsored by NetBurner

MONTHLY
ENGINEERING CHALLENGE
Each month, you’re challenged to find an error in a
schematic or in code that’s presented on the challenge
webpage. Locate the error for a chance to win prizes and
recognition in Circuit Cellar magazine!

Prizes such as a NetBurner MOD54415 LC Development kit or


a Circuit Cellar subscription will be announced each month.

Participate: circuitcellar.com/engineering-challenge-netburner
Launch: 1st of each month
Deadline: 20th of each month
No purchase necessary to enter or win. Void where prohibited by law. Registration required. Prizes subject to change based on
availability. Review these terms before submitting each Entry. More info: circuitcellar.com/engineering-challenge-netburner-terms
2 CIRCUIT CELLAR • MARCH 2015 #296

TIMELY TOPICS: ROBOTICS, WEARABLES, & MORE


In this issue we cover some of most important subjects of our time: robot systems and
their use in innovative applications such as surgical tools; human- and building-monitoring
Issue 296 March 2015 | ISSN 1528-0608
systems; machine learning; energy efficiency; cutting-edge lighting; flexible circuitry; and
CIRCUIT CELLAR® (ISSN 1528-0608) is published monthly by: more. Here are the details.
On page 6, we present an interview with University of Pennsylvania professor Katherine
Circuit Cellar, Inc.
111 Founders Plaza, Suite 300
Kuchenbecker, who is helping lead a revolution in haptics technology. Her goal: “We should
East Hartford, CT 06108 be able to capture and reproduce how surfaces feel with the same acuity that we can
capture and reproduce how surfaces look.”
Periodical rates paid at East Hartford, CT, and additional offices.
One-year (12 issues) subscription rate US and possessions Turn to page 12 to learn about four of our staff’s favorite robotics projects: an inertial
$50, Canada $65, Foreign/ ROW $75. All subscription orders rolling robot, a photo-taking mobile robot, a robot navigation system, and compact
payable in US funds only via Visa, MasterCard, international
“minirobot.”
postal money order, or check drawn on US bank.
Gerard Fonte wraps up his two-part series, “Electronics Testing Platform,” with details
SUBSCRIPTIONS
about a custom sweep generator board (p. 16). This project is a plug-in board for the base
unit he covered last month.
Circuit Cellar, P.O. Box 462256, Escondido, CA 92046
Looking to add infrared control capability to an electronic system? Check out Tommy
E-mail: circuitcellar@pcspublink.com
Tyler’s article, “Infrared Learning,” in which he presents a low-cost method for mimicking
Phone: 800.269.6301
IR control signals (p. 26).
Internet: circuitcellar.com
David Penrose’s Sentry Project on page 32 won Honorable Mention in the WIZnet
Address Changes/Problems: circuitcellar@pcspublink.com
Connect the Magic 2014 Design Challenge. Follow his lead to construct a building-monitoring
Postmaster: Send address changes to system of your own.
Circuit Cellar, P.O. Box 462256, Escondido, CA 92046 Maximum power point trackers (MPPTs) ensure that maximum power is transferred to
a device from renewable energy input applications. In “Sensorless Maximum Power Point
ADVERTISING Tracking,” you’ll learn about a new maximum power tracking control method (p. 38).
Strategic Media Marketing, Inc. High-performance computing (HPC) clusters run intensive, multi-processor applications.
2 Main Street, Gloucester, MA 01930 USA
On page 46, Ayse Coskun discusses how cooling awareness in job allocation can improve
Phone: 978.281.7708
energy efficiency in such environments.
Fax: 978.281.7706
In February, George Novacek discussed practical EMC requirements for electronic
E-mail: circuitcellar@smmarketing.us
Advertising rates and terms available on request.
systems. This month, he finishes his mulipart series with tips for achieving electromagnetic
New Products:
compliance.
New Products, Circuit Cellar, 111 Founders Plaza, Suite 300 On page 54 Ed Nisley details several parts of a recent machine controller project that
East Hartford, CT 06108, E-mail: newproducts@circuitcellar.com were unexpectedly problematic. Use his “debugging guide” when you’re faced with project
issues of your own.
HEAD OFFICE
Last month, Jeff Bachiochi introduced the topic of electroluminescent (EL) technology.
Circuit Cellar, Inc. 111 Founders Plaza, Suite 300 In this issue he explains how EL technology can produce a nondirectional output as opposed
East Hartford, CT 06108
Phone: 860.289.0800 to an LED’s concentrated point source output (p. 62).
Looking for an interesting robotics project? We pulled Joseph Miller’s “Mini Rover 7”
COVER PHOTOGRAPHY article out of the archives to get you motivated to begin a new project (p. 68).
Chris Rakoczy, www.rakoczyphoto.com Mark Finstad wraps up the issue with an essay on the future of flexible circuitry (p.
80). He prognosticates that they future of flex circuit technology is “on you”—that is, in
COPYRIGHT NOTICE wearable technology.
Entire contents copyright © 2015 by Circuit Cellar, Inc. All
rights reserved. Circuit Cellar is a registered trademark of
Circuit Cellar, Inc. Reproduction of this publication in whole C. J. Abate
or in part without written consent from Circuit Cellar, Inc. is
prohibited. cabate@circuitcellar.com

DISCLAIMER

Circuit Cellar® makes no warranties and assumes no


responsibility or liability of any kind for errors in these
programs or schematics or for the consequences of any
THE TEAM
such errors. Furthermore, because of possible variation in
the quality and condition of materials and workmanship of EDITOR-IN-CHIEF (Green Computing), Bob FOUNDER
reader-assembled projects, Circuit Cellar® disclaims any
responsibility for the safe and proper function of reader- C. J. Abate Japenga (Embedded Steve Ciarcia
assembled projects based upon or from plans, descriptions, or
information published by Circuit Cellar®. ART DIRECTOR in Thin Slices), Robert PROJECT EDITORS
The information provided by Circuit Cellar® is for educational
KC Prescott Lacoste (The Darker Chris Coulston, Ken
purposes. Circuit Cellar® makes no claims or warrants that
Side), Ed Nisley (Above Davidson, and David
readers have a right to build things based upon these ideas ADVERTISING COORDINATOR
under patent or other relevant intellectual property law in
Kim Hopkins the Ground Plance), Tweed
their jurisdiction, or that readers have a right to construct or
operate any of the devices described herein under the relevant George Novacek (The
patent or other intellectual property law of the reader’s PRESIDENT OFFICE ASSISTANT
Consummate Engineer), Alice Roberts
jurisdiction. The reader assumes any risk of infringement Hugo Van haecke
liability for constructing or operating such devices.
and Colin O’Flynn
© Circuit Cellar 2015 Printed in the United States COLUMNISTS (Programmable Logic in
Jeff Bachiochi (From the Practice)
Bench), Ayse K. Coskun
circuitcellar.com 3

OUR NETWORK

SUPPORTING COMPANIES
Accutrace 7 Measurement Computing Corp. 25

All Electronics Corp. 79 microEngineering Labs 79

Anaren 15 MyRO Electronic Control Devices, Inc. 79

AP Circuits 53 NetBurner, Inc. C2, 1

Custom Computer Services 79 Newhaven Display International 41

EMAC, Inc. 19 Pico Technology, Ltd. 31

IAR Systems 43 Saelig Co., Inc. 19

Imagineering, Inc. C4 Technologic Systems 59, 73

Ironwood Electronics 79 Teledyne LeCroy Corp. 11

Jeffery Kerr, LLC 29 Triangle Research International, Inc. 79

MaxBotix, Inc. 79

NOT A SUPPORTING COMPANY YET?


Contact Peter Wostrel (circuitcellar@smmarketing.us, Phone 978.281.7708, Fax 978.281.7706)
to reserve your own space for the next edition of our members’ magazine.
4 CIRCUIT CELLAR • MARCH 2015 #296

CONTENTS MARCH 2015 • ISSUE 296

ROBOTICS

 CC COMMUNITY
06 : QUESTIONS & ANSWERS
Advances in Haptics Research
An Interview with Katherine J. Kuchenbecker
Details on the design and control of haptic interfaces
for applications such as robot-assisted surgery

INDUSTRY & ENTERPRISE


12 : EDITORS' PICKS
Four of the CC staff’s favorite robotics projects

14 : PRODUCT NEWS

15 : CLIENT PROFILE
Freescale Semiconductor (Costa Mesa, CA)

FEATURES
16 : Electronics Testing Platform (Part 2)
DDS Sweep Generator
By Gerard Fonte
How to construct a plug-in sweep generator board

26 : Infrared Learning
How to Mimic IR Control Signals
By Tommy Tyler
A small, inexpensive module for learning and
reproducing infrared signals

32 : The Sentry Project


By David Penrose
Build a compact microcontroller-based, building-
monitoring system

CUTTING-EDGE HAPTICS RESEARCH 38 : Sensorless Maximum Power Point Tracking


By David Weight, Ian Johnson, and Sajjad H. Lalji
An impedance-matching method for a closed-loop
digital control system

STAFF PICKS: INNOVATIVE ROBOTICS PROJECTS A LOOK BACK A THE MINI ROVER 7 ROBOT
circuitcellar.com 5

CONTENTS

MCU-BASED SENTRY MONITORING SYSTEM MAXIMUM POWER POINT TRACKING

68 : FROM THE ARCHIVES


Mini Rover 7 TESTS & CHALLENGES
By Joseph Miller 77 : TEST YOUR EQ
An overview of the Mini Rover 7 robot, which is
modeled after the NASA/JPL Rocky 7 Mars rover 78 : CROSSWORD

COLUMNS TECH THE FUTURE


46 : GREEN COMPUTING 80 : The Future of Flexible Circuitry
Cooling Awareness in HPC Job Allocation By Mark Finstad
By Ayse K. Coskun Why flexible circuitry will grow in popularity as the
How cooling awareness in job allocation can improve interconnect method of choice
energy efficiency

50 : THE CONSUMMATE ENGINEER


Essential Electromagnetic Compliance (Part 2)
Tips for Achieving Compliance
By George Novacek
Useful advice for dealing with EMI

54 : ABOVE THE GROUND PLANE


Startup Transients
By Ed Nisley
Dealing with startup problems arising in a retrofitted
sewing machine controller

62 : FROM THE BENCH


Solid-State Lighting (Part 2) TIPS FOR ELECTROMAGNETIC COMPLIANCE
Get Your Lighting Under Control
By Jeff Bachiochi
How EL technology can produce a nondirectional output
@editor_cc
@circuitcellar circuitcellar
6 CIRCUIT CELLAR • MARCH 2015 #296

QUESTIONS & ANSWERS

Advances in Haptics Research


An Interview with
Katherine J. Kuchenbecker
Katherine J. Kuchenbecker is an Associate Professor
in Mechanical Engineering and Applied Mechanics at
the University of Pennsylvania, with a secondary ap-
pointment in Computer and Information Science. She
directs the Penn Haptics Group, which is part of the
General Robotics, Automation, Sensing, and Percep-
tion (GRASP) Laboratory. In this interview, she tells
us about her research, which centers on the design
and control of haptic interfaces for applications such
COMMUNITY

as robot-assisted surgery, medical simulation, stroke


rehabilitation, and personal computing.

CIRCUIT CELLAR: When did you first become interested in photography) to proclaim an ambitious goal for haptics
haptics and why did you decide to pursue it? research: we should be able to capture and reproduce how
surfaces feel with the same acuity that we can capture and
KATHERINE: I chose to become an engineer because I wanted reproduce how surfaces look.
to create technology that helps people. Several topics piqued When I entered the field of haptics in 2002, a lot of great
my interest when I was pursuing my undergraduate degree in research had been done on methods for letting a user feel a
mechanical engineering at Stanford, including mechatronics, virtual three-dimensional shape through a stylus or thimble.
robotics, automotive engineering, product design, human- Essentially, the user holds on to a handle attached to the end
computer interaction, and medical devices. I was particularly of a lightweight, back-drivable robot arm; the 3D Systems
excited about areas that involve human interaction with Touch device is the most recent haptic interface of this type.
technology. Haptics is the perfect combination of these A computer measures the motion that the person makes and
interests because it centers on human interaction with real, constantly outputs a three-dimensional force vector to give the
remote, or virtual objects, as well as robotic interaction with user the illusion that they are touching the object shown on
physical objects. the screen. I was impressed with the haptic demonstrations
My first exposure to this field was a “haptic paddle” lab in a I tried back in 2002, but I was also deeply disappointed with
Stanford course on system dynamics, but that alone wouldn’t how the virtual surfaces felt. Everything was soft, squishy, and
have been enough to make me fall in love with this field. Instead, indistinct compared to how real objects feel. That’s one of the
it was conversations with Günter Niemeyer, the professor who benefits of being new to a field; you’re not afraid to question
advised me in my PhD at Stanford. I knew I wanted a doctorate the state of the art.
so that I could become a faculty member myself, and I was I started working to improve this situation as a doctoral
inspired by the work he had done as an engineer at Intuitive student, helping invent a way to make hard virtual surfaces
Surgical, Inc., the maker of the da Vinci system for robotic like wood and metal feel really hard and realistic. The key was
surgery. Through my early research with Günter, I realized that understanding that the human haptic perceptual system keys
it is incredibly satisfying to create computer-controlled electro- in on transients instead of steady-state forces when judging
mechanical systems that enable the user to touch virtual hardness. I had to write a research statement to apply for
objects or control a robot at a distance. I love demonstrating faculty positions at the end of 2005, so I wrote all about
haptic systems because people make such great faces when haptography. Rather than trying to hand-program how various
they feel how the system responds to their movements. surfaces should feel, I wanted to make it all data driven. The
Another great benefit of studying haptics is that I get to idea is to use motion and force sensors to record everything
work on a wide variety of applications that could potentially a person feels when using a tool to touch a real surface. We
impact people in the near future: robotic surgery, medical then analyze the recorded data to make a model of how the
training, stroke rehabilitation, personal robotics, and personal surface responds when the tool moves in various ways. As
computing, to name a few. with hardness, high-frequency vibration transients are also
really important to human perception of texture, which is a big
CIRCUIT CELLAR: What is haptography? What are its benefits? part of what makes different surfaces feel distinct. Standard
haptic interfaces weren’t designed to output high-frequency
KATHERINE: I coined the term “haptography” (haptic vibrations, so we typically attach a voice-coil actuator (much
If you do, than we
will match the price
AND give you $100
towards your
next order!

THERE ARE NO GAMES INVOLVED IN OUR PRICING

Our Capabilities:
From same day quick turn prototype to production in under 10 days
Full CAD and CAM review plus design rule check on ALL �erber �les
Materials: Fr4, Rigid, Flex, Metal Core (Aluminum), Polymide, Rogers, Isola, etc.
HDI Capabilities: Blind/Buried Mocrovias, 10+N+10, Via-in-Pad Technology,
Sequential Lamination, Any Layer, etc.
Our HDI Advantage: Direct Laser Drilling, Plasma De-Smear Technology, Laser
Microvia, Conductive Plate Shut.
Take the Accutrace Challenge and see WHY OUR PRICING CANNOT BE BEATEN

www.PCB4u.com sales@PCB4u.com
8 CIRCUIT CELLAR • MARCH 2015 #296

QUESTIONS & ANSWERS

like an audio speaker) to the handle, CIRCUIT CELLAR: How has the
near the user’s fingertips. When Haptics Group grown or evolved
the user is touching a virtual over the past few years? How
surface, we output data-driven many students, researchers, and
tapping transients, friction forces, professors are currently involved
and texture vibrations to try to with the group?
fool them into thinking they are
touching the real surface from KATHERINE: My group has both
which the model was constructed. grown and diversified over the last
After many years of research by my eight years. I started out with just
PhD students Heather Culbertson one PhD student, plus a bunch of
and Joe Romano, we’ve been able students who took my graduate-
to create the most realistic haptic level class on haptic interfaces.
surfaces in the world. Back in those days, I was delighted
My work in haptography is and a little surprised to find that
motivated by a belief that there students wanted to learn more about
are myriad applications for highly what I study. I like to incorporate
realistic haptic virtual surfaces. each student’s interests and ideas
One exciting use is in recording into the research we do together,
what doctors and other clinical which tends to lead us in lots of
COMMUNITY

practitioners feel as they use various interesting directions. For example,


tools to care for their patients, such one of my current PhD students
as inserting an epidural needle or (Naomi Fitter) is really interested
examining teeth for decay (more in using robots for education, so
on this below). Haptography would we’ve been working to create a
enable us to accurately simulate robot that can teach people how to
those interactions so that trainees play hand-clapping games. My lab
can practice critical perceptual- currently includes one postdoctoral
motor skills on a computer model This wearable device allows the user to control the motion of the researcher, five doctoral students,
instead of on a human patient. PR2 robot’s hand and also feel what the PR2 is feeling. The haptic about eight masters students, and
Another application that excites us feedback is delivered via a geared DC motor and two voice-coil four undergraduates. These students
is adding tactile feedback to online actuators. hail from mechanical engineering,
shopping. We’d love to use our electrical engineering, computer
technology to let consumers feel the fabrics and surfaces of science, and bioengineering, and I’ve also worked with several
products they’re considering without having to visit a physical medical students and surgical residents. Overall, I’ve advised
store. Touch-mediated interaction plays an important role in about 40 graduate students and 50 undergraduates in research.
many facets of human life; I hope that my team’s work on I’ve also hosted visiting graduate students from Italy, Germany,
haptography will help bring highly realistic touch feedback into Japan, and South Korea, and I had a prominent Korean haptics
the digital domain. professor spend one year as a visiting faculty member in my
lab. These days, I get a lot of emails from students who want
CIRCUIT CELLAR: You founded the Penn Haptics Group in to join my lab. I’m honored by this attention, but I am sad to
2007. When you started the group, what was your mission? have to turn away so many students want to work on the same
kinds of topics that excite me.
KATHERINE: I wanted to create a world-class research group
dedicated to inventing clever and useful haptic technologies. I CIRCUIT CELLAR: Which of the group’s projects most interest
started at the University of Pennsylvania (Penn) as an Assistant you at this time?
Professor, which means I had six years to prove that I was
worthy of tenure (a job for life). While going through the tenure KATHERINE: That’s a hard question! I’m excited about all of the
process can be stressful, I found it exhilarating to finally have projects we are pursuing. There are a few I can’t talk about,
the opportunity to assemble my own team of students and because we’re planning to patent the underlying technology
work on problems and ideas that interested us. Scientifically, I once we confirm that it works as well as we think it does. Two
have focused on elevating and formalizing our understanding of those that are in the public domain have been fascinating
of haptic feedback while simultaneously uncovering new me recently.
opportunities for its use in interactions between humans, Tactile Teleoperation: My lab shares a Willow Garage PR2
computers, and machines. By working really hard, and through (Personal Robot 2) humanoid robot with several of the other
the hard work of all my great students, I was able to establish faculty in Penn’s GRASP Lab. Our PR2’s name is Graspy.
a research group that is now reasonably well respected in my While we’ve done lots of fun research to enable this robot
field. We have been able to get research grants, publish papers, to autonomously pick up and set down unknown objects,
and even win some awards for our work. I’m proud of the work I’d always dreamed of having a great system for controlling
we’ve been able to do, and I’m equally proud of the students Graspy from a distance. Instead of making the operator use
who have been working by my side. They taught me a lot! a joystick or a keyboard, we wanted to let him or her control
Graspy using natural hand motions and also feel what Graspy
circuitcellar.com 9

QUESTIONS & ANSWERS

was feeling during interactions with second half of the palpation project,
objects. My PhD student Rebecca my PhD student Jennifer Hui has been
Pierce recently led the development of writing algorithms to automatically
a wearable device that accomplishes determine whether a given sample
exactly this goal. It uses a direct- of tissue contains a tumor. Aided by
drive geared DC motor with an an undergraduate researcher, she
optical encoder to actuate and sense mounted the BioTac on a CNC mill and
a revolute joint that is aligned with recorded data while it methodically
the base joint of the operator’s index pressed into a large sample of
finger. Opening and closing your hand simulated tissue. Now she is using
opens and closes the robot’s parallel- machine learning principles to write
jaw gripper, and the motor resists the software that can process what the
motion of your hand if the robot grabs BioTac feels in a given location and
onto something. We supplement decide whether it feels like a tumor,
this kinesthetic haptic feedback with the edge of a tumor, or healthy tissue.
tactile feedback delivered to the pads In the long run, we’d like to combine
of the user’s index finger and thumb. these two approaches so that a
A voice coil actuator mounted in surgeon could control the tactile
each location moves a platform into A high-bandwidth MEMS-based accelerometer records the sensor, feel what it is feeling, and
and out of contact with the finger to sensations a dentist feels as she probes an extracted human receive an automatic second opinion

COMMUNITY
match what the robot’s tactile sensors tooth. Feeling these recordings lets dental trainees practice on whether that tissue contains a
diagnosing dental decay before they treat live patients.
detect. Each voice coil presses with tumor.
a force proportional to what the
corresponding robot finger is feeling, and the voice coils also CIRCUIT CELLAR: In your TEDYouth talk, you describe a
transmit the high-frequency vibrations (typically caused by project in which a dental tool is fitted with an accelerometer
collisions) that are sensed by the MEMS-based accelerometer to record what a dentist feels and then replay it back for a
embedded in the robot’s hand. We track the movement of this dental student. Can you tell us a bit about the project? How
wearable device using a Vicon optical motion tracking system, it started and how it works?
and Graspy follows the movements of the operator in real
time. The operator sees a video of the interaction taking place. KATHERINE: This project spun out of my haptography
We’re in the process of having human participants test this research, which I described above. While we were learning
teleoperation setup right now, and I’m really excited to learn to record and model haptic data from interactions between
how the haptic feedback affects the operator’s ability to control tools and objects, we realized that the original recordings had
the robot. value on their own, even before we distilled them into a virtual
Palpation for Robotic Surgery: My PhD student Will McMahan model of what the person was touching. One day I gave a lab
and I previously invented a new way to add haptic feedback to tour to two faculty members from the Penn School of Dental
robotic surgery systems like the Intuitive da Vinci; we use tiny Medicine who were interested in new technologies. I hit it off
accelerometers to measure the high-frequency vibrations of with Dr. Margrit Maggio, who had great experience in teaching
the robotic instruments, and we use voice-coil actuators to play general dentistry skills to dental students. She explained that
those vibrations for the surgeon to feel in real time. While we’re some dental students really struggled to master some of the
still trying to convince a company to incorporate our invention tactile judgments needed to practice dentistry, particularly
into their robotic surgery system, we’ve continued to work on in discerning whether or not a tooth surface is decayed (in
new ways of adding haptic feedback to robotic surgery. One popular parlance, whether it has a cavity). A few students and
big drawback to minimally invasive surgery is that the surgeon I went over to her lab to test whether our accelerometer-based
can’t tactilely examine soft tissue for anomalies such as tumors. technology could capture the subtle details of how decayed
We have been addressing this problem in two distinct research vs. healthy tooth tissue feels. While the recordings are a
thrusts, both of which use a SynTouch BioTac biomimetic tactile little creepy to feel, they are super accurate. We refined our
sensor to measure rich haptic data during interactions with approach and conducted several studies on the potential of this
simulated samples of soft tissue. In the first project, Claudio technology to be used in training dental students. The results
Pacchierotti (an Italian PhD student visiting my lab) worked were really encouraging, once again showing the potential that
with other students to attach the BioTac to the end of a da haptic technology holds for improving clinical training.
Vinci instrument, so we could use it to palpate silicone rubber
tissue samples that contained simulated tumors. We then CIRCUIT CELLAR: You were a TA in the Stanford Product
created a custom tactile feedback device that used three small Realization Lab (PRL). What sort of work did you do there?
RC servo motors and an ALPS ForceReactor vibration actuator
to move a platform below the user’s fingertip. We mounted KATHERINE: When I was an undergrad, I thought the
this tactile device on the hand controller that the surgeon uses PRL was the coolest place on Stanford campus; it’s a giant
to control the instrument to which the BioTac was attached. machine shop, rapid-prototyping lab, CAD loft, model shop,
We then wrote an algorithm that continually processes the welding room, and foundry. The PRL is staffed by ubercool
finger deformations and vibrations that BioTac feels and drives Shop TAs—engineering grad students tasked with teaching
the tactile device to output an approximation of these haptic other students how to use all that fancy equipment without
signals for the operator to feel. It works really well! In the injuring themselves, each other, or the machines. Given my
10 CIRCUIT CELLAR • MARCH 2015 #296

QUESTIONS & ANSWERS

esteem for their profession, I applied While it went very quickly, this year of
to become a Shop TA as soon as I got postdoctoral research was a lovely oasis
into grad school, and I feel incredibly between the stress of finishing grad
lucky that they hired me. Being a Shop school and the strain of starting my lab
TA was an amazing learning experience. at Penn. My favorite takeaways from
I worked five four-hour shifts each Johns Hopkins were the friendships
week, sometimes teaching structured I made there, and I am especially
labs and other times running open shop grateful for Allison’s mentorship. She’s
sessions where I would be hounded by now a professor at Stanford, and two of
dozens of students who needed help my former students are working in her
getting their projects done. I got to lab—what fun!
teach manual milling, manual turning,
CNC milling, oxy-acetylene welding, and CIRCUIT CELLAR: Your work is
sand casting; for this last one, I learned becoming increasingly publicized.
to run the furnace to melt and then pour You have the TEDYouth talk, and the
molten bronze! My favorite time to be in Haptics Group continues to grow.
the shop was the Friday night session, Do you frequently get requests to
which ran from 7 pm to 11 pm. Working design solutions to problems? Are you
on so many different projects gave me frequently pitched product ideas or
great practice at mechanical design and business opportunities? For instance,
COMMUNITY

problem solving, and it showed me that are medical teams, virtual reality
I absolutely love teaching and working startups, and other groups contacting
This NeoDriver prototype lets the user change the angle
with students. Being around such a of the suture needle in the jaws of the tool simply by
you for prototyping and consulting
creative and dedicated group of people adjusting the angle of a knob; stainless steel wires run work?
was inspiring, as was having such good from the knob along the left and right sides to rotate a
resources for manufacturing. During tiny disk embedded in the jaws. KATHERINE: I couldn’t believe the
my time as a Shop TA, I designed and amount of attention I got after my
an organically shaped pendant lamp and CNC milled it out TEDYouth talk about haptics went live on TED.com. I initially
of aluminum and clear acrylic. I also worked with two other tried to send a personal response to every email, but that
students and a urologic surgeon to create the NeoDriver, a quickly got to be too much. I am grateful that people do still
surgical needle driver that allows the surgeon to re-angle the contact me about interesting projects after finding my TED
suture needle in the jaws of the tool with just the touch of a talk. For example, my students and I have recently been doing
finger, without needing his or her other hand. a project with researchers from a large European company;
if I told you about this project, I’d have to kill you (as my Dad
CIRCUIT CELLAR: Tell us about your postdoctoral research at would say), but I can say that working on a totally new area has
Johns Hopkins. been intellectually invigorating. Most inquiries from startups
don’t go very far, but I recently agreed to work with Steven
KATHERINE: After I finished my PhD, I spent one year doing Domenikos, an experienced entrepreneur from Boston, to try
research with Professor Allison Okamura at the Johns Hopkins to create a prototype for a new commercial device related to
University. She is a worldwide expert on haptics, and I loved haptics. Again, I can’t give any details, but it is fun to try to
seeing the fascinating range of projects she and her lab were create something that would really touch the masses.
tackling—everything from human motor control to steerable I do encourage people to contact me with any ideas
needles. and questions they have about haptics. My email address
The main focus of my work that year was related to the is kuchenbe@seas.upenn.edu I’ll try to send you a personal
Revolutionizing Prosthetics program funded by DARPA. Many response, but please don’t be offended if that takes a few
people in haptics agreed that next-generation upper-limb weeks!
prostheses should provide the wearer with haptic feedback
such as grip force or the making and breaking of contact. CIRCUIT CELLAR: What is the “next big thing” in the field of
Thinking farther ahead, we were curious about whether haptics? Is there a specific area or technology that you think
prosthetic devices should give the wearer an artificial sense will be a game changer?
of proprioception, which is how you can feel the position and
orientation of your limbs when you close your eyes. KATHERINE: Of course this depends on where you’re looking.
Proprioception is known to be important in human motor While cell phones and game controllers have had vibration
control, but no one had studied whether it might help humans alerts for a long time, I think we’re just starting to see high-
control artificial limbs. Because we wanted to compare perfect quality haptic feedback emerge in consumer products. Haptics
proprioception with no proprioception, I created an apparatus can definitely improve the user experience, which will give
that simulated this scenario by giving a user with an intact haptic products a market advantage, but their cost and
limb control over a virtual prosthetic device. We found that implementation complexity need to be low enough to keep the
proprioceptive feedback did indeed seem to help users! In product competitive. On the research side, I’m seeing a big
addition to this main project, I supervised three students in move toward tactile feedback and wearable devices. Luckily
creating a tactile fingertip device that was an early pre-cursor there are enough interesting open research questions to keep
to the tactile teleoperation projects that I discussed above. my students and me busy for 30 more years, if not longer!
A new wave
of thinking

WaveSurfer 3000
with MAUI

teledynelecroy.com/newwave
12 CIRCUIT CELLAR • MARCH 2015 #296

EDITORS' PICKS

Robotics
INERTIAL ROLLING ROBOT
Jeff Bingham & Lee Magnusson
Circuit Cellar 200, 2007
This H8/3664-based rolling robot is capable of inertial movement.
A DC electric motor is attached to a pendulum and suspended inside
an inflated ball, which provides the driving force. As the engineers
explain, “The robot employs a single driven pendulum inside of a
sphere. With 2 degrees of freedom, it drives and tilts the ball. With
this geometry, the robot can reach high speeds, steer, and jump.
In addition, it doesn’t get stuck when it flips over. “
COMMUNITY

The robot’s inner core consists of an electronics


assembly and a mechanical drive assembly. The spherical shell
is an inflatable ball. The inner core is suspended via a drive
axle from the two plastic caps.

The H8/3664 microcontroller connects to several components that provide


control and sensing. The circuit is basic and easy to connect to most other
microcontrollers as well.

These articles and others on topics relating to Robotics are available in the
CC Webshop. Go to www.cc-webshop.com.

WIRELESS MOBILE ROBOTICS


Scott Coppersmith
Circuit Cellar 224, 2009
Scott used a microcontroller, an embedded
Ethernet board, and a wireless router in an
innovative control system for a compact
mobile robot. The robot features a mounted
webcam that transmits real-time pictures to a
remote laptop. Scott explains how he planned
the project, assembled the pieces, and created
the control software.

The embedded Ethernet board, speed control, and servos for controlling steering, camera pan,
and tilt are wired to a Microchip Technology DM300027 16-bit, 28-pin development board. A
WIZnet board is connected to the DM300027 development board by wire wrapping the header
connector pins directly. The two boards communicate via the SPI bus.

The assembled robot with a webcam


circuitcellar.com 13

EDITORS' PICKS
ROBOT NAV & CONTROL SUBSYSTEM
Guido Ottaviani
Circuit Cellar 224, 2009
You can build navigation control subsystem for an
autonomous differential steering explorer robot. The
system’s software manages wheel speed, closed-loop
control with a PID algorithm, dead-reckoning by odometry
(in both theoretical and practical forms), field mapping,
navigation, motor control, and more. The subsystem
includes Guido’s dsPIC-based navigation control Board (the
“dsNavCon”) and an STMicroelectronics L298-based dual
H-bridge board for controlling the geared 12-V motors.

Rotary encoder 1
LEDs
NiMh Battery pack
12 × AA cells
2,700 mAh
Motion feedback

14.4 V
The entire navigation control subsystem
QEI/IC
5V PWM
14.4 V Motion controller 1 H-Bridge 1 Motor 1

ADC
VREF Current sensing
OSC 0 INT 0 RB3 INT 1 RX TX
Preregulator 3.3 V
9V

Serial 2 (RX2/TX2)

COMMUNITY
RF
CS 1 TX EN 1 Modem
9V
5V
5V
OSC Clock
7.37 MHz 1 ms Supervisor TX 1 RX 1
LEDs
On-board I2C
power VREF
supply CS 2 TX EN 2
Main board

3.3 V
OSC 0 INT 0 RB3 INT 1 RX TX 14.4 V
5V
PWM
Navigation control system
Motion controller 2 H-Bridge 2 Motor 2

VREF
ADC Current sensing
QEI/IC

Motion feedback

LEDs
The motors, encoders, and H-bridges. The metal box at the top
contains a battery pack, 9-V preregulators, and PI filters. It also
Rotary encoder 2

The navigation control subsystem's main components acts as a heatsink.

DESIGN & PROGRAM A "MINIROBOT"


Marco Aiello
Circuit Cellar 236, 2010
Control capability is at the heart of most robotics
applications, particularly when object avoidance is a
project requirement. This mobile “minirobot” features a
custom power board built around a Microchip Technology
dsPIC30F2010 that translates serial commands into the
right PWM power signals to drive the two motors and an
OLIMEX SBC running a Debian distribution on an Atmel
AT91SAMl9260 ARM9 CPU.

The fully assembled Linux-based robot

These articles are available at www.cc-webshop.com.


A close-up shot of the motor board
14 CIRCUIT CELLAR • MARCH 2015 #296

PRODUCT NEWS

CONTROLLER FOR ONE-STEP DESIGN-IN SMALL STEP-DOWN POWER MODULE


OF 3-D GESTURE RECOGNITION Intersil Corp.’s ISL8203M is a dual 3A/single 6A step-down DC/
Microchip Technology recently announced a new addition DC power module that simplifies power supply design for FPGAs,
to its patented GestIC family. The new MGC3030 3-D gesture ASICs, microprocessors, DSPs, and other point of load conversions in
controller features simplified user-interface options focused on communications, test and measurement, and industrial systems. The
gesture detection, enabling true one-step design-in of 3-D gesture module’s compact 9.0 mm × 6.5 mm × 1.83 mm footprint combined
recognition in consumer and embedded devices. Housed in an with industry-leading 95% efficiency provides power system designers
easy-to-manufacture SSOP28 package, the MGC3030 expands with a high-performance, easy-to-
the use of 3-D gesture control use solution for low-power, low-
features to high-volume, cost- voltage applications.
sensitive applications such as The ISL8203M is a complete
audio, lighting, and toys. power system in an encapsulated
The simplicity of gesture- module that includes a PWM
detection integration offered by controller, synchronous switching
the MGC3030 is also achieved MOSFETs, inductors and passive
through Microchip’s free, components to build a power supply
downloadable AUREA graphical supporting an input voltage range of
INDUSTRY & ENTERPRISE

user interface (GUI) and easily configurable general-purpose IO 2.85 to 6 V. With an adjustable output voltage between 0.8 and 5 V, you
ports that even allow for host MCU/processor-free usage. The can use one device to build a single 6-A or dual output 3-A power supply.
MGC3030’s on-chip 32-bit digital signal processor executes real- Features and specifications: dual 3-A or single 6-A switching power
time gesture processing, which eliminates the need for external supply; high efficiency, up to 95°; wide input voltage range: 2.85 to 6 V;
cameras or controllers for host processing and allows for faster adjustable output range: 0.8 to 5 V; internal digital soft-start: 1.5 ms;
and more natural user interaction with devices.. external synchronization up to 4 MHz; and overcurrent protection.
The MGC3030 featuring GestIC technology is available in a 28- The ISL8203M power module costs $5.97 in 1,000-piece quantities.
pin SSOP package. Each unit costs under $2 each in high volumes. The ISL8203MEVAL2Z evaluation costs $67.

Microchip Technology Intersil Corp.


www.microchip.com www.intersil.com

CLAMSHELL SPRING PIN QFN SOCKET FREQUENCY-PROGRAMMABLE TRANSCEIVER


Ironwood Electronics recently introduced a new QFN socket The new Multi-Use Radio Service (Mini-MURS) NiM1B-154.570-5-
addressing high performance requirements for testing QFN devices 12.5-MURS is a frequency-programmable narrow band transceiver
- CBT-QFN-7039. The contactor is a stamped spring pin with 17-g that offers a low-power, reliable data link in a Lemos /Radiometrix
actuation force per ball and cycle life of 50,000 insertions. The self transceiver standard pinout and footprint. It’s suitable for licensed
inductance of the contactor is 0.75 nH, insertion loss less than 1 dB and unlicensed VHF allocations, FCC part 90 and part 95.
at 31.7 GHz. The current capacity of each contactor is 1.5 A at 20°C The transceiver’s features include the following: conforms to
temperature rise. Socket EN 300 220-3 and EN 301 489-3
temperature range is –55°C (10-mW version only); compliant
to 180°C. with FCC part 95 (MURS); standard
The socket also features frequency 154.570 MHz or 154.600
an alignment guide for MHz (reprogrammable); data rates
precise device to pin up to 5 kbps for standard module;
alignment. The specific usable range over 1 km; feature-
configuration of the package rich interface (true analog and/or
to be tested in the CBT- digital baseband); and more.
QFN-7039 is a QFN, 3 × Technical specifications:
3 mm, 0.5-mm pitch, 10
positions with center ground pad. The socket is mounted using • Fully integrated sigma-delta PLL synthesizer based design
supplied hardware on the target PCB with no soldering. To use, • High stability TCXO reference
place the QFN device into the socket base and lock the double latch • Data bit rate: 5 kbps max.
socket lid on to the base using the latch. • Transmit power: +13 dBm (20 mW)
The socket uses a compression wave spring to apply constant • Image rejection: greater than 70 dB
downward pressure enabling the device be interconnected to the • Receiver sensitivity: –120 dBm (for 12-dB SINAD)
target PCB. This socket can be used for hand test and quick device • RSSI output with greater than 50-dBm range
screening applications with the most stringent requirements. • Supply: 3.3 V – 15 V at 30 mA transmit, 18 mA receive
The CBT-QFN-7039 costs $552 with reduced pricing available • Dimensions: 33 × 23 × 11 mm (fully screened)
depending on quantity required. • Evaluation platforms: NBEK + BiM/SMX carrier

Ironwood Electronics Lemos International


www.ironwoodelectronics.com www.lemosint.com
circuitcellar.com 15

CLIENT PROFILE

Freescale Semicondcutor
2100 East Elliot Road, Tempe, AZ 85284
www.freescale.com/Sensors

CONTACT: Freescale.com/Support SPECIAL OFFER: Take your sensor design to the next level!
Receive 50% off on the Freescale Development Platform for
FEATURED PRODUCTS: Freescale is a global semiconductor 9-Axis Sensor Solution. Visit freescale.com and search for kit
company enabling the Internet of Tomorrow. As a leader number FRDM-STBC-AGM01. Select “Buy Direct” and enter
in processing and sensing solutions, we are driving a more code FSLND425 once the kit is in your shopping basket. One
innovative and connected world for the future. Freescale kit per person. Discount coupon valid only for purchases by
sensors, smart digital networks and microcontrollers provide persons 18 years of age or older made online at Freescale
complete solutions for a secure Internet of Tomorrow. Buy Direct at freescale.com on or before December 31, 2015.
Expanding on its more than 35-year heritage of sensor
innovation, Freescale is the only company supplying Internet
of Tomorrow solutions from sensors (edge) to network to
cloud.

INDUSTRY & ENTERPRISE


WHY SHOULD CC READERS BE INTERESTED? Freescale’s new
FXAS21002C gyroscope can combine with accelerometers and
magnetometers for a full 9-axis sensor fusion solution. The
gyroscope has best-in-class power performance at 2.7 mA
(active) and 2 µA (standby) for advanced motion sensing
applications. The FXAS21002C gyroscope has a dynamically
selectable full scale range that is configurable for maximum Circuit Cellar prides itself on presenting readers with information about
angular velocity that the gyro can read allowing for multiple innovative companies, organizations, products, and services relating to
use cases to be addressed with a single device. For more embedded technologies. This space is where Circuit Cellar enables clients
information, please visit freescale.com/gyroscope. to present readers useful information, special deals, and more.

Today

JOIN THE
EVOLUTION. 1905
1945
2005

Learn more

Get “mobile smart”


in 3 easy steps:
Get your AIR for Wiced
Evolve to app-based control with AIR for Wiced Smart!
Smart dev kit at your If you’re ready to evolve from fixed control panels populated with dials, buttons, keypads,
distributor of choice. and LCD displays to mobile-app based control of your embedded product – check out
(See our website for a Anaren’s AIR for Wiced Smart module, featuring Broadcom’s Wiced Smart Bluetooth®
current list.)
chip (BCM20737). Not only does our small-footprint, SMT, and pre-certified all-in-one module save you
Develop your wireless the time, effort, and trouble of designing your own radio... It’s supported by our industry-exclusive
link and basic app using Atmosphere development ecosystem that lets you develop your basic embedded code and app code in
our exclusive Atmosphere
development tool. one, easy-to-use development tool – for a far speedier product development cycle and time-to-market.
Follow the steps at left to join
With our AIR for Wiced www.anaren.com/AIRforWiced
the evolution, right now! 800-411-6596
Smart module on board,
proceed in record time to In Europe: 44-2392-232392
a prototype and final,
mobile-app development!
16 CIRCUIT CELLAR • MARCH 2015 #296

Electronics Testing
Platform (Part 2)
FEATURES

DDS Sweep
Generator

In the first part of this series, Gerard


explains how he engineered the base
unit platform for the development
of test instruments. Here he details
the construction of a plug-in
sweep generator board.
By Gerard Fonte (US)

I f you’ve never used a sweep generator


before, you don’t know what you are
missing. It’s a very powerful test instrument
base unit I described in the first part of
this article series. I built the board around
an inexpensive Analog Devices AD5930 DDS
that greatly simplifies and speeds up all sweep generator chip ($14 each). The AD5930
sorts of analyses. You can quickly test the is a very powerful and flexible device with
frequency response of an amplifier, speaker, very nice specifications. It operates from 3
or filter, find the precise resonant frequency Hz to 25 MHz (Nyquist limit), although a more
of a circuit, determine just how long it takes reasonable upper limit is 10 to 15 MHz. It has
a phase-lock-loop circuit to lock, and lots differential outputs (two outputs 180° out of
more. There are a number of inexpensive phase with each other). Output distortion is
analog sweep generators available and they typically about 0.1%. It can operate in fixed-
work acceptable well. However, this is a direct frequency, burst, or continuous mode, linear
digital synthesis (DDS) sweep generator with or log sweep, with sine/triangle wave output
features that can’t be matched by any analog as well as a separate square wave output
sweeper. Comparable DDS systems cost $500 (TTL level). Frequency step size is about 0.3
to $600, many times more than this one. Hz for low frequency operation and 3 Hz for
This project is a plug-in board for the full-range operation. Frequency accuracy is
circuitcellar.com 17

50 PPM. A software marker/cursor is provided fully integrated system for audio and other
that identifies a precise frequency sweep- relatively low-frequency work (less than
point on your oscilloscope is extremely useful. 1 MHz). This meant driving an 8-Ω speaker
Up to eight setups can be stored on EEPROM. directly, small frequency steps (0.3 Hz), and
software level controls.
AMPLIFIER DESIGN APPROACH The second goal was to provide the

FEATURES
The AD5930 does not provide much output maximum frequency range available for
drive capability. The peak-to-peak (PP) output RF applications (25 MHz/Nyquist). I wanted
voltage is only about 0.5 V and it can only a high-level output (±10 V unloaded) and
drive with about 3 mA. Obviously this is capable of driving the standard 50-Ω loads. It
not sufficient for most applications and an also had to be stable driving any type of load.
amplifier must be added. Since I don’t like choosing which is best,
There were conflicting goals in this I provided both amplifiers (see Figure 1).
amplifier design. The first was to provide a The low-frequency amplifier uses a simple

FIGURE 1
This is the sweep generator board with low-frequency and high-frequency amplifiers.
18 CIRCUIT CELLAR • MARCH 2015 #296

PHOTO 1
Jumpers can be used instead of a
DPDT switch for single amplifier
operation.
FEATURES

5-V, 0.25-W stereo audio amplifier (LM4880) steps are about 0.3 Hz (using a 5-MHz clock).
to drive both channels. It operates up to 1 The high-frequency amplifier uses a
MHz, but not very well. I used a Microchip National Semiconductor LM6181 current
Technology MCP42151 digital potentiometer as feedback op-amp. (The typical op-amps
a volume control. Initially, I wanted to use this found in most hobbyist designs are voltage
for amplitude modulation (AM). However, this feedback op-amps.) Current feedback (CF)
turned out to be impractical. The frequency op-amps have the very nice feature that the

PHOTO 2
J1 is mounted on the bottom of the
PCB and consists of five pieces of SIP
socket strip.
circuitcellar.com 19

gain is nearly independent of the bandwidth.


In this way, a power amplifier with a gain
of 42 and maximum operating frequency
of 25 MHz can be designed around a single
amplifier stage. (A voltage feedback op-amp
would need to have a gain-bandwidth product

FEATURES
of over 1 GHz. While a few such devices were
found none could drive 50 ohms.) A positive
and negative 14-V supply is also required for
this amplifier. Heatsinks are shown and listed
in the parts list for the regulators but are not
really required. They run cool.
There are a couple of important points
to note about this CF circuit. The feedback
resistor (R23 or R29) is specified and fixed
at 820 Ω by the manufacturer. To change the
gain, resistor R22 or R28 can be changed as
required. The resistor-capacitor (RC) network
(R26 + C21 or R27+C22) is used to stabilize
the op-amp by reducing the high-frequency
gain. The 51-Ω output resistor (R21 or R25)
does double duty. The first is to isolate the
op-amp from capacitive loads which could PHOTO 3
lead to instability. The second is to limit the The TSSOP footprint for U1 is expanded for an adapter.
output current in case of a short circuit.
CF op-amps tend to run hot, so a
heatsink (with silicone grease) is an absolute
requirement. Running into an open circuit (no
load), the amp outputs 22 V PP and warms up to

Low Power ARM Module


l Atmel ARM Cortex A5 536Mhz Processor
l 4GB of eMMC Flash SoM-A5D36
l 512 MB of LP DDR2 RAM
l 16MB of Serial Data Flash
l 22 GPIO (3.3V) Lines
l 6x Serial Ports
l 24-bit LCD Controller
l Up to 720P Video
l Touch Controller
l External Address/Data Bus
l Internal Real time clock/calendar
l 4 PWM Channels, 5 Timer/Counters
l 10/100/1000 BaseT Ethernet Industrial Temperature
l 2x USB 2.0 High Speed Host ports
l 1x USB 2.0 High Speed Host/Device port
l 6 channels of 12 bit A/D (0 to 3.3V)
l 200 pin SODIMM form factor (2.66" x 2.375")

Designed and manufactured in the USA, the SoM-A5D36 is a System on


Module (SoM) based on the Atmel ARM Cortex A5 ATSAMA5D36 processor.
This low power, wide temperature ARM 536 MHZ SoM utilizes 4GB of
eMMC Flash, 16MB of serial data flash, and up to 512MB of LP DDR2 RAM.
Like other modules in EMAC's SoM product line, the SoM-A5D36 is
designed to plug into a custom or off-the-shelf carrier board containing all
the connectors and any additional I/O components that may be required.
Qty 1 pricing is $155. Please contact EMAC for OEM & Distributor Pricing.

http://www.emacinc.com/products/system_on_module/SoM-A5D36

Since 1985
OVER

30
YEARS OF

EQUIPMENT MONITOR AND CONTROL


SINGLE BOARD
SOLUTIONS

Phone: ( 618) 529-4525 · Fax: (618) 457-0110 · www.emacinc.com


20 CIRCUIT CELLAR • MARCH 2015 #296

about 110°F (with the heatsink). With a 51- Ω the setting of one can affect the level of the
load, the output is 10 V PP and the temperature other. For that reason a switch was added. If
rises to a reasonable 141°F. Running into you choose to incorporate only one amplifier,
10 Ω provides 3 V PP and a temp of 162°F. A the switch can be eliminated and jumpers can
short on the output pushes the temperature be used instead (see Photo 1).
up to 170°F. (All of these measures had an Note that the clock oscillators are
FEATURES

ambient temperature around 70°F.) It is not independent of the amplifier. You can choose
recommended to use a load of less than 50 to use either the 5- or 50-MHz clock with either
Ω. Note that a socket is required; otherwise, amplifier (via software). Or, you can choose
it may not be possible to slide the heat-sink to use only one oscillator and not install the
under the amplifiers. other. Also, the datasheet, schematic, and
Since digital pots do not work well at high PCB show C6 and C7. These filter out clock
frequencies (above 1 MHz), manual pots are noise from the AD5930. However, they also
needed to set the output level. And since attenuate high-frequency signals (greater
these pots are in parallel with the digital pots, than10 MHz). Since the low-frequency option
doesn’t work at those frequencies, they can
be omitted. And since the high-frequency
amplifier has its own filter, they again can
be omitted. Positions are left for them on the
PCB just in case of some future need.

CONSTRUCTION
First, you need to decide which options you
want. If you don’t want the high-frequency
option, you can eliminate the parts in the box
in Figure 1 and use two jumpers for SW1.
If you don’t want the low-frequency option,
you can eliminate U3, U4, and the associated
parts. Again, you can use two jumpers for
SW1. You can choose to operate with only
one clock oscillator, either 5 or 50 MHz. The
5-MHz clock provides 0.3-Hz steps and has a
Nyquist limit of 2.5 MHz (usable to about 1 to
1.5 MHz). The 50-MHz clock has 3-Hz steps
and a Nyquist limit of 25 MHz (usable to about
10 to 15 MHz).
RXXX is used if only one oscillator is
present. This lets the software know which
clock is available. It should be 332K to enable
PHOTO 4
the 50 MHz clock and 182K to enable the 5
Shielded wire and good connectors attach the PCB to the outside world.
MHz clock. If it’s absent, both oscillators are
assumed to be available and are software
selectable.
Most of the construction is pretty
straightforward but there are several
important points to note. The first is that the
inline socket-strips that connect to the base-
unit are mounted on the bottom of the board
(see Photo 2). Note that J1 is actually made up
of five separate socket strips. The reason for
this is space. Using a full row of pins on the
inside makes routing difficult and the unused
pads take up a surprising amount of space.
The second point is that U1 and U5 are
only available as surface-mount parts (SMT).
SMT part U5 is the stereo amplifier and is
an eight-pin SOIC. It has leads on 0.050″
centers which is half the spacing as standard
DIP through-hole parts. Most designers
won’t have too much trouble soldering that.
PHOTO 5
However, U1 the sweep-generator chip, has
A digital sweep looks a lot like an analog sweep.
a 20-pin, TSSOP footprint with the leads on
circuitcellar.com 21

SOLDERING FINE-PITCH SMT DEVICES


Surface mount is here to stay. And, quite simply, you you either have one or should get one. The other two items
can either learn to work with these parts or get left behind. you need are a “needle” type of soldering point and some
There have been similar changes in the past: from tubes to very thin solder. That’s it.
transistors and from transistors to integrated circuits. Of The first thing to do is to obtain a true “needle-point”
course, there will be more changes in the future. “It’s like soldering tip. You might be able to buy one for your iron,
deja-vu all over again” (Yogi Berra). if they are available. They typically cost a few dollars. (Or,

FEATURES
Some SMT (Surface Mount Technology) parts are you can make one like I did.) The soldering tip at the left
simply impossible for the typical hobbyist to work with. in Photo 2 is the standard “fine” tip that is actually about
For example, soldering leadless chip carriers and ball-grid 0.055” (1.4 mm). The tip to the right of that is one that I
devices can only be accomplished with some sort of solder- filed down to a true needle point (measures about 0.015” or
reflow oven. Clearly this not practical for the vast majority 0.4 mm). This is about the same as the 1/64” tips that are
of readers. However, manufacturers generally provide at now available for some irons.
least one version of their product in a leaded package. And The second necessity is to use ultra-thin solder. The
it is certainly possible for hobbyists to incorporate these solder on the far right is 0.062” (1.6 mm) from the good
modern devices without too much expense. old days when vacuum tubes ruled. The middle solder is
0.28” (0.7 mm) and is the current standard for general
SMT FORMATS work. The solder at the left is 0.015” (0.4 mm) in diameter.
There are many different types of SMT packages. Photo It is possible to find this solder in “hobby packs” for a
1 shows several as well as a standard Dual In-line Package few dollars rather than one-pound spools for $40. (Radio
(DIP) IC. There are lots more. Shack has 0.015” solder “with silver” for about $6. The
Small Outline Integrated Circuit (SOIC) parts have a lead part number is 64-035.) A small amount will solder a lot
pitch of 0.050” (one pin per 0.050”). This is half the spacing of TSSOP devices. Note: I haven’t tried the more common
as a standard DIP. This can be soldered with a regular fine- 0.020” (0.5 mm) solder.
point soldering iron and common 0.030” diameter solder if
care is taken. However, it is basically impossible to solder MAKING IT WORK
any part with a smaller lead pitch this way. So, don’t waste The two key concepts are: you want to be able to heat
your time, parts and energy trying. one pin and only one pin at a time and apply solder to only
Obviously, the important aspect for us is how close the that pin. That’s why you have to have a needle point and
pins are to each other (lead pitch). The actual number of extra-thin solder.
pins and whether the IC has leads on two or four sides The first step is to melt some solder onto a corner pin
isn’t that significant. Generally, “fine pitch” parts space the (Photo 3a). Obviously take care not to make any solder
leads from 0.0256” (0.65 mm) to 0.0197” (0.50 mm). bridges to the adjacent pad. You will find that a lower heat
Note that TSSOP (Thin Shrink Small Outline Package) setting works well.
does NOT define the lead spacing. The 20 pin TSSOP The next step is probably the hardest part of the whole
in Photo 1 has a lead pitch of 0.65mm while the 48 pin procedure. You have to re-heat only the solder and carefully
TSSOP’s is 0.50 mm. The Shrink Small Outline Package align the chip to the rest of the pads (Photo 3b). For a small
(SSOP) is usually 0.0250” (0.635 mm), which is one quarter PCB, like the one shown, I find is useful to use some double-
the spacing as the standard DIP. While these differences sided tape to hold the PCB onto something. I use card-stock.
aren’t really important for soldering, they are absolutely But you can tape it to your desk or a piece of cardboard or
critical when laying out a PCB. whatever suits you. Trying to adjust the part with a moving
PCB is simply making a difficult task harder. The alignment
REQUIRED EQUIPMENT can be very slightly off if there is enough flexibility in the
A soldering iron with adjustable heat is useful but not one fixed pin to allow alignment with the rest of the pins.
absolutely required. However, if you are a serious hobbyist But, obviously, it’s better to be as perfect as possible in this
step. It will make all later steps that much easier. Note: it is
important to view the registration (alignment) of the IC to
the pads from above. If you look at it from an angle it may
appear not to be registered properly (see Photo 3c).
Now you can solder the pin that is diagonal to the

PHOTO 1: PHOTO2:
A common assortment of package types A comparison of soldering iron tips and solder
22 CIRCUIT CELLAR • MARCH 2015 #296

previously soldered pin (shown in Photo 3c). You can use However, here is another little trick. Don’t solder the
whatever method you prefer to do this. However, approach pins in sequence. This is because the pin you just soldered
the pad from the open side so there will be less chance of is still hot. This heat and the proximity of the iron can be
making solder bridges. Note that Photo 3c is seen from hot enough to melt the solder and make a solder bridge. So,
a different angle than in Photo 3b. This angle makes it skip around a bit. I solder every other pin and then go back
FEATURES

appear that the chip is not registered properly. But as seen to solder the remaining pins. However, if the iron is too hot
from above in Photo 3b, the IC has good alignment with or if you heat the pin too much you may need to skip two
the pads. pins or allow the joint to cool before continuing. You’ll know
Here’s the trick to soldering the remaining pins. Place things are too hot if you get solder bridges.
the soldering iron tip vertically onto the small horizontal
part of the lead as shown in Photo 3d. This requires a DROPPING THE BRIDGE
different method of holding the iron and brings the hot There will be times when you get solder bridges. It
metal close your wrist. So be careful. happens. First eliminate as much solder as possible with
While keeping the iron vertical and resting on the pad a copper-braid product (like Solder Wick) from the pads.
(the weight of the iron is enough), add a little solder (see Often this will take care of the problem. What’s more you
Photo 3e and Photo 3f). Bring the solder to the pad near probably don’t need to re-solder these leads. Look closely,
the lead. You don’t have to touch the lead. The solder will most likely you will see a film of solder remaining. If you
melt on the pad and wick to the lead. Once this happens can’t lift the pin with a gentle pry with a razor-knife (like
remove the solder and soldering iron. You don’t need, or an X-Acto knife) then the solder joint is fine. The amount
want, much solder. You can then move on to the next pin of solder shown in the photographs is many times what is
to solder. really needed.
If the bridge remains,
a) b) then heat one pin as
before and draw the
knife between the pins.
You don’t need to press
down hard and score the
PCB. All you want to do is
to separate the solder’s
surface tension. Once
this happens, you will see
a space open up. Allow
d)
this pin to cool and then
c)
heat the other pin. This
should draw some of the
remaining solder to that
pin and open up the space
even more. Also, the knife
blade should be cold. If
it’s hot, the solder will just
wick around it and not
remove the bridge.

f) PRACTICE HELPS
It doesn’t take much
e) to work with fine-pitch
devices. You could spend
a couple of hundred
dollars for a special
soldering system. Or you
could spend about $12
and upgrade your existing
soldering iron with a new
tip and some very thin
solder. It does require
good close-in work and a
steady hand. But a little
PHOTO 3
practice goes a long way.
First add some solder to a corner pin (a). Attach the chip (b). Solder the diagonal pin (c). Place the iron tip vertically on the IC
lead (d). Add just a little solder to the pad (e). Twenty TSSOP pins with 0.0256” (0.65 mm) lead pitch soldered in less then 10
minutes (f).
circuitcellar.com 23

0.026″ (0.65 mm) centers. This is a quarter


of the spacing as DIP parts and ordinary
soldering tools and methods simply won’t
work. (Refer to the sidebar, “ Soldering Fine-
Pitch SMT Devices,” for additional information
about SMT soldering.)

FEATURES
To make things easier, I expanded the
20-pin TSSOP footprint to a 20-pin, wide DIP
footprint. This allows the use of a small SMT
adapter board with SIP socket strips (see
Photo 3). For prototyping it was necessary to
be able to remove the chip as required. But
many find it easier to solder to a smaller and
inexpensive PCB than a larger and costlier
one. Whatever you choose, always mount
the SMT parts on the PCB first. Their small
footprints make soldering it hard. Don’t make
impossible by putting obstacles in the way.
The rule of thumb that says to mount the parts
from low to high (height-wise) is a good rule
here. The base unit socket strip connectors
are considered “low” because only the ends
of the pins stick up on the component side of
the PCB.
PHOTO 6
You have lots of options for wiring to the
In burst mode, the signal is only on for part of the step.
side panel. I choose to use two, quad RCA panel
mount jacks for simplicity and low cost (see
Photo 4). You can use whatever connectors
that suit you best. Shielded wiring is not Manual, which is posted on the Circuit Cellar
absolutely necessary, but the performance FTP site. But a general overview is useful.
is a little better at the high frequencies. I Instead of specifying a start and end
chopped up a couple of spare audio cables. point (like an analog sweep generator), the
It was considerably cheaper than buying a start frequency, step size, and number of
lot of shielded wire. Flexibility of the wire is steps define the sweep range. Since the start
probably the most important consideration. frequency and step size are 24 bits, they
You can use SIP socket-strips to mate require two registers each. So, these five
with the connectors. They are cheap and easy registers precisely define the sweep range.
to use. However, they are not very rugged. Note that the sweep is in discrete frequency
Plugging them in and removing them a few steps rather than a continuous sweep. If the
times caused problems. There’s nothing worse steps are close together, there isn’t much
than an intermittent connector. I chose to go practical difference between an analog sweep
with quality socket-pins and shells. The cost and a digital sweep (see Photo 5). Of course,
wasn’t very much but it did take considerable
time to properly assemble them (see Photo 4).

OPERATION
The operation of a DDS sweep generator
is different from an analog one. An analog
sweeper is basically a voltage-controlled
oscillator (VCO) governed by a ramp generator.
The start and end voltages of the ramp are
adjustable and define the frequency range
of the sweep. The speed of the ramp is also
adjustable and controls the sweep rate. As
you can see, it’s pretty straightforward.
The DDS sweep generator is essentially
a small computer in itself. It’s completely
controlled with digital words. In order to
create what you want, you have to load eight,
12-bit registers. The details of the registers
PHOTO 7
are available in the Analog Devices AD5930 As a fixed-frequency generator, it’s pretty accurate. This 2-PPM accuracy is much better than the specified
datasheet, as well as from the Operator’s 50 PPM.
24 CIRCUIT CELLAR • MARCH 2015 #296

you can make the steps as big as you like.


For example, you can set your steps precisely
on the center of every channel in the AM
broadcast band.
The minimum step size is the clock oscillator
divided by 224. For a 50-MHz oscillator, this
FEATURES

is 2.98023224 Hz. For a 5-MHz oscillator, the


step size is 0.298023224. It is unfortunate that
binary and decimal don’t mix.
There’s another register for the step
interval. That is, it specifies how long each
step is to be. This defines the overall sweep
rate. The number of steps multiplied by the
step interval equals the sweep rate. The step
interval can be specified in either oscillator
clock cycles (linear sweep) or output frequency
cycles (log sweep). The step-interval can be
as short as two clock cycles (or output cycles)
and as long as 1,023,500 cycles. And since
you can have as many as 4,095 steps, a full
sweep can take as long as 83.8 s (with a 50-
MHz clock).
There’s a separate register for the burst
function. This defines how long the output is
active for each step-interval (see Photo 6).
(Normally, the output is active for the whole
step interval.) This can also be either oscillator
clock cycles or output frequency cycles (but
must agree with the step interval register,
PHOTO 8 above).
Marker identifies frequency of interest The last register is the control register. This
controls all the various options and features. A
few of the major options are: sine/triangle wave
output, sawtooth/triangle sweep, continuous/
burst mode, sync-pulse-per-step/sync-pulse-
per-sweep, internal/external control, sweep-up
at start/sweep-down at start, and others.
The sawtooth/triangle sweep option
defines the output profile. A sawtooth sweep
begins at the start frequency, sweeps to the
end frequency, and then jumps back to the
start frequency. A triangle sweep begins at the
start frequency, sweeps to the end frequency,
and then sweeps back to the start frequency.
There is no frequency discontinuity with a
triangular sweep profile (however there may
be a phase discontinuity).
The internal/external control allows
the user to manage aspects of the sweep
manually. In particular, the burst length and
PHOTO 9 the stepping of frequencies can be defined
A “sweep” of 10 different frequency segments with external signals. This allows single-
stepping of the frequency sweep which
means fixed-frequency operation. With 0.1%
distortion and frequency accuracy of 50 parts
SOURCES per million (PPM), it’s a pretty good signal
HDM16216 LCD generator (see Photo 7).
Hantronix | www.hantronix.com
SOFTWARE
The software is a story all by itself. It
Microcontroller started out as a simple driver for the sweep
circuitcellar.com/ccmaterials Microchip Technology | www.microchip.com generator chip. But over a period of two years
circuitcellar.com 25

M E A S U R E M E N T C O M P U T I N G

Great 16-Bit
it became an operating system consisting of
about 9,000 lines of code and comments. If
you choose to print it out, you’ll need over 200
sheets of paper in your printer. It’s available
for free (non-commercial use) at the Circuit
Cellar FTP site. The side-panel layout/graphics DAQ Solutions

FEATURES
and comprehensive operator’s manual are
available, too. Easy to Use • Easy to Integrate • Easy to Support
There is one special aspect to the software.
It creates a marker/cursor for an oscilloscope.
NEW
This is extremely useful for determining the
precise frequency at a particular point in the
sweep (see Photo 8). In this case you can
quickly plot the impedance curve of a 2.5″
speaker and identify the minimum impedance
frequency.
Ethernet, Multifunction High-Speed, Multifunction
Since the marker is software controlled
it is completely independent of the sweep E-1608 USB-1608GX-2AO
generator. Therefore, there are some Only $499 Only $799
limitations. First, it can’t be set for the first • 8 SE/4 DIFF analog inputs • 16 SE/8 DIFF analog inputs
two or last two frequency steps. Second, there • 250 kS/s sample rate • 500 kS/s sample rate
is a software latency of about 3 µs. This means • 2 analog outputs • 2 analog outputs
that for proper accuracy, your step length • 8 digital I/O, 1 counter • 8 digital I/O, 2 counters
should be longer than this (150 clock cycles
at 50 MHz or 15 clock cycles at 5 MHz). Lastly,
there is a re-sync period between sweeps of
about 15 µs. This is seen as an inactive period
from the end of one sweep to the start of the
next sweep. Generally, these limitations are
not too significant.
Simultaneous Sampling Low-Cost, Multifunction
POWERFUL TESTING SOLUTION
This DDS sweep generator is a very flexible USB-1608FS-Plus USB-231
and powerful test instrument that is very Only $399 Only $249
useful for any type of frequency work. It can do • 8 simultaneous analog inputs • 8 SE/4 DIFF analog inputs
things an analog sweeper can’t. For example, • 400 kS/s overall sample rate • 50 kS/s sample rate
Photo 9 shows a “sweep” where each step • 100 kS/s max for any channel • 2 analog outputs
is only a fraction of the period. Ten different • 8 digital I/O, 1 counter
• 8 digital I/O, 1 counter
frequency steps form one cycle. Note the angle
change at the end of the cycle/sweep. And the
DDS provides digital precision in frequency
accuracy as well as low distortion. Once you
use a sweeper, you’ll wonder how you ever got
along without one.
Coming soon: a micro-ohmmeter/micro-
voltmeter plug-in board for the base unit.
High-Channel Count Simultaneous Sampling
USB-2533 USB-1602HS
ABOUT THE AUTHOR Only $1,149 Only $1,999
Gerard Fonte is the principal engineer at The • 64 SE/32 DIFF analog inputs • 2 SE analog inputs
PAK Engineers and has nearly 30 years of • 1 MS/s sample rate • 2 MS/s sample rate
hands-on experience that includes missile • 2 timer outputs • 3 quadrature detectors
guidance systems, electronic warfare, gravity • 24 digital I/O, 4 counters • 4 counters
navigation, and projects that “don’t exist.” He
has well over 100 publications. Gerard was mccdaq.com
awarded the Engineers’ Council Outstanding
Engineering Merit Award in 2006 for his work Contact us
on Egyptian pyramid construction. He holds
1.800.234.4232
a BA degree in Psychology and a MS degree
in Natural Science. ©2015 Measurement Computing Corporation, 10 Commerce Way, Nor ton, MA 0276 6 • info@mccdaq.com
26 CIRCUIT CELLAR • MARCH 2015 #296

Infrared Learning
How to Mimic IR
Control Signals
FEATURES

Here’s a simple way to add infrared


control capability to your project. The
tiny module can learn and reproduce
infrared signals better than most other
methods at a fraction of the cost.
PHOTO 1
By Tommy Tyler (US) Chunghop L102 learning
remote

S uppose one of the functions of that


wonderful new gadget you’re designing
is to transmit an infrared (IR) control signal
a processor. An Internet search turns up a
few articles that seem to offer a solution. You
might have noticed these solutions usually
when a certain event occurs. What if you’re rely on a three-pin IR receiver module as
not sure exactly which signal will be needed or an optical sensor to learn the IR signal. That
whether it might have to be changed at some sensor combines a fast photo diode, high-gain
future time? I ran across this problem while amplifier, and demodulator in one unit. For
designing a gadget motivated by an obsessive, maximum sensitivity and rejection of noise
almost fanatical dislike of TV commercials. from ambient illumination, it also includes a
Watching a news program or weather band-pass filter whose center frequency is
broadcast in real time was always unpleasant chosen to match the carrier frequency of the
during the lengthy, obnoxious, and incredibly IR signal it must receive. To accommodate
repetitious commercials. So my gadget was various brands of consumer products, receiver
supposed to turn off TV sound after receiving modules are manufactured in at least 11
a UHF signal from a tiny transmitter pinned different varieties, with center frequencies of
to my shirt pocket, and then turn it back on 30.0 to 56.9 kHz. Most IR learners compromise
after a three-minute commercial break unless by using a 38-kHz receiver module to detect
I sent the signal again to immediately abort as many carrier frequencies near that value
the silence. Nothing rocket science about as possible. They learn a signal by looking
that, right? To avoid TV modifications or at its demodulated waveform without ever
messy wiring connections, I wanted to turn actually knowing its carrier frequency. Since
the sound off and on with an infrared mute the reproduced signal must have a carrier to
command learned from the TV remote control. be usable, they just give it 38 kHz. That might
That raised the complexity of my project to a be close enough for some signal protocols like
whole new level. Sony12, NEC1, and RC5 or RC6, but it could
be problematic for signals whose carrier
SEARCHING FOR AN EASY WAY frequency is as low as 32 kHz or as high as
If you’re like me you do not relish digging 57 kHz. Testing to decide how well a one-size-
into a problem like this. You just want a simple, fits-all learning circuit like that meets your
reliable solution that doesn’t require you to be needs is almost hopeless. You can try learning
an expert on IR remote control technology, a bunch of different IR signals generated with
adds as few parts as necessary to your gadget, a universal remote control, but unless you
and preferably doesn’t require programming have all the equipment those signals control,
circuitcellar.com 27

PHOTO 2
L102 learning remote circuit board

there’s no way to tell if the learned copies are


accurate enough to do the job.
You might have decided from your searches
that there is no application-specific IC available
for learning and transmitting IR signals. But
such a chip does exist! It’s the processor used

FEATURES
in a Chunghop Electronics Model L102 Learning
Remote Control (see Photo 1). This remarkable
little remote can learn and accurately mimic
up to 11 different IR signals of almost any
protocol at carrier frequencies from 20 to
80 kHz or more. Learned signals are saved
in nonvolatile memory so that nothing is lost
when power is off. In this article, I’ll explain
enough about the Chunghop remote to add
reliable and comprehensive IR learning and
signaling to your project. You can accomplish
this on a low budget without knowing anything
about IR remote controls. Another perk is that
you’ll use less than half a cubic inch of space
in your gadget.
Unfortunately, the chip with Chunghop’s
proprietary OTP firmware installed is not sold
separately. But you’ll easily find a “Chunghop
L102” remote on the Internet for less than
$8 including shipping. The price is a bargain,
considering that the remote contains nearly
everything you need to solve this problem.

INSIDE A CHUNGHOP REMOTE


Unlike most remote controls that snap
together like a bear trap, the L102 is very easy
to disassemble for access to its components. writing to the EEPROM, and two pins (3 and 12)
Just remove the batteries and six tiny Phillips for an LED (D2) that guides you through the
head screws in back to open the case and drop learning procedure and shows when the unit
out the board. Most of the components are is transmitting. The internal clock oscillator
grouped together at the lower end of the board requires no external components. IR1 serves
(see Photo 2). The 16-pin AD009-03 processor as both the IR emitter when transmitting
IC is the only item that is unique. The eight- and as a fast photo detector when learning.
pin 24C16 EEPROM and other parts are icing A key’s learned signal is transmitted when
on the cake. If you are designing your own the matrix lines that intersect at that key are
PCB, you can just transplant the processor momentarily bridged. For example, bridging
and EEPROM to your board. But if you’re processor pins 9 and 10 would transmit a
nervous about unsoldering the surface-mount signal learned for K10.
ICs with their tiny, fragile leads, I’ll show you
how to make a module out of the lower end of BUILDING THE IR MODULE
the board that provides one intact unit with Start by removing both battery contact
most of the major components preassembled. springs from the board. The Chunghop PCB FIGURE 1
The schematic of this incredibly simple can be cut easily because it is only 1-mm thick L102 learning remote schematic
remote shows an outstanding example
of well-engineered product design (see
Figure 1). I’ve labeled the keys with their
generic designations (K1, K2, K3, etc.) rather
than Chunghop’s arbitrary names (POWER,
VOL, CH, etc.). Each key is capable of learning
and reproducing any kind of IR signal totally
independent of the other 10 keys. Half of the
processor’s 16 pins (4–11) are dedicated to the
keyboard matrix, and three pins (1, 2, and 16)
are used for power and ground. That leaves
one pin (15) for learning and transmitting IR
signals, two pins (13 and 14) for reading and
28 CIRCUIT CELLAR • MARCH 2015 #296

PHOTO 3 this, try scribing and breaking somewhere


Lower end of PCB used as module in the upper portion of the board that won’t
be used. Although it’s optional, you can also
scribe and break off the ears on both sides
so that your module is only about 1.5″ long.
Smooth the edges with a file or sandpaper.
FEATURES

Attach seven small insulated buss wires


A-G to the module for connections to a
solderless breadboard, perf board, or PCB
(see Photo 4). For a minimum footprint, you
can mount the module on edge. When used
that way, a small dab of epoxy or hot-melt
glue on each wire near the edge of the module
will stabilize it like a molded SIP component.
If you want the module to lie flat, you should
transfer electrolytic capacitor C5 from the
underside of the board to the top with the
other components. Be sure to observe proper
lead polarity for C5. Solder wires A and G to
the abandoned pads for the battery + and -
contact springs. Solder wires B and C to the
ends of resistors R6 and R2. Solder wires D,
E, and F to the traces of U1 pins 3, 8, and 9.
The wiring diagram for the completed module
shows how to connect it to the few additional
components used (see Figure 2). Holding the
setup switch (S) closed initiates learning, the
same as with the Chunghop remote. K7 was
chosen as the transmit switch simply because
the processor pins (8 and 9) for that particular
switch are on the end of the IC where access
for soldering wires is easiest. Other wiring
arrangements using a different switch or several
switches can be substituted for the one shown.
Switch S is referenced to ground, so it can
be almost any type of switch, a mechanical
contact, an open collector or open drain
Phenolic. Scribe across the board several times transistor, or a processor output that can
on both sides with a very sharp knife, about be tristated so it floats high. But both
0.75″ from the lower edge (see Photo 3). Bend sides of the K7 switch (as well as any other
PHOTO 4 the board at the scribed lines and it should keyboard switch used) must be left floating
Attaching wires to module break cleanly. If you feel you need to practice and completely isolated. If you want to
switch K7 with an active device instead of a
dry circuit contact, a CMOS bilateral analog
switch is a logical choice. For a small, single
switch in a five-pin SMD package, I suggest
an SN74LVC1G66. If you prefer a part in a
DIP package, or if you need to use more than
one switch, the venerable old CD4066 works
well. Don’t worry about the resistance of
the switches you use. My tests indicate that
the Chunghop processor switch inputs will
tolerate an ON state resistance of thousands
of ohms, no doubt to work with the inefficient
conductive rubber switches of the keyboard.
You’ll need to supply 3.0 or 3.3 VDC to
wires A and G for U1 and U2, but not much
current. The module draws less than 50 mA
while transmitting and about 1 µA in Sleep
mode. After applying power, it needs a couple
of seconds for power-up initialization and
signals when it is ready by flashing “dash-
circuitcellar.com 29

dot” once with D2.

TEACHING THE MODULE


Chunghop Module

There are several different ways A B C D E F G


you can teach an IR signal to your +3 V
module, depending on the likelihood it IR1

FEATURES
will need to be changed in future. If
the chances of a change are negligible,
you can enjoy the ultimate in simplicity D2

by omitting the in-circuit learning


components (D2, S, and K7) altogether,
K7
along with wires C and D to the
module. Just learn the needed signal S
GND
to the Chunghop << button (K7) before
you dismantle the remote to make the
module. (Be sure to test it first.) It will FIGURE 2
remain safely stored in the memory Wiring diagram for module

chip and ready to use after you’ve


completed the module or transplanted
the chip to your gadget. switches, or to correct a mistake.
For strictly personal use, or if 5. Press switch S to turn off D2 and
there’s no convenient place to put the lock in the learned signal(s).
learning components in your gadget, E������� S�����
you can use a DIP version of the 24C16 Many remote controls keep repeating P����������
EEPROM. Install an eight-pin socket an IR signal as long as a button is held
for it in your gadget and another in a closed. Chunghop will usually transmit just • An introduction to Assembly
second Chunghop L102 that you save one or two copies of a signal if the teaching language & its functionality
as a learning tool. To reprogram an sample was very brief and contained only
IR signal, transfer the EEPROM from one or two copies. If the teaching sample • Essential terminology pertaining
your gadget to the L102, learn the contained three or more copies, Chunghop to higher-level programming
new signal, and then plug it back will usually mimic that by repeating the languages & computer architecture
into your gadget. Be sure the source signal as long as K7 remains closed. If that
• Important algorithms that may
and destination power is off before causes a problem with your gadget, and
be built into high-level languages
transferring the EEPROM. you want the module to transmit only one — multiplication, division, and
But if you are designing a gadget to copy of the signal, try tapping the source polynomial evaluation
be used with many different brands of button very briefly during learning. To test
equipment, or perhaps if you just want it, hold K7 closed and watch D2. If it gives • Overview of Interrupt Service
the security of being able to change the one short flash it is a non-repeating signal. Routines
signal easily at any time, the wiring If it flashes continuously it is treating the
• Free, downloadable Assembler
diagram shows everything needed for learned signal as a repeating signal. Also
program… and more!
in-circuit learning. With the “teaching” note that transmission of a signal is never
remote facing IR1, an inch or two away, shut off in midstream when K7 is released.
the learning procedure is as follows: The Chunghop processor always completes
any signal it has started before turning off.
1. Press switch S until D2 turns on Although bright red works best, almost
steady, then release. any LED of any color can be substituted for
2. Press button-to-be-learned (on D2. The LED you use for IR1 should have
teaching remote) until D2 begins an IR wavelength of 940 or 950 nm to
blinking, then release. work well as a photo detector. For remote
3. Press switch K7 until D2 turns on transmission up to about 25 feet it’s
steady again, then release. recommended that you salvage and use the
4. Repeat steps 2 and 3 for more Chunghop infrared LED for IR1. If you need

ABOUT THE AUTHOR A matter-of-fact guide


Tommy Tyler (tomytyler@comcast.net) is a retired engineer with over 40 years of ex- to Assembly that will
perience in industrial instrumentation, medical electronics, consumer electronics, and introduce you to the most
fundamental programming
robotics product design, earning 17 patents in these fields. He lives in the mountains
language of a processor.
west of Denver where he pursues his hobbies of technical writing and illustration.
Tommy is a contributing expert to the JP1 Forum on IR remote control technology. CC-WEBSHOP.COM
30 CIRCUIT CELLAR • MARCH 2015 #296

service or replacement.
A final comment on Chunghop. When
searching for the Model L102, you may run
across a Model RM-L7, which is a smaller, egg-
shaped learning remote with seven buttons
instead of 11. It sells for slightly less than the
FEATURES

L102, but I don’t recommend using it for a


number of reasons. The processor is chip-on-
board mounted beneath a blob of epoxy, and
access to soldering points is much more tedious.
It has nonvolatile learning-data memory, but
there is no separate EEPROM.

LEARNED SIGNAL ACCURACY


Figure 4 and Figure 5 show how well
Chunghop copies IR signals transmitted by
OEM remote controls. This data was captured
FIGURE 3
something other than line-of-sight transmission and recorded with an IR widget. The first line
The commercial killer
(for example, if the controlled equipment is shows measured carrier frequency and a
enclosed in a cabinet, or too far away), place the thumbnail picture of the captured signal. The
LED on a long cable like an IR Blaster. Purchased following line(s) show timing details of the
blasters can also be used, but it’s hard to predict demodulated waveform, with carrier ON
how well they will perform as a photo detector bursts (high) and OFF times (low). Numbers
during learning. below the line are time in microseconds, and
As you can see in Figure 3, all the heavy numbers within the ON bursts are the number
lifting is done by the module. The timer is trivial, of carrier pulses counted during that burst.
and the UHF link uses purchased components. As you can see, the carrier frequency and all
When I convert my breadboard to a printed timing of the copy is within a few percent of
circuit, I plan to use a 15-position inline socket the original, well within the allowed tolerance
for the module so it can be easily unplugged for of remote controlled equipment.

Original Signal from OEM Remote

Chunghop Copy of Signal

FIGURE 4
Example of learned Sony12 infrared signal with 40-kHz carrier

Original Signal from OEM Remote

Chunghop Copy of Signal

FIGURE 5
Example of learned RCA infrared signal with 57-kHz carrier
MIXED SIGNAL
OSCILLOSCOPES
4 ANALOG + 16 DIGITAL CHANNELS
RAPIDLY DEBUG COMPLEX MIXED SIGNAL DESIGNS
• USB 3.0
• ULTRA DEEP MEMORY
• SEGMENTED MEMORY
RAPID
• RA
R PID TRIGGERS

INCLUDES AUTOMATIC MEASUREMENTS, SPECTRUM ANALYZER, SDK,


ADVANCED TRIGGERS, COLOR PERSISTENCE, SERIAL DECODING
(CAN, LIN, RS232, I²C, I²S, FLEXRAY, SPI), MASKS, MATH CHANNELS,
ALL AS STANDARD, WITH FREE UPDATES . 5 YEAR WARRANTY

3204D MSO 3205D MSO 3206D MSO 3404D MSO 3405D MSO 3406D MSO
Channels 2 analog, 16 digital 4 analog, 16 digital
Bandwidth 60 MHz 100 MHz 200 MHz 60 MHz 100 MHz 200 MHz
Buffer memory 128 MS 256 MS 512 MS 128 MS 256 MS 512 MS
Max. sampling rate 1 GS/s
Signal generator Function generator + Arbitrary waveform generator
Digital inputs 100 MHz max. frequency, 500 MS/s max. sampling rate

www.picotech.com/pco538
32 CIRCUIT CELLAR • MARCH 2015 #296

The Sentry
Project
FEATURES

PHOTO 1
The Sentry system uses commercial IR motion sensors (lower left)
together with a customer vibration sensor (lower right) to determine
where an individual is within a building. The base unit (top) integrates
reports from these sensors to generate alerts to a caregiver.

The Sentry project uses an array of passive IR sensors placed


throughout a building to track motion. The system comprises
an RF link to a processor along with an Ethernet module to
unobtrusively monitor motion and activity levels.

By David Penrose (US)

M y Sentry System is designed to assist


those folks living alone who desire
the peace of mind provided by a caregiver
pattern. The system is designed to be simple
to set up yet very flexible in its application
so the needs of different residents can be
looking after them without the caregiver addressed. A resident with minimal needs
having to be present. Its implementation can be monitored by a set of relaxed rules,
was facilitated by the WIZnet WIZ550io while a resident in need of more continuous
Ethernet module, which provides a rich observation can be assigned a set of strict
yet simple interface to the Internet. With a rules. In all cases, the overarching design
simple microprocessor, the system allows approach was to provide a system that
the status of a resident to be continuously augments the caregiver’s capability.
monitored in a minimally intrusive fashion.
Any abnormal conditions can immediately be THE APPROACH
alerted to a remote caregiver for action. In The Sentry System integrates motion
this way, a caregiver’s smartphone acts as sensors, a microprocessor, and the WIZ550io
an alert system by letting them know when Ethernet interface to monitor a resident and
a resident’s activity deviates from a normal report abnormal activity patterns to a remote
circuitcellar.com 33

caregiver (see Photo 1). The relationship of


these subsystems is illustrated in Figure 1.
The primary sensors are IR motion sensors. RF
These can be augmented by vibration sensors, Sensor Processor
Xmit
pressure mats, ultrasonic, and other devices
capable of detecting a person’s presence.

FEATURES
These sensors are placed at key locations in
a resident’s home to monitor movement from Vibration/microwave/sonic…
sensors/transmitters
room to room or within rooms. The vibration 89LPC936
Microprocessor Ethernet
sensors are placed in favorite chairs/couches connection
or in the bed to determine if the furniture
is occupied and if there is normal activity.
All of these sensors are battery powered RF
and report over an RF link. The RF reports Rx WIZ550io
from these devices are received by a base Internet
interface
unit which then compares the resident’s Bunker Hill
wireless
location and activity to a set of rules that alert system

define normal behavior for different times of


day. Any deviation from normal results in an
SMS text message or e-mail being sent to the MCP7940
RTC
24LC1025
EEPROM
IR Sensors/transmitters
caregiver along with information about how
to contact the resident. In most cases, it is
expected that the caregiver would respond
by phoning the resident to check on them.
The system is designed to be easy to
install and operate. The WIZ550io’s Internet
interface is used to communicate to a Some cost only $11. The item consists of a FIGURE 1
Up to eight sensors transmit activity
browser allowing the caregiver or resident sensor/transmitter and a receiver/alarm
to a base unit processor, which checks
to configure the system. This configuration device. The receiver/alarm device is not used
for abnormal behavior of a resident.
consists of identifying sensors and rooms and in this project although the RF receiver was Alerts to a caregiver are generated
describing a set of rules for each room for lifted from one of these units to provide the and communicated over the internet.
periods in the day. This local interface also receiver for the base unit. These sensor units
allows for a review of all past activity once are powered by 9-V batteries and report on
the system is operational. This history data an RF link at 433 MHz with a unique address
is valuable for refining the rules to reduce code. The code allows multiple sensors to
false alarms and ensure security. Since the be deployed and recognized by the base unit.
interface is behind the resident’s firewall, the I constructed a custom sensor from a
system is secure from improper modification. sensitive vibration-sensing device integrated
The key output from the system is the alert with a small microprocessor and an RF
to the caregiver, which relies on the WIZ550io transmitter (see Photo 3 and Figure 3). This
module communicating to a service site such sensor is powered by a 9-V battery and is
as Exosite. The site generates the alerts sent a working example of just one of the many PHOTO 2
The base unit incorporates the
to the caregiver. different types of add-on sensors possible.
WIZ550io, an 89LPC936 processor, a
This particular unit can be attached to a
MCP79401 real-time clock, and a serial
SYSTEM HARDWARE bed or chair and hence continuously report EEPROM to process reports received
The system’s hardware consists of a base activity even when a resident is not moving from the 433-MHz receiver.
unit and multiple sensor/reporting units.
The base unit (see Photo 2) comprises a
WIZ550io Ethernet interface, an inexpensive
microprocessor, an RF receiver, a battery
backed-up real-time clock, and a serial
EEPROM. All of these pieces are integrated
into a small form factor case and powered by
a plug-in transformer (see Figure 2).
The remote units can be one of many
different sensor/reporting devices depending
on the needs of the resident. The basic sensor
is the IR motion sensor, which is available from
a number of different sources. I used Bunker
Hill Security sensors, which I purchased
from Harbor Freight Tools (Item 93068). A
sensor plus receiver is very inexpensive.
34 CIRCUIT CELLAR • MARCH 2015 #296

FIGURE 2
The microprocessor accomplishes all
of its tasks while using only a few of
the available port pins.
FEATURES

about. keyed to time of day. An EEPROM stores all


the rules and information, including sensor,
BASE UNIT room, resident, and caregiver information.
The base unit integrates the reports This EEPROM also stores a time-tagged
received from the remote sensors and recording of all status changes and alerts/
processes this data to generate reports acknowledgments generated.
issued on the Ethernet interface. This The WIZ550io is a key component in the
Ethernet interface does all the difficult base unit. It features the WIZnet WZ5500
processing involved in communicating over chip and additional hardware to provide a
the Internet so the microprocessor can full-featured interface to Ethernet and hence
focus on receiving and processing the sensor the Internet. The microprocessor talks to this
data. The processor is assisted by a battery unit over a SPI, while the Ethernet interface
backed up real time clock so that rules for is through an RJ-45 socket. There are eight
checking on the resident’s activity can be send and eight receive interfaces available
within the WIZ550io with a large 16-KB
buffer shared among them. This buffer can
be allocated in any fashion needed to provide
the speed and flexibility required. This large
buffer is invaluable for integrating with a small
microprocessor since all transmit messages
can be constructed in this buffer and all
receive information can be read a character
at a time from the receive buffer. Without this
external memory, using the Internet would
be much more difficult or require an external
memory to the microprocessor.
The Sentry uses an NXP Semiconductor
89LPC936 microprocessor. It is a very
inexpensive but fairly powerful 8-bit
processor using the 8051 architecture and
instruction set. The 89LPC936 includes 16 KB
of flash program memory, 768 bytes of SRAM,
512 bytes of EEPROM, and a wide assortment
of peripherals and timers. This project uses
the built-in I 2C interface, the SPI interface,
the capture/compare unit (CCU), and the
real-time clock. The CCU in the 89LPC936
provides significant assistance in decoding
the incoming RF stream. By just inverting the
expected edge with each bit acquisition, the
CCU provides very accurate timing of the on/
PHOTO 3
off periods in the data stream.
This is as simple as it gets: a
A Microchip Technology MCP79401 real-
microprocessor with a vibration
switch to wake it up and a 433-MHz
time clock chip (RTCC) provides time of day
transmitter to communicate. information. The MCP79401 is a Microchip
circuitcellar.com 35

Technology device that implements a battery FIGURE 3


backed-up real time clock and 64 bytes The mechanical vibration sensor
generates an interrupt to wake the
of battery backed-up RAM. This RAM was
processor, which then formats and
valuable for my project, since I needed to
transmits a report using the 433-MHz
keep track of the head and tail of the history transmitter.
file maintained in EEPROM. I did not want to

FEATURES
constantly rewrite these values in EEPROM
since it has a limited number of write cycles
available. I also wanted these pointers to be
maintained during power outages so the RAM
in the clock chip was the perfect solution. I
also use this RAM to store the user’s selection
of Daylight Saving Time tracking just because
it logically belongs with the clock data. I
have also used this RAM for a few other key The codes sent are unique to the address of
variables but these could have gone equally the different units available. This uniqueness
as well to the EEPROM. of codes allows the Sentry to identify which
I selected the Microchip Technology sensor is reporting and associate the sensor
24LC1025 EEPROM for bulk data storage. The to a room. Setting up the sensor address table
24LC1025 I 2C serial EEPROM device provides is automatic. Each time a new sensor is seen,
1 Mb (128 KB) of storage arranged as 8-bit it is recorded and available for naming and
words in 128-byte pages. I logically divided associating to a room.
this chip into two sections of 64 KB each. The on-off keyed sequence of these
The lower section stores all the configuration transmissions is not a very robust data stream
information for my project, while the upper and is subject to significant noise. Fortunately,
64 KB is used for a circular buffer of time the coding of the transmission sequence
tagged history data. This chip provides 1 allows for noise to be discriminated from the
million write cycles with a 3-ms page write signal by the patterns employed. Only select
time. When evaluating the number of write sequences of 1s and 0s are valid, and the
cycles possible, you need to keep in mind that entire sequence must be followed by a 16-ms
any write to a page forces the entire page quiet period. The flipside to this is that a valid
to be rewritten, so don’t just write a few signal may be missed by noise interfering with
bytes consecutively to the chip and expect to it. To minimize this, the codes are sent a total
achieve the 1 million cycles. One other feature of 16 times and a full sequence requires about
that needs attention is that all writes occur 1.5 s to complete. The base unit processor is ABOUT THE AUTHOR
on the 128-byte boundaries. Any attempt to designed to ignore repeated transmissions Dave Penrose (david.
write a block of data across the 128-byte while assembling a valid sequence. penrose@comcast.net)
boundary will just wrap around the 128-byte The IR motion sensors can report a i s re t i re d f ro m t h e
boundary. Individual consecutive writes of resident’s location as long as there is aerospace industry. He
single words can avoid this problem but this significant motion and the resident is in view began his career pro-
is slower and the number of write cycles prior of the sensor. If the person is sitting down or gramming test soft-
to wear-out is decreased. I allocated my use in bed, then the motion sensors will not be able ware for space vehicles
of the EEPROM so all sections fall on a 128- to discern small movements. To augment the and has maintained a
byte boundary and avoided the problem of detection capability of the system, vibration life-long passion for de-
wrap-around. monitors have been added which transmit a veloping microprocessor
Completing the base unit is the receiver data stream similar to the IR motion sensors. projects. He holds an
subassembly. This 433-MHz receiver is a These sensors are designed to pick up small Expert Class Amateur
commodity product available from a number motions of a healthy individual sitting in a Radio License (K1DHP),
of suppliers. I elected to remove mine from chair or lying in bed. These monitors use a an MS in Computer Sci-
the IR motion sensor system receiver. The Fast Vibration Sensor (Adafruit 1766) and an ence from the Universi-
device was a good candidate for the receiver 89LPC922 microprocessor transmitting with ty of Santa Clara, and
in this base unit since it is a self-contained a WRL-10534 RF transmitter from Sparkfun a BA in Mathematics
small daughter board in the Harbor Freight Electronics. from the University of
units. If you elect not to do this harvesting, California at Berkeley.
these devices are available from a variety of SOFTWARE Much credit for putting
suppliers on the Internet. The aforementioned hardware is simple, up with strange devices
inexpensive, and readily available. The magic appearing through the
THE SENTRY SENSORS of the project is in its software. The 89LPC936 house but also for edit-
The main sensors for the Sentry system processor in the base unit provides for 16 KB ing rough thoughts into
are IR motion sensors. These sensors respond of code memory in flash memory. The project finished articles goes to
to a warm body moving in their field of view was developed in assembly language and uses Dave’s wife, Melinda.
by sending a coded transmission on 433 MHz. a significant amount of this memory. HTML
36 CIRCUIT CELLAR • MARCH 2015 #296

the CLIENT logic, which opens a port to the


Exosite system and transmits a message with
current time, status, and any alerts.
After the 1-s and 1-min timed events are
processed, the loop calls the SERVER routine
to listen for any request from a client such
FEATURES

as Firefox, Safari, or Chrome. If a request is


present, then the appropriate action is taken
to either deliver a display page or process
data input by the user. This process is called
as often as possible to ensure a smooth
response to any user requests.
After these events are processed, the main
loop then checks for any signals that have
been assembled by the interrupt logic from
the RF input stream. If data is available, it is
identified as to which of the eight sensors it
represents, which room it is assigned to, and
then the rules are checked for this input. This
signal is then removed from the processing
stack and the process begins again at the top
of the loop.
The signals are assembled for the main
processing loop by interrupt logic. This
FIGURE 4
text strings take a big portion of memory. interrupt is generated by the CCU. The CCU
The information displayed to a local
client allows all aspects of the Sentry
The software itself uses a main processing in the 89LPC936 is programmed to recognize
system to be defined. It also repeats loop and two interrupt routines. The main changes on an input pin and to time durations
any alerts that may have been sent to loop begins by initializing the processor, between edges. Luckily, the CCU also includes
the caregiver. interrupt routines, its peripherals, and key a glitch filter so short spikes are eliminated
variables that track state conditions. Once the automatically. The job of assembling a sensor
initialization is complete, the project begins report requires that the time duration of the
its continuous processing loop. At the top of off and on periods are recorded and checked
the loop, a 1-s timer is examined. If this flag against valid sequences. The interrupt logic
is set, the MCP79401 RTC is read and used for first reads the value of the 16-bit timer that
rule checking and message generation. The has been running in the CCU. It then selects
next step is to examine a 1-min timer. If this the alternate edge (high to low or low to high)
timer flag is set, the logic proceeds to check of the interrupt to capture the next interval in
all occupancy rules that are independent of the data stream. The time value just recorded
movement from room to room. These checks is then passed to the DECODE routine to
will catch a resident being quiet too long or decide if a valid set of data is present.
not entering or leaving a room when they The DECODE logic first identifies the
should. Any rule violations detected here are measured interval as a short low, a short
flagged for further processing in later steps. high, a long low, a long high, noise, or a very
The last step of this 1-min tick is to execute long interval (15.5 ms), which indicates a sync
position in the data stream. The low and high
periods are used to assemble a sequence
of 1s and 0s, the noise interval resets the
process while the sync period indicates that
an assembled set can be passed to the main
89LPC936 Microcontroller
processing loop. The interface between this
NXP Semiconductors | www.nxp.com interrupt logic and the main processing loop
is a ring buffer where multiple signals can be
Network Sniffer stacked up for the main processing loop to use.
To reduce the amount of data, this routine will
Wireshark | www.wireshark.org
circuitcellar.com/ccmaterials remove repeated transmissions from the same
sensor. Each sensor will repeat its message
WIZ550io Ethernet Module up to 16 times so removing these duplicates
SOURCES
WIZnet | www.wiznet.co.kr early is imperative. This logic will also check
24LC1025 EEPROM and for invalid bit sequences in the stream. Once
MCP79401 RTCC this processing takes place the interrupt will
Microchip Technology | exit until the next edge detected by the CCU.
www.microchip.com
circuitcellar.com 37

WIZ550IO ETHERNET LOGIC


The WIZ550io accomplishes all of the
difficult logic of communicating over the
Internet through an Ethernet connection.
Without this assistance, the base unit could
not possibly accomplish all of its processing

FEATURES
and reporting. With this assistance available,
the base unit only needs to implement a host
to talk to a client such as Firefox or a client
to talk to a remote host such as Exosite. Both
of these host and client interfaces operate
simultaneously in this project and use only a
small percentage of the WIZ550io’s features.
The host logic in the base unit
communicates with a web browser to
configure the system. To act as a server, it
establishes a Listen configuration and waits
for a client browser to establish a connection.
The browser will then pass an HTML message
requesting a specific page to be displayed or
it will pass data to the process from a user
form (see Figure 4).
The Client processing generates the Exosite
remote display and any alert messages to be FIGURE 5
sent to the caregiver (see Figure 5). This Current alert information as well as detailed information on the resident and caregiver is presented on the
process is serviced once per minute and remote Exosite display.
when called establishes a Talk relationship to
Exosite. After each interchange of data, this
process disconnects from Exosite.

RULE PROCESSING
All rule processing is keyed to rooms in
the resident’s house. A room can have one
or more sensors in it, but all of these sensor
reports are combined to determine what
room the resident is in and when the last
activity in the room took place. There are four
simple rules that the caretaker establishes
for each room (see Figure 6). These rules
were based on the logic a person might use
to determine if an individual is behaving
normally. They can check if a person visits
FIGURE 6
the kitchen or bathroom on a regular basis, Four simple rules allow the Sentry system to be tailored to any resident’s needs.
if they are in bed prior to a normal time, if
they remain in bed past a normal time, if they
are too quiet in a room, and other checks fixed IP address for the WX550io needs to be
that can be made based on time of day and fetched from a DHCP server to obtain a local
duration in a room. Each rule can be enabled IP address. The first new function I might add
or inhibited depending on what makes sense would be an audio signal together with an
for a particular room and how the resident is indicator light and push button switch on the
expected to behave. base unit. The audio and light would indicate
A violation of a rule generates an alert that an alert had been issued. The resident
to the caregiver. This is either an SMS text could press the button to acknowledge the
message or an e-mail saying, for example, alert and let the caregiver know everything
“John Doe may need your attention.” is okay. This would be useful in suppressing
false alarms but would still record a history
NEXT STEPS of alerts issued.
The project is complete and working. Prior This project is just one example of how the
to commercial use, a feature would be required Internet of Things (IoT) might serve our
to use a Domain Name Server (DNS) to retrieve senior population. Hopefully, it will stir up
the IP address for Exosite. This is currently additional ideas from the talented readers of
hard coded into the program. Secondly, the Circuit Cellar.
38 CIRCUIT CELLAR • MARCH 2015 #296

Sensorless Maximum
Power Point Tracking
FEATURES

Maximum power point trackers (MPPTs) are used to ensure that maximum power is
transferred to a device from renewable energy input applications. This article details an
impedance-matching method for a closed-loop digital control system, which provides
MPPT for input applications that have an approximately fixed internal resistance.

By David Weight, Ian Johnson, Sajjad H. Lalji (UK)

A s renewable energy resources become


more involved in helping to provide
today’s increasing demand for energy, energy
using a boost converter, without the use of
current sensors, which allows for varying
input voltage, varying load impedance and
efficiency is becoming pivotal and thus more varying output voltage when the input power
importance is being placed on harnessing source has an approximately fixed internal
the maximum power that they are capable of resistance (see Figure 1). In order to do this,
transferring. In order to obtain the highest we had to find a new equation to calculate the
efficiency possible, maximum power point duty ratio needed to produce the maximum
tracking circuits are used which match the power transfer using only voltage sensors.
input resistance of the source to the output This was a difficult obstacle to overcome.
resistance of the load, a technique known as The duty ratio equations for boost converters
impedance matching. found in most textbooks and papers do not
The main aim of our project was to develop a look for the maximum power transfer when
new maximum power tracking control method the variables are constantly changing and
and then subsequently design and construct involve the voltage and current terms. That’s
a prototype converter with a microcontroller a problem as current isn’t measured due to
used to perform the control. There are a the removal of the current sensor.
number of existing maximum power tracking Numerous other maximum power point
methods currently available. However, none tracking circuits have been designed using
of them have approached the problem in boost converters, although many of these
the way we do, by using a boost converter incorporate current sensors in their design,
operating in discontinuous conduction mode with current sensors costing, on average, an
(DCM) with no current sensors used as part additional $75 or more for a suitable accuracy.
of the control algorithm, whilst also allowing Therefore, with the current sensor being
for load variation. The trade-off involved in the most expensive component used in the
this new approach is that it currently only circuit, there is a significant cost advantage
applies where the source internal impedance in removing them from the system. Our
is known and approximately fixed. However, circuit cost us around $75 in total to produce
once this is established, measuring the input a prototype. The primary renewable-energy
(and output) current becomes unnecessary, applications this can be applied to include
therefore removing the need for any current thermoelectric generators and inductive
sensors and thereby greatly reducing the cost power transfer systems, as they have an
of the circuit. approximately fixed internal resistance.
We have looked at integrating a new Unfortunately, the internal impedance of
maximum power tracking control method photovoltaic panels varies with environmental
circuitcellar.com 39

Fixed internal Fixed internal


resistance source L resistance source L
D D

RFS RFS

+ Voltage Switch + Voltage Switch Voltage


− VFS Load − VFS Load
sensor (MOSFET) sensor (MOSFET) sensor

FEATURES
CSMOOTH CSUPER CSMOOTH CSUPER

RSHUNT RSHUNT

Current
sensor

Ground reference
problem

FIGURE 1
conditions. So this circuit, as it stands, will not variable and simply measure the input and
A comparison between a traditional
function correctly using a photovoltaic panel output voltages, using these to perform the
MPPT circuit (left) and our circuit
as the input source. However, thermoelectric maximum power tracking. (right)
generators and inductive power transfer
systems are becoming more widely used. 2L ( VO − VI )
D= [1]
For example, if you were to look at one R INT TVO
application in particular that would benefit
R INT T ( VO − VI )
with the addition of this MPPT, it is the new L= [2]
2VO
thermoelectric generator being developed by
BMW in conjunction with NASA. It improves This gives us an output of the converter’s
fuel efficiency and reduces carbon dioxide duty cycle, expressed as a function of the
emissions by up to 5%. In addition, it could input and output voltage, as well as the
eventually replace the need for an alternator, component values.
as it aims to produce enough electric power to As you can see in Figure 2, the circuit is a
run all the electrical components of the car. The very standard generic boost converter. Being
energy and environmental implications of this a discontinuous converter, it runs in three
will be huge. If successful, it could be applied modes.
to all vehicles (cars, lorries, etc.) around the In the first mode, the switch is closed
world, which is a massive reduction in oil and current flows from the source of power,
consumption and a big improvement in energy through the inductor, and back to ground.
efficiency as it reuses the heat escaping from Energy is stored in the inductor during this
the exhaust to power a vehicle. Consider that cycle, and the load is being powered from the
around 60% of the energy generated by a energy already present in the capacitor.
typical internal combustion engine is lost: half In the second mode, the switch is opened.
by heat absorbed by the engine cooling system This suddenly decreases the current flow (or
and the other half lost via exhaust heat. Thus, would if it wasn’t for the energy stored in the
by reusing this exhaust heat, the efficiency of inductor previously). The energy now flows out
the engine can be significantly improved. of the inductor and into the capacitor, which FIGURE 2
Our prototype circuit features a ChipKIT stores energy and smoothes the voltage. The MPPT schematic
Max32 development board. It performs the
closed-loop digital control that yielded positive
results from both simulation and experimental
verification for input applications that have an
approximately fixed internal resistance, such
as thermoelectric generators and inductive
power transfer systems.

CIRCUIT OVERVIEW
We decided to use a boost converter
operating in the discontinuous conduction
mode in order to reduce switching losses.
After overcoming the obstacle of creating
equations for the duty cycle in terms of
voltages only (see Equation 1) and the design
equation for inductance (see Equation 2),
resulting in the maximum power transfer, we
can therefore eliminate current as a required
40 CIRCUIT CELLAR • MARCH 2015 #296

sound. For this, we used Linear Technology’s


free LTSpice software, an extremely powerful
and fast SPICE simulator.
Instead of trying to load the look-up tables
into LTSpice and trying to simulate the entire
controller, we decided to set the simulation up
FEATURES

with a certain input voltage and load, and then


set the duty cycle manually. This enabled us
to get results extremely quickly (see Photo 1).
The results we got from LTSpice looked
excellent and gave us a great deal of confidence
that the final design should perform as
intended. In order to ensure that the design
did not look marginal or unstable, we also
ran a Monte Carlo analysis on the circuit. This
uses the tolerances of the components and
varies these on each run, giving an idea of the
PHOTO 1 In the third mode, the switch remains open variation and design robustness of the circuit.
The LTSpice schematic for simulation and the load runs from the energy stored in The results showed that the circuit seemed
the capacitor. The voltage will gradually fall to be stable and not overly reliant on any one
during this phase, until it drops sufficiently component tolerance (see Photo 2).
ABOUT THE AUTHORS
such that the circuit enters mode one again,
David Weight (david. and the whole cycle repeats. CONSTRUCTION
weight@wattcircuit. The real control aspect comes from the Simulations are all very well, but the next
com), Ian Johnson ChipKIT running the control software. This step was to build a prototype and actually take
(ian.johnson@wattcir- reads the voltage at the inputs and outputs, some measurements! We decided to break
cuit.com), and Sajjad and then controls the duty cycle of the down the circuit into two parts for the initial
H. Lalji (sajjad.lalji@ MOSFET. As the source internal resistance prototype. The first section had all the boost
wattcircuit.com) met at and the frequency being used are assumed circuitry on board (see Photo 3). This contains
Brunel University while to be known, and the size of the inductor all the circuitry which drives high currents
studying Electronic and has been chosen based on our inductor and high-speed switching, and it is therefore
Electrical Engineering design equation, the required duty cycles pretty dependent on the layout being good
as undergraduates. Be- for different conditions can be precalculated and keeping the parasitics minimized. The
tween their day jobs, using our duty ration equation and loaded second part (see Photo 4) had the circuitry
they work together on onto the ChipKIT in the form of a look- used to condition the voltage signals in order
various projects, par- up table, which makes for extremely fast to make them suitable for the ChipKIT board
ticularly those relating response using only a simple controller. If to read. As this isn’t particularly high-speed
to LED lighting and em- dynamic loads need to be considered, it would or sensitive circuitry, we decided to prototype
bedded systems. They be a relatively straightforward task to add on this on veroboard in order to facilitate
also run the Watt Cir- board calculation capability to the software. changes as we refined the design and circuit.
cuit video blog (http:// Thirdly, the ChipKIT was connected to these
wattcircuit.com/). SIMULATION two boards and ran the show!
Before building circuits, we decided to Going through the sections, the first one
PHOTO 2 use SPICE software to simulate the circuit in contains the inductor, capacitors and field
Monte Carlo analysis of the circuit operation to ensure that the principles seemed effect transistor for the main boost converter.
To make sure the transistor performs well, we
used a driver IC from Microchip which makes
sure that the transistor turns on and off really
quickly, meaning it dissipates as little power
as possible as heat. This really helps the
efficiency of the circuit.
The capacitors are used to filter and smooth
the input and output voltages to the circuit.
The exact values aren’t too critical, but there
is a trade-off between cost and how smooth
the voltages need to be so we produced a
trade-off analysis in order to select the best
parts. Having said this, this is a demanding
application for the smoothing capacitors as
the switching is extremely fast in this circuit,
which leads to high frequency components in
the current pulses drawn from the supplies.
Slim OLEDs •Vivid•Organic•Affordable
• Only 5 mm thin • Operating temp: (-40°C ~ +85°C) • Low power 2.4 ~ 3.6VDD
• 2x16, 2x20, and 4x20 character sizes • Storage temp: (-40°C ~ +90°C) • Double height characters
• Yellow, Blue, Red or Green colors • US2066 Built-in controller • 3 built-in font tables
• Response time: 10 microseconds • Contrast ratio: 10,000:1 • Built-in required logic
• SPI, I C & Parallel interfaces
2
• Viewing angle: >160° • Built-in screen saver

NEWHAVEN DISPLAY INTERNATIONAL


For more information visit: circuitcellar.newhavendisplay.com
Contact us at: 847-844-8795
42 CIRCUIT CELLAR • MARCH 2015 #296

Schottky diode will conduct at around 0.2 V.


This difference in forward voltage
translates to gains in efficiency when applied
to the entire circuit as this forward voltage
translates to energy burned off as heat. In
order to provide even higher performance, an
FEATURES

improvement would be to replace this diode


with another field effect transistor in order to
reduce these losses even further. The ChipKIT
used for the controller is capable of driving
this additional field effect transistor with little
added complexity to the software.
The input and output voltages from this
circuit need to be fed into the ChipKIT in
order to provide the feedback to stabilize the
circuit. However, the voltages are too high to
feed directly into the ChipKIT as this can only
take up to 3.3 V.
We took a simplistic approach for the
prototype and used a resistor divider network.
This takes the maximum expected voltage and
scales it down to the 3.3 V maximum of the
ChipKIT. But this has some disadvantages. The
resistors have a 1% tolerance and variation
here can have a profound effect on the overall
performance and efficiency of the circuit. In
addition, because this approach wastes much
of the dynamic range of the analog to digital
PHOTO 3 The bulk capacitors shown on the top of the converter, there is a loss of precision when
The boost converter
PCBs cannot cope with these high frequency the conversion is made.
components, so we’ve added several ceramic To address these issues, a couple of
capacitors in parallel with the bulk capacitors. improvements are being prototyped. Firstly,
Although these have much less capacitance as the maximum and minimum expected
than the bulk capacitors, they actually have voltages are known, the analog-to-digital
smaller parasitic components than the bulk converter does not have to read all the way
capacitors, in particular, equivalent series down to 0 V. Therefore, a differential amplifier
inductance, and can therefore respond to the can be used to provide an offset to the signal
high-frequency components. so the entire range of the analog to digital
We used a Schottky, high-current diode as converter is used. In addition to this, a
part of the design. Because it is a Schottky higher-resolution external analog-to-digital
diode, it switches reasonably quickly and has converter can be used to replace the on board
a lower forward voltage whilst conducting converter currently used. The on-board device
compared to a standard silicon diode. has a resolution of 10 bits, whereas external
PHOTO 4 Typically, a silicon diode will have a forward 16-bit converters are readily available.
The voltage scaling circuitry voltage of approximately 0.6 V, whereas a
SOFTWARE
The software is really simple. All the hard
work was done on a desktop computer with
Microsoft Excel to create the look-up table. We
used the ChipKIT because it makes software
development fast. The ChipKIT MAX32 is a
great prototyping platform because of its
relatively fast operating frequency and the
large amount of memory that is included.
This allowed us to add the look-up table into
the ChipKIT random access memory for faster
operation.
The ChipKIT software is broken up into
two main functions, the setup function, and
the loop function. Everything inside the setup
function is run once upon power-up, here we
initialize the input and output pins. At this
44 CIRCUIT CELLAR • MARCH 2015 #296

process is then repeated continuously in real


time to ensure that the source is operating to
provide the maximum power to the load.

TESTING
In order to test the board, we needed to
FEATURES

provide a repeatable test setup and it was rapidly


decided that using a thermoelectric generator or
similar for bench testing would make repeatable
testing more difficult. The decision was therefore
taken to use a bench power supply unit but to
add a precision high-power resistor in order to
replicate the source impedance. This resistor is
included on our main boost converter printed
circuit board just for prototype purposes.
PHOTO 5 In order to verify the operation of the
The experimental setup stage we have added the look-up table. We circuit, we also needed to measure the voltages
also start a serial connection that is used for independently, as well as measuring the input
debugging and monitoring, this appears as a and output current to verify that the circuit is
virtual serial port on your personal computer. functioning as a maximum power point tracker.
In the loop function, we repeatedly read Due to budget limitations, we had available Fluke
the voltages at the input pins. Allowing for current clamps with a frequency response of
the fact that these voltages have been scaled only 100 kHz. Unfortunately, this means that
down, we then use these as inputs to the many of the oscilloscope captures where current
lookup table that we defined earlier. Finding has been captured lacks detail and the switching
the value at this point in the lookup table will cycles cannot be seen. The experimental setup is
be a very quick operation, and this will allow shown in Photo 5.
the unit to cope with rapidly changing loads When we tested the circuit, the performance
to maintain maximum power point tracking. matched the simulations extremely well and
The program works by reading the input surprisingly (for us), the circuit worked first
and output voltages into the ChipKIT through time. After recovering from the surprise, we
the analog input and output pins. The relevant then tweaked a few resistor values to bring the
duty ratio value from the lookup table is voltage measurements back in line so they were
returned to perform the maximum power spot on accurate, which further underlined the
point tracking and send the relevant pulse need to improve this area of the circuit.
width modulation signal to the circuit. This During this phase of testing the debug
output from the ChipKIT was extremely useful
in verifying the operation of the circuit to ensure
RESOURCES that it was in the correct mode and reading
the input and output voltages correctly. The
C. P. Basso, Switch-Mode Power Supplies:
measured input and output voltages, as well
Spice Simulations and Practical Designs, Mc- as the duty cycle selected based on these was
Graw-Hill Professional, 2008.
displayed on a serial monitor program running
on a laptop on the bench.
Green Car Congress, “BMW provides an update
on waste heat recovery projects; Turbosteam- RESULTS
circuitcellar.com/ccmaterials er and the Thermoelectric Generator,” 2011, As you can see in Photo 6a, maximum power
www.greencarcongress.com/2011/08/bmwther- transfer has indeed been achieved due to the
mal-20110830.html fact that the input voltage to the converter (Vi) is
SOURCES always approximately half of the source voltage
LTSpice (VS) applied throughout the range of values
I. Laird, et al., “Comparative Study of Max-
Linear Technology | tested from 2 to 12 V. A more detailed look at
imum Power Point Tracking Algorithms for
www.linear.com the circuit working with a 12-V input voltage
Thermoelectric Generators,” Australasian Uni-
and providing an 81-Ω load produced an output
versities Power Engineering Conference, 2008.
voltage of approximately 6 V and can thus be
ChipKIT Platform seen in Photo 6b. This was also confirmed over
Microchip Technology & M. P. Theodoridis and I. Johnson, “Current-sen- a range of resistive loads ranging from 4 to 400
Digilent | www.digilentinc.com soreless Boost Converter for Maximum Power Ω and an inductive load consisting of a brushed
Tracking of Thermoelectric Generators,” Uni- direct current motor. This means that the
versities Power Engineering Conference (UPEC) internal resistance of the source (RINT) always
2012, 47th International, 2012. matches the resistance of the converter and
thus impedance matching is being performed
circuitcellar.com 45

throughout. Therefore, the equations for the duty ratio


shown in Equation 1 and for the inductance design value in
Equation 2 hold true, as maximum power transfer has been a)
achieved for a full range of values.
In conclusion we have managed to deliver a method
for the design and construction of a prototype converter

FEATURES
with a microcontroller used to perform maximum power
point tracking control of renewable energy devices with an
approximately fixed internal resistance, which has been
fully analyzed and experimentally verified.
As the source voltage (VS) is varied, the output
voltage (VO) changes as a result of the system performing
maximum power point tracking. The input voltage (VI) to
the converter also changes as it follows half the value of the
source voltage (VS) due to impedance matching (maximum
power point tracking). The change in the duty ratio is not
static as it is in fact dynamic, which means that the duty
ratio is constantly changing until the circuit reaches steady-
state, after which point it is restored to its original value.
The steady-state value of the duty ratio only changes if the
load resistance changes or if the source voltage changes
while the output voltage is “clamped” (for instance, if the
output was connected to a battery).
Furthermore, this was all made possible thanks to the b)
implementation of digital control, without which specific
experiments could not have been carried out. For example,
Photo 6a could not have been produced without the
automatic updating of the duty ratio from the closed loop
digital control system. If you look again at Photo 6a, you
can verify that the equation discovered for the duty ratio
(Equation 1) and the design equation for the maximum
value of inductance (Equation 2) which ensured that the
boost converter remained in discontinuous conduction
mode indeed holds true. This is done due to the fact that
the input voltage is always approximately half of the source
voltage when varied over a period of a time. This proves
that maximum power transfer has been transferred.

FURTHER WORK
The circuit that has been produced here in order to
test this new method of maximum power point tracking
can be vastly improved for efficiency and to broaden its PHOTO 6
applicability. Component selection has only been carried This shows circuit maintaining maximum power point tracking as the input voltage is
varied (a). The blue trace shows the input voltage and the yellow trace shows the input
out with a view to circuit prototyping, and therefore large
voltage after the simulated internal resistance. The circuit working with a 12-V input and
and easily reworkable components have been selected.
a 81-Ω load (b). The blue trace shows the input voltage and the yellow trace shows the
The performance of the circuit can be easily improved with input voltage after the simulated internal resistance.
more modern components. For example, you could replace
the Schottky diode with a switched field effect transistor,
reducing voltage losses. sensor combined with the input voltage, the internal
Also, the potential dividers used to scale the input and impedance can be approximated when the necessary work
output voltages to the range suitable for the ChipKIT are has been carried out to characterize a particular panel’s
extremely crude and don’t use the full dynamic range of the behavior. This is likely to have poorer performance than a
ADCs. Accuracy, and therefore efficiency, can be improved true closed-loop system using a current sensor. But in many
with a more sophisticated method to scale these voltages applications, the cost/performance trade-off may be
(e.g., using differential amplifier circuits instead). attractive as the temperature and irradiance sensors will be
With further modification to our design, we could apply cheaper than current sensors for many applications. The
the circuit to a wider range of renewable input sources variable input and output voltages also favor the use of
which have variable internal impedance, particularly if the supercapacitors, which can be used in place of the output
internal impedance is proportional to other factors. The capacitor in order to store more energy and charge/
obvious use is with photovoltaic panels, where the internal discharge faster, in order for the load to be supplied even
impedance can frequently be approximated using additional during times when the input source is unable to provide
measurements. By utilizing an irradiance or temperature enough power.
46 CIRCUIT CELLAR • MARCH 2015 #296

GREEN COMPUTING

Cooling Awareness in
HPC Job Allocation
COLUMNS

High performance computing (HPC) clusters run a


variety of computationally intensive applications,
each of which typically occupy many processors in
parallel. Job allocation in HPC so far has primarily
focused on performance. This article discusses how
cooling awareness in job allocation can improve
energy efficiency substantially.

By Ayse K. Coskun (US)

H igh-performance computing
clusters serve large supercomputing
(HPC)

applications or, more broadly, applications


Labs showed a 2× slowdown for two
communication-intensive jobs when hand-
placing them such that their communication
that are computationally intensive and highly paths overlap significantly (as opposed to
parallelized. Scientific computing applications grouping tasks of each job close together).[1]
are common examples of HPC applications. Optimizing the performance or
Running highly parallelized applications communication delay of jobs in HPC clusters
implies that a job’s various tasks run on is a generally well-studied area, and there
a large set of processor cores, and these are many interesting algorithms targeting
tasks communicate and synchronize through different types of jobs, communication
protocols, such as the message passing patterns, or network topologies. A common
interface (MPI). property of most of these algorithms is to
Leveraging MPI-based infrastructures maintain a total “hop-distance” (or total
for inter-task communication for most HPC Manhattan-distance) of each job’s allocation
applications indicates that a non-negligible and then to seek minimizing this distance
amount of the overall application execution during job allocation.
time is spent in sending and receiving Reducing the communication distance
messages. In fact, it is common to have 20% of a job helps reduce the time spent in
to 30% of the overall time spent executing an communication while running that job.
application to be dedicated to communication. Thus, one would expect performance-aware
As a result, current job allocators in HPC algorithms to reduce energy consumption
clusters seek to group various tasks of a job (energy is running time multiplied by average
close together in nearby processor cores. power). One important aspect of an HPC
This means that the allocator would prefer cluster’s energy consumption, however, is
cores that are on the same chip or within cooling: 30% to 50% of the total energy is
the same server, and also servers that are consumed by the cooling infrastructure in
within a small number of network “hops” of current clusters. This number is dropping
each other. In this way, sending/receiving with more efficient cooling technologies, but
messages over many hops, which increases is still substantially high.
the delay of communication, can be avoided The rest of this article discusses how
to some extent. bringing cooling awareness into HPC job
Grouping the tasks of each job close allocation can provide significant reduction
together also helps reduce interference in cooling costs and improvement in overall
across jobs. In fact, researchers at Sandia energy efficiency.
circuitcellar.com 47

THERMAL DYNAMICS
Figure 1 shows the layout of a typical 0)#$"/( )*+
#&($(
$%&'
computing cluster. In this arrangement, rack !"#"
#&($ ()*1
inlets where the cool air is supplied are facing $%&' )
the outer aisles forming cold aisles at the !"#" $%&'
sides. Rack outlets, where the hot air exits,
are facing each other forming a hot aisle in
, !

between the two rows. This arrangement is "


(
frequently used in modern clusters and is
4
%
referred to as “hot aisle/cold aisle” layout.
3 - !"#!
The significance of a hot/cold aisle 2 # %).!$"/(
layout is that some of the exhaust heat gets +
recirculated back into the cluster. In other %).!$"/( 1

COLUMNS
words, the hot air outcome of the servers
is not fully absorbed by the computer room
air conditioners (CRACs). Because of this
recirculation and the inherent asymmetries of
the layout (e.g., CRAC units residing in certain cooling cost? One straightforward approach FIGURE 1
specific locations of the cluster), even when would be to prioritize more “thermally- Layout of a two-row cluster with hot
the servers are all of the same kind, one can efficient” nodes while selecting the nodes for aisle/cold design. Some of the heat
speak of a thermal heterogeneity across the a job that is waiting to be allocated. This is exhaust is recirculated back into
the system, which creates thermal
servers. a complex problem as the solution space is
heterogeneity among the compute
Figure 2 shows the cross-interference large and also each job allocation decision
nodes.
coefficient matrix for an example 40-node affects the later decisions. One way to solve
cluster (where each node may include this problem is to set up a formal optimization
multiple servers) in a 3-D map. This matrix framework with goals and constraints.[3]
represents the recirculation phenomena by In my research lab, my students and
quantifying the fraction of output heat from I noticed that while methods to optimize
each node that is recirculated to the inlet of the cooling energy and the performance
the other nodes. It is an n × n matrix for a (communication) cost separately exist in the
cluster with n nodes. This recirculation matrix literature, jointly targeting these goals has not FIGURE 2
can be obtained for a given cluster through An example cross-interference matrix
been addressed. If we accomplish to address
for a 40-node cluster. The 3-D map
detailed computational fluid dynamics (CFD) both goals, this joint optimization can bring
demonstrates how much each node
simulators or through measurements. energy efficiency benefits. These two goals
impacts other nodes in terms of
What does such a matrix tell us? Simply, of reducing cooling and reducing the hop- the recirculated heat. A higher bar
nodes are not equal in their thermal distance of each job may conflict depending implies a higher amount of heat being
efficiency. For example, some of the compute on the specific case. Thus, we decided to set recirculated from a node’s output into
nodes may be more prone to getting extra up an optimizer that weighs both goals and another’s inlet.
heat input because of their relative location to
other nodes and to CRAC units in the cluster.
As a result of the recirculation and, also,
considering there are often idle nodes even in
busiest computing clusters, which nodes we
select for allocating a job makes a difference
in the overall temperature of the cluster.
The recirculation matrix and the power
consumption of each node determine
the temperature for each server. Server
temperatures and the CRAC unit properties
then determine how much cooling power
is needed to cool down a given cluster. So,
job allocation has an impact on the cooling
power consumed in a cluster. (Temperature
and cooling power dynamics of clusters can
be estimated via detailed CFD tools or simpler
mathematical models. Some examples of
estimation mechanisms are given in recent
work.[2,3]).

EFFICIENT JOB ALLOCATION


How can we make the job allocation process
reduce its potential adverse effects on the
48 CIRCUIT CELLAR • MARCH 2015 #296

circles imply free nodes. The numbers


indicate the arrival order of the jobs. For
example, job 1 arrives first and runs on six
nodes. Cooling-aware policy assigns the
jobs to nodes while avoiding the nodes that
contribute more to heat recirculation as much
as possible. (Note that the sequence here
is specific to the example cluster and will
change for a different cluster.) On the other
hand, performance-aware policy starts from
FIGURE 3 minimizes a weighted sum of performance an arbitrary node of the data center and tries
Joint optimization policy degradation and cooling cost. to confine the allocated nodes for each job to
simultaneously seeks to reduce the
Figure 3 shows a simple example to the smallest total hop-distance possible. The
COLUMNS

cooling cost and also to reduce the


demonstrate the principles of solely cooling- joint policy prefers the cooling-efficient nodes
communication distance of each job.
aware, solely performance-aware, and first but also assigns the tasks of a job in
“joint” optimization while allocating four close proximity to each other.
jobs sequentially onto a cluster row including In my research lab at Boston University,
20 nodes. Each job requires six, five, four, we expanded this idea of jointly optimizing
and three nodes to run on. Colored circles for performance and cooling energy, and put
represent the busy nodes while the white together a full-scale optimizer that is able to
evaluate the performance and cooling costs
for an arbitrary cluster and job sequence. This
optimization problem, however, may take a lot
of time to solve for a large number of nodes
because performance and cooling cost problems
are both time consuming. For example, a
typical HPC cluster has hundreds or thousands
of nodes, which creates a huge possible solution
(a)
space that needs to be spanned.

IMPROVING SCALABILITY &


Job Queue Number PERFORMANCE
Several methods can be applied for
designing an algorithm that can determine the
job allocation to reduce both communication
time and cooling energy in a reasonable time
(b)
and complexity. First, one can design heuristics
that follow a given set of rules of thumb instead
of finding the optimal solution.[2] Second, it is
Job Queue Number possible to use lower cost estimators for the
thermal evaluations (i.e., linearized models
instead of complex CFD simulations).
FIGURE 4 In a recent on-going project, my students
Comparison of running times (i.e., larger running time means lower performance) and average cooling power and I formulated the joint optimization
for various job queues arriving at a 40-node cluster including 800 processors. The average communication
problem as a binary quadratic programming
time to running time ratio for each job (before applying any allocation) is 30% in this example.
problem, which is actually a combinatorial
optimization problem. It is an NP-hard
IEEE International Conference on Distributed problem; however, in practice, it can be
Computing Systems, 2002. efficiently solved using well-known discrete
optimization techniques such as the branch
[2] F. Kaplan, J. Meng, and A. K. Coskun, “Op- and bound algorithm. For example, it is
timizing Communication and Cooling Costs possible to solve this optimization problem
in HPC Data Centers via Intelligent Job Allo- using the TOMLAB/CPLEX solver using existing
cation,” Proceedings of International Green functionality in the tool.
circuitcellar.com/ccmaterials
Computing Conference (IGCC), 2013. Figure 4a shows the average increase in job
execution time for each policy in comparison
REFERENCES [3] Q. Tang, S. K. S. Gupta, and G. Varsam- to ideal job running times (ideal case considers
[1] V. Leung, et al., “Pro- opoulos, “Energy-Efficient Thermal-Aware optimal communication delay for each job).
cessor Allocation on Cplant: Task Scheduling for Homogeneous High-Per- Even the performance-aware policy results in
Achieving General Processor formance Computing Data Centers: A Cy- a slight increase in job running times. This is
Locality Using One-Dimen- ber-Physical Approach,” IEEE Transactions on because the job running times in the ideal case
sional Allocation Strategies,” Parallel Distributed Systems 19, 11, 2008. do not consider the utilization of the cluster
circuitcellar.com 49

ABOUT THE AUTHOR


and the availability of the nodes. In other Ayse K. Coskun (acoskun@bu.edu) is an assistant
words, depending on the current utilization professor in the Electrical and Computer
of the data center and the locations of the Engineering Department at Boston University.
available nodes, performance-aware policy She received MS and PhD degrees in Computer
may not always guarantee an ideal allocation Science and Engineering from the University of
for each job. Cooling-aware policy, however, California, San Diego. Coskun’s research interests
results in considerably longer job running include temperature and energy management,
times, resulting in an up to a 12% increase for 3-D stack architectures, computer architecture,
the given job queues. Intuitively, jobs with a and embedded systems. She worked at Sun
lower communication to computation ratio will Microsystems (now Oracle) in San Diego, CA,
see a smaller increase in their execution times; prior to her current position at BU. Coskun
however, the general trends shown here would serves as an associate editor of the IEEE
still be valid. Embedded Systems Letters.

COLUMNS
Figure 4b compares the average cooling
power for the three policies across the same
job queues as Figure 4a. The joint optimization
policy results in an average cooling power the HPC applications.
close to the power consumption achieved by Other open problems include combining
the solely cooling-aware policy. In comparison job allocation with power budgeting. (I talked
to the solely performance-aware policy, joint about power budgeting in my Circuit Cellar
allocation saves 18% cooling power on average. 292 article, “Budgeting Power in Data
An interesting observation is that for some Centers.”) In my lab, we are also investigating
cases, the joint policy achieves lower average how to combine job allocation with task
cooling power than the cooling-aware policy mapping, which is deciding where to allocate
such as in queues 4 and 6. This is because each specific task of a given job. Task
with the cooling-aware allocation, some jobs mapping can bring additional performance
may take a longer time to run in comparison and efficiency benefits especially for jobs
to the joint policy (as the allocation is not with largely diverse tasks.
performance-optimized). When a large job is
running for an extended period of time, it keeps
the nodes active for a longer time. This results
in higher total computing power and cooling
energy in comparison to the joint policy.
Get PUBLISHED.
Another significant aspect of building job Get NOTICED. Get PAID.
allocation optimization policies is the access
Circuit Cellar feature articles are contributed by professional
to simulators that can evaluate realistic
scenarios. This is especially critical as many engineers, academics, and students from around the globe.
researchers do not have privileges to test Each month, the editorial staff reviews dozens of article
job allocation policies on real-life clusters. proposals and submissions. Only the best make it into the
My students and I were initially using our in-
house simulators, but we are now expanding
pages of this internationally respected magazine.
the open-source SST simulator (http://sst.
sandia.gov/) with power and cooling models. Do you have what it takes?
The SST simulator is able to run real-life job
Contact C. J. Abate, Editor-in-Chief, today to
traces collected from various machines under
a set of different job allocators/network discuss the embedded design projects and
topologies. programming applications you’ve been working
on and your article could be featured in
FUTURE TOPICS an upcoming issue or online at
Many open problems remain to be solved
in the area of efficient HPC job allocation. circuitcellar.com.
Even though future data centers are likely to
be more cooling efficient (via the use of in- Email: editor@circuitcellar.com
row coolers, more substantial use of liquid
cooling, etc.), which means less recirculation
effects, the servers in cluster are still going to
be thermally heterogeneous. This is because
a cluster often includes a variety of hardware,
and also, asymmetries in cooling still exist
in many recently built clusters. Thus, taking
thermal efficiency into account during job
allocation can help push the performance of
50 CIRCUIT CELLAR • MARCH 2015 #296

THE CONSUMMATE ENGINEER

Essential Electromagnetic
Compliance (Part 4)
COLUMNS

Tips for Achieving Compliance


Last month, George covered practical EMC requirements for electronic
instruments and systems. He wraps up the series with advice for achieving
electromagnetic compliance.

By George Novacek (Canada)

I ’ll conclude this series of articles by


touching on some the design aspects
that an engineer must address to achieve
EMI PREVENTION
One objective of good EMC design is to
prevent electromagnetic interference (EMI)
electromagnetic compliance (EMC). As I emanating from our equipment, while making
explained in Part 1, a fluctuating voltage is the equipment immune to external sources of
always accompanied by a related current EMI. Both requirements go hand in hand, often
and vice versa, generating a fluctuating utilizing the same methods of suppression.
electromagnetic (EM) field. The magnetic For effective EMC, it must be addressed
component of the field and permeability early in the design stage. If left unattended
(µ) associated with it cause magnetic flux for later time, what could have been a
H. Electric component and permittivity (ε) very simple solution, such as moving a few
associated with it cause electrical flux. In components on the printed circuit board
consequence, every fluctuating voltage or (PCB), could become a nightmare, costing
current causes a propagating EM wave. thousands in design modifications, retesting,
Resistivity (R) in the path of the electrical and schedule slip.
current causes energy loss which converts The first step to EMC is determination of
into heat. There is always a return current the requirements. Most electronic equipment
into a circuit node identical in every way to is subject to compliance to some standard.
the transmitted current out of that node, but Even if there are no mandatory requirements,
in opposite polarity. responsible engineers should not be satisfied
In the far field, EM power is divided among with passing just the minimum standard.
all alternative paths, inversely proportional Your engineering pride should not allow
to the impedance of each path. The wave you to put your name to a design that
impedance through vacuum or air, associated could be inadvertently affected by a cell
with radiated emissions and immunity, is phone operating in the vicinity or a similar
approximately 377 Ω. If an equipment is embarrassing flaw.
exposed to near field, determination of the The first line of defense is a competent
impedance is much more complicated and PCB layout and proper grounding. Keep the
characteristics of the field must be taken into traces carrying high frequencies short, shield
account. components known to be susceptible to or
circuitcellar.com 51

PHOTO 1
A metal cabinet is an excellent shield

COLUMNS
generating noise. Ground, not necessarily internal metallic coat for shielding.
synonymous with “Earth,” is a sink for
interference currents to be directed back to EXTERNAL INTERFACES
their source. PCB ground layers, separate for Before we delve into the details of
analog and digital circuits, are very effective. protection circuits, let’s consider external
If only a single or two-layer PCB is used, interfaces, from power to loads to input
ground bars are an effective solution with devices, such as sensors. These are not always
the added benefit of acting as stiffeners and under the equipment designer’s control, but
perhaps a heat sink. knowing their characteristics is crucial for
A metal enclosure is an effective EMI shield effective EMC. With the exception of power-
(see Photo 1). Such an enclosure, milled out carrying conductors, all signal lines should
of a solid piece of aluminum, is not always be shielded. Double-braided twisted pairs, if
affordable. Sheet metal or fiberglass with affordable, are the best. Twists create small
an embedded mesh are commonly used for adjacent loops with opposite magnetic flux,
industrial equipment. Consumer equipment is which is very effective for canceling out the
often in plastic cabinets, sometimes with an effects of the M-field.

FIGURE 1
Shielding effectiveness of a single and
a double braided cable
52 CIRCUIT CELLAR • MARCH 2015 #296

Nonferrous cabinets or shields, often made


of aluminum or copper, effectively suppresses
the E-field, but are ineffective for suppression
of the M-field. That is best achieved with high
permeability ferrous materials, such as mu-
metal.
Figure 1 shows the shielding effectiveness
of a single and a double braided cable
irradiated by E-field in a laboratory. Notice
that at high frequencies a single braided
FIGURE 2
cable provides less then –20-dB attenuation.
Typical EMI and transient suppression circuit
Shield terminations and the use of connector
shells have crucial effect on the shielding
COLUMNS

effectiveness. The popular pigtail shield


termination, simple and quick to make,
ABOUT THE AUTHOR acts as an inductor, degrading the shielding
effectiveness. The effectiveness can be quickly
George Novacek is a professional engineer improved by employing the 360° shield
with a degree in Cybernetics and Closed- termination instead. The connector shells, if
Loop Control. Now retired, he was most re- not metal or metalized and connected to the
cently president of a multinational manu- shield, have a detrimental effect on shielding,
facturer for embedded control systems for as they cause discontinuity of the shielding.
aerospace applications. George wrote 26 There is a common dilemma whether to
feature articles for Circuit Cellar between ground the shield at one end only or at more
1999 and 2004. Contact him at gnovacek@ points. The general rule of thumb for lower
nexicom.net with “Circuit Cellar”in the sub- frequencies, such as analog (not RF) signals,
ject line. is to ground the end at the controller only. The
shield, however, must be bonded to the shell
of a sensor assembly, but may be floating
with regard to the system chassis ground.
For high frequencies, such as to suppress
radiated emissions caused by digital circuits,
bonding at both ends of a cable and even at
several points in between, may be needed to
satisfy the certificating requirements.
Knowing the maximum field strengths
we have to work with, we can calculate the
interference levels reaching inside the device,
we can measure the interference generated
by our circuits and determine the maximum
levels the circuits can accept without
performance degradation. Figure 2 shows a
typical transient suppression and EMI filtering
to use in extreme environments. It is located
in a grounded metallic cavity. This dual stage
PHOTO 2 circuit can be modified for less demanding
Two stage EMI plate applications. The first stage is a spark gap. In
Photo 2 the spark gaps are within the yellow
rectangle. Many are dual gaps, meaning that
G. Novacek, “Are You Grounded?,” Circuit Cellar if one fires the second one fires too. They are
145, 2002. most useful when protecting balanced circuits
but may be used for separate circuits as well.
———, “My Analog World,” Circuit Cellar 244, The ones in the picture fire at 90 V and can
2010. conduct up to 5,000 A to ground. They have
52-V DC holdover, meaning that the DC supply
circuitcellar.com/ccmaterials ———, “The Shocking Truth About EMC,” Cir- must be less than that to allow the gaps to
cuit Cellar 117, 2000. extinguish the discharge.
Sometimes the gap can be omitted, using
RESOURCE
RTCA, “Environmental Conditions and Test Pro- just the transzorb (TVS diode) together with
O. Hartal, Electromagnetic
cedures for Airborne Equipment,” DO-160G, R1 to limit a spike. R1 and the transzorbs are
Compatibility by Design, R&BV
2010. also seen in Photo 2, just next to the gaps.
Enterprises, 1993.
Typical value of R1 is 10 to 30 Ω. For DC power
circuitcellar.com 53

PHOTO 3
Controller PCB with dirty and clean
cavities

COLUMNS
supplies and loads chokes are used instead to mode signals can be effectively suppressed by
minimize the DC voltage drop. The TVS diodes transformers. And when you are dealing with
act like fast, high dissipation Zener diodes. E-fields of thousands of volts per meter, you
They are unidirectional as well as bidirectional can always employ fiber optics.
for balanced or AC signals. To conclude, don’t forget that the EMC
Due to the finite speed of gaps and TVSs, testing is static. In a real life, dynamic
there is always a remnant, narrow, high- environment there is always a chance that a
voltage spike, also caused by an electrostatic combination of several conditions can result
discharge (ESD). Capacitor C1 together with in a failure. That’s when the fun begins.
the following low pass filter suppress it. The
feed-through filters leading into the clean
cavity with the electronics are seen at the
extreme right of the EMI plate.
The filters are usually “pi” filters with a
–60 dB/decade theoretical slope. They’re
manufactured with critical frequency from
about 10kHz to a few megahertz.
Connectors with filter and TVS pins are
sometimes sufficient to achieve EMC, but
they do have limitations. They can withstand
relatively low voltage spikes only, dissipate a
limited power and be quite costly.

DESIGNING FOR EXTREMES


In extreme environments, the enclosure is
divided between electrically “dirty” cavity, such
as shown in Photo 2, where cleaning up the
signals takes place. Clean signals are conducted
to the clean cavity through the filters.
The cabinet shown in Photo 1 is an example
of a design for an extreme EM environment.
The ridge in the bottom of the upper cavity
marked by the black rectangle is bonded to
the PCB ground plane which is marked by
the yellow rectangle in Photo 3. Components
to the left of that area are EMI suppression
circuits. The controller circuits are to the
right. This is a dual redundant controller with
each channel occupying a vertical half of the
cabinet.
Aside from the EMC method described
above, great deal of immunity can be achieved
with optically coupled interfaces. Common
54 CIRCUIT CELLAR • MARCH 2015 #296

ABOVE THE GROUND PLANE

Startup
Transients
COLUMNS

Ed provides insight into some startup problems


arising in his retrofitted sewing machine controller,
with solutions involving both hardware and software.

By Ed Nisley (US)

P erhaps you’ve proceeded all the way through a system’s design, collected
and assembled the parts, and written the bring-up code, only to discover
the real challenge: making it work the way you expected at the beginning. The
problems you encounter seem obvious only after they occur!
In this column, I’ll discuss several parts of my sewing machine controller
retrofit project that required more tweaking than I expected. Although your
projects should never have any of these problems (because they’re obvious!),
perhaps my experiences can serve as a debugging guide when you’re faced
with a new and somewhat cantankerous collection of parts that should work
perfectly together.

MOTOR SPEED & SHAFT POSITION SENSORS


The Arduino firmware must have feedback from the sewing machine to
determine the motor speed and needle position, so I used a pair of optical
proximity switches based on the TCRT5000 IR sensor and available for under
$2 on eBay. You can find modules with various sensor orientations, but they
all include a sensitivity/range adjustment, a digital output bit, and an analog

PHOTO 1
This image, taken through a visible-blocking infrared filter,
emphasizes the IR LED on the proximity sensor board.
Surprisingly, the black drive belt appears transparent in IR.

PHOTO 2
The setscrew on the motor pulley produces a glitch as it passes over the phototransistor. Rather than
attempting to smooth out the screw, I fixed the glitch in software.
circuitcellar.com 55

voltage output. The infrared image of the at the midpoint of those values for the best
motor RPM sensor in Photo 1 highlights the average noise immunity.
IR LED on the right, with the phototransistor The interrupt handler should run once per
behind the barrier just to its left. motor revolution, triggered by the falling edge
I blackened the motor pulley with Brownell’s of the signal, when it records the elapsed time
Oxpho-Blue Gun Bluing solution, which, despite since the previous interrupt. The first version
the name, produces a dense black finish on of my handler sometimes reported that the
steel that’s a perfect “dark side.” Stainless motor ran twice as fast as shown on the
steel HVAC tape, burnished with a plastic rod, display of my trusty laser tachometer, which
boosts reflectivity and increases the contrast meant the interrupt happened twice on each
of the other half. The sensitivity trimpot has revolution.
enough range to turn the output off over the Unsurprisingly, at least in retrospect, the
tape and on over the blued steel, so I set it setscrew locking the pulley to the motor shaft

COLUMNS
struct pulse_t {
byte Counter;
unsigned long LastIRQ;
unsigned long Period;
unsigned int RPM;
byte State;
};

struct pulse_t Motor;


struct pulse_t Shaft;

//------------------
// Motor RPM interrupt handler

void ISR_Motor(void) {

static unsigned long Now;

digitalWrite(PIN_SYNC,HIGH);

Now = micros();

// detect and ignore glitches


if ((5000ul < (Now - Motor.LastIRQ)) && !digitalRead(PIN_MOTOR_REV) ) {
Motor.Counter++;
Motor.Period = Now - Motor.LastIRQ;
Motor.LastIRQ = Now;
Motor.State = digitalRead(PIN_MOTOR_REV); // always zero in a Physics 1 world
}

digitalWrite(PIN_SYNC,LOW);
return;
}

//------------------
// In setup() function

pinMode(PIN_MOTOR_REV,INPUT_PULLUP);
pinMode(PIN_SHAFT_POSITION,INPUT_PULLUP);
attachInterrupt((PIN_MOTOR_REV - 2),ISR_Motor,FALLING); // one IRQ / motor rev
attachInterrupt((PIN_SHAFT_POSITION - 2),ISR_Shaft,CHANGE); // two IRQs / shaft rev

LISTING 1
Each falling edge from the motor RPM sensor triggers this interrupt handler, which should run once per motor revolution. However, the setscrew holding the pulley to the shaft
can produce spurious interrupts, which the the if() statement detects and ignores. The machine shaft sensor interrupt handler uses similar logic, so it’s not shown here, but the
last two lines configure it to run on both edges of the sensor signal.
56 CIRCUIT CELLAR • MARCH 2015 #296

PHOTO 3 trace of Photo 2. The interrupt handler records


This position of the counterweight the time between successive interrupts and
on the sewing machine’s main shaft
that glitch introduced a second interrupt on
indicates that the needle is at the top
each revolution. Just to add confusion, certain
of its travel. The needle will be at the
bottom after half a revolution, with
motor speeds produced two glitches, while
the counterweight’s other edge over other speeds produced none at all.
the sensor. Triggering the interrupt handler on the
rising edge would produce a second interrupt
shortly after the first, which didn’t seem
helpful. I was reluctant to grind the screw
flush with the pulley and put tape over it,
as I must occasionally remove the pulley for
adjustments. As a result, I decided to fix this
COLUMNS

one in software.
The interrupt handler in Listing 1 marks
its execution by turning on an output bit while
it runs. That bit appears in the lower trace of
Photo 2, where it shows the Arduino hardware
and interrupt header code requires about 7
µs to save the CPU registers before passing
control to the handler; the first cursor should
mark the falling edge of the glitch, not the
rising edge.
The handler’s if() statement accepts only
those interrupts that occur more than 5 µs
after the previous one, with a low voltage at
the sensor pin. That logic works well over the
normal range of motor speeds, although I
can still trigger a spurious interrupt by hand-
turning the motor very slowly.
With that sensor working, I moved on to the
shaft position sensor, shown in Photo 3 with
the shaft turned to set the sewing machine
needle at top dead center. The shaft rotates
produces a glitch on the rising edge of the counterclockwise and the counterweight
sensor’s digital output, as shown in the upper occupies half of the circumference, producing

FIGURE 1
Plotting the setpoint current, open-
loop actual current, and shaft speed
against motor speed shows the
variation that the firmware must
process. The difference between the
setpoint and actual current depends
strongly on transistor temperature.
circuitcellar.com 57

a square wave with rising edges aligned at the


needle’s highest position and falling edges at
its lowest position.
Unlike the motor speed sensor, the
position sensor produces a clean signal. The
strip of stainless steel tape brightens the
counterweight’s machined surface enough that
the sensor can easily distinguish it from the
cutaway section.
The shaft position interrupt handler
resembles the motor speed handler, minus
the setscrew glitch rejection logic. The last
two lines of Listing 1 show the setup() code

COLUMNS
that configures the handler to run on both the
rising and falling edges of the signal, when
it records the state of the sensor after each
edge. That bit indicates the needle position at
the time of the interrupt: low = needle down,
high = needle up.
The two sensors and their interrupt handlers
produce accurate speed measurements, but PHOTO 4
they don’t directly indicate that the motor has The upper trace shows the motor current limited to 650 mA. The firmware samples the current just before
stopped turning. A few lines in the main loop the falling edge of the first nine pulses in the lower trace, then sorts the values during the last pulse.
detect that the motor speed handler hasn’t run
in the previous 100 ms: the absence of that the stall detection code. The plot includes
interrupt means the motor isn’t turning. several consecutive runs with increasing and
Plotting the shaft speed against the motor decreasing speeds that produced a maximum
speed produces the blue points in Figure 1. spread of 6%, sufficiently accurate for a
The vertical scattering below 500 RPM shows machine controlled by a foot pedal. An eyeball-
where the motor stalls at low speeds, without fit line has a slope of 0.089, so the drive belts

#define NUM_I_SAMPLES 9

unsigned int SampleCurrent(byte PinNum) {

unsigned int Samples[NUM_I_SAMPLES];


unsigned int AvgSample;
byte i,j;
for (i=0; i < NUM_I_SAMPLES; i++) { // collect samples
Samples[i] = ReadAI(PinNum);
delayMicroseconds(640);
}
for (i=0; i < (NUM_I_SAMPLES - 1); i++)
for (j=0 ; j < (NUM_I_SAMPLES - 1 - i); j++)
if (Samples[j] < Samples[j+1]) {
Samples[j] ^= Samples[j+1]; // swap entries!
Samples[j+1] ^= Samples[j];
Samples[j] ^= Samples[j+1];
}
LISTING 2
This function samples the values
AvgSample = (Samples[1] + Samples[2])/2; // discard highest sample from the Hall effect sensor
monitoring the motor current
and returns an estimate of the
return AvgSample; maximum value. The highest
reading generally corresponds to
a transient, so the code averages
} the next two lower values.
58
COLUMNS CIRCUIT CELLAR • MARCH 2015 #296

FIGURE 2
A simple SPICE model of the motor and ET227 transistor just after the relay contacts close. All values represent estimates based on measurements, but the overall accuracy won’t
be very good.

reduce the motor speed by 1/0.089 = 11.3. The measurements aren’t synchronized with
other points scattered around that plot require the power line, their results include data
a bit more explanation, though. representing the entire waveform.
Because the leading edge of the flat tops
CURRENT SAMPLING in the current-limited waveform generally have
As you saw in the January 2015 column, a small overshoot, as shown in Photo 4, the
the motor controller uses a big ET227 NPN code in Listing 2 sorts the array in descending
transistor as a current limiter, with a bridge order and returns the average of the second
rectifier converting the AC supply voltage and third measurements. That work well for
into unfiltered DC. Even though the universal most cases, but will slightly underestimate the
wound motor runs perfectly well from the maximum of a waveform without flat tops.
half-sine voltage, the oddly shaped current Although it’s not complex DSP, it gets the job
waveform in Photo 4 shows the effect of the done with enough accuracy for my purposes.
current limiter. As the current limit increases, The calibration routine steps the motor
the flat tops shrink as the waveform becomes a current limit from 400 to 900 mA in 50 mA
distorted sinusoid, with the motor inductance steps, records the ADC value returned by the
holding the current above zero between the code in Listing 2, then dumps those values
pulses. to the Arduino’s serial port. I also manually
I had originally planned to synchronize record the “true” motor current, as measured
the current sampling routine with a zero- by my calibrated Tektronix Hall effect current
crossing voltage detector, but the current probe, at each current step. Plotting the true
waveform peak doesn’t occur at a consistent current against the ADC count produced a line
delay from the voltage minimum. The lower so straight there’s no point in showing the
trace in Photo 4 shows a different approach: graph:
collect nine measurements spanning one
cycle of the rectified waveform (one half of a
Current ( mA ) = 2.97 × ADC + 152.6
complete power-line cycle) into an array, then
apply digital signal processing to determine
the maximum current. Even through the That equation applies for ADC values from
DESIGN YOUR SOLUTION TODAY
CALL 480-837-5200

TS-4900 Computer Module TS-7670 Industrial Computer


1 GHz i.MX6 with WiFi & Bluetooth GPS Radio and Cellular Modem

Pricing starts at
$129 $168
Pricing Starts At Qty 100 Qty 1

$99
Qty 100

$134
Qty 1

1 GHz Single or Quad Core Cortex A9 ARM CPU


Up to 2 GB DDR3 RAM and 4 GB eMMC Flash low cost plastic
enclosure available
Wireless 802.11 b/g/n and Bluetooth 4.0
4 KLut FPGA, 1x Gigabit Ethernet, 1x PCI Express Bus
Features:
1x mSD slot, 1x SATA II, 1x USB Host, 1x USB OTG 454MHz ARM CPU 1x USB Host
70x DIO, 4x I2C, 1x I2S, 2x SPI, 2x CAN Up to 256MB RAM 4x DIO, 2x CAN
1x LVDS & 1x RGB Display Port 2GB NAND/eMMC Flash 2x COM, 1x RS-485
-40 ºC to 85 ºC Industrial Temperature Range 2x mSD Card Socket 1x Battery Backed RTC
Runs Android, QNX, Linux 3.10, Yocto, QT, OpenGL 1x Temperature Sensor
1x 10/100 Ethernet
Coming Soon: Windows Support
Benefits:
Low power with 10mW sleep state
-40 to +85C, 100% soldered-on components
Easy development w/ Debian and Linux 2.6
Boots quickly to your Embedded Application
Guaranteed available until 2025
NG Coming Soon:
MI ! TS-7970: SBC Version Available w/ TS-8550
CO ON of the TS-4900 Development Baseboard TS-7680: Like the TS-7670 w/ WiFi & Bluetooth
SO

We’ve never Embedded Support every Unique embedded


discontinued a systems that step of the way solutions add
FE

L
D

NA
N
LI

E
GG

PE

GI

product in 30 are built to with open value for our


NG

RI
RU
LO

years endure source vision customers


60 CIRCUIT CELLAR • MARCH 2015 #296

FIGURE 3 the motor under control of the Arduino


The SPICE simulation shows that the firmware. As one test started, the relay
transistor current can reach a high
clicked closed, the motor accelerated to full
value for a very short time, driven
speed, and nothing I could do affected the
by the parasitic capacitance between
the collector and base junctions.
speed. Some careful probing revealed that
The values depend strongly on the the DAC still produced the expected series
voltage rise time caused by the closing of voltages and the current amplifier drove
relay contacts, which will be entirely the correct current through the optoisolator
different from that shown in the LED, but the big ET227 NPN transistor wasn’t
model. paying any attention.
More probing showed that the ET227
had failed with a short circuit between the
collector and emitter terminals. In a typical
COLUMNS

application using the transistor as an on-off


switch, a collector-emitter short can cause
serious collateral damage until the fuse or
circuit breaker pops. In this case, however,
200 through 360, corresponding to motor the motor simply ran with a direct connection
currents from 400 through 900 mA. The gain to the AC power line and everything else
coefficient accounts for everything from the survived.
number of turns on the ferrite core and its I decided the ET227 probably failed
permeability, to the Hall effect sensor and from simple age, because it came from a
differential amplifier gains. The offset value decades-old stash that my buddy Eks had
includes the differential amplifier’s manual accumulated, and installed a spare. Two
offset, which I set to about 100 mV to keep days later that “new” transistor failed with
the output well above 0 V with 0 mA through a collector-emitter short under exactly the
the motor. same conditions. Obviously, I missed an
Note that the actual current limit set by important clue.
the DAC at each step doesn’t matter, because The Safe Operating Area graph in my
both the ADC and the Tek probe sample the January column showed that, even though
same current. The equation simply converts the ET227 can control 100 A and 1 kV, the
from the ADC reading to the actual current, sewing machine motor operates just inside
whatever it may be. the continuous SOA region at 1 A and 180 V.
Faced with two dead transistors on my desk,
THE CLICK OF DOOM I built the SPICE model in Figure 2 to see
Collecting all of that data required many what could push the transistor’s operating
test runs, repeatedly starting and stopping point over the edge into failure.
Keep in mind that a simulation cannot
prove that a design must work. At best, it can
kenmore-158-shaft-position-sensor/. suggest why a circuit may fail, by allowing
you to model conditions that you cannot
———, “NTC 2.5 Power Thermistor Character- create and measure in physical hardware.
istics, 2014, http://softsolder.com/2014/11/24/ None of the transistors in the SPICE
ntc-2-5-power-thermistor-characteristics/. library came close to the ET227’s Herculean
ratings, so I used an idealized model: a
———”Sewing Machine RPM Sens- current-controlled current source driven by
circuitcellar.com/ccmaterials ing: Gun Bluing FTW!,” 2014, the transistor’s base current. All the internal
http://softsolder.com/2014/10/21/ resistances will be very small in a transistor
RESOURCES sewing-machine-rpm-sensing-gun-bluing-ftw/. rated for 100 A continuous current and I
E. Nisley, “Brute-force Motor felt that omitting the forward biased base
Control,” Circuit Cellar 294, ———”Universal Motor Control vs. Transistor junction wouldn’t affect the results.
2015. SOA,” Circuit Cellar 292, 2014 Because the failure was intermittent, I
thought that it might occur only when the
SOURCES relay closed at the peak of the AC power line
———, “ET227 Transistor:
Brownell’s Oxpho-Blue Gun Bluing waveform, applying an abrupt high voltage
SOA Violation,” 2014, http://
Brownells | www.brownells.com pulse to the motor and transistor. Although
softsolder.com/2014/11/18/
et227-transistor-soa-viola- the inductive motor winding wouldn’t
TCRT5000 IR Sensor transmit an instantaneous current change,
tion/.
Vishay Intertechnology | www.vishay.com the 1 nF of stray capacitance I measured
Optical proximity switch: search eBay for between the windings and the case implies
———, “Kenmore 158: Shaft
“tcrt5000 module” a similar capacitance between the winding
Position Sensor,” 2014, http://
softsolder.com/2014/11/03/ terminals.
circuitcellar.com 61

The ET227 datasheet does not specify the


transistor’s junction capacitance values, so ABOUT THE AUTHOR
the 6 nF I measured between the collector and
Ed Nisley is an EE and author in Poughkeep-
the other terminals with zero DC bias came
sie, NY. Contact him at ed.nisley@pobox.com
as a surprise. I cracked the dead transistors
open and found the huge silicon slabs bonded with “Circuit Cellar” in the subject line to avoid
to the collector had enough surface area to spam filters.
account for that much capacitance. Of course,
you should measure the junction capacitance
using a differential bridge under proper bias
conditions to get a more accurate value, a
process that requires instrumentation I don’t
have.

COLUMNS
Even without a SPICE simulator, the affect the rise time, because the stray
schematic suggests that the peak collector capacitance causing this problem completely
voltage won’t be much more than 1/12 of bypasses it. The ET227 datasheet doesn’t
the input voltage: the three capacitors form mention the effect of extremely short pulses,
a series-parallel voltage divider across the but the absolute maximum pulse current
input. Assuming a 180 V peak on the input, limit is 200 A at 50 µs.
the collector terminal might reach 15 V, which Tinkering with the model showed that a
certainly isn’t enough to cause any problems small series resistor dramatically reduced
by itself. the peak current, so I inserted four 2.5 Ω
However, the collector-base capacitance NTC power thermistors between the relay
could supply a base current that, amplified and the bridge rectifier. These thermistors,
by the transistor’s gain, would produce also known as inrush limiters, generally
a damaging collector current. I thought appear in power supplies, reducing the
that the motor’s stray capacitance could initial charging current of large electrolytic
apply a sufficiently fast voltage transient at capacitors. Their resistance has a negative
the collector to drive current through the temperature coefficient, so the resistance
collector-base capacitance, and that, even falls as they warm up, reaching a steady
with a low collector voltage and the internal state that depends on the power supply load.
13 Ω base shunt resistor, the transistor’s gain The sewing machine motor will run
would produce enough collector current to intermittently, allowing the thermistors to
force the operating point beyond the 100 A cool and increase their resistance. However,
DC and 200 A pulse limits at the of the safe even after a few minutes at the motor’s full-
operating area plot. throttle current of 1 A, each thermistor adds
A simple differential equation relates 1 Ω to the circuit and the quartet limits the
capacitor current to the voltage change at its simulated peak current to 33 A, well within
terminals: the safe operating area.
As it turned out, the third ET227 has
dV survived several weeks of relay clicks
IC = C
dt applied through the thermistors, so I’ll say
that problem has been fixed. I can’t defend
Although mercury-wetted relay contacts the simulation’s exact results, although it
can have a rise time on the order of a few does seem to reveal a failure mode that I’d
picoseconds, I couldn’t find any data on the completely overlooked.
dry contacts used in power relays. For lack of
better data, I slowed the rise time by a factor CONTACT RELEASE
of 1000 and Figure 3 shows the results of the After the November 2015 column
source voltage rising from 0 V to 180 V in 1 ns: appeared, reader Steve Troy sent me a
a nearly rectangular 150 A pulse of collector lengthy note describing a super-slow-motion
current. The collector voltage remains under AC motor drive he designed for a radar
3 V during the entire pulse and the current antenna mount. His technique should
does its damage at essentially zero bias. overcome the terrible low-speed torque of
Assuming a faster rise time of 100 ps the sewing machine motor, without requiring
would increase the current to 1.5 kA, while a complex control circuitry. I’ll adapt his AC
slower 10-ns ramp drives only 15 A through drive to the pulsed-DC circuitry you’ve seen
the collector. The actual rise time and peak here and report back: a simple matter of
current will depend on the relay contact rise software should make the sewing machine
time, as well as the stray series inductance work even better than I planned. Which is
that’s not included in the model. Remember why I appreciate hearing from you: I learn
that the motor winding inductance doesn’t something new every time!
62 CIRCUIT CELLAR • MARCH 2015 #296

FROM THE BENCH

Solid-State Lighting (Part 2)


Get Your Lighting
Under Control
In the first article in this series,
Jeff introduced the topic of
COLUMNS

electroluminescent (EL) technology


and its uses. This month he shows
how EL technology can produce a
nondirectional output as opposed
to an LED’s concentrated point
source output.

By Jeff Bachiochi (US)

E lectroluminescent (EL) technology doesn’t


have the clout to challenge LEDs in replacing
our heat-generating incandescent lighting. EL
a combination of functions with corresponding
durations. Four functions are offered: Channel
On, Channel Off, Brighten, and Dim. The
just doesn’t have the output levels that can circuit I presented last month used a subset
compete. What it does have is the ability to of these, On and Off. Dim and Brighten were
produce a rather exceptional nondirectional not provided.
output as opposed to the concentrated point
source output of an LED. Other than the high- HIGH VOLTAGE
voltage source required to get those photons By itself, the term “high voltage” generally
flowing, it is relatively inexpensive to produce denotes danger. This warning should be carried
and easy to work with. forward when experimenting with EL. Last
In the first part of this article series, I spent month I provided a schematic that showed an
much of the column explaining the background isolation of the high-voltage circuitry from the
of this material and what’s required to make logic-level circuitry. It is a good idea to keep
use of it. I suggest you refer back to that these physically separated from one another
article as a primer if you happened upon this so you can keep the two both electrically and
EL discussion midstream. I left off with a circuit physically isolated (see Photo 1). Putting this
that enables me to control eight separate all into an enclosure will keep fingers and toes
pieces of EL material from a single high-voltage away from danger; however, while on the
source that’s available from many of the same bench, it is especially important to recognize
venders that offer EL in sheets, strips, and the potential for harm.
wire. Because EL material uses a high-voltage One of the issues with using a purchased
source, control is handled via logic level-driven high-voltage supply is you have no control over
TRIACs. The circuit uses a microcontroller to it. That is, it will free run at a frequency that
provide the TRIAC control of each channel. It may make it difficult to control. The circuit
also uses a serial user interface that enables presented uses TRIAC drivers that are either
you to set up control sequences for each phase-independent or phase-dependent.
channel. Each channel‘s sequence consists of Phase-independent control enables the TRIAC
circuitcellar.com 63

to turn on at any point in its cycle, while phase- in its secondary. A 12-V
dependant control limits when a TRIAC can source is applied to the
turn on (only at zero crossings). Syncing control transformer’s center
to zero crossings enables one to consistently tap and alternately
turn on a TRIAC at the same point every cycle. driven FETs ground the
Without this sync, you have On/Off control but winding (see Figure 1).
no way of varying this over each cycle. The FET’s PWM source
Providing “per-cycle” control over our 60- will then control over
Hz world is easy because we know what the the period of time
frequency of each cycle will be and we can during each half cycle
monitor the voltage to get “in-sync” with it. that the FET is turned
We know each cycle will be 1/60 of a second, on. This moves the
or 16.6 ms. To operate a TRIAC at the 50% phase control from each

COLUMNS
level, the TRIAC ON signal must delayed by TRIAC to this oscillator.
4.1 ms after each zero crossing. Most of these The transformer’s
high-voltage circuits run at a soft frequency secondary can now
PHOTO 1
and you can’t depend on them to remain produce a voltage from 0 to 120 V. By syncing I kept the high-voltage circuitry at one
constant. It becomes very difficult to monitor this with a channel’s on time, we can produce end of this prototype. There was plenty
the frequency and dynamically adjust delays a brightening and dimming effect for each of room left over to add the circuitry
based on their varying zero-crossing times. channel. for an on-board DC-to-AC converter to
Readers who are familiar with Star Trek, last month’s project.
and specifically “The Wrath of Khan,” may be PWM
familiar with Captain Kirk’s solution to the There are couple of ways to get PWM
Kobayashi Maru. He defeated the so-called outputs that will alternate on separate pins.
no-win situation by hacking the problem and The first might be to use the top pair of a
providing a “back-door” if you will. To start off full-bridge output. This approach requires
this month, I am going to eliminate a variable changing direction every cycle to alternate
and thus allow a solution to present itself. direction (outputs). A second approach might
Based on inverter topologies, an addition to be to use the top and bottom of a half-bridge
the present circuit includes a microcontrolled configuration. Again you must change direction
oscillator with complementary outputs driving every cycle to alternate between the outputs.
a transformer’s primary (in this case, the step I chose to use a third approach using a single
down transformer is reversed) to produce 120 V PWM output. This approach makes use of an

FIGURE 1
The right side of this schematic
shows the circuitry I added to last
month’s project. The microcontroller’s
hardware PWM output is “steered”
to drive each FET alternately. The
frequency on the primary is therefore
2× the PWM rate. A 100% duty cycle
is maximum RMS secondary voltage. A
0% duty cycle is zero RMS secondary
voltage. So, the duty cycle controls the
RMS secondary voltage.
64 CIRCUIT CELLAR • MARCH 2015 #296

VDD LX CS
EN Device enable Last month, I used a simple “Eat at Joe’s”
100 k senario, where the circuit sequenced through
RSW-OSC PWM Switch commands for the first three channels of EL
oscillator control. The commands instructed the first
0 to 88%
channel turn on then off (Eat), followed by
VA
+ VSENSE the second channel (At), and finally the third
C
− channel (Joe’s) remaining on for 3 s.
VREG 1.26 V Output
VREF drivers VCS
60 pF
C1 O5 X5 X5 X5 X10 X10 X10 X10 X10 <CR>
2 × EL
C2 X5 X5 O5 X5 X10 X10 X10 X10 X10 <CR>
VREF Frequency VB C3 X5 X5 X5 X5 O10 O10 O10 X10 X10 <CR>

REL-OSC EL Using this same idea we can substitute


COLUMNS

Frequency
GND Brighten and Dim commands here to get a
fade effect instead of blink of each EL segment.

FIGURE 2 enhanced function called Steering mode. A C1 B5 D5 X5 X5 X10 X10 X10 X10 X10 <CR>
This block diagram shows the internal single PWM output can be routed to any (or C2 X5 X5 B5 D5 X10 X10 X10 X10 X10 <CR>
reference voltage that is fed into the C3 X5 X5 X5 X5 B10 O10 D10 X10 X10 <CR>
all) of four output pins via bits in the steering
VREG input to control the inductor/
register. An interrupt available at the end of
diode tied to LX to pump up the diode/
capacitor on CS to a regulated output
each PWM timer overflow is used to trigger an DURATION TO PULSE WIDTH
voltage of 110 V. The output drivers interrupt to swap output pins. Now that there is a way to alter the PWM
then use the voltage on CS to produce Two timers are used in this example. Timer that drives the step-up transformer and you
±110 V to an EL lamp connected 4 provides a tick every 100 ms for the Brighten can adjust the secondary’s AC output voltage,
between VA and VB. and Dim commands. This is the command’s you need to be able to vary the pulse width
minimum time period. Every 100 ms, all during each duration period. As I explained
durations are decremented. Should a duration earlier, the CCPR1L register controls the on
reach zero, the next command for that channel time of each PWM period. We will need to plug
is queued up. Timer 6 sets the PWM frequency values in here that range from 0 (0%) to PR6
with the PR6 register. The PR6 register is (100%). I use the duration value for this.
used to reload Timer 6 each time it reaches The duration value decrements once each
zero, providing the base frequency for the 100 ms to zero. Let’s begin with the Dim
PWM output. The CCPR1L register will hold the command because it directly relates to this
PWM’s on time pulse count. It is some fraction decreasing value. In the above example , the
of the PR6 register. If you place a value of half D5 command calls for a Dim to occur over five
PR6 in this register, the PWM output will be on 100-ms periods. So, you use the following
for half the PWM period and then turn off for formula to calculate a value for the pulse-
the second half. width register CCP1RL: PR6 × PresentDuration/
While both outputs are never really on at CommandDuration. This calculation is used
the same time, the FETs these outputs drive every 100 ms. For this command, you have
could potentially be on at the same time if they the following five calculations.
turn on faster than they turn off. In a bridge
208 × 4  166 
circuit, if both FETs are on at the same time, it = 166;  = 80% 
creates a high current path across the power 5  208 
supply. This is not exactly the case here, but 208 × 3  124 
= 124;  = 60% 
it would cause unwanted harmonics here. To 5  208 
eliminate this possibility, you can add a delay 208 × 2  83 
= 83;  = 40% 
to the on time in each cycle. The lower seven 5  208 
ABOUT THE AUTHOR
bits of the PWM1CON register indicates how 208 × 1  41 
J e f f B a c h i o c h i ( p ro - many ticks the PWM ON should be delayed. = 41;  = 20% 
5  208 
nounced BAH-key-AH- Since the outputs alternate, the actual output
208 × 0  0 
key) has been writing frequency will be half the PWM frequency. While = 0;  = 0% 
the resistance of the transformer will limit the 5  208 
for Circuit Cellar since
1988. His background DC current through the transformer and FET, it
includes product design is a good idea to completely remove any drive to Every 100 ms, the duty cycle will be
and manufacturing. either FET when the oscillator is stopped. Under changed affecting the AC output voltage and
You can reach him at program control, you can do this by disabling the EL intensity. The Brighten command uses
jeff.bachiochi@imagine the drive outputs. However, you should use the same formula; however, instead of using
thatnow.com or at www. caution when running an in-circuit debugger, as the decreasing duration count, we subtract
imaginethatnow.com. you may inadvertently break the program while it from the Command Duration (in this case
the oscillator is on, which would create a static = 5) to get an increasing value and in turn a
condition. increasing AC output voltage.
circuitcellar.com 65

FIGURE 3
Here is the schematic of one channel
of the eight EL drivers attached to
EL LAMP DRIVER PORTC of the PIC16F1829.
“And now for something completely
different.” When Monty Python used this
phrase, it usually meant more of the same
British humor. While the project’s objective
remains the same, I want to offer a different
approach. So far, the DC to AC conversion has
gone from a purchased module to an on-board
converter. Both approaches are similar and
use step-up transformers. I’d like to turn your
attention to a family of parts manufactured
by Supertex (now Microchip Technolgy). The
HV8xx parts are EL lamp drivers. In particular, in increments of 1% would require resolutions

COLUMNS
the HV860 part is a dimmable EL driver in of 500 ns. Even with this microcontroller’s
a QFN-12 package. While the part uses an PLL running at its maximum speed (Microchip
inductor, it is considerably smaller than using Technology PIC16F1829) of 32 MHz, that’s an
a transformer. And, since it has its own DC- execution cycle of125 ns (i.e., 1/32,000,000 ×
AC converter, a connected EL device does not 4). There would only be four instruction cycles
share the supply with other channels. In other per bit of resolution required. This won’t fly. By
words, all channels can be on at the same time. limiting the PWM resolution to 10%, the number
Figure 2 depicts the HV860. Two internal of instructions would skyrocket to 40. Even this
oscillators use external resistors to set their seemed doubtful, but let’s give it a go.
frequency. The first oscillator drives an First of all, we need to set up a timer to
internal FET that allows the external inductor give 5-µs interrupts. Refer to the flowchart in
to charge and release its charge through a Figure 4 to see what must be accomplished
diode into an external capacitor on CS. The during Timer 2’s 5-µs interrupt. Note that this
capacitor’s voltage on CS is monitored by
VSENSE and a portion compared to a 1.26-V
voltage reference. The comparator’s output
is feedback (duty cycle control) to the first Timer 2 interrupt
oscillator regulating the voltage on CS.
The second oscillator converts the DC
voltage on CS to an AC voltage on outputs Decrement PWM_Tick
VA and VB by driving four FETs in a full-
bridge configuration. The converter’s EN input
N
can be used to turn on and off the internal PWM_Tick > 0?
circuitry. However, since the internal reference
voltage is connected to the voltage regulation Y PWM_Tick = 10
comparator through an external resistor, you
can modulate this via an external signal to
PWM_Mask = 0
reduce the voltage to the comparator. A lower
reference voltage will in turn lower the DC
voltage produced at CS. This effectively gives
N
control over the AC voltage and thus the EL PWM_Tick >
Channel0?
device’s illumination level.
There are a couple of limits for this device. PWM_Mask.0 = 1
First, it is designed to drive up to 5 square Y

inches of EL material. Second, the external PWM


signal used to adjust the reference voltage must
be between 20 and 100 kHz. The PWM frequency N
PWM_Tick >
would not be an issue for a microcontroller’s Channel7?
hardware PWM handling a single HV860;
however, I am looking to handle eight devices PWM_Mask.7 = 1
Y
with a single microcontroller. Since there are
not eight hardware PWMs on many devices, LATC = PWM_Mask
FIGURE 4
this must be done in software. I used the same
The flowchart shows what must
basic circuit from the previous example and just
happen every 5 µs in order to produce
changed the high-voltage portion (see Figure 3). PIR.TMRIF = 0
eight channels of 20-kHz PWM outputs
that have individual duty cycles
TIMING adjustable to 10% resolutions. Note
Return
A 20-kHz output requires a cyclic output of that channels 1 to 6 are identical and
50 µs. To adjust a pulse width of 0 to 100% not shown here for simplicity.
66 CIRCUIT CELLAR • MARCH 2015 #296

PHOTO 2 other functions begin to suffer. So, 8 µs had


I find that working with SMT parts to do. Now I’ll cover what else had to happen
usually requires the high precision of
between interrupts.
a real PCB. Fine motor skills, tweezers,
and a fine-tipped solder iron are a
must. When ever possible, I try to use
MAIN
all through hole parts which is much The main loop code is similar to what had
easier for readers to duplicate. been already established. There are only three
items to look for. First, the RXBuffer is checked
for a received character. This only happens
if the user is connected serially and enters
commands to change the Animation Program.
The default hardcoded Animation Program
always executes on power-up unless the user
COLUMNS

enters a new one. That is then saved to internal


EEPROM and becomes the new default. Second,
the soft reset command flag is checked to see
if the user wants to restart execution after
entering a new Animation Program without
powering down and back up again. Finally, a
diagram does not show channels 1 through 6, check of the execution flag indicates if at least
which are similar to channel 0 and 7 shown. I one channel has decremented its duration
added some debug code to turn on an output to zero and is in need of a new command/
bit at the entry to the interrupt and off at the duration pair.
exit so I could see its time as a positive pulse For last month’s example, I was concerned
happening every interrupt. When I looked at with enabling/disabling each channel. There
this on the oscilloscope, I saw a 66% duty was no control of the AC voltage because it was
cycle and thought: “That’s great, I’ve still got created by an external power supply module
33% of the execution time for other purposes.” and I had no control of it. This month began
What I didn’t realize at the time was that with the addition of an on-board DC-to-AC
the interrupt routine was taking just over 5 converter. Besides enabling and disabling each
µs, long enough for the interrupt timer to roll channel, I created a PWM output. And thanks
over 5 µs again. The clearing of the interrupt at to a step-up transformer, I had control of the
the end of the routine was in fact clearing the AC voltage by varying the PWM. If the change
second interrupt that had just occurred and so in PWM was synchronized with an enabled
it was another 5 µs until it rolled over again. I channel, I then controlled the AC voltage
could prove this by clearing the interrupt right applied to that channel (for Brighten and Dim
away instead of waiting until the end of the functions). In either case, only one channel
interrupt. With that little change, everything was enabled at a time. Multiple enabled
stopped. This allowed the interrupt to channels would put multiple loads on the AC
reoccur before the end of routine, which kept and each channel would then share the current
interrupting and no other code could execute. and illuminate at a reduced level (or not at all).
This should be able to be fixed by lengthening With this last example, each HV860 creates
the time between interrupts from 5 to 10 µs. its own AC. That output is controlled via one
And sure enough, the interrupt timer was of eight software PWM outputs generated for
now happy to release control for the extra each channel. This requires an open collector
5 µs. However, I had just proven that I was type of output on PORTC, such that the output
not going to meet the 20-kHz modulation for can sink to ground but will not source to VCC
eight output channels with the present code. I (3.3 V), as this would affect the voltage on the
did find that even if I removed any debugging VREG input to the HV860. This microcontroller
code, I could only lower the interrupt time to has push-pull outputs, so we need to be a bit
approximately 7 µs before I began to see the tricky to simulate this. A logic 0 is written to
the PORTC latch that handles sinking a channel
to ground (off). When a channel is going to be
SOURCES on, the TRISC register is used to change the
EL Panels, Strips, and Wire pin’s function from an output to an input (a
www.adafruit.com | www.robotshop.com | high-Z condition).
www.seeedstudio.com | www.sparkfun.com When an output is at ground potential (or
off), none of the 1.26-V VREF can get through
PIC16F1829 Microcontroller and Supertex to the HV860’s VREG input. When a PWM value
HV860 low-noise, dimmable EL lamp driver of 0x00 (0% of PR2) is written to the duty cycle
circuitcellar.com/ccmaterials Microchip Technology | www.microchip.com count, Channelx, the channel will always be off.
When the port becomes an input (or on), it has
circuitcellar.com 67

no effect on the 1.26 V VREF, and so it remains transfer pad. The internal FETs can raise the
fully applied to the VREG input of the HV860. operating temperature a bit. While the PWM
When a PWM value of 0xD0 (100% of PR2) is signals I was creating are slightly below
written to the duty cycle count, Channelx, the the minimum specs, the circuit seemed to
channel is always on. PWM values of anything operate well. However, if I wanted to be within
in between 0x00–0xD0 will vary the average specs, I was not going to get there with this
voltage on VREF. If the duty cycle is increased microcontroller. There are other alternatives in
from 0% to 100%, the 1.26 V VREF will begin the PIC18 family that offer a few advantages
shorted out and then will be applied to VREG over the PIC16 device. These can execute at a
for longer periods as the duty cycle increases, faster speed (48 MHz vs. 32 MHz) and also offer
until this modulation is at 100%, at which time two level interrupts. When you are counting
VREG will equal VREF. cycles, every last one is important and you
waste an amazing amount of support cycles
LIMITATIONS & ADVANTAGES

COLUMNS
just branching through the interrupt structure.
The HV860 is a tiny SMT QFN-12 part that’s When you have multi-level interrupts, you can
difficut to work with (see Photo 2). I used a assign an important task to the top level and
toaster oven to mount these eight parts on the therefore get right to it. Ten cycles might be
PCB before adding any other components. It’s the difference between attaining your goal, or
tough to get just the right amount of solder not.
paste applied to each one, so they required Each HV860 is able to drive 5 square inches
a bit of touch up afterwards to remove a few of EL material. Check out the other parts
bridges. My smallest iron tip, 0.4 mm, was just available in this family. With each channel
about right for the part’s 0.5-mm lead spacing. responsible for its own AC source, the
But I’ll have to wear magnification and use a animation program is free of restrictions. Now
steady hand if I want to successfully rework each channel can independently flash, brighten,
anything. The rest of the external SMT parts are and dim independent of the others. I’ll bet a
huge by comparison once you’ve done the ICs. single channel programmable circuit could be
The HV860 has a square pad, centered pretty small if a tiny SMT microcontroller was
between the leads, that serves as a heat used. I think I see the light!

Circuit Cellar 2014


Digital Archive
With this digital subscription, you have
access to all 12 issues of Circuit Cellar 2014
from any computer or tablet at anytime.
Readers can explore project ideas,
bookmark pages, and make annotations
throughout each issue.

Circuit Cellar 2014 CD


CD includes 12 issues of Circuit Cellar in
PDF format along with related article code.

cc-webshop.com
Order yours today
68 CIRCUIT CELLAR • MARCH 2015 #296

FROM THE ARCHIVES

Mini Rover 7
Electronic Compassing
for Mobile Robotics
Electronic compassing is one of the most
intelligent ways to provide absolute heading
information for a mobile robot. In this article,
Joseph explains why the PNI V2Xe compass
turned out to be the best fit for his Mini Rover 7
robot, which he modeled after the NASA/JPL Rocky
7 Mars rover.

By Joseph Millier (US)

R ecent technological growth has yielded some


impressive tools for tackling increasingly
difficult tasks. The robotics field has been
built-in local distortion correction, such as any
other instrument. Compasses have their own
uncertainties and issues. Understanding how
a large beneficiary of these advancements compasses work, as well as the behavior of
because it encompasses so many disciplines, the environment that they measure, will better
each heavily dependent on technology. Mobile prepare you to manage their uncertainties and
robot navigation is one particular recipient of best apply the technology to a project like my
recent technological advancements. Accurate Mini Rover 7 robot.
and reliable navigation is fundamental to the
success of any mobile robotic application. BASIC ROBOT NAVIGATION
Navigation is typically given one of the Dead reckoning (DR) is the fundamental
highest, if not the top, consideration when navigation method used in mobile robotics. It is a
designing an autonomous mobile robot. You method of mathematically tracking your present
have to consider numerous hardware and position by measuring speed and direction
software options. These days a GPS receiver traveled at regular intervals, or distance and
is one of the first tools that you think about direction at any convenient interval. The latter
to fulfill your navigational needs. However, is easier to do on most wheeled mobile robots
the area that many mobile robots operate in if you use wheel encoders. This is also referred
is within GPS’s present 3- to 15-m accuracy to as odometry.
range.[1] Even long-range mobile robots still The basic tools for DR in mobile robotics are
have to maneuver successfully within that 3- to a compass and an odometer. In more complex
15-m resolution uncertainty. robots with advanced navigation resources, DR is
Compound these resolution limitations with still used to navigate between absolute position
satellite signal interference, and it becomes fixes. Position tracking by DR is used to get to
clear that a supplemental system is essential. and from fixed locations, help create maps of
Heading information, along with positional data surroundings, and keep track of position when
from other sources, can provide interim position moving around unexpected obstacles.
data as well as augment GPS data to resolve Position errors have a tendency to accumulate
higher accuracies. over time when navigating with DR. A robot
A magnetic compass has many advantages happily hobbling down a path can easily drift off
as a provider of heading information. the path because of the imperfect traction of its
CC REBOOT

Compassing is one of the only methods that drive wheels or limbs. Furthermore, the terrain
can provide absolute heading information may be uneven, inconsistent, obstacle-ridden,
without external references for calibration. or even move, as is the case for aquatic vehicles.
Today’s electronic compasses easily interface A robot could simply correct its steering to stay
with microcontrollers and come with a host of on course (or on bearing), but that little off-
other features like low-power consumption and course excursion could add a small position
circuitcellar.com 69

FIGURE 1
Magnetic
North As you study the Earth’s geodynamo
Pole
magnet field pattern, note how the
error. The magnitude of the position error is the field lines are not horizontal to the
integral of time, distance, and off-course angle surface except along the equator. The
traveled while the robot is off course. What is rotating dynamo and coil in the center
really required is a new bearing calculation represent the Earth’s magnetic field
to increase the robot’s chances to reach the being generated by its ever-flowing
desired target. iron outer core.

HEADING DETERMINATION
For centuries, we have been taking
advantage of the Earth’s magnetic field to
orient ourselves with respect to its magnetic
poles. Both the mechanical needle compass and Earth’s geodynamo

electronic compass can provide absolute heading

COLUMNS
information. It is hard to beat the compass for
this purpose. With the exception of GPS, other
systems that exist require an external heading
reference as calibration. approach. There are many ways to determine
Gyroscopes use mechanical angular heading, each of which has its own strengths
momentum changes to measure angular and weaknesses. None of them are infallible.
and linear movements. Traditional flywheel For this reason, some systems use two or more
gyroscopes are fast-spinning gimbaled flywheels methods cooperatively to increase system
with encoders. The encoders are situated about accuracy and reliability. The deciding factors are
the pivotal axes of the gyroscope’s gimbals cost, accuracy, efficiency, features, availability,
and register angular movement of the spatially ease of use, speed, and size.
stable flywheels to its base, which is fastened Kalman filters are typically used to integrate
to a host vessel. Modern gyroscopes use micro the data from multiple sensors to produce a
electromechanical systems (MEMS) and optical more reliable and accurate heading. Kalman
technologies in place of the bulky flywheels. filtering is a statistical method that combines
Gyroscopes have fast response times and the dynamic model of the system with the
are insensitive to magnetic anomalies. They statistical behavior of system errors. It enables
are also relative angular position sensors, navigation systems to handle periodic GPS signal
which require an external reference heading to interruption, odometer slippage, magnetic
initially set. A special kind of gyroscope called anomalies, and other sensor irregularities with
the gyrocompass can align itself with the Earth’s minimal degradation of accuracy. Kalman filters
rotational axis, but it tends to be a large and also can be extremely complicated. You must
costly instrument. fully understand the dynamic behavior of your
Differential wheel encoding is another systems and the statistical and systemic errors
technique used to determine heading. Relative of your sensors in order to make proper use
heading changes can be computed by taking of Kalman filters. It might be easier and more
the difference of distance traveled by two feasible in less demanding projects to use other
opposing wheels. This technique has the same software-based analytical tools like averaging,
traction and terrain issues associated with the weighted averaging, limiting, and majority
aforementioned wheel encoder odometry. voting to improve heading data reliability. FIGURE 2
A single-antenna GPS can provide heading I plotted the magnetometer sensor
information, but it is not instantaneous. It MAGNETIC COMPASSING output versus the angle. You can also
inherently lags the movement of the robot or The Earth’s magnetic field is created deep see the x-y plot of the magnetometer
vehicle because the derived heading requires in its iron core by a regenerative magnetic field sensor output.
previous position data. A GPS could not tell you
where you are heading if you were to stop and
change directions. Like compasses, GPS receivers
do not require external reference heading
calibration. Once moving, the GPS heading
update rate is a maximum of approximately
1 Hz, although some receivers add damping,
which increases this time constant even more.
A dual-antenna GPS receiver can provide
CC REBOOT

instantaneous heading—or yaw—information,


although the recommended distance between
the two antennas is 1 m. This fact, along with its
large price tag, can be a limiting factor for many
mobile robot applications.
A combination of techniques is the best
70 CIRCUIT CELLAR • MARCH 2015 #296

Measured sensor value


Quadrant(s) Heading Calculation
X Y
component. At the magnetic equator where
≥0 >0 270–360 360 – Arctan (Y/X) the magnetic field is horizontal, the field has
≥0 ≤0 0–90 0 – Arctan (Y/X) no vertical component. At the magnetic poles,
the field is purely vertical and has no horizontal
<0 All 90–270 180 – Arctan (Y/X)
component. At places where the inclination angle
TABLE 1
is 45°, the horizontal and vertical components
Use this table to convert the limited generator that’s sometimes referred to as the are equal.
range, Cartesian coordinates system geodynamo. This iron core has a liquid outer The U.S. Geological Service (USGS) and the
output of the Arctan function into full- section and a solid inner section. The flow of Nation Oceanic and Atmosphere Administration
range compass coordinates. electrical current in the turbulent liquid iron (NOAA) maintain web sites that have global maps
outer section creates the magnetic field. and on-line programs that chart declination
The simplest description of the Earth’s angles, field intensities, dip angles, and much
magnetic field spatial pattern is that of a dipolar more. I will focus on the horizontal component
field with magnetic flux emanating from the of the magnetic field, because that is the portion
South Pole and converging at the North Pole. The that contains the heading information that I
Earth’s magnetic field pattern is a little more wish to measure.
complex than a simple bar magnet model. As
previously mentioned, the Earth’s geodynamo is MAGNETIC MEASUREMENTS
constantly moving. Presently, the magnetic poles A magnetometer is an instrument that
are tilted about 11° away from the geographical can measure the flux density of a magnetic
poles, and they are not at exactly at opposite field. It uses one of any number of types of
sides of the world either. The magnetic North sensors to convert magnetic flux to voltage,
Pole is located in northeastern Canada, and the current, frequency, or some other electronically
magnetic South Pole is located in the Antarctic measurable form.
ABOUT THE AUTHOR Ocean south of Australia. There are numerous types of magnetic field
Joseph Miller is a Senior The geographical North Pole is also known sensors: the saturable core magnetometer (or
Electrical Engineer at as true north. The angular difference between fluxgate magnetometer), the Hall effect sensor,
PNI Corporation, where the true poles and the magnetic poles at a the magneto-resistive sensor, and the magneto-
he designs consumer given location is called the declination angle. inductive sensor. A two-axis magnetometer,
and OEM sensor- and Depending on your location, true north could in which the two sensors are in quadrature
network-based products. appear to either the east or west of the magnetic (orthogonal) orientation, can be used as an
He earned an ASEE de- North Pole. electronic compass to compute heading. When
gree from the Heald In- The Earth’s spherically shaped geodynamo it is parallel with the measured field, the
stitute of Technology in produces a magnetic field as shown in Figure 1. magnetometer sensor’s output is at maximum
Note that the field lines are not horizontal to the for the given amount of magnetic flux density
San Francisco, and has
Earth’s surface, except at the Earth’s magnetic that is present. When the magnetometer sensor
been an electrical engi-
equator. Unlike the Earth’s straight geographical is perpendicular to the magnetic lines of flux,
neer for approximately
equator, this one meanders but is located in the sensor will output no signal. A plot of the
20 years. Joseph enjoys
roughly the same area. At the magnetic poles, x-sensor output versus the y-sensor output
competing and demon- the field lines are vertical. The angular vector of results in the heading being represented around
strating his robots. You the magnetic field with respect to the horizontal the polar axis of the coordinate system origin
m ay c o n t a c t h i m a t plane at any given location is known as the dip (see Figure 2).
compass@sonomatron. angle, or inclination angle. The density of the This form is preferred as a visual analysis
com. magnetic field also varies around the world. tool for sensor and system performance analysis
The magnetic field density is approximately two and troubleshooting. Notice that the y-axis
times as dense at the magnetic poles as it is at is inverted from that of a typical Cartesian
the equator. coordinate system. This was done so that
The magnetic field vector is sometimes the compass coordinates would be produced
FIGURE 3 referred to as having two separate components, in its correct orientation. When operating
The x-y plots show various magnetic a horizontal component and a vertical with compass coordinates, it is important to
distortion effects. remember to make the proper translations from
a Cartesian coordinate system to a compass
coordinate system, especially after using
trigonometric functions.
At angles between parallel and antiparallel
with respect to the magnetic lines of flux, the
CC REBOOT

sensor’s output signal, X, is a product of the


applied magnetic flux density, b, and the cosine
of the angle, q, of the sensor from being parallel
with the flux lines.
X = β cos(θ) [1]
circuitcellar.com 71

FIGURE 4
Here you can see the effects of
soft iron distortions in the Earth’s
If a second sensor is added, and if it is magnetic field.
positioned at a right angle to the first sensor,
its output, Y, will have the same function as X,
but will be 90° out of phase. The y sensor will
be in the east position, and the x sensor will
be in the north position. The two sensors are
said to be in quadrature with one another. The
North
equation for output Y is the following: Pole
Soft
Y = β sin(θ) [2] iron
You now have enough data to compute
heading from the output values of the x and y
sensors. Use the trigonometric identity:
sin(θ)
tan(θ) =
cos(θ) [3]
Combining Equations 1–3 yields:

 β sin[θ]  current (electromagnetism) in your circuitry


θ = Arctan  
 β cos[θ]  and neighboring appliances. There are
or permanent magnets in your robot’s motors,
Y and there is magnetized metal in the robot’s
θ = Arctan   construction materials.
X [4] Items external to the robot, such as
The arctangent, or inverse tangent (tan–1), is appliances, underground pipes, and ducts may
inherently restricted to ±90°, which covers only have their own fields, and can locally offset or
two quadrants of the coordinate system over its change the direction of the Earth’s field. Items
entire input range of –¥ to ¥. This function also that create offsetting fields are classified as
operates in the Cartesian coordinate system, hard iron. A soft iron material is anything that
which is rotated 90° from compass coordinates. alters the natural path of a magnetic field’s
To convert the Cartesian q to a compass lines of flux. By “natural path” I mean its path
heading coordinate, a translation must be through air. Put another way, any material
performed. Table 1 shows the translation based with a relative permeability other than one is
on the output polarity of the sensors when the a soft iron material. A soft iron also can have
sensors are oriented as shown in Figure 2. a hard iron effect. Usually soft iron and hard
Note that magnetometer polarities may vary iron materials are referred to by the effect they
depending on the manufacturer. have on the surrounding magnetic field. These
As demonstrated in Equations 1 and 2, the effects are easy to recognize when an x-y
output signals of both sensors are proportional graph is plotted of the compass sensors output
to field density (b) and its angle relative to values as the compass is rotated through
magnetic north. The field density can be 360°. Figure 3 illustrates these effects.
extracted at any angle of the quadrature pair All of the plots assume that the culprit
by computing the geometric sum of the two material is local, which is to say that it is
sensors outputs:
β = X2 + Y 2 [5]
Equation 5 computes the horizontal
component of the overall magnetic field density
from the perspective of the robot’s horizontal
plane. By monitoring this value, you can spot
magnetic anomalies and tilting, which effect
heading accuracies.

SOFT/HARD IRON DISTORTION


As you now, producing a compass heading
with a pair of sensors is fairly straightforward.
CC REBOOT

However, there’s trouble in the neighborhood.


Magnetic anomalies are all around you. Other
magnetic sources and alternate magnetic flux
FIGURE 5
pathways are corrupting your intended signal—
Here are several magnetic signature
the Earth’s magnetic field. plots of the Mini Rover 7 with
Magnetic fields are generated by electrical additional effects.
72 CIRCUIT CELLAR • MARCH 2015 #296

Modern electronic compasses have little trouble mathematically


correcting for simple soft iron and hard iron distortions, sensor
gain mismatch, and even sensor misalignment (orthogonality),
which are all shown in Figure 3. Electronic compasses calculate
the correctional coefficients after completing a one-time
calibration procedure that involves rotating the robot or vehicle
through at least one complete rotation so that it can analyze the
geometry of the x-y sensor data.
When testing your robot and creating plots for your analysis,
the patterns to watch for are excessive hard iron offsets and
multimode soft iron distortions, which look like lumpy circles or
ellipses. Excessive hard iron offsets can bring sensors into their
nonlinear regions. This looks like a flat spot on the x-y circle plots,
which are perpendicular to the axis of the saturated sensor. It is
also a good idea to create plots for the robot when it is rotating
both clockwise and counterclockwise, and then compare the two
to see if the motor currents affect sensor readings.
PHOTO 1 Figure 5 shows x-y sensor plots (magnetic signature plots)
No, it isn’t the Spirit rover you’ve seen on the news; it’s my Mini Rover 7 robot. running on my Mini Rover 7 robot. The red trace shows that the
robot has some hard iron offsets but no soft iron distortions. I
rotated the robot in both directions under its own power and
onboard the robot when it is rotated. These traces, or profiles, saw nothing significantly different, although it would be hard to
can be thought of as the magnetic signatures of the robot’s local see any rotational offsets with these plots. There are ways to
environment. Notice how the soft iron effects create an elliptical test this.
profile. Soft iron material attracts, bends, and condenses The slightly elliptical blue trace is the result of placing a 9-V
magnetic flux toward itself, creating sparse field densities on its battery next to the compass. I placed a small magnet in the robot
lateral sides. At the same time, it will also create dense magnetic when I generated the light blue trace. The dark blue trace is the
fields in areas that are in line with it and the source field direction, result of placing a PC chassis next to the robot when it performed
as shown in Figure 4. The distribution and quantity of soft iron a rotation. The small amplitude is to be expected because the
material will determine the alignment and offset of the ellipse’s external soft iron material attracts the magnetic flux away from
foci. the robot, therefore creating an area with a sparse field, much
Nearby electromagnetic fields, ferrous construction materials, like the one in Figure 4. You should not calibrate the compass in
and motors make robots especially tough environments for your robot under this condition because it does not represent a
compasses. Before using an electronic compass in a mobile robot, normal condition. Any electronic compass with hard iron and soft
it is a good idea to analyze its magnetic signature by creating an iron compensation should have no problem producing accurate
x-y sensor plot. From this plot, you can identify the existence of heading data using any of the vehicle magnetic signatures shown
the aforementioned simple distortions and, more importantly, in Figure 5.
the more complex ones. The plots should give you an indication As you have seen, with a little effort a compass can adapt
of the compass’s chances of providing accurate readings, as well itself to your robot’s unique internal magnetic signature by using
as information to help you make corrective adjustments to the its built-in calibration algorithm. However, when operating after
robot or sensor placement. calibration, your robot will most likely come across external hard
iron and soft iron objects, which will alter the Earth’s magnetic
field direction.
Figure 4 shows how a soft iron object can alter the heading
of a robot as it attempts to keep steady (north in this case) when
it moves past the object. Notice that the field density is sparse in
this area. As long as the sensors are relatively close (so that they
experience the same field density ratios), the compass abilities
are not significantly diminished. This is because the heading
calculation for a quadrature sensor pair uses the arctangent of
the ratio of the two sensors (see Equation 2). The overall field
density, or magnitude of the field density, can be monitored by
calculating the geometric sum of the two sensors (see Equation
4), which can alert you to such anomalies. This information can
be used to weigh your options.
You may decide to temporarily trust differential wheel
CC REBOOT

encoder outputs for tracking heading while the overall measured


field density falls outside established thresholds. A Kalman filter
or your own statistical algorithm can use this information with
other sensor data to make improved estimates of actual heading.
PHOTO 2 It is important to use the compass’s calibrated x-y sensor data to
I thought you’d like a look inside the Mini Rover 7’s enclosure. compute field density because it already has been compensated
DESIGN YOUR SOLUTION TODAY
CALL 480-837-5200

TS-7250-V2 Embedded Board TS-7700 Embedded Board


High Performance and Industrial Grade High Performance Compact SBC
Pricing Starts At Pricing Starts At
$165 $119
Qty 100 Qty 100

$199 $165
Qty 1 Qty 1

Available with TS-ENC720 enclosure Available with TS-ENC750 enclosure


(Shown with optional microSD card) and TS-752 interface board
Features: 800 MHz or 1 GHz Marvell PXA168 ARM CPU
Up to 1 GHz ARM CPU 2x USB Host 512 MB DDR3 RAM, 128 bytes NVRAM

512 MB RAM 1x USB Device 2x microSD Card Sockets for Redundant Storage
8 KLut FPGA, 1x 10/100 Ethernet, 2x USB Host
8 or 17 KLut FPGA 6x Serial Ports
55x 3.3V DIO, 6x TTL UARTs, 1x I2C, 1x 12S, 1x CAN
2x SD Card Socket 75x DIO, 1x CAN
On board temperature sensor and watchdog timer
2x 10/100 Ethernet 1x PC/104 Connector
-40 ºC to 85 ºC Industrial Temperature Range
Runs Linux 2.6.34 or 3.14 with Debian Wheezy
Benefits:
Hardware flexibility with on-board FPGA Computer-on-Modules
Several control I/O interfaces State of the Art Embedded Design
Launches your application in half a second TS-4600: 450 MHz low cost w/ 2 Ethernets
Easy development w/ Debian and Linux 3.14 TS-4710: Up to 1 GHz PXA168 w/ video
TS-4720: Like TS-4710 + 2 GB eMMC Flash & 2 Ethernets
High data reliability with 2 GB SLC eMMC flash
TS-4200: Atmel ARM9 w/ super low power
-40 ºC to 85 ºC industrial temperature range TS-4800: 800 MHz FreeScale iMX515 w/ video

We’ve never Embedded Support every Unique embedded


discontinued a systems that step of the way solutions add
FE

L
D

NA
N
LI

E
GG

PE

GI

product in 30 are built to with open value for our


NG

RI
RU
LO

years endure source vision customers


74 CIRCUIT CELLAR • MARCH 2015 #296

for your robot’s personal magnetic signature.


Modern electronic compasses like the PNI V2Xe
can report the overall field density in proportion
to the field that it experienced at every heading
angle during a calibration cycle so that local field
distortions do not interfere with the assessment
of external magnetic fields.

EFFECTS OF TILT
Tilting an electronic compass can create
heading errors. When tilted, the sensors no longer
receive the magnetic field in the proportions
measured during calibration. Equations 1 and
2 characterize the sensor output value with
respect to the magnetic field’s angle to the
sensor’s orientation in the horizontal plane.
Tilting the sensor would expose the sensor to
portions of the Earth’s vertical field component
and reduce its exposure to the horizontal field
component, which could either be an increase
or decrease in field density depending on local
inclination angles and direction of tilt.
Equation 6 gives the relationship of heading
error versus tilt angle when a compass is tilted
in the north-south rotational axis (also known
as pitch):
θERR = Arctan ( sinα tanϕ )
[6]
where qERR is the heading error caused by
FIGURE 6 tilt, a is the pitch angle compass, and j is the
Because I like to make my robots as expandable and serviceable as possible, most subsystems are
inclination angle of the Earth’s magnetic field.
modularized and plug into the main board using connectors.
To use an example, if your compass were
located in San Francisco, which has a magnetic
field inclination angle of 61°, you could expect a
Wellesley, MA, 1998. heading error of up to 1.8° for every degree of
pitch for the first 10° of tilt. Tilt in the east-west
PNI Corp., “Multipoint Calibration Primer,”
direction (roll) or any compound angle of the
1001766 R01, 2003.
two tilt axes creates similar errors, although the
U.S. Geological Service (USGS), worst-case errors could still be characterized by
geomag.usgs.gov. Equation 6 by simply substituting the pitch angle,
a, with a tilt angle in any direction. Another
circuitcellar.com/ccmaterials SOURCES accuracy-degrading factor would be the lack of
CStamp Module hard iron and soft iron distortion correction in
REFERENCES Ken Gott | cstamp51@earthlink.net the pitch and roll axes. The two most common
[1] Garmin Ltd., www. ways to make a compass insensitive to tilt is to
Maxstream Wireless modems
garmin.com/aboutGPS/. mount a two-axis compass on a gimbal and to
Maxstream | www.maxstream.net
use a three-axis, tilt-compensated compass.
RESOURCES MAXI Dual H-Bridge two-motor driver kit
H.R. Everett, Sensors for Mo- Mondo-tronics, Inc. | www.robotstore.com COMPASS FEATURES
bile Robotics: Theory and Ap- A good compass should have high dynamic
plications, A.K. Peters, Welles- V2Xe Compass module range sensors. The need to compensate
ley, MA, 1995. PNI Corp. | www.pnicorp.com large hard iron offsets is not uncommon, and
R.B. Langley, “The Magnet- C8051F330 Microcontroller can account for 75% to 90% of the sensor’s
ic Compass and GPS,” GPS Silicon Laboratories | www.silabs.com operating range. A good compass will have an
World, September 1, 2003.
operating range that is at least four times the
Earth’s magnetic field density.
CC REBOOT

E. Kaplan ed., Understanding A compass also should be able to resolve the


GPS: Principles and Applica- Earth’s horizontal magnetic field component to
tions, Artech House, Norwood, 1:115 for 1° resolution and 1:1146 for 0.1°. These
MA, 1996. numbers don’t account for soft iron distortions
that effect sensor gains and hard iron offsets,
M. Miller et al., The Personal which would increase these requirements.
Robot Navigator, A.K. Peters,
circuitcellar.com 75

A good compass should be temperature-compensated.


Magnetic sensors have temperature dependencies like most
sensors. Fortunately, the sensor’s common temperature effects
drop out of the heading calculations because the arctangent
function’s input value is a ratio of the sensor pair (y/x). Sensor
nonlinear temperature effects, external hard iron offsets, and
soft iron distortions do not share this temperature cancellation
characteristic. Of course, a compass that has hard iron and soft
iron compensation is essential. The necessity of tilt compensation
depends on the robot’s requirements and your budget.

V2XE COMPASS MODULE


I used the V2Xe compass in the Mini Rover 7 robot. This is a
1” square electronic compass module that uses an SPI interface FIGURE 7
as a means of communication. It consumes less than 3 mW of Here you have the robot’s distance from the origin versus heading and magnitude
power, and has an output resolution of 0.01° with a heading during a straight-line test with a soft iron distortion effect near the 125" mark.
accuracy of 2°. Its field measurement range is about 20 times
that of the Earth’s field, which means that it can operate with and transmit the robot’s heading, as well as the measured field
extremely large hard iron offsets that are common in robotic magnitude and raw sensor values. You may download the code
applications. from the Circuit Cellar ftp site.
The V2Xe compass can be calibrated using one of two The wireless modem that links the Mini Rover 7 to a remote
methods. Distortion-compensation coefficients along with terminal enables you to use the keyboard on the remote
declination settings are stored in nonvolatile memory. The V2Xe terminal to send the Mini Rover 7 commands for maneuvering
can provide raw sensor data and compensated field magnitude. and to select the type of data you want the robot to report. For
It has an adjustable digital low-pass filter for heading. instance, sending a “c” to the robot tells it to begin calibrating of
A continuous calibration is the simplest calibration method to the V2Xe compass. An “s” stops the calibration process and any
perform on the V2Xe. Send the calibration start command to the movements. Sending an “h” tells it to include only heading data
V2Xe to begin the calibration process, rotate the robot in one or in its periodic data transmissions.
two complete circles, and then send a calibration stop command You can command the robot to rotate in a circle (“r” or “l”).
to end the calibration process. After completing the calibration, It also can send raw sensor data (“b”) in its datastream, which
you can retrieve the heading data from the V2Xe as necessary. I was able to cut from a terminal program receive buffer window
and paste into a spreadsheet program to create the x-y magnetic
V2XE IN THE MINI ROVER 7 signature plots shown in Figure 5.
The Mini Rover 7 depicted in Photo 1 is a working scale model Another good test is to command the robot to move forward in
of the NASA/JPL Rocky 7 Mars rover. It incorporates six drive a straight line. You can then observe the heading and magnitude
motors, and it has a rocker-bogey suspension as well as a zero values for irregularities. For this test, I commanded the Mini
turn radius steering system that’s capable of rotating the rover Rover 7 to travel down a hall in my house and into the living
in place. The robot contains a Maxstream 900-MHz wireless room. Along the way, the robot passed the kitchen. As it passed
modem for receiving commands and transmitting data to and the backside of the refrigerator, the heading reported by the
from a terminal program on a host PC, which has a matching compass drifted. The magnitude was simultaneously changing,
wireless modem. therefore signifying a magnetic field anomaly.
The Mini Rover 7 also sports a C8051F330 microcontroller Figure 7 is a graph of the distance the robot traveled versus
that’s mounted on a CStamp, which is a Basic Stamp II the heading and magnitude. Notice that the field magnitude is
socket-compatible module. It contains two regulators and a a good indicator of magnetic anomalies, which can be used to
JTAG programming/debugger port connector. I used the free determine the quality of the compass heading information.
integrated development environment and evaluation C compiler I performed an outdoor test that proved more successful than
supplied by Silicon Laboratories along with its EC2 serial-to-JTAG the indoor test. The outdoor environment didn’t reveal any of the
adapter. The wiring diagram for the robot is shown in Figure 6. magnetic disturbances that I had observed indoors because I
Photo 2 shows the placement of the compass in the Mini didn’t encounter manmade iron objects.
Rover 7. What is not clear from this photo is that I raised the
compass to distance it from the motors and current-carrying THE NEXT MOVE
wires in an effort to reduce distortion. Additionally, the wires The program listing posted on the Circuit Cellar ftp site also
are twisted in complimentary pairs to alternate the magnetic contains a PID-based steering control system that keeps the
field direction and to minimize the distance of the radiated field robot on a steady course—if it doesn’t encounter magnetic
generated by current flow; this effectively reduces offsets to the anomalies. The next step for this project is to add two wheel
measured field. encoders to create a differential odometer. I plan to experiment
CC REBOOT

The end result is illustrated by the red trace in Figure 5, which with this data along with compass heading and magnitude
shows that the robot’s magnetic signature has only a small hard information in a weighted averaging algorithm to increase
iron offset. The compass can easily compensate for this simple heading accuracies.
offset mathematically after a calibration is performed.
To explore the compass’s performance in various Editor’s Note: This article first appeared in Circuit Cellar 165,
environments, I wrote a simple program to perform basic moves April 2004.
76 CIRCUIT CELLAR • MARCH 2015 #296

CC SHOP

ADVANCED CONTROL

ADVANCED CONTROL ROBOTICS HANNO SANDER


ADVANCED CONTROL ROBOTICS

1 CC VAULT
ROBOTICS
Untibus et audae eos sequost aspella
ndipsaperios et inis vollab invelitatqui
berum, omnis ullenihicid quas maxi-
min res con everfer ibusae omnitat

CC Vault is a pocket-sized USB


iisque eum dolore volut que suntibus
ad et ut rerum volupta ne con repta-
tis nos doluptas eosanditiam rem re

that comes fully loaded with ev-


volluptis as evellor res dolum nat.

Os pratis ma solore volupta speris HANNO SANDER


ery issue of Circuit Cellar maga-
sum as sim rescia nonseque conse-
rum ne alique et ulpa sa quaes sam
eat parit et que molestios que om-
zine! This comprehensive archive
nis ipit accusa volest aut est, nusci-
ent magnam excerum id eum aut est

provides an unparalleled amount


veleseq uissect urestia volori comni-
tiur?

of embedded hardware and soft-


Obis si sinvende venis ipist, volor-
enim doluption et acestiis ut qua-
tesci audions erundunt andissit, eum
ware design tips, schematics, and
audandi gnimeni sintis eat adia sa
dis prorunt rerem explignitio invelic

source code. CC Vault contains


aectatus sin ea vel ium dendaest,
consed que nis dolorum aut vit mo-
lorum ipiendunt et, iliquatia vellori-

all the trade secrets you need to


taqui ad ea sim iur sequia nectem
utem quibus sinum remporio id ut
adi bla nation.
become a better, more educated
HANNO SANDER
electronics engineer!

Item #: CCVAULT
1 PARALLAX PROPELLER

4
2 CC 2014 CD
2014 was an exciting year for
electronics engineers! The continued 4 ADVANCED CONTROL
success of open-source solutions, ROBOTICS—NEW!
Internet of Things (IoT) revolutions,
and green-energy consciousness has When it comes to robotics, the
changed the face of embedded design future is now! This book simplifies the
indefinitely. In Circuit Cellar’s 2014 theory and best practices of advanced
archive CD, you can find all of these hot robot technologies by providing insight
topics and gain insight into how experts, to communication technologies, control
as well as your peers, are putting the robotics, embedded technology,
newest technologies to the test. You’ll programming, and more. Complete
have access to all articles, schematics, with code samples, schematics, and
and source code published from January design tips. Great reading for beginners
to December 2014. and experts alike.
2
Item #: CD-018-CC2014 Author: Hanno Sander
Item#BK-ELNL-978-0-963013-33-0

3 MICROPROCESSOR DESIGN USING VERILOG HDL


After years of experience, Monte Dalrymple has compiled his knowledge of
designing embedded architecture and microprocessors into one comprehensive
guide for electronics engineers. Microprocessor Design Using Verilog HDL provides
you with microarchitecture, writing in Verilog, Verilog HDL review, and coding
style that enables you to depict, simulate, and synthesize an electronic design on
your own.

Author: Monte Dalrymple


Item #: CC-BK-9780963013354

Further information and ordering: www.cc-webshop.com


3 CONTACT US: Circuit Cellar, Inc. | Phone: 860.289.0800 | E-mail: custservice@circuitcellar.com
circuitcellar.com 77

What’s your EQ? The answers are posted at www.circuitcellar.com/

TEST YOUR EQ
category/test-your-eq/. You can contact the quizmasters at
eq@circuitcellar.com.

Contributed by David Tweed

PROBLEM 1—Back in the days of stand-alone UART chips PROBLEM 3—Modern UARTs usually include internal
that required separate baud rate generators, one way to baud rate generators that can divide the input clock by
generate the 3.6864 MHz clock for the baud rate generator an arbitrary integer N. Given an input clock of 16.000
was to take the 16.000 MHz system clock and feed it to a MHz, and assuming that the output of the baud rate
synchronous 4-bit counter that was configured to divide by generator needs to be 16× the actual baud rate, what is
13 by forcing it to load the value 3 when it got to 15, giving the highest standard baud rate for which the frequency
the following waveforms: error is no greater than that generated by the scheme
above?

PROBLEM 4—What is the maximum frequency error


that a baud rate generator for a UART can produce?
Assumptions:

• 8N1 data format


As you can see, the QB output of the counter produces 3 • Error equally distributed between transmitter and
pulses for every 13 input clocks, and it turns out that this receiver
comes very close to the required frequency. What is the exact • Generator output is 16× the baud rate
error, expressed as a percentage?

PROBLEM 2—Obviously, there is some jitter in the timing of


the individual pulses produced by this circuit, relative to an
evenly-spaced clock at the same frequency. What is the peak-
to-peak magnitude of this jitter?

TESTS & CHALLENGES


Sign up for the
FREE Circuit Cellar Newsletter!
You’ll receive electrical engineering tips,
interesting electronics projects, embedded
systems industry news, and exclusive product
deals via e-mail to your inbox on a regular
basis. If you’re looking for essential electrical
engineering-related information, we’ve got
you covered: micrcontroller-based projects,
embedded development, programmable
logic, wireless communications,
robotics, analog techniques, embedded
programming, and more!

Subscribe now to stay up-to-date with


our latest content, news, and offers!

circuitcellar.com
78 CIRCUIT CELLAR • MARCH 2015 #296

CROSSWORD MARCH 2015


The answers will be available at circuitcellar.com/crossword.

3 4

6 7

9 10

11

12

13

14

15 16
TESTS & CHALLENGES

17

18

19

20

EclipseCrossword.com

ACROSS DOWN
2. Field of 60- or 120-Hz magnetic or electrostatic energy 1. QC (two words)
5. Scan of a range of frequencies 3. A field of radiated energy
6. WW 4. Magnetizable substance based on iron
13. Pot 7. Bending of energy waves as they move around or through
14. Prefix that divides a unit by a billion an obstacle
15. Exhibiting the same physical properties in all directions 8. Any connection between two electrical conductors
17. One millionth of a meter 9. Slicing off of signal peaks
18. To change in value by a discrete step 10. Conductor shared by various circuits
19. RFI, EMI 11. Slower than the speed of sound
20. Test instrument that can make several different measurements 12. Convert a digital signal back into an analog signal
16. Measured in fractions of a farad
IDEA BOX
circuitcellar.com 79
the directory of
PRODUCTS & SERVICES
For current rates, deadlines, and more information contact Peter Wostrel at 978.281.7708 or circuitcellar@smmarketing.us.

 Programming
 Debugging
$89 Need sensors for your
application?
For PIC® MCUs!
► ICD & ICSP functionality with
CCS IDE Compilers
► Powers & Connects via USB
► FREE CCS Load Software
► Data Streaming with Real-time Call Carlson today for
Diagnostic Data & more...
application specific sensors
View our full line of Dev Tools:
www.ccsinfo.com/CC315 Phone: 218-454-0766
sales@ccsinfo.com
Email: info@maxbotix.com
262-522-6500 x 35 www.maxbotix.com
®
PIC MCU is a registered trademark of Microchip Technology Inc.

$20 for 5PCBs


ICD-U64 March Issue.indd 1 1/20/2015 2:53:50 PM

Join The
2 layer,4x4inch, FR4(RoHS),0.063”,1oz,
2LPI,Green,1SK,Lead free HASL

Standard PCB: Promotion code:


CC14061

PCB & PCBA


Small to Mass QTY
INSTANT QUOTE AT:

www.myropcb.com
OR CALL:
1-888-PCB-MYRO
TRi microEngineering Labs, Inc.
Programmable Logic Controllers
www.melabs.com 888-316-1753
Powerful & Easy Ladder
+BASIC Programming
Ethernet integrated
Programmers for Microchip PIC® Microcontrollers
MODBUS TCP/IP PC-Tethered USB Model (shown):
DI/Os & AI/Os integrated •Standalone software
•Command-line operation
•Hide GUI for automated use
OEM Prices as low as $119 •Override configuration with drop-downs
for full-feature Nano-10 PLC
Stand-Alone Field Programmer:
•Power from target device or adapter
tel : 1 877 TRI-PLCS •Program file stored on SD-CARD
web : www.triplc.com/cci.htm •Programming options stored in file
•Single-button operation
TRIANGLE Starting at $79.95
RESEARCH Program in-circuit or use adapters for unmounted chips.
INTERNATIONAL Zero-Insertion-Force Adapters available for DIP, SOIC, SSOP, TQFP, and more.
PIC is a registered trademark of Microchip Technology Inc. in the USA and other countries.
80 CIRCUIT CELLAR • MARCH 2015 #296

The Future of Flexible Circuitry


By Mark Finstad
T he flexible circuit market has been growing
steadily for the last three decades. This trend
will continue into the foreseeable future as flexible
can be worn on the baby’s leg or in their clothing
and can keep track of breathing, heartbeat, body
temperature, etc. If the device senses that there is
circuitry supports many of the same industries a problem, an alert is sent to the parents phone to
and many of the same applications that have been wake them. It is almost like having a private nurse
around for more than 30 years. Past and current watching the child all night long.
industries include military and avionics with most Medical Sensors: This is an area that has been
of these applications being high layer count, high- growing rapidly, and I predict that the trend will
density rigid flex, and also consumer electronics, continue at an accelerated rate. With today’s push
telecom, and automotive applications with flex to get patients out of the hospital as quickly as pos-
circuit designs that are typically less complex than sible, electronic home monitoring of the patient is
those of mil/aero. Medical diagnostic applications going to be necessary. There are currently sensors
will continue to grow as new equipment is that can be worn by the patient for several days at
developed and older equipment is refurbished or a time, while keeping tabs on heart functions conti-
redesigned. But if I had to sum up an answer to the nuously during this time. Just like the baby monitor
Mark Finstad is a Senior question “where is flex going in the near future?” referred to earlier, these devices can send alerts to
Application Engineer at my answer would be simply “on you.” the patient’s physician if any abnormalities are de-
Flexible Circuit Technologies The wearable electronics market has absolutely tected. These devices will allow a patient to recover
in Minneapolis, MN. He is a exploded in the last few years with new applicati- from heart attack or surgery in the comfort of their
nationally recognized expert ons emerging almost daily. If an electronic device is own home while still having continuous monitoring
in the design, fabrication, and going to be worn on the body comfortably, it has to of their state of health.
test of flexible and rigid flex be flexible. So what better way to provide intercon- Pet Monitors: Even Rover gets to wear electro-
TECH THE FUTURE

printed circuits with more than nects for these types of devices than a flex circuit? nics these days. Training collars have been around
30 years of experience in the Here are just a few of the current and emerging for a while, but now thanks to shrinking electro-
flexible PCB industry. wearable products that contain flexible circuitry. nics there are collars that contain GPS and mobile
Wrist-Worn Activity and Body Function Monitors: phone capabilities. Today a lost pet can use the GPS
Electronic watches were some of the first wearable to figure out where he is and call his owner for a

If an electronic device is going to be worn on the body comfortably, it has to be flexible. So what
better way to provide interconnects for these types of devices than a flex circuit?
electronics, so it was just a natural progression to ride home! Not really, but if your pet is wearing one
include more advanced functionality than just time of these devices he is never truly lost. The mobile
keeping. Wrist-worn activity monitors are light phone module is used to transmit the GPS coordi-
weight and use multiple axis accelerometers and nates to tracking service, where the owner can log
other sensors to detect motion and body functions. on and track the pet’s location to within a few feet.
They can capture and record daily activity levels as Clothing Worn Electronics: This is an area that
well as sleep cycles. This data is stored in on-board is just starting to emerge, and new technology
memory in the device until it can be downloaded to is being developed to support these applications.
the user’s mobile phone. Since the human hand is Standard flex circuitry is constructed from a com-
larger than the wrist, these monitoring bands need bination of polyimide film, thermo-setting film ad-
to be able to expand when the user is putting it on hesive, and copper foil. Unfortunately, flex circuits
or taking it off. Flexible circuits allow the band to fabricated with these materials will not survive
flex while maintaining connectivity across flexing the crumpling that they would be exposed to in a
sections. washing machine. I have seen several applications
Foot-Worn Sensors: I have seen a lot of applica- where flex has been incorporated into clothing that
tions recently for electronics that are worn on the does not need to be machine washed (e.g., flexible
foot or inside the shoe. Foot-worn electronics mo- heaters in winter gloves). The key to making this
nitor everything from steps taken when running or type of wearable application machine washable is
walking to stride irregularities that can contribute to make the flex circuit not only flexible, but also
to back problems. These sensors need to be very stretchable. This means that both conductors and
thin in order to be comfortable and also very robust dielectrics must be developed that will allow the
to survive in what I would consider a pretty hostile finished product to stretch and still maintain elec-
environment. Flexible circuitry is thin enough to lay trical continuity. This technology is not mainstream
on the sole of a shoe and be almost undetectable yet, but it is on its way.
to the wearer. These examples are just a small sampling of the
Wearable Baby Monitors: Baby monitors are applications that are currently on the market, and
one of the newer products in the wearable elec- there are many others in development. As more
tronics market. New parents no longer have to rely and more of these applications emerge, flexible cir-
on a simple walkie talkie system to keep tabs on cuitry will continue to be the interconnect method
their little ones while they sleep. These monitors of choice.
CC Vault
Unlock the power of embedded design.

This pocket-sized vault comes fully loaded with every issue of Circuit Cellar
magazine and serves as an unparalleled resource for embedded hardware
and software design tips, schematics, and source code.

From green energy design to ‘Net-enabled devices, maximizing power to


minimizing footprint, CC Vault* contains all the trade secrets you need to
become a better, more educated electronics engineer.

A vault of need-to-know information in the fields of embedded


hardware, embedded software, and computer applications

*CC Vault is a 16-GB USB drive.

Order yours today! cc-webshop.com


We bring the full range of Electronic Contract
Manufacturing services to your fingertip!
FABRICATION ASSEMBLY KEYPADS

ENCLOSURES

This is the only place where you would put all


your eggs in one basket to get fastest time to
market. From concept design to prototype to
full turnkey production on all your
electronic products.

Imagineering

Winner
Family Entrepreneurship
Award 2014

www.PCBnet.com
847-806-0003 sales@PCBnet.com
Certified Woman-Owned Small Business

You might also like