Circuit Cellar 2014.11
Circuit Cellar 2014.11
NOVEMBER 2014
                                                                   circuitcellar.com                                                                                                                                                                                                               ISSUE 292
                                                                  circuit cellar
REPEAT: Analog. Still. Matters.
Analog. Still. Matters. Analog. Still. Matters.
Analog. Still. Matters.                                                                                 Analog. Still. Matters. Analog. Still. Matters. Analog. Still. Matters.
Analog. Still. Matters.          A na lo g . S till. M atte rs. A n alo g . S till. M a tters. Analo g . S till. M a tters. A n a lo g . S till. M a tte rs . A n a lo g . S till. M a tte rs . A n a lo g . S till. M a tte rs . A n a lo g . S till. M a tte rs . A n a lo g . S till. M a tte rs . A n a lo g . S till. M a tte rs.
    $ 9 . QOUS   $ 1 0 . OOCAN                                                  CC Present & Future |Q&A: Designing "Little Robots"                                                                                                                                                     Build a Control
                                     1 1>
                                                                                        Display Component |MCU-Based Ultrasonic Wayfinder |DIY BP Monitor
                                                                       > MOD5270
                                                                          147.5 MHz processor with 512KB Flash & 8MB RAM • 47 GPIO
                                                                          3 UARTs • l2C • SPI
                                                                       > MOD5234
                                                                         147.5 MHz processor with 2MB flash & 8MB RAM • 49 GPIO ■3 UARTs
                                                                         l2C • SPI • CAN • eTPU (for I/O handling, serial communications, *
                                                                         motor/timing/engine control applications)
                                                                       > MOD54415
                                                                         250 MHz processor with 32MB flash & 64MB RAM ■42 GPIO • 8 UARTs
                                                                         5 l2C • 3 SPI • 2 CAN • SSI ■8 ADC • 2 DAC • 8 PWM • 1-Wire8 interface ,
                                                                       > NAN054415
                                                                         250 MHz processor with 8MB flash & 64MB RAM • 30 GPIO • 8 UARTs
                                                                         4 l2C ■3 SPI • 2 CAN ■SSI ■6 ADC • 2 DAC • 8 PWM • 1-Wire8 interface
S Add Ethernet connectivity to an existing product, or use it as your product's core processor
    The goal: Control, configure, or monitor   The method: Create and deploy applications from        The result: Access device from the
    a device using Ethernet                    your Mac or Windows PC. Get hands-on familiarity       Internet or a local area network (LAN)
                                               with the NetBurner platform by studying, building,
                                               and modifying source code examples.
        and to monitor a company's communications assets. For a very                        to customize any aspect of operation
        low price point, this module solves the problem of                                  including web pages, data filtering, or
        network-enabling devices with 10/100 Ethernet, including                            custom network applications. The kits
        those requiring digital, analog and serial control.                                 include all the hardware and software you
                                                                                            need to build your embedded application.
        MOD5270-100IR.........$69 (qty. 100) NNDK-MOD5270LC-KIT............ $99
        MOD5234-1001R.........$99 (qty. 100) NNDK-MOD5234LC-KIT.......... $249              > For additional information please visit
        MOD54415-1001R.......$89 (qty. 100) NNDK-MOD54415LC-KIT......... $129                  http://www.netburner.com/kits
        NAN054415-200IR...$69 (qty. 100) NNDK-NAN054415-KIT............. $99
                     MIXED SIGNAL
                     OSCILLOSCOPES
       4 ANALO G + 16 DIGITAL CHANNELS
   RAPIDLY DEBUG COMPLEX MIXED SIGNAL DESIGNS
    • USB 3.0                                                                '4 -------------------------------
    • ULTRA DEEP MEMORY
    • SEGMENTED MEMORY
    • RAPID TRIGGERS
3204D MSO 3205D MSO 3206D MSO 3404D MSO 3405D MSO 3406D MSO
Call:1.800.591.2796 www.picotech.com/pco529
2   CIRCUIT CELLAR • NOVEMBER 2014 #292
    C I R C U IT C E L L A R ® (ISSN 1 5 2 8 -0 6 0 8 ) is p u b lis h e d m o n th ly by:                     In the first edition of Circuit Cellar magazine in 1988, founder Steve Ciarcia ran an
                                                                                                           editorial titled "Inside the Box Still Counts." The argument was that too many engineers
                                       C ir c u it C e lla r, Inc.
                              111 F o u n d e r s P laza , S u ite 300
                                                                                                           and so-called IT professionals were regarding PCs as mere "appliances." In fact, many
                                  E a st H a rt fo r d , C T 06108                                         were openly arguing that the electronics "inside the box" didn't matter. Ciarcia noted
                                                                                                           that he'd heard a PC salesman say, "Real computer people don't want to know what's
    P e rio d ic a l ra te s p a id at E a st H a rtfo r d , CT, an d a d d itio n a l o ffice s.
       O n e - y e a r (12 issu es) s u b s c r ip t io n ra te U S a n d p o s s e s s io n s
                                                                                                           inside the box and don't care."
      $ 50, C a n a d a $ 65, F o re ig n / R O W $75. All s u b s c r ip tio n o rd e r s                     A somewhat similar argument is made today regarding analog technology. If you
      p a y a b le in U S fu n d s o n ly v ia V is a , M a s te r C a rd , in te r n a tio n a
                                                                                                           pick up the tech section of almost any newspaper, electronics magazine, or book on
               p o sta l m o n e y o rd e r, o r c h e c k d ra w n on US b ank.
                                                                                                           the subject of modern technology, you'll surely read various analyses about "our digital
                                        S U B S C R IP T IO N S
                                                                                                           world" of 1s and 0s. The problem, of course, is that too many of us regard digital as
                                                                                                           "new" and analog as "old." Others see digital as high tech and analog as low tech.
            C ir c u it C e lla r, P.O. B o x 4 6 2 2 5 6 , E s c o n d id o , C A 9 2 0 4 6
                                                                                                               For this issue, we asked Columbia University electrical engineering professor Peter
                        E - m a il: c ir c u it c e lla r @ p c s p u b lin k .c o m
                                                                                                           Kinget to write an essay on the state of analog technology and its relevance for current
                                     P h o n e : 8 0 0 .2 6 9 .6 3 0 1
                                                                                                           and future engineers. On page 80, he presents a realistic take on the state of analog and
                                I n t e r n e t : c ir c u itc e lla r .c o m
                                                                                                           digital technologies. He also points to the relevance of devices like analog sensors and
      A d d r e s s C h a n g e s / P r o b le m s : c ir c u itc e lla r @ p c s p u b lin k .c o m
                                                                                                           interfaces within the quintessential "digital" systems of our day— mobile devices.
                       P o s t m a s t e r : S e n d a d d r e s s c h a n g e s tc                            Now let's turn to the rest of this issue.
            C ir c u it C e lla r, P.O. B o x 4 6 2 2 5 6 , E s c o n d id o , C A 9 2 0 4 6                   On page 8 we run an interview with Rome, Italy-based electronics enthusiast
                                                                                                           Alessandro Giacomel. We're fascinated by his interest in "little robots" and we found the
                                          A D V E R T IS IN G
                                                                                                           projects posted on his website to be worth a closer look.
                            S t r a t e g ic M e d ia M a rk e tin g , Inc.                                    Turn to page 18 for Jerry Brown's article on a microcontroller-based control display
                     2 M a in S tr e e t, G lo u c e s te r, M A 0 193 0 U S A
                                                                                                           component. It's used in an innovative traffic-monitoring system.
                                     P h o n e : 9 7 8 .2 8 1 .7 7 0 8
                                                                                                               Interested in echolocation? Check out the article "Ultrasonic Wayfinder" (p. 26),
                                       F a x : 9 7 8 .2 8 1 .7 7 0 6
                                                                                                           which details a project that uses the principle of echolocation to assist visually impaired
                       E - m a il: c ir c u itc e lla r @ s m m a r k e tin g .u s
              A d v e r t is in g ra te s an d t e r m s a v a ila b le on re q u e s t
                                                                                                           individuals.
                                          N e w P ro d u c ts :
                                                                                                               On page 34, a team of university students describes its microcontroller-enabled
       N e w P ro d u c ts , C ir c u it C ellar, 111 F o u n d e r s P laza , S u ite 300                 optical blood pressure sensor system. The design detects volumetric changes in blood.
    E a st H a rtfo r d , C T 0610 8, E-m a il: n e w p r o d u c ts @ c irc u itc e lla r .c o m              Tracking power consumption and energy costs are among the most important tasks
                                                                                                           for data center admins. On page 47, Ayse Coskun addresses the "power budgeting" issue.
                                           H E A D O F F IC E
                                                                                                               George Novacek covered resistors and capacitors in recent articles. This month he
               C ir c u it C e lla r, Inc. 111 F o u n d e r s P la z a , S u ite 300
                                                                                                           investigates inductors and covers the basics (p. 52).
                                  E a st H a rt fo r d , C T 0610 8
                                     Phone: 8 6 0 .2 8 9 .0 8 0 0
                                                                                                               Ed Nisley has been upgrading a sewing machine with speed control, lighting, and
                                                                                                           needle positioning. On page 58 he describes how he converted the foot pedal and more.
                                   CO VER PHO TO G R APH Y                                                     If you found Jeff Bachiochi's October article on embedded voice recognition useful,
                      C h r is R a k o cz y , w w w .ra k o c z y p h o to .c o m
                                                                                                           you're in for a treat. This month he explains how to add and access sound files (p. 66).
                                                                                                               Lastly, be sure to check out the top eight winning projects from the WIZnet Connect
                                     C O P Y R I G H T N O T IC E                                          the Magic 2014 Design Challenge on page 68. Congratulations to all the winners!
       E n tir e c o n te n ts c o p y rig h t © 2014 by C ir c u it C e lla r, Inc. All
       r ig h t s re s e r v e d . C ir c u it C e lla r is a r e g is te re d tr a d e m a r k of
      C ir c u it C e lla r, Inc. R e p ro d u c tio n o f th is p u b lic a tio n in w h o le             C. J. Abate
     o r in p a r t w it h o u t w r itte n c o n s e n t f r o m C ir c u it C e lla r, Inc. is
                                             p ro h ib ite d .                                             cabate@ circuitcellar.com
D IS C L A IM E R
           C ir c u it C e lla r ® m a k e s no w a r r a n t ie s an d a s s u m e s no
          r e s p o n s ib ilit y o r lia b ility o f a n y k in d f o r e r r o r s in th e se          THE TEAM
         p r o g r a m s o r s c h e m a tic s o r f o r th e c o n s e q u e n c e s o f any
       s u c h e r ro r s . F u r th e r m o r e , b e c a u s e o f p o s s ib le v a r ia tio n ir
       th e q u a lity a n d c o n d itio n o f m a t e r ia ls an d w o r k m a n s h ip o f
                                                                                                         E D IT O R -IN -C H IE F                (Green Co m p uting ), Bob       FO U N D ER
        r e a d e r -a s s e m b le d p ro je c ts , C ir c u it C e lla r ® d is c la im s a n y
        r e s p o n s ib ility f o r th e s a fe an d p ro p e r f u n c tio n o f re a d e r-
                                                                                                         C. J. A bate                            Japen ga (Em bedded              Steve C iarcia
    a s s e m b le d p ro je c t s b a se d u p o n o r f ro m p la n s, d e s c rip tio n s , o r
                     in fo r m a tio n p u b lis h e d by C ir c u it C e lla r® .                       A R T D IR ECTO R                       in Thin Slices), R ob ert        PR O JE C T ED ITO RS
OUR NETWORK
SUPPORTING COMPANIES
ExpressPCB 39 Oscium 51
CONTENTS
circuit cellar
    ANALOG
    TECHNIQUES
           CC COMMUNITY                                             FEATURES
    06 : CC WORLD                                               18 : MCU-Based Control Display Component
                                                                By Je rry Brown
    08 : QUESTIONS & ANSWERS                                    A DIY microcontroller-based CDC for a traffic-
    Robotics & Intelligent Gaming                               monitoring system
    An Interview with Allesandro Giacomel
    A Rome, Italy-based roboticist and blogger on his           26 : Ultrasonic Wayfinder
    "little robotics" projects, DIY games, and more             Echolocation for the Visually Impaired
                                                                By Shane Soh & Eileen Liu
                                                                The wayfinder system comprises a head-mounted
           INDUSTRY & ENTERPRISE                                navigation unit and a hand-mounted tactile sensor
     16 : PRODUCT NEWS
                                                                34 : The Pressure Is On
     17 : CLIENT PROFILE                                        Microcontroller-Based Blood Pressure Monitoring
     EMAC, Inc. (Carbondale, IL)                                By Randy Song & Alexander Ngai
                                                                Use a microcontroller and optical sensors to detect
                                                                volumetric changes in blood
                                                                    COLUMNS
                                                                46 : GREEN COMPUTING
                                                                Budgeting Power in Data Centers
                                                                By Ayse Coskun
                                                                An analysis of the power budgeting problem facing data
                                                                centers
CONTENTS
THE ULTRASONIC W AYFINDER SYSTEM TOP PROJECTS FROM THE W IZNET IoT DESIGN CHALLENGE
CC WORLD
Go to: CircuitCellar.com/circuit-cellar-newsletter-subscribe/
 WE DARE YOU.
    -_r BEST W fc?
                                    OUR GUARANTEE:
                          We are so confident in our PCB pricing,
     PCB PRICES
                              we dare you to find lower prices!
        IN THE
    “ INDUSTRY       v    If you do, we will match the price AND
                          give you $100 towards your next order!
■- ----------------
       Visit us at www.PCB4u.com
and see why our pricing can not be beaten!
 * From sam e day quick turn prototype to
   production in under 10 days
 * Full CAD a n d C A M review plus design rule check
   on ALL G erber files
 * Materials: Fr4, Rigid, Flexr M eta l Core (Aluminum),
   Polym idet Rogers, Isola, etc.
 * HD I Capabilities: Blind/Buried Mocrovias,
   10+N+10, Via-ln-Pad Technology,Sequential
   Lamination, Any Layer, etc,
 * Our HD I Advantage: Direct Laser Drilling, Plasm a
   D e -S m e ar Technology, Laser M icro via
   Conductive Plate Shut, etc.
 www.PCB4u.com ■ sales@PCB4u.com *
        8     CIRCUIT CELLAR • NOVEMBER 2014 #292
                                                        CIRCUIT CELLAR: How long have you been                The design included m odified servom otors
                                                        designing embedded systems and what                   that can rotate 360° moving the robot and
                                                        sparked your interest?                                connected to the wheels and a servom otor to
                                                                                                              move a little head where there is an ultrasonic
                                                        ALESSANDRO: I have been designing embedded            distance sensor. The distance sensor lets you
                                                        system s for about five years. My interest arose      know when the robot is in front of an obstacle
                                                        from the possibility of building robots. When I       and helps you decide the most convenient way
                                                        was a kid, I found robots extrem ely fascinating.     for the robot to escape.
                                                        The ability to force m atter to do som ething we          In its sim plicity, this robot enables one to
                                                        decided always seemed to be one of the main           understand the basics for the developm ent
                                                        goals conceded to man.                                of a m icrocontroller-based robot: the need to
                                                                                                              have separate power supplies for the m otors'
                                                        CIRCUIT CELLAR: Tell us about your first              power circuits and for the m icrocontroller's
                                                        design.                                               logic, the need to have precise sensor reading
                                                                                                              tim ing, and the im portance of having efficient
                                                        ALESSANDRO: My first em bedded system was             algorithm s to ensure that the robot moves in
                                                        an Arduino 2009. The availability of a huge           the desired mode.
                                                        shield, sensors, and actuators has enabled me             My first robot took me a long tim e to build.
                                                        to design many applications at an acceptable          But all the elements of the robot (hardware and
                                                        price for an am ateur like me.                        software) were developed by me and this was
                                                            I started like many people, w ith a robot         im portant because it let me begin to face the
                                                        on wheels moving around avoiding obstacles.           real problem s that arise when you are building
                                                        It's a standard robot that alm ost all beginners      a robot. Today there are many resources on
                                                        build. It's sim ple because it is built with only a   the Internet that enable one to build a robot
                                                        few com ponents and a standard Arduino 2009.          sim ply replicating a set of steps anyone has
                                                                                                              described. These guides should be used as a
                                                                                                              source of inspiration, never followed exactly
                                                                                                              step-by-step, otherw ise—while in the end it is
                                                                                                              true that you can build a robot—you don't own
                                                                                                              the knowledge of what has been done.
                                                                                                                  My robot evolved with the a b ility to speak,
                                                                                                              thanks to a sound module. When I build a
                                                                                                              robot the goal is always to experim ent with a
                                                                                                              technology and to have fun. My frien ds have
                                                                                                              enjoyed seeing the robot turning around,
                                                                                                              speaking, and telling funny stories.
                                                                                                                                                                               COM M UNITY
beginner— inexpensive and robust.
    The community has developed thousands
of applications that can be reused. When I
started the blog in 2011, I was building small
robots for a few years. In the beginning, finding
information was much more complicated and
there were few shields that were not cheap.
So, I always tried to use "poor" materials (e.g.,
                                                                                                            A le s s a n d r o 's f ir s t ro b o t a t th e A r d u m c
recovered or recycled). Decreasing the cost of             Initially, I built robots to understand how
                                                                                                            D ay 2011 event
implementation and reusing and imagining new          the driver for the m otors w orks, the sensors,
purposes for the things already available in a        and the problem s related to the logic of the
normal house seemed like a good way to work.          robot. A fterw ard, the first branch of research
    My achievem ents docum ented in the blog          was the issue of control, how to set the
are never step-by-step guides to build the            proportional, integral, derivative (PID) control
robot. I include a list of com ponents to buy,        to follow a line or make a robot that is in
the source code, and som etim es the w iring          balance. This has enabled me to address the
diagram . But I never provide a complete              m anagem ent of com plex sensors, such as the
guide, since I think everyone should try to           inertial m easurem ent unit (IMU).
build their own robot because, once built, the            To have a robot balance on two w heels it
satisfaction is enormous.                             is im portan t to m easure how much the robot
    Through my blog I am available to help            is tilting from the vertical. To do this, typically
with problem s people encounter when they             a cluster of sensors is used, called IMU,
are building robots, but I think it is im portant     w hich are based on m ulti-axes com binations
to give people the tools to build, rather than        of precision gyroscopes, accelerom eters,
providing detailed explanations. Everyone
can learn only by fighting the difficulties,
w ithout having som eone preparing everything
perfectly.
Welcome to Planet e.
The entire em bedded universe at a single location!
                                              .       electrónica
E lectronic C o m p o n e n ts , Systems
and A p p lic a tio n s                                                     2014
M esse M ü n ch e n
N o ve m b e r 11-14, 2014                                  inside tomorrow
w w w . ele c tro n ic a .d e
   12         CIRCUIT CELLAR • NOVEMBER 2014 #292
    71
             Technologic
               Systems                                                CALL 480-837-5200
www.embeddedARM.com
                                                     Pricing
                                                    starts at
                                                    $99
                                                     Q t y 100
                                                   $134
                                                      Qty 1
                                                                    Pricing starts at
                                                                                                          (Shown with all options)
                                                                  s i 5 9 $203
    1 GHz Single or Quad Core Cortex A9 ARM CPU                     Qty 100        Qty 1
    -40 °C to 85 °C Industrial Tem perature Range                 ■ 1x microSD Socket          24 VAC or 8-24 VDC Power
    Runs Linux 3.10, Debian, U buntu, Yocto, QT, OpenGL           ■ 2x 10/100 Ethernet         DIO, CAN, M odbus, Relays
    Coming Soon: QNX, A ndroid and W indow s Support
                                                                  B e n e fits :
         Com puter-on-M odules                                    ■ Low pow er and low cost industrial grade SBC
     State of the Art Embedded Design                             ■ Rugged 24-Pin screw term inal connector
&   TS-4740: High Capacity FPGA and G igabit Ethernet             ■ Flexible pow er inputs including AC and DC
    TS-4600: 450 MHz lo w cost w / 2 Ethernets
    TS-4710: Up to 1 GHz PXA168 w / video                         ■ Wireless data aquisition via WiFi and Bluetooth
    TS-4720: Like TS-4710 + 2 GB eMMC Flash & 2 Ethernets         ■ 30 V to leran t DIO, analog IO, 3 A relays, and more
    TS-4200: Atm el ARM9 w / super lo w power                     Also Available:
    TS-4800: 800 MHz FreeScale iMX515 w / video                   TS-7670 Low Power SBC with GPS Radio & Cell Modem
                                         www.embeddedARM.com
   14         CIRCUIT CELLAR • NOVEMBER 2014 #292
                                                        Program m ing these servos is more             the long term. Instead, building a robot or a
                                                    com plicated than standard servom otors. In        machine capable of interacting with a person
                                                    fact, each bit has a sp ecific m eaning. I wrote   has a very different impact. It enables people
                                                    som e lib ra rie s for A rduino to m anage these   not only to watch, but to experience. Added to
                                                    servos. This enables one to deal with low-         this, there is the playful side, which enables
                                                    level program m ing, w here it is necessary        one to deal with the technology without fear,
                                                    to evaluate the checksum for exam ple,             breaking down the walls of suspicion that a
                                                    and, according to the conventions used, set        person with no technical skills has. Sim plicity
                                                    the byte with the big-Endian or the little-        is the other key to successfully interact with
                                                    Endian convention. This is an unusual way to       people. The games and the robots must be
                                                    program w orking with Arduino, w here these        easy to understand and relate to people in the
                                                    com plexities are masked by the IDE, but           way they are accustomed. That's why these
                                                    the interaction w ith the low-level hardw are      m achines w ill have the ability to speak—thanks
                                                    enables a better understanding of how the          to an MP3 chip and 4D Systems's SOMO-14D
                                                    m icro co ntro lle rs work.                        embedded audio sound module—and will be
                                                        I'm w orking w ith new sensors, such as        equipped with an LCD and LEDs.
                                                    Freescale       Sem iconductor's    MPR121QR2.
                                                    The MPR121 is a capacitive-touch sensor            CIRCUIT CELLAR: What         new   technologies
                                                    controller driven by an I2C interface. The chip    excite you and why?
COM M UNITY
HFTIflfEST
ÍPisrftjT
M o u se r a nd M o u s e r E le ctro n ics a re re g istere d tra d e m a rk s o f M o u s e r E le ctron ics, Inc. O th e r p ro d u c ts , logos, a nd c o m p a n y n am es m e n tio n e d herein, m ay be tra d e m a rk s o f th e ir re sp e ctive o w ners.
  16           CIRCUIT CELLAR • NOVEMBER 2014 #292
PRODUCT NEWS
               W AVESURFER 3 0 0 0 OSCILLOSCOPES
               FEATURING MAUI UI
                    Teledyne LeCroy re ce n tly in tro d u ce d the W aveSurfer
               3000 se rie s of o sc illo sc o p e s fe a tu rin g the MAUI advanced
               u ser in te rfa ce . The user in te rfa c e , w hich w as p re v io u sly
               a v a ila b le only on high e r-e n d o sc illo sc o p e s, in te g ra te s
               a deep m e a su re m e n t to o lse t and m u lti-in s tru m e n t
               c a p a b ilitie s.
                    The o sc illo sc o p e 's fe a tu re s include:
                   The MAUI advanced user in te rfa c e puts the o scillo sco p e 's                                                                T e le d y n e Le C ro y
               pow er and fu n c tio n a lity at y o u r fin g e rtip s . E a sy-to -u se                                                           te le d y n e le cro y .c o m
               to u ch scre e n co n tro ls enab le you to p o sitio n and zoom
               w ave form s, move c u rso rs, co n fig u re m e a su re m e n ts, and
               in te ra c t w ith re su lts.
               STATEMENT REQUIRED BY THE ACT OF AUG U ST 12, 1970, TITLE 39, UNITED STATES CODE SHOWING THE OWNERSHIP, MANAGEMENT AND CIRCULATION OF CIRCUIT CELLAR, THE MAGAZINE FOR COMPUTER APPLICATIONS.
               Published m on thly at 111 Founders Plaza, Suite 300, East Hartford, CT 06108. Annual sub scrip tio n p rice is $50.00. Publisher: Hugo Van haecke. The ow ner is C irc u it Cellar, Inc., East Hartford, CT 06108. The nam es anc
               addresses of stockholders holding one percent o r m ore of the total am o unt of stock are: Elektor International Media, LLC, 111 Founders Plaza, Suite 300, East Hartford, CT 06108. EXTENT AN D NATURE O F CIRCULATION:
               A verag e n u m b e r o f cop ies o f each issue p ublished d u rin g the p re ced ing tw elve m onths; (A) total n u m b e r of copies printed , 12,544; (B.1) p aid/re que sted m ail su b scrip tio n s, 5,434; (B.3) sales thro ug h d ealers and c a rrie rs,
               street v end o rs and c o u n ter sales, 3,736; (B.4) p aid/re que sted copies d istrib u te d by o th e r m ail classes, 10; (C) total p aid/re que sted circu latio n , 9,180; (D.1) sam p les, c o m p lim e n ta ry , and o th e r nonrequested copies, 2,153,
               (D.4) Nonrequested copies d istrib u te d outsid e the m ail, 1,212; (E) total nonrequested d istrib u tio n (sum of D.1 & D.4), 3,365; (F) total d istrib u tio n (sum o f C & E), 12,545; (G) cop ies not d istrib u te d (office use, leftover,
               u naccounted, spoiled after p rin tin g , re turns fro m new s agents), 2,568; (H) total (sum o f F & G), 15,113. Percent Paid Requested: 73% A ctual n u m b e r o f cop ies o f a single issue p ublished nearest to filin g date: (A) total
               n u m b e r of copies p rinted , 11,350; (B.1) p aid/requested m ail su b scrip tio n s, 5,146; (B.3) sales thro ug h d ealers and c a rrie rs, street vend o rs and c o u n ter sales, 3,710; (B.4) p aid/requested cop ies d istrib u te d by o th e r m ail
               classes, 10; (C) total p aid/re que sted c ircu la tio n , 8,856; (D.1) sam p les, c o m p lim e n ta ry , and o th e r nonrequested copies, 2,109; (D.4) Nonrequested copies d istrib u te d outsid e the m ail, 200; (E) total nonrequested d istrib u tio n
               (sum o f D.1 & D.4), 2,309; (F) total d istrib u tio n (sum o f C & E), 11,165; (G) cop ies not d istrib u te d (office use, leftover, unaccounted, spoiled a fte r p rinting , re tu rn s fro m new s agents), 2,597; (H) total (sum o f F & G),
               13,762. Percent Paid Requested 79% . I c e rtify tha t the sta te m e n ts m ad e by m e above are c o rre ct and com plete. Hugo Van haecke, Publisher.
                                                                                                                            circu itc el lar .c om   17
CLIENT PROFILE
EMAC, Inc.
w w w . em acinc. com
2390 EMAC Way, Carbondale, IL 62902
                                                                                                                                                          INDUSTRY
OF INTEREST TO CC READERS: The iPAC-9x25 is a low-power
PC/104-sized SBC for use in em bedded data acquisition and           SPECIAL OFFER: EMAC is o ffering in sta lla tio n of EMAC OE
control applications. The board has an industrial tem perature       Linux pre-installed on the iPAC-9x25, along with integration,
                                                                                                                                                          & ENTERPRISE
range of -40°C to +85°C and is powered by an Atmel SAM9X25           test, and enhanced support. Promo code: CIRCUITCELLAR
ARM9 processor. It comes standard with 4-GB eMMC, 16-MB
of serial data flash, and 128 GB of DDR RAM. With PWM, A/D,          Circuit Cellar prides Itself on presenting readers with information
a battery-backed real-tim e clock/calendar, an external reset        about innovative companies, organizations, products, and
button, and an abundance of I/O, the iPAC-9x25 is the perfect        services relating to electrical engineering and embedded systems
choice for engineers and designers looking for a web-enabled         technology. In this space, Circuit Cellar enables clients and
SBC for equipm ent m onitor and control applications.                sponsors to present readers product info, special deals, and more.
18 C IR C U IT C E LL A R • N O V E M B E R 2 0 1 4 # 292
           MCU-Based
           Control Disp lay
FEATURES
           Component
                                       i »,     h
laser diodes in the tra n sm itter continually     Functionally, the CDC had to be capable
em it a pair of parallel beams a sm all distance   calculating speed to w ithin ±1 mph of all
above the road surface, and the beams are          vehicles passing through (i.e., "interrup ting")
aligned so that they im pinge on the two           the laser beam pair. In addition, the CDC had
photo sensor arrays in the receiver across         to be able to determ ine the direction of travel,
the road. When a vehicle passes through the        the tim e the valid interruption occurred,
                                                                                                                                                                               FEATURES
m onitoring location, one beam is interrupted      and the cum ulative count for all vehicles
and, a sh ort tim e later, the second beam is      interrupting the laser beam pair during a
interrupted. The CDC electronics and softw are     manned or unmanned test session. A real
accurately m easures the tim e differential        tim e GUI (i.e., the LCD) and a keypad were
between the sequential beam interruptions to       also required, as was nonvolatile m em ory
determ ine vehicle speed and, depending on         (CFM card) to store all the traffic pattern data
which beam is interrupted first, determ ines       obtained during a traffic-m onitoring session.
the direction of travel. The CDC—which
counts the passing vehicles accum ulatively        CDC OPERATION
and calculates and displays vehicle speed,              Photo 1 shows the actual prototype CDC's
direction of travel, and tim e of event on an      user interface (i.e., LCD, keypad, three status
LCD— is electrically connected to the receiver.    LEDs, and the three control switches). The LCD
All traffic-m onitoring data including the time    is the GUI that provides a visual representation
of each interruption event is recorded on a        of the data being entered into the CDC by the
Com pact Flash Mem ory (CFM) card w ithin the      operating technician as well as all the traffic
CDC for later review and analysis in an Excel      pattern data. The LCD is daylight readable. In
spreadsheet or other data analysis program .       norm al operation, the receiver provides 12-V
In addition, the CDC has an alphanum eric          electrical power to the CDC. If the receiver
keypad w hereby the set-up technician can          battery is between 10 and 12 V, the Battery
enter four initial param eters (Date, Location,    Status LED will display green. If the battery
Map Book Page, and Map Book Coordinates),          voltage falls below 10 V, the Battery Status LED
which are downloaded to the CFM card as the        will display red. If the battery is below 10 V,
"Header File."                                     it must be recharged to the full 12 V before
    The     TMS    system -level   requirem ents   system operation can continue.
established by my colleague drove the CDC               The sensor status LEDs provide the status
level requirem ents which I documented.            of the receiver's left and right sensors. In
Specifically, the CDC had to be of a size and      the Align and Test modes, the Right and Left
w eight so that it could be easily hand carried.   sensor status LEDs will display green if the
Inexpensive off-the-shelf com ponents were to      tra n sm itter's Right and Left laser beams are
be utilized to the m axim um extent possible in    properly aligned with the receiver's associated
the design and fabrication of the CDC. Power       sensor, indicating a "h ig h " or Logic 1. If the
consum ption needed to be kept to a m inim um .    laser beam is not properly aligned with the
                                                                                                       FIGURE 1
                                                                                                       The             t r a f f ic - m o n it o r in g        s y s te m
in c lu d e s a la s e r beam tr a n s m it t e r ,
                             [ Dat*:                                            011414
                             |Location:                                         93010                                                      1   A l l an Mode
                             I TR F-3r30 s                                      494
FEATURES
Coords: B.5?4.bg |
           PHOTO 2
           T h e to p -le ft s c re e n (a) d is p la y s th e In itia l P a r a m e te r e n trie s . T h e t o p - r ig h t s c re e n (b)
           s h o w s th a t th e C D C is in th e A lig n M o d e a n d th e s e n s o r s ta tu s L ED s in d ic a te th a t n e ith e r
           t r a n s m it t e r la s e r b e a m is a lig n e d w ith th e a s s o c ia te d re c e iv e r s e n s o r. In th e b o tto m -
r ig h t d is p la y (c), th e s e n s o r s ta tu s L E D s in d ic a te th a t bo th L a s e r b e a m s a re alig n e d .
                                                                             associated sensor or a previously aligned                             STBY position, the CDC is in the Align mode.
                                                                             beam is being interrupted (e.g., by a passing                         In the Align Mode, no traffic pattern data is
                                                                             car), then the associated Sensor Status LED                           generated, but the sensor status LEDs are
               ABOUT THEAUTHOR                                               will display red indicating a "lo w " or Logic 0.                     functional. The operating technician uses the
               Jerry Brown is a Camaril                                     When the laser beam is properly aligned with                          Align mode when aligning the tran sm itter
               lo, CA-based aerospace/                                       the associated sensor or the interruption of                          laser beams to the receiver detectors. When
               electrical engineer who                                       a previously aligned beam is removed, the                             both sensor status LEDs display green, the
               retired from the indus                                       Sensor Status LED w ill again display green                           system is properly aligned. Once aligned,
               try about five years ago.                                     (see Photo 2).                                                        the CDC mode sw itch is moved to the Run
               Since then, he has worked                                         The operating technician can enter up                             position, putting the CDC in the Test mode. In
               as a consultant for a lo                                     to four initial param eters (IPs) using the                           Test mode, the CDC generates and records on
               cal aerospace firm and as                                     alphanum eric keypad. Norm ally, a key press                          the CFM card the traffic pattern data when the
               a math tutor. He has also                                     will enter a num eric value except when the                           tra n sm itter laser beam pair is m om entarily
               worked on numerous "in                                       map coordinates for the test session location                         interrupted by a passing vehicle.
               house" (i.e., his garage                                      are entered. For that value, an alphabetical                              The CDC Display sw itch turns the LCD
               "lab") electronic projects.                                   character ("A" through "J") is entered depending                      backlight and front panel status LEDs on or
               Jerry holds a BS in Electri                                  on which key is pressed (see Photo 2). The                            off. When in the On position, the LCD and
               cal Engineering and a BS                                      keypad is also used to set/reset the on-board                         status LEDs are functional. When the sw itch is
               in in Business Administra                                    real-tim e clock (RTC).                                               in the Display position, the LCD backlight and
               tion from California Poly                                        The CDC main power sw itch turns power                            front panel status LEDs are turned off in order
               technic State University in                                   (12 V, ~350 mA) to the CDC on and off when the                        to save battery power. Power consum ption
               San Luis Obispo, CA. His                                      CDC is connected to the receiver via the DB-9                         goes from ~320 mA when the LCD the Display
               interests include photog                                     connector or is being powered externally by a                         sw itch is in the On position to ~200 mA when
               raphy, electronics, science                                   12-V source plugged into the CDC's external                           the sw itch is in the Display (Off) position.
               and anything Apple.                                           power port.                                                               The receiver and CDC pair are self-powered
                                                                                 When the CDC mode sw itch is in the                               by a 12-V, 18-Ah rechargeable, sealed lead
                                                                                                                                                                                                                                                        c ir cu itc e ll ar .c om       21
                                                                                                                                                                                                            FIGURE 2
                                                                                                                        1     2       3   t                                  Real-tim e                     The       C D C 's      fu n c tio n a l      b lo c k    d ia g r a m
                                                                                                                                                      Real tim e
                                                                                                LCD                     4     5       6                                    clo ck m odule
                                                                                                                                                    clo ck m odule                                          show s           th e       tw o           m ic r o c o n tr o lle r s ,
                                                                                                                        7     8       9   2nd
                                                                                                                                                                                                            u se r     in te r f a c e ,    and          th e    s u p p o r t in g
                                                                                                                       Clr    0 Help Entr
                                                                                                                                                                                                            f u n c tio n a lit y
                                                                                                      I2C Data
                                        -H *—
                                                                                                                                                                                                                                                                                         FEATURES
   P1                                                                                                                                                                    M ath
             1                                                                                                                                                                                M ath
                                          H -U -T         R B eam _In                                 I2C C lock                                                     co pro ce sso r
             6                                                                                                                                                                            co pro ce sso r
                                                                                                        C rystal oscilla tion
                                                                                                              40 M H z
                                                                                                 TX
                                                                            P IC 18 F4 52 0                      POR
                                                                                                                                                   CFM
             5                             T |___T LB eam _In
                                                                                                                                              P IC 18 F 4 52 0          C FM Card          C FM Card
                                                                                                                                                                          m odule            m odule
  C o nn e cto r
      DB9
                                                        B attery
                                                        pow e r
                                                                                                                 e ry L_B eam
                                                        se nse
                                                                              IC S P Port     M ode sw itch
                                                                                                                                   r R_Beam
                                                                                              SW 2
   External                                                                                                                        vN         rr,
 p ow e r port
  (12 VDC)                           P ow er on
                                                                                       J
                                         1                                                      B ico lor LEDs
                                                                                                (red/green)
                                                                                                                 D isplay o n /o ff
                                    SW1                      P ow er co nd itio ning                             sw itch SW 3
                                                             and reg ula tio n
acid battery located in the receiver ca rry                                                               for approxim ately 90 hours before the 12-V
                                                                                                                                                                                                            FIGURE 3
box. The receiver/CDC draw s approxim ately                                                               battery would need recharging.
                                                                                                                                                                                                            T h is      is    th e         m a in        m ic r o c o n tr o lle r
320 mA at 12 V when the LCD backlight is on
                                                                                                                                                                                                            c ir c u it, w h ic h        in c lu d e s th e p o w e r on
and 200 mA when the LCD backlight is off.                                                                 CDC HARDWARE                                                                                      re se t     c ir c u it     and      4 0 -M H z          o s c illa t o r
Since the LCD backlight is m ostly off during                                                                Figure 2 is a functional block diagram                                                         c ir c u it. T h e c o m p le te s e t o f s c h e m a tic s
a lengthy traffic-m onitoring session, the                                                                (FBD) showing the CDC's various functional                                                        is a v a ila b le on th e C irc u it Cellar FTP
receiver/CDC can be continuously operated                                                                 elem ents. During the initial design phase                                                        site .
+5V
                                                                                                                                                                                                                                       VDD
                                                                                                              RE3/*M CLR/VPP      RB7/PGD                                                                             SOUT            TSTIN
                                                                                                              RAO/ANO             RB6/PG C                        I.                                                  S C LK /S C K TSTOUT
                                                                                                              RA1/AN1             RB5/PGM                                                                             VSS           SIN/SDA
                                                                                                              RA2/AN2/VR EF-      RB4/AN11                                             CStart/Run H1
                                                                                                              RA3/AN3/VREF+        RB3/AN9
                                                                                                              RA4             RB2/INT2/AN8
                                                                                                              RA5/AN4        RB1/INT1/AN10
                                                                                                              RE0/AN5        RB0/INT0/AN12
                                                                                                              RE1/AN6                  VDD
                                                                                                              RE2/AN7                  VSS
                                                                                                              VDD                      RD7
                                                                                                              VSS                      RD6
                                                                                                              RA7/OSC1                 RD5
                                                                                                              RA6/OSC2           PSP4/RD4                    -^FX^Data
                                                                                                              RCO               RX/DT/RC7                    <Rx
                                                                                                              RC1               TX/CK/RC6
                                                                                                              RC2                 SDO/RC5
                                                                                                              SCK /SCL/R C3   SDI/SDA/RC4
                                                                                                              RDO                      RD3
                                                                                                              RD1                      RD2                       -< R B LED Grn
                                                                                                                     *PBRST       VCC
                                                                                                                     *ST           RST
                                                                                                                     TD           *RST
                                                                                                                     TOL
                                                                                                                     GND
mccdaq.com/Android
F a a1                      M E A S U R E M E N T
                                                                                                                                            Contact us
aVK                       C O M P U T IN G ,
  The Value Leader in D ata A cquisition                                                                                       1.800.234.4232
         © 2 0 1 4 M e a s u r e m e n t C o m p u t in g C o r p o r a t io n , 10 C o m m e r c e W a y , N o r t o n , M A 0 2 7 6 6 • in f o @ m c c d a q . c o m
  24       CIRCUIT CELLAR • NOVEMBER 2014 #292
                                                                                                                                                                                         show s             a c tu a l   tr a f f ic
TESTS & RESULTS
                                                                                                                                                                                         p a tt e r n        ta k e n    on       a
    Once the prototype CDC was assembled and the software
                                                                                                                                                                                         lo ca l c it y s tr e e t o v e r a
downloaded and partially "debugged," I "bread-boarded" a                                                                                                                                 1 5 - m in u te p e rio d . T h e
microcontroller-based sensor receiver simulator. The simulator                                                                                                                           a v e ra g e          speed          w as
                                                                                                                                                                                                                                        FEATURES
has two m om entary pushbutton switches and a potentiometer.                                                                                                                             20       m ph.          The      In itia l
When a pushbutton was pressed, two high-to-low-to-high                                                                                                                                   P a ra m e te r          H eader      file
    Now that the CDC hardware and software design has been
functionally verified, our plan is to contact some local city traffic                                                                                                                                       :■/
agencies and homeowner associations (HOAs) and demonstrate
the system to them. My colleague is considering setting up the                            loWiRower, Hi y fr Performance
TMS on his busy residential street for a period of time and
submitting the results to his city council for possible installation                                       l^em iconmictorsj
of speed bumps.                                                                           /       Tuee lien l s cusitivLtv. very E11iciofll Power ton pullers
    I     live in a small homeowners' com m unity with one main
street through it. Residents often drive on that street too fast.
                                                                                                          R F Design Services
We plan to conduct a measurement session there as well in the
                                                                                                     P rc p a rt d !o wc.'Jk w i ifr jt tm in - A o u j r e â p m rp r i.,
near future and present the results to the HOA Board of                                f l f i u p j i w f jfO tff       p r c / t d frflm                               i s ïff lp f o iW f lfo ip s fî.
Directors, of which I am president, and to the homeowners and               uîtffol •Wtftery » S p s r * * J iW r c f llf * £ b « T                  f i r â i W f t ir iW ÿ                  • Ligtofirwji     Control
residents in an effort to slow down the traffic. And finally, to
support potential future utilization of the TMS, I wrote a user's                                          #             F             i L T O              Q »ft
                                                                                    f c                      L       C        f        r   f   l /     O            o r é m O lu n o iin t . f o *
guide for the CDC which will enable city traffic engineers and
                                                                             T        *                      Î N T Ë R N A T iO N A L                                w    w w . îe m a s i n t . c a m
the like to operate it in the future. £
  26       CIRCUIT CELLAR • NOVEMBER 2014 #292
           Ultrasonic Wayfinder
                                                      '* i                                                                                 -
            Echolocation for the Visually Impaired
FEATURES
           PHOTO 1
           T h e f in is h e d p r o d u c t s h o w in g s e p a ra te h e a d - m o u n t e d (a) a n d h a n d - m o u n t e d (b) s u b s y s te m s
                                                                                                                                                   c ir cu itc e ll ar .c om   27
                                                                                                                                                                                FEATURES
developed an "ultrasonic w ayfind er" that
uses the principle of echolocation to help the
visually im paired navigate their environm ent
w ith ease and confidence (see Photo 1).
WAYFINDER OVERVIEW
    The ultrasonic w ayfinder com prises two
main w earable subsystem s: a head-mounted
navigation subsystem and a hand-m ounted
tactile sensor subsystem (see Figure 1 for
a high-level overview). The head-m ounted                    The rate of the m otors' pulse is proportional
navigation device is used for spatial sensing            to the distance of the obstacle from the user—
and directional navigation, while the hand-              the closer the object, the more rapid the
mounted tactile sensor is used much like a               pulses. This way, the user can easily discern
virtu al w hite cane for sensing obstacles below         an obstacle's proxim ity and determ ine the
eye-level and nearby.                                    urgency with which he or she should react.
    The head-m ounted navigation subsystem
consists of two ultrasonic rangefinders                  HARDWARE DESIGN
and two m otors. It is capable of detecting                  The ultrasonic w ayfinder design features
obstacles up to 5 m away with a field of view            an    Atm el   ATmega1284       m icrocontroller
of about 120°. It provides instructions to               mounted on a custom PCB that was designed
turn left or right using one of the two m otors          by our course instructor, Bruce Land. M ini
mounted on the back of the user's head.                  disc m otors are sewn into the headband and
The hand-m ounted tactile sensor subsystem               the hand strap. We chose the m otors because
consists of one ultrasonic rangefinder and               they were sm all enough to be sewn into
one motor. The tactile sensor enables the                w earable pieces of fabric and strong enough
user to "sw eep" for obstacles that are out of           to provide clear vibrational pulses.
the head-m ounted sensors' range in a fashion                The m otors are driven directly from the 9-V
sim ila r to how one would use a w hite cane.            battery via a sim ple control circuit that uses
BAT1 _
Left Rangefinder
Forward Rangefinder
ATmega1284
                                                                                                              FIGURE 2
                                                                                                              T h e u ltr a s o n ic w a y fin d e r 's c ir c u it r y
  28       CIRCUIT CELLAR • NOVEMBER 2014 #292
                                                                                                                                                                               FEATURES
run in the order in which they are released
(i.e., not in a true "re a l-tim e " fashion) and
have p rio rity over the navigation logic. The
navigation logic is also executing every 300
ms com pared to 250 ms for all the other
tasks. This is because the navigation logic
can still function fa irly accurately w hile using
range data that are slightly "old."
    The ranging tasks for all three rangefinders repeat every 250 ms. We determined
experim entally that this is approxim ately the m inim um tim e the tasks require to com plete the
ranging (which takes 49 ms according to the datasheet), convert the range to m eters, and save
the range for median filtering.
         ,      ^            (5 1 2 V in c h e s ^    meters^   (   5 ^          (5 1 2 ^
       Distance (m) = V IN x I I I — —— I x 0.02541— —— I = I             x ADC x I       I x 0.0254
The firs t term converts the ADC (the nam e of a re g iste r) bit value p ro p o rtio n a te ly from 0 to
255 (since the value is 8 bits) to 0 to 5 V. The second term converts the voltage to distance in
inches. A ccord ing to the MB1000 datasheet, the analog output from the sensor corresponds
to (VCC/512) vo lts per inch. Finally, the th ird term converts the distance reading from inches
to m eters.
MEDIAN FILTERING
    All ultrasound rangefinder readings are median filtered (with a filter of size 3) to remove
im pulse noises. The median filtering was effective as m ost of the noises encountered in the
ranging data were im pulse noises (see Photo 2).
  30
FEATURES   CIRCUIT CELLAR • NOVEMBER 2014 #292
           PHOTO 3
           U s e rs te s tin g th e u ltr a s o n ic w a y fin d e r                  We found th a t the m ost freq ue n t cause                                     data w ill change a b ru p tly from 3 to 5 m,
           had        little      d if f ic u lt y   d e te c t in g      the     of the noise is the sudden changes in ranges                                        creating spikes in the range data sim ilar to
           p re s e n c e      o f s m a lle r o b s t a c le s        b e lo w
                                                                                  detected when the rangefinder ranges                                                those in Photo 1. Another common source
           e y e -le v e l     u s in g     th e     h a n d -m o u n te d
                                                                                  m ultiple objects of d iffe re n t distances.                                       of impulse noises are the unintended
           t a c t ile s e n s o r
                                                                                  For instance, when the rangefinder is                                               reflections caused by overestim ating the
                                                                                  pointed slig h tly o ff center tow ard a person                                     distance of an object when the reflected
                                                                                  standing 3 m away from the sensor (with                                             pulse bounces o ff the ground before
                                                                                  a wall 2 m behind the person), the range                                            reaching the rangefinder.
                                                                                                                                                                      WAYFINDING LOGIC
                                                                                                                                                                          There are two real-tim e ta sks responsible
           PROJECT FILES
                                                                                                                                                                      for the w ayfind ing aspect of the device: the
                                                                                                                                                                      navigation and ta ctile sensor logic. The
                                                                                                                                                                      navigation log ic checks for the presence of
                                                                                  -------- , "P r o t o t y p e B o a r d fo r A tm e l M e g a 6 4 4 ,”
                                                                                                                                                                      obstacles in the field s of view of the le ft and
                                                                                  C o r n e ll U n iv e r s i t y , 2006, h t t p : / / p e o p l e .e c e .c o r -
                                                                                                                                                                      rig ht ran ge fin d ers and buzzes the m otor
                                                                                  ne ll.e d u / l a n d / P R O J E C T S / P r o t o B o a r d 4 7 6 / .
                                                                                                                                                                      to in dica te to the user the direction of the
                                                                                                                                                                      obstacle. If obstacles are detected by both
                                                                                  M a x B o t i x , " L V - M a x S o n a r - E X 0 Hig h P e r f o r m a n c e       the left and rig ht rangefind ers, then the
                    c ir c u it c e lla r . c o m / c c m a t e r ia ls           S o n a r R a n g e F in d e r ,” P D1 0 0 0 1 , 2012.                              user w ill be notified of the direction of the
                                                                                                                                                                      obstacle closer to the user (which is likely
                                                                                                                                                                      the obstacle m ore c ritic a l or hazardous to
           RESOURCES                                                              M. P r a s a d , "T h e A D C o f th e AV R,” 2011,
                                                                                                                                                                      the user).
                                                                                  http://m axem b ed d ed .com /20 11/06 /20 /
           A t m e l C o r p. , " 8 - B i t A tm e l M i                                                                                                                 The ta ctile sensor logic checks for the
                                                                                  the-adc-of-the-avr/.
           c r o c o n t r o l l e r w it h 1 6 / 3 2 /1 2 8 K                                                                                                        presence of obstacles w ithin the threshold
           Bytes In-System P r o g r a m m a                                                                                                                         as determ ined by the calibratio n process.
                                                                                  SOURCES
           ble F la s h ,” 8 2 7 2 C - A V R - 0 6 / 1 1 ,                                                                                                            O bstacles at a range below this threshold
           2011.                                                                  ATm ega1284 M icroco ntroller                                                       correspond to obstacles that would norm ally
                                                                                  A t m e l Co rp. | w w w . a t m e l . c o m                                        be detected when a v isu a lly im paired person
                                                                                                                                                                      scans his im m ediate su rro u n d in g s using
           B. Land , "A P r e e m p t i v e K e r 
                                                                                                                                                                      a w hite cane (i.e., objects that are large
           nel fo r A tm e l M e g a 1 2 8 4                                      MB1000 LV-M axSonar-EZ0 so nar ran ge fin der
                                                                                                                                                                      enough to cause the user to trip and fall or
           M i c r o c o n t r o l l e r s , ” E CE 4760,
                                                                                  M ax B o tix | w w w .m a x bo tix .co m                                            objects that can collide w ith the user). The
           C o r n e ll U n iv e r s i t y , 2013,
                                                                                                                                                                      ta ctile sensor logic also scales the intensity
           h t tp :/ / p e o p le .e c e .c o rn e ll.
                                                                                                                                                                      of the v ib ra tio n s p ro p o rtio n a tely w ith the
           e d u /lan d/cou rses/ece4760/
                                                                                                                                                                      p ro xim ity of the obstacles.
           TinyR ealTim e/.
                                                                                                                               circu itc el lar .c om   31
     Both the navigation and ta ctile logic                              sensor was responsive and sensitive enough
functions scale the in te n sity of the vib ratio n s                    to enable the user to sense sm a ller obstacles
p ro p ortio n ately w ith the distance of the                           below eye-level (see Photo 3).
obstacles from the sensor. This is done by                                   More interestingly, m any users found the
v ary in g the duration of each pulse using                              device to be v ery intuitive. Most were able
the follow ing equation: pulse duration = (1/                            to use the ultraso nic w a yfin d er w ith little
                                                                                                                                                         FEATURES
range) x m ultiplier, w here the values of the                           to no prio r in stru ctio n s, suggesting that the
m u ltip lier w ere exp erim en ta lly determ ined                       pulsing se nsations of v a ryin g stren g th s were
to be 30 for the navigation logic and 20 for                             v ery natural indicato rs of obstacles and their
the ta ctile sensor logic. This w as chosen                              proxim ities.
so that the m inim um detectable range of
ap p roxim a tely 0.15 m w ill give 200 and 133                          FUTURE WORK
ms for the m u ltip lie r values of 30 and 20,                                As a prototype device developed within
respectively. Longer pulse durations (and                                the m onetary and tim e constraints of a
hence higher pulse intensities) were used                                u n iversity course, the device has exceeded
fo r the head-m ounted m otors as com pared                              our expectations in term s of how well it has
to the hand-m ounted m otors as we found                                 perform ed. We feel that this proof-of-concept
that the head is less sensitive to vib ratio n s                         device has clearly dem onstrated the potential
com pared to the hand.                                                   utility behind a novel approach to visual
                                                                         assistive devices. We are excited to see what
RESULTS                                                                  we can achieve with m ore tim e and resources.
    The ultraso nic w a yfin d er perform ed                             This is an endeavor we hope to pursue with
exceedingly well when we had our classm ates                             future research and coursework.
and in stru cto r test it. We found that most                                 Who knows? Perhaps the ultrasonic
users w ere able to confidently w alk around                             w ayfinder m ight pave the way for future
indoor environm ents w ith th eir eyes closed                            assistive devices of this nature? O
w hile avoiding m ost obstacles. The head-
m ounted sensors allow ed the user to detect
w alls easily, w hile the hand-m ounted tactile
       A                     AP CIRCUITS
                             PCB Fabrication Since 1984
www.apcircuits.com
                                  —                                           ^
                                   JSff-Zn      IPC MEMBER                   i-
                                              _ASSOCIATIONCONNECTING
                                              I BLSCTHONICBINOUBTRieS'
Spotlight
                                                                                           @electronica 2014
                            Made in Munich
                           Come MAKE it ©electrónica 2014
                           By W isse Hettinga (Elektor Labs)
                           You've all heard of the m aker revolution and seen cool things described
                           but how cool is it to MAKE som e real electronics at the w orld's largest
                           exhibition on real electronics? To have a place w here you can relax,
                           charge you r phone, e-gossip, have a coffee and touch base with re
                           al-w orld electronics. W here you can bring along anything you'd w ant
                           to unbox, (un)solder, show off, m easure, check-4-specs, Arduino'd, or
                           R aspberry Pi'd. Feel free to com e w ork with us the Elektor way!
                           For th is special occasion E lektor Labs are putting at yo u r disposal: de sk space, tools,
                           test & m e asurem ent equipm ent, a 3D printer, and free WiFi. Not forgetting mini w ork
                           shops, techtalk, coffee (please donate), and plenty of pow er sockets to charge phones,
m n H i amh                tablets, laptops, and gizm os.
e l e k t o Z s m a k e r s p a c e
                                                                            2014
                                        MnUF.MBER l l ' 1'*'
              E L E C T R O N IC A    M U N IC H ^ q q T H
  34       CIRCUIT CELLAR • NOVEMBER 2014 #292
                                                                                                     Pressure
FEATURES
                                                                                                                       Microcontroller-Based
                                                                                                                       Blood Pressure Monitoring
           You can build a m icrocontroller-enabled optical blood pressure sensor system. Featuring
           an MCU and a few optical sensors, the system uses infrared light to detect blood flow,
           prim arily heart rate. By detecting volum etric changes in blood, it can identify when a pulse
           goes through a particular area of the body.
           L E D s,      an       a rra y    of    r e s is t o r s     anc
                                                                                 features. Photo 1 shows prototype. In future        reflectivity, since the com position of the
           c a p a c it o r s ,   an    A tm e l   ATm ega1284p
                                                                                 iterations, we will be supporting Bluetooth         surrounding tissue stays the sam e w hile the
           m ic r c o n t r o lle r ,   and        som e         v o lta g e     com m unication as well as a sm aller form          volum e of blood changes. We can m easure
           re g u la to rs .                                                     factor.                                             these volu m etric changes and detect peaks
                                                                                                                                                                                                    circu itc el lar .c om    35
                                                                                                                                                                                                                               FEATURES
Hennig and A. Patzak analyze the correlation
PTT w ith blood pressure changes (see
Figure 1). The theory is that a patient's
PTT can be utilized to m easure a patient's                                                           I? “ftPi
pulse wave velocity, w hich is based on blood
                                                                                                                                 •
vessel stiffness. This stiffn ess correlates to                                                                                                        *
                                                                                                                                                       *        •                          *    -
HARDWARE OVERVIEW
    In order to m easure pulse, we use
an infrared LED and a phototransistor to
m easure the reflectivity of blood in an artery.
As blood pumps through the body, the blood
volum e in the points of m easurem ent also
  36       CIRCUIT CELLAR • NOVEMBER 2014 #292
                                 1
                                                        L ig h t to
                          N e ck pulse       —     >    fre q u e n cy                                                                             PHYSICAL HOUSING
                                                        co n ve rte r
                                                                                                                                                       The physical housing was designed in
                                                         •f Ligh t-to -fre qu en cy
                                                            co nve rte r                                                                           Solidw orks and converted to an .STL file to be
                                                                                                                                                   printed on a 3-D printer. The housing includes
                                                                                                                                                   ports for the light sensors and associated
            FIGURE 2                                                                                                                               LEDs, as well as ports for an on/off toggle
           T h e A T m e g a 2 8 4 p m ic r o c o n t r o lle r a n d a s s o c ia te d c o m p o n e n ts
                                                                                                                                                   power sw itch and a m om entary push button
                                                                                                                                                   for user input. The ports are designed so a
                                                                                                                                                   plastic w indow is mounted on top, so the user
                                                                                   to convert UART to USB and send the data to                     has a place to rest his/her finger on top to
                                                                                   a PC. Figure 2 shows the basic setup including                  reduce m ovem ent during m easurem ent. Later
                                                                                   the m icrocontroller and associated hardware.                   revisions of the housing w ill more properly
                                                                                      An HC-06 Bluetooth module is mounted                         shroud the sensors from am bient light by
                                                                                   underneath the main board and connected                         better enclosing the sensing areas. There was
                                                                                   to UART0 on the m icrocontroller. The module                    also an issue with cro ss-talk between sensors
                                                                                   is paired with a PC that has Bluetooth                          w ithin the housing, so thicker isolation
                                                                                   connectivity via a USB dongle. Currently,                       between light sources and light sensors will
                                                                                   the device can utilize Bluetooth, but we                        increase inform ation gain.
                                                                                   encountered som e interference in the signal,
                                                                                   so we chose to utilize an FTDI chip with a USB                  DIGITAL OPTICAL SENSOR
                                                                                   connection instead.                                                 We chose the TSL235R light-to-frequency
                                                                                      The ATmega m icrocontroller is the brain of                  converter because it allowed com plete digital
                                                                                   the device (see Figure 3). All of the sensors                   m easurem ent of light. The typical square wave
                                                                                   and LEDs are broken out and connected to the                    output from the sensor was several kilohertz,
                                                                                   microcontroller, which is connected to a white                  which was reasonably accurately detectable
                                                                                   board. The unit is still on battery power, and                  by our m icrocontroller. The advantage of the
                                                                                   thus the entire device can be made wireless. We                 light-to-frequency sensor was its variable
                                                                                   used the board that Professor Bruce Land gave                   dynam ic range. Since we ultim ately used
                                                                                   us for the ECE 4760 class at Cornell University.                counters to m easure the frequency, we could
                                                                                   The custom PCB board includes an external                       m easure over a wide range of frequencies and
           FIGURE 3
           P C B la y o u t f o r m ic r o c o n t r o lle r b o a rd
                                                                                                                                                                           circu itc el lar .c om   37
                                                                                                                                                                                                     FEATURES
blood glucose and blood cholesterol. S1 and          the m easurem ents to a PC for visualization
S2 in Figure 5 show our two light-to-frequency       with a GUI. Table 1 shows the functions for
sensors hooked to power and to pin B0 and B1         our program.
of our m icrocontroller.                                 Our optical data acquisition method used a
                                                     m ixture of externally triggered counters and
                                                     internal tim e r interrupts in order to sam ple
                                                     the num ber of pulses from the light sensors
                                                     in a given am ount of time. We used a total
                                                     of four tim ers. Tim er2 and Tim er3 were used
                                                     for tim ekeeping. Tim er2 was set with a clock
                                                      ABOUT THEAUTHORS
                                                       R a n d y S o n g (s s h . r a n d y @ g m a i l . c o m ) ) is c u r r e n t l y a s t u d e n t in E l e c t r i c a l a n d
                                                      C o m p u t e r E n g i n e e r i n g a t C o r n e l l U n i v e r s i t y . H is i n t e r e s t s i n c l u d e r o c k c l i m b 
                                                       ing, s a ilin g , a n d p r o g r a m m in g .
                                                      A l e x a n d e r N g a i (a s n 5 4 @ c o r n e l l . e d u ) is c u r r e n t l y a s t u d e n t in        E le ctrica l an d
                                                      C o m p u t e r E n g i n e e r i n g a t C o r n e l l U n i v e r s i t y . H is i n t e r e s t s i n c l u d e r o b o t s a n d
                                                      electronics.
F in a l d a ta a n d GUI
  38       CIRCUIT CELLAR • NOVEMBER 2014 #292
           FIGURE 4
                                                                                                                              actual acquisition of the data.
           A d d it io n a l F T D I /F T 2 3 2 R U A R T -to -U S B
           c h ip
                                                                                                                              DIGITAL SIGNAL PROCESSING
                                                                                                                                   Though our data acquisition m ethods
                                                                                                                              w ere designed to reduce jitte r and noise, the
                                                                                                                              signals w ere still unstable. Because we chose
FEATURES
visual Java IDE called Processing to quickly        These invalid results could be easily removed
build the real tim e display. The program           since the invalid m easurem ents were much
sim ply updates on each valid reception             different than the co rrect m easurem ents.
from the Bluetooth connection, delim ited by        We could easily remove outlier data points
a newline character. We tra n sm it multiple        due to deviation from the median and retain
variables indicating sensor readings and            only valid values. In addition, we could
                                                                                                                               FEATURES
detected peaks for pulse tra n sit time.            remove data points that are larger than a
    We made a predefined packet structure           certain threshold. However, w ithout these
and delim ited between different transm itted       counterm easures, the m easurem ents were
variables with a space character. The               often skewed and inconvenient as we had
transm itted variables are then displayed on        to m anually stabilize the device to reduce
the GUI, including the m easured pulse transit      m ovem ent a rtifa cts. To remove som e of the
tim e and m easured heart rate.                     m ovem ent artifacts, the optical sensors and
                                                    em itters could be moved closer to the surface
FINAL DEVICE                                        and a non-infrared blocking plastic should
     Currently, our system is portable, but
there are several w ires protruding from the
main device to the ATmega board. In addition,
due to the construction of the device and the
sam pling techniques we used, we currently
need close supervision to get good data
w ithout motion artifacts. Our device does not
filter out results that are obvious outliers, but
only averages the data so we do not always
get very accurate sam ples. While we were
testing, we had to hold the device to our necks
very still to acquire a few decent sam ples,
and we had to record sam ples of data that we
knew w ere accurate readings while rejecting
motion a rtifa ct corrupted data.
     The way the current device is configured,
you m ust place your index finger on the
device's top-facing window. Next, you must
point the front w indow at your neck. Currently,
in order to get accurate readings, you must
take a deep breath, and slow ly exhale. The
readings taken while you're slow ly exhaling
are the m ost accurate. For best results, you
m ight have to adjust the placem ent of the
forw ard facing window, as it m ust be pointing
directly at a larger artery.
RESULTS
    In the end, we obtained results that serve
as a proof of concept for an optical blood
pressure and heart rate m onitor using digital
signals processing. Our results show the
correlation between PTT and blood pressure,
giving us a good stepping stone tow ards
making a general health m etric acquisition
device. Although we would need more data
from patients of different body types, we
show that for certain body types it is possible
to acquire som e level of accuracy utilizing
PTT. We processed the data in real-tim e so
that we could analyze the data. We learned
about the physical constraints associated with
using the ATmega1284p and the effectiveness
of the sensors we implem ented.
    M any of the m easurem ents we gathered
w ere invalid due to som e inaccuracies with
peak detection and m ovem ent a rtifacts.
                                                                     e$>resspcb.com
  40       CIRCUIT CELLAR • NOVEMBER 2014 #292
                uart_init, uart_putchar,                                The UART functions were taken from Joerg Wunsch on Bruce Land's ECE 4760 website. These
                uart_getchar                                            functions are utilized for serial com m unication with a com puter in order to send data to a GUI.
                                                                        The initialize function initializes tim er 0 and tim er 1 to be externally triggered through pin
                                                                        B0 and B1, and both tim ers used overflow interrupt routines that extended the length of the
FEATURES
                initialize                                              counters to 32 bits. Tim er 2 and 3 are initialized to count 1 ms and 10 ms. Tim er 2 serves as a
                                                                        millisecond tim e base, while tim er 3 serves as a counter that counts the num ber of clock edges
                                                                        from tim er 0 and 1 in 10 ms.
                                                                        The main loop runs lightSensorCapture, filters the values with filterSensor, runs peak detection
                main                                                    on the two sensors using threshold1 and threshold2, calculates pulse transit tim e and pulse rate
                                                                        using ptt_calc and ps_calc, and sends all relevant data using uart to the main computer.
                                                                        This function begins the 10-m s sequence that kicks off tim er 3. Because we can run different
                                                                        biom etric sensors at different tim es, we have a dead w aiting while loop that w aits until the
                lightSensorCapture
                                                                        tim er has counted 10 ms. Once the tim er 3 interrupt occurs, this function records the number
                                                                        of counts from each of the light sensors in order to obtain intensity inform ation.
                                                                        The filtersensor function applies a running average filter and a mean subtraction filter to the
               filterSensor
                                                                        acquired values.
                                                                        These functions run a state machine that checks to see if the intensity inform ation changes
               threshold1/threshold2
                                                                        from positive and growing to decreasing. This peak is then utilized by ptt_calc and ps_calc.
                                                                        This function uses the tim e base to calculate the am ount of tim e passed between the peaks of
                ptt_calc
                                                                        the two different sensors.
                                                                        S im ila r to ptt_calc, ps_calc uses the tim e base to calculate the am ount of tim e between two
                ps_calc
                                                                        peaks in the sam e sensor.
           TABLE 1
           T h e f u n c tio n s f o r o u r p ro g ra m                 be attached to the front sensor window. In                                  greatly increase the usability by any user. In
                                                                         addition, shielding from external sources of                                one of our tests, we lay on the ground while
                                                                         light and an opaque shielding would create a                                m easuring our blood pressure and observed
                                                                         less noisy signal.                                                          that our readings were much noisier. Sim ply by
                                                                             We could achieve this by using a thinner                                instructing the user to sit upright while using
                                                                         profile for the device that allowed for the                                 the device allow s for a much higher am ount
                                                                         sensors to be closer to the surface, in addition                            of accuracy. By including these instructions,
                                                                         to a better encasing that allow s for less                                  we believe that any user with basic reading
                                                                         transm ission of light and a sm aller window                                a b ility will be able to use the device.
                                                                         to m axim ize signal to noise ratio. In addition,                                 For the Scan-E M ark II, we plan to use
                                                                         proper instructions and pictures of use will                                a more powerful m icrocontroller with more
                                                                                                                                                      precise tim ing so that we can acquire higher
                                                                                                                                                      precision when calculating PTT. We also want
           PROJECT FILES                                                 B. Land " P ro to ty p e B o a rd fo r A tm e l M e g a 6 4 4 ,”
                                                                                                                                                     to include an acquisition mode on the device
                                                                         C o rn e ll U n iv e rs ity , h ttp :/ / p e o p le .e c e .c o rn e ll.
                                                                                                                                                     that acquires data for a set am ount of tim e so
                                                                         e d u /la n d /P R O JE C T S /P ro to B o a rd 4 7 6 /.
                                                                                                                                                     that the LEDs w on't be on when the device is
                                                                                                                                                      not in operation, as they use heavy am ount of
                                                                                                                                                      power from the battery.
                                                                         SOURCES                                                                           Lastly, we want to explore how to shield
                                                                         A T m e g a 1 2 8 4 p M ic r o c o n tr o lle r
                                                                                                                                                     our signal from noise that is received from
                                                                                                                                                     the Bluetooth module. Currently, we cannot
                                                                         A tm e l C o rp . | w w w .a tm e l.c o m
                  c ir c u it c e lla r . c o m / c c m a t e r ia ls                                                                                 use Bluetooth for real-tim e data acquisition
                                                                                                                                                      because of noise that we encounter while
                                                                         FT 2 3 2 R U S B - to -s e r ia l UART in te rfa c e                         recording signals.
                                                                         F u tu re T e c h n o lo g y D e v ic e s In te r n a tio n a l | w w w .
                                                                                                                                                           If you would like to learn more about our
           RESOURCES                                                                                                                                 device or look at som e of the source code
                                                                         ftd ic h ip .c o m
           A. H en n ig and A. P atzak.                                                                                                              (which is posted on C ircuit Cellar's FTP site),
           "C o n tin u o u s b lood p re s s u re                                                                                                   feel free to em ail us. We are currently
           m e a s u r e m e n t u s in g p u lse                                                                                                    developing a product w ebsite at w w w.m oxie-
           t r a n s it tim e ,” S p r in g e r- V e r la g                                                                                           health.com, so stay tuned for more updates
           B e rlin H e id e lb e rg 2013.                                                                                                            in the future! O
                                                                DESIGN YOUR SOLUTION TODAY
         7191Technologic                                             CALL 480-837-5200
   T i                      S y s t e m s
www.embeddedARM.com
F e a tu re s c a n in c lu d e :                                                                         T S -8 8 2 0 -4 8 0 0
■ 5, 7, and 10 Inch Touchscreens                                                                           Pricing starts at
■ Fanless O peration from -20 °C to 70 °C
                                                                                                         $6 4 8 $699
■ Up to 1 GHz ARM CPU, 2 GB RAM, 4 GB eMMC Flash                                                           Q ty l 0 0    Q ty l
                                                                  F e a tu re s:
- Ethernet, USB, DIO, CAN, RS-232, M odbus, SPI                     800 MHz ARM CPU             2x USB Host
■ O ptional Cellular, WiFi and XBee Radios
                                                                    256 MB RAM                  8x Opto-Isolated Inputs
■ Supports A ndroid & Linux w ith Fast Boot Times
                                                                    256 MB Flash Storage        6x Digital Inputs, 6x Out
   6x 24 VDC A uto Relays           12x 8 A Power Switches          -40 to 85 °C industrial tem perature range
   2x MODBUS-TW RJ45                O u tp u t Power M onitor
                                                                    Boots Linux 2.6 in less than 3 seconds
   Rugged Connectors                6-Bit PWM Capable
                                             www.embeddedARM.com
                                 WIZnet Connect
                                 the Magic 2014
                                 Design Challenge
                                 Winners
                                 The    Internet  of     Thing    (IoT)    is
                                 revolutionizing       everyth          from
                                 consumer electronics to healthcare-
                                 related technology. It's transforming how
                                 humans interact with electronic systems
                                 and Internet, and it's advancing the ways
                                 machines connect with other machines.
                                 The leaders driving progress in the
                                 IoT field are inventive engineers and
                                 creative electronics enthusiasts who are
                                  jassionate about embedded systems, the
To study the complete projects
—including abstracts, photos,
                                 fnternet, and problem solving.
documentation, schematics,
diagrams, and code—go to:
                                  Back in March 2014, WIZnet launched the
circuitcellar.com/wiznet2014
                                 Connect the Magic 2014 Design Challenge
                                 and called on engineers around the world
                                 to join the IoT revolution. The challenge
                                 was to incorporate at least one WIZnet
                                 WIZ550io Ethernet module or W5500 chip
                                 in inventive 'Net-connected systems for a
                                 chance win prizes and gain international
                                 recognition. The project subm ission
                                 deadline was August 3, 2014.
THIRD PRIZE
WIZ Security Network
C la u d iu   C h ic u lit a   ( R o m a n ia )
W IZpix
Internet-Connected Pixel Controller
R o b ert G asio ro w ski (United States)
   The WIZpix pixel controller uses a WIZnet W5500 to connect
to the Internet and an MCU to interface with W5500 and drive
intelligent pixels. You can use the system anywhere animated
lights are required (parties, displays, snows, home decor, etc.). It
eliminates the need for a complex DMX system. Thanks to built-in
PoE, only one cable is required.
                                  '                   .
   !      GREEN COMPUTING
*4
          Budgeting Power
          in Data Centers
                                                               I
                                                                  n my May 2014 C ircuit Cellar article, "Data       controlling the peak power consum ption using
                                                                  Centers in the Sm art G rid" (Issue 286), I        data center power-capping m echanism s.
                                                               discussed the growing data center energy              Other m echanism s of cost and capacity
                                                               challenge and a novel potential solution that         m anagem ent include load shedding, referring
                                                               modulates data center pow er consum ption             to tem p orary load reduction in a data center,
                                                               based on the requests from the electricity            load shifting, which delays executing loads to
                                                               provider. In the sam e a rticle, I elaborated on      a future tim e, and m igration of a subset of
                                                               how the data centers can provide "regulation          loads to other facilities, if such an option is
                                                               service reserves" by tracking a dynam ic              available.
                                                               power regulation signal broadcast by the                  All these aforem entioned m echanism s
                                                               independent service operator (ISO).                   require the data center to be able to dynam ically
                                                                   Dem and-side     provision    of regulation       cap its power w ithin a tolerable error margin.
                                                               service reserves is one of the ways of                Even in absence of advanced cost m anagem ent
                                                               providing capacity reserves that are picking          strategies, a data center generally needs to
                                                               up traction in US energy m arkets. Frequency          operate under a predeterm ined m axim um
                                                               control reserves and operating reserves are           power consum ption level as the electricity
                                                               other exam ples. These reserves are sim ilar          distribution infrastructure of the data center
                                                               to each other in the sense that the dem and-          needs to be built accordingly.
                                                               side, such as a data center, m odulates its               Most data centers today run a diverse set
                                                               power consum ption in reaction to local               of w orkloads (applications) at a given time.
                                                               m easurem ents and/or to signals broadcast            Therefore, an interesting sub-problem of the
                                                               by the ISO. The tim e-scale of m odulation,           power capping problem is how to distribute
                                                               however, differs depending on the reserves:           a given total power cap efficiently among the
                                                               m odulation can be done in real tim e, every          com putational, cooling, and other com ponents
                                                               few seconds, or every few minutes.                    in a data center. For exam ple, if there are two
                                                                   In addition to the em erging m echanism s of      types of applications running in a data center,
                                                               providing capacity reserves in the grid, there        should one give equal power caps to the
                                                               are several other options for a data center to        servers running each of these applications, or
                                                               manage its electricity cost. For exam ple, the        should one favor one of the applications?
                                                               data center operators can negotiate electricity           Even when the loads have the sam e level of
                                                               pricing with the ISO such that the electricity        urgency or priority, designating equal power
                                                               cost is lower when the data center consum es          to different types of loads does not always
                                                               power below a given peak value. In this               lead to efficient operation. This is because the
                                                               scenario, the electricity cost is significantly       pow er-perform ance trade-offs of applications
                                                               higher if the center exceeds the given limit.         vary significantly. One application may meet
                                                               "Peak shaving," therefore, refers to actively         user quality-of-service (QoS) expectations
                                                                                                                                                         circu itc el lar .c om           47
                                                                                                                                                                                           COLUMNS
the heat transfer among the servers create
differences in tem peratures and cooling           a model that estim ates the throughput given                FIGURE 1
efficiencies of servers. Thus, w hile budgeting,   server power and hardw are perform ance                     The          p lo t    d e m o n s tr a te s          b illio n      of
one may want to dedicate larger power caps counter m easurem ents. In addition, in s t r u c tio n s per seco nd (BIPS)
                                                                                                               v e r s u s s e r v e r p o w e r c o n s u m p tio n as
to servers that are more cooling-efficient.        we analyzed the potential perform ance
                                                                                                               m e a su re d          on      an     O r a c le      e n t e r p r is e
    As the com putational units in a data center   bottlenecks resulting from a high num ber of
                                                                                                               s e rv e r        in c lu d in g       tw o         SPARC           T3
need to operate at safe tem peratures below        m em ory accesses and/or the lim ited num ber
                                                                                                               p ro ce s s o rs .          A p p lic a t io n s       ru n        a re
m anufacturer-provided lim its, the budgeting      of softw are threads in the application. We
                                                                                                               S P E C p o w e r_ s s j2 2 0 8                    (sp e c p o w e r),
policy in the data center needs to make sure       w ere able to predict the saturation point                  m cf         fro m       SPEC          CPU          2006,         anc
a sufficient power budget is saved for the         for each application via a regression-based                 s tr e a m c lu s t e r       and      fe rre t        fr o m      th e
cooling elements. On the other hand, if there      equation constructed based on this analysis.                P A R S E C s u ite . T h e s lo p e o f th e B IPS
is over-cooling, then the overall efficiency       Predicting the m axim um server power using                 vs. p o w e r c u rv e a n d th e p o w e r level
drops because there is a sm aller power this em pirical modeling approach gave a w h e re th ro u g h p u t s a t u r a te s d iffe r
budget left for computing. mean error of 11 W for our 400-to-700-W s ig n if ic a n t ly a m o n g th e a p p lic a tio n s .
                                                ABOUT THEAUTHOR
                                                A y s e K. C o s k u n (a c o s k u n @ b u .e d u ) is a n a s s is ta n t p r o fe s s o r in th e E le c tric a l a n d C o m p u t e r E n g in e e rin g
                                                D e p a rtm e n t a t B oston U n iv e rsity . S h e rece ive d M S an d PhD d e g re e s in C o m p u te r S c ie n c e an d E n g in e e rin g
                                                fr o m th e U n iv e rs ity o f C a lifo rn ia , S a n D ieg o. C o sk u n 's re s e a rc h in te re s ts in c lu d e te m p e r a tu r e a n d e n e rg y
                                                m a n a g e m e n t, 3 -D s ta c k a r c h it e c t u r e s , c o m p u t e r a r c h it e c t u r e , a n d e m b e d d e d s y s te m s . S h e w o rk e d a t
                                                S u n M ic ro s y s te m s (no w O racle) in S a n D ieg o , CA, p r io r to h e r c u r r e n t p o sitio n a t BU. C o sku n se rv e s a s an
                                                a s s o c ia te e d ito r o f th e   IE E E Embedded Systems Letters.
COLUMNS
                                                 hardw are and packaging choices, and can be                                              Recently, using       in-row   coolers that
                                                 characterized em pirically. For a given total                                        leverage liquid cooling to im prove efficiency
                                                 server power, CPU power can be estimated                                             of cooling is preferred in som e (newer) data
                                                 using perform ance counter m easurem ents in                                         centers to im prove cooling efficiency. In such
                                                 a sim ila r way to estim ating the perform ance                                      settings, the heat recirculation effects are
                                                 given a server cap, as described above (see                                          expected to be less significant as the most of
                                                 Figure 1). Our sim ple em pirical tem perature                                       the heat output of the servers is im m ediately
                                                 model was able to estim ate tem perature with                                        removed from the data center.
                                                 a mean error of 2.9°C in our experim ents on                                             In my lab, my students and I used low-cost
                                                 an Oracle enterprise server. M                                                       data center tem perature models to enable
                                                     Heat distribution ch aracteristics of a                                          fast dynam ic decisions.M Detailed therm al
                                                 data center depend stron gly on the cooling                                          sim ulation of data centers is possible through
                                                 technology used. For exam ple, traditional data                                      com putational fluid dynam ics tools. Such
                                                 centers use a hot aisle-cold aisle configuration,                                    tools, however, typ ica lly require prohibitively
                                                 w here the cold air from the com puter room a ir                                     long sim ulation times.
                                                 conditioners (C R A C ) and the hot air coming
                                                 out of the serves are separated by the rows                                          BUDGETING OPTIMIZATION
                                                 of racks that contain the servers. The second                                            What should the goal be during power
                                                 step in therm al estim ation, therefore, has                                         budgeting? M axim izing overall throughput in
                                                 to do with estim ating the im pact of servers                                        the data center may seem like a reasonable
                                                 to one another and the overall im pact of the                                        goal. However, such a goal would favor
                                                 cooling system.                                                                      allocating larger power caps to applications
                                                     In a traditional hot-cold aisle setting, the                                     w ith   higher throughput,      and   absolute
                                                 inlet server tem peratures can be estimated                                          throughput does not necessarily give an idea
                                                 based on a heat distribution m atrix, power                                          on w hether the application QoS demand is
                                                 consum ption of all the servers, and the                                             met. For exam ple, an application with a lower
                                                 CRAC air tem perature (which is the cold air                                         BIPS may have a stricte r QoS target.
                                                 input to the data center). Heat distribution                                             Consider this exam ple for a better
                                                 m atrix can be considered as a lumped model                                          budgeting metric: the fa ir speed-up m etric
                                                 representing the im pact of heat recirculation                                       com putes the harm onic mean of per-server
                                                 and the air flow properties together in a                                            speedup (i.e., per-server speedup is the ratio
                                                 single N x N m atrix, where N is the num ber                                         of measured BIPS to the m axim um BIPS for an
                                                 of servers.!2!                                                                       application). The purpose of this m etric is to
                                                REFERENCES
                                                [1] O. T un cer, K. V a id y a n a th a n , K. G ro ss, an d                          [3] J. M o ore , J. C h a se , P. R a n g a n a th a n , an d R.
                                                A. K. C o sk u n , "C o o lB u d g e t: D ata C e n te r P ow er                      S h a r m a , "M a k in g S c h e d u lin g 'C o o l': T e m p e ra 
                                                B u d g e tin g w ith W o rk lo a d an d C o o lin g A s y m                         tu r e -A w a r e W o rklo a d P la c e m e n t in D ata C e n 
                                                m e tr y A w a re n e s s ,” in P ro c e e d in g s o f IEEE                          te rs ,” in U S E N IX A T C -05, 2005.
                                                In te r n a tio n a l C o n fe re n c e on C o m p u te r D e sig n
                                                (ICCD ), O c to b e r 2014.                                                           [4] CVX R e se a rc h , "CVX: M a tla b S o ftw a re fo r
                                                                                                                                      D is c ip lin e d C o n v e x P r o g r a m m in g ,” V e rsio n
                                                [2] Q. Tang, T. M u k h e rje e , S. K. S. G u p ta , and                             2.1, S e p te m b e r 2 0 1 4 , h ttp :/ / c v x r .c o m /c v x /.
                                                P. C a y to n , "S e n s o r-B a s e d fa s t T h e rm a l E v a l
              circuitcellar.com /ccm aterials
                                                u a tio n M odel fo r E n e rg y E ffic ie n t H ig h -P e r 
                                                fo r m a n c e D a ta c e n te rs ,” in IC IS IP -0 6 , O c to b e r
                                                2 006.
                     T h e n e w E A G L E h a s la n d e d !
V e r s i o n 7
           now
         available
                                                 y
                                      EAGLE
    ...what are your plans
             between
November 11 & 14, 2014?                          i i   r*
          A f t e r s te p 5 , th e a lg o r it h m n o tic e s th e
                                                                                A b ility to meet such constraints strongly           above      dem onstrate    prom ising    energy
          f a ir s p e e d u p is d e c r e a s in g (ste p 6), s c             relies on the a b ility to estim ate the power-vs.-   efficiency im provem ents; however, there are
          c o n v e rg e s to th e v a lu e in s te p 5.                        perform ance trends of the applications. Thus,        many open problem s for data center power
                                                                                em pirical models I m entioned above are also         budgeting.
                                                                                essential for delivering m ore predictable                First, the above discussion does not
                                                                                perform ance to users.                                consider loads with som e dependence to
                                                                                     Figure 2 dem onstrates how the hill-             each other. For exam ple, high-perform ance
                                                                                clim bing strategy my students and I designed         com puting applications often have heavy
                                                                                for optim izing fa ir speed up evolves. The           com m unication among server nodes. This
                                                                                algorithm sta rts setting the CRAC tem perature       means that the budgeting method needs
                                                                                to its last known optim al value, which is            to account for the im pact of inter-node
                                                                                20.6°C in this exam ple. The CRAC power               com m unication for perform ance estim ates as
                                                                                consum ption corresponding to providing air           well as w hile making job allocation decisions
                                                                                input to the data center at 20.6°C can be             in data centers.
                                                                                computed using the relation ship between                  Second, especially for data centers with a
                                                                                CRAC tem perature and the ratio of com puting         non-negligible am ount of heat recirculation,
                                                                                power to cooling power.[3] This relationship          therm ally-aw are job allocation significantly
                                                                                can often be derived from datasheets for the          affects CPU tem perature. Thus, job allocation
                                                                                CRAC units and/or fo r the data center cooling        should be optim ized together with budgeting.
                                                                                infrastructure.                                           In data centers, there are elem ents other
                                                                                     Once the cooling power is subtracted from        than the servers that consume significant
                                                                                the overall cap, the algo rithm then allocates        am ounts of power such as storage units. In
                                                                                the rem aining power among the se rvers with          addition there are a heterogeneous set of
                                                                                the objective of m axim izing the fa ir speed         servers. Thus, a challenge lies in budgeting
                                                                                up. Other constraints in the optim ization            the power to a heterogeneous com puting,
                                                                                form ulation prevent any server to exceed             storage, and netw orking elements.
                                                                                m anufacturer-given redline tem peratures                 Finally, the discussion above focuses on
                                                                                and ensure each server to receive a feasible          budgeting a total power cap among servers
                                                                                power cap that falls between the server's             that are actively running applications. One can,
                                                                                m inim um and m axim um power consum ption            however, also adjust the number of servers
                                                                                levels.                                               actively serving the incoming loads (by putting
                                                                                     The a lgorithm then iteratively searches         some servers into sleep mode/turning them
                                                                                for a better solution as dem onstrated in steps       off) and also consolidate the loads if desired.
                                                                                2 to 6 in Figure 2. Once the algo rithm detects       Consolidation often decreases performance
                                                                                that the fa ir speed up is decreasing (e.g., fair     predictability. The server provisioning problem
                                                                                speedup in step 6 is less than the speedup in         needs to be solved in concert with the budgeting
                                                                                step 5), it converges to the solution computed        problem, taking the additional overheads into
                                                                                in the last step (e.g., converges to step 5 in        account. I believe all these challenges make
                                                                                the example). Note that setting cooler CRAC           the budgeting problem an interesting research
                                                                                tem peratures typ ically indicate a larger            problem for future data centers. O
         S                    e             r          i       o         u            s           .                  T        o   o   l    .
2 .4 G H z S p e c tru m A n a ly z e r
S O -A P -1
    t
          TtTTTL
             '-■
               ■■:I                     i                                                 im
                                  1     1
                                  I   KPfPjfllJEOr-        :f a 6^0   .SflOHWI^HilCt .Wlf*'
»        I...               II         H            S                                                  II     A JU        ^
        Sptctrum           C urton.   U upiir#     C A o                               hfettnfi       PVMM   Swrtlc-hTo
Now with:
◦ SSID/RSSI
◦ Open API
° Increased amplitude & frequency resolution
                                                                                 R
                                                                                     ecently, I covered two passive components,      electrom echanical        and   electrical   power
                                                                                     resistors and capacitors. Now let's take a      devices, ranging from sim ple solenoids
                                                                                     closer look at inductors. Basic inductors are   through motors, electrom echanical actuators,
                                                                                 the sim plest com ponents to construct, as they     various     inductive      sensors,   relays   and
                                                                                 are essentially nothing m ore than a coiled         transform ers. Many pages would be needed
                                                                                 piece of w ire, usually wound on a bobbin with      to only briefly address all those applications.
                                                                                 air or a ferrom agnetic core.                       In this a rticle, I'll focus on just the inductors
                                                                                     Inductors form       the basis of most          used com m only in electronic circuits. These
                                                                                                                                     are alternatively called chokes, reactors,
                                                                                                                                     baluns and inductors.
                                                                                                                                     COMMON INDUCTORS
                                                                                                                                         Photo 1 shows som e inductors one can
                                                                                                                                     com m only encounter. They are available
                                                                                                                                     as through-hole as well as surface mount
                                                                                                                                     devices (SMD). Those in Photo 1 contain
                                                                                                                                     ferrom agnetic    cores   to  increase    their
                                                                                                                                     inductance as com pared with air-core coils.
                                                                                                                                     Iron, for exam ple, has 5,000 tim es greater
                                                                                                                                     perm eability than air. This means that 5,000
                                                                                                                                     tim es few er turns of w ire would be needed
                                                                                                                                     to obtain the sam e inductance. Inductors
                                                                                                                                     with ferrom agnetic cores are w idely used
                                                                                                                                     in applications requiring large inductance,
                                                                                                                                     such as in power supplies, power line filters,
                                                                                                                                     im pedance m atching and resonant (tank)
                                                                                                                                     circuits, radio frequency (RF) transform ers,
                                                                                                                                     and so forth. Notice the two ferrite core
                                                                                                                                     exam ples located at the left and right
                                                                                                                                     extrem es of Photo 1. These are to be clamped
                                                                                                                                     on, typically, com puter interface cables to
                                                                                                                                     increase their im pedance at high frequencies
          PHOTO 1                                                                                                                    for suppression of conducted as well as
          I n d u c t o r s a n d f e r r it e c o re s u se d in e le c t ro n ic s                                                 radiated electrom agnetic interference (EMI)
                                                                                                                                                      ci rcu itc el lar .c om     53
REACTIVE COMPONENTS
     Just like capacitors, inductors are reactive
com ponents,      albeit    com plem entary     to
capacitors. In their ideal form , like capacitors,
they do not dissipate any power—they store
                                                                                                                                                                                   COLUMNS
energy. Capacitors store energy in an electric
field, inductors in a m agnetic field. The AC
voltage across capacitors lags the current
by 90°. The AC current through inductors
lags the voltage by 90°, as it is opposed by a
back electrom agnetic force (EMF) developed
by the inductance's m agnetic field. The unit
of inductance is Henry (H), defined as 1 V
of back EMF developed across the coil when
the current changes by 1 A in 1 s. This is           a rt, it used to be a painful experience. With            pho to       2
illustrated by the diagram Figure 1.                 the present-day va riety of low -cost inductors           T y p ic a l t r a n s f o r m e r s , c h o k e s a n d c o ils
Due to Faraday's law, a changing current available on the m arket, the pain is no longer u se d in rf e q u ip m e n t
                                                                                                                                                                                   L = — x 10-8
                                                                                                                                                                                       I
                                                                                                                                                            L is the in d u cta n ce in H, I is the c u rre n t
                                                                                                                                                            ca u sin g the m a g n etic flu x in am p s, and 0
          FIGURE 3
                                                                                                                                                            is the m ag n etic flu x in M a xw ells (M).
          O n e - t r a n s is t o r   g y ra to r      c ir c u it      w ith
                                                                                                                                                                 Henry, the un it of in d u cta n ce , is too
          5 -H e q u iv a le n t in d u c ta n c e
                                                                                                                                                            larg e fo r m ost e le c tro n ic a p p lic a tio n s. You
                                                                                                                                                            w ill be m ore lik e ly to en co u n te r a m illih e n ry
                                                                                 transistor, as shown in Figure 3 . For R2>>R1                              (mH) o r a m ic ro h e n ry (pH), even nanoh enry
                                                                                 the equivalent inductance is approxim ately:                               (nH), w here:
                                                                                 It is 5 H in this case. All gyrators require some                                When tw o (or m ore) in d u c to rs operate
                                                                                 current flowing through them , but in many                                 close to each other, such as in tra n s fo rm e rs
                                                                                 instances, it's not a problem . For exam ple,                              and filte rs , th e ir re sp e ctiv e m ag netic
                                                                                 the gyrator in Figure 3 can be, and often is,                              flu x e s a ffe c t the o th e r c o ils th ro u g h m utual
                                                                                 used instead of a heavy netw ork inductor in                               in d u cta n ce , also exp re sse d as a c o e ffic ie n t
                                                                                 modern telephones. R4 is selected for the                                  of co u p lin g (k). For tw o coupled co ils,
                                                                                 desired "off-hook" current.                                                m u tual in d u cta n ce is:
                                                                                                                                                                               o             o
                                                                                 ELECTRICAL CHARACTERISTICS                                                               M=         x 10-8 = x 10-8
                                                                                     When specifying or looking for an off-the-                                                 Ii            I2
                                                                                 shelf inductor, there are several electrical                               Here, M is the mutual inductance. 0 2,i is
                                                                                 characteristics to keep in mind, in addition                               m agnetic flux in the second coil caused by
                                                                                 to the required inductance and m echanical                                 the current in the first coil. 0 12 is magnetic
                                                                                 issues,   such    as   m ounting,    shielding,                            flux in the first coil caused by the current in
                                                                                 dim ensions and so forth. It is crucial to                                 the second coil. I1 and I2 are the respective
                                                                                 pay attention to the m axim um operating                                   currents in the first and the second coil.
                                                                                 current. This is not only lim ited by the coil's                           Mutual inductance and coupling are im portant
                                                                                                                                                            characteristics for coupled coils. It affects the
                                                                                                                                                            perform ance of tra nsfo rm ers and sensors.
                                                                                                                                                  .co m /
                                                                                                                                                            A nd, if a c c id e n ta l, it can also cause
                                                                                 A sk," B eig e Bag S o ftw a re , w w w .b e
                                                                                                                                                            unw anted e ffe c ts, such as in te rfe re n c e and
                                                                                 c a s e _ g y ra to r.h tm .
                                                                                                                                                            o s c illa to r fre q u e n c y pu llin g. The m axim um
                                                                                                                                                            m u tual in d u cta n ce betw een tw o co ils L1
                                                                                 G. N ovacek, "W ire le s s D ata L in k s (P a rt 1)," C ir 
                                                                                                                                                            and L2 o ccu rs w hen m a g n etic flu x of one
                                                                                 c u it C e lla r 2 83, 2014.
                                                                                                                                                            coil c ro sse s all the tu rn s of the second coil.
                                                                                 O ltro n ix , "T h e o ry o f O p e ra tio n : F e rro re -
                   c ir c u it c e lla r . c o m / c c m a t e r ia ls           s o n a n t R e g u la to rs ," w w w .o ltro n ix .n l/ e n /
                                                                                                                                                                               M,
                                                                                 fe r r o r e s o n a n t - p r in c ip le .
                                                                                                                                                                The ratio of an actual (measured) mutual
          RESOURCES                                                                                                                                         inductance M divided by M max is a coefficient
          H. M o re h o u se , "E v e ry th in g                                 P. P ark, C. S. K im , M. Y. P ark, S. D. K im , and
                                                                                                                                                            of coupling.
          You W an te d to Know A b o u t                                        H. K. Yu, "V a ria b le In d u c ta n c e M u ltila y e r I n 
     It has no d im e n sio n . Its m a xim u m value                     have been unable to find a so u rce to
is 1. For tig h tly coupled co ils, k > 0.5, w hile                       p u rchase a few sa m p le s fo r test. One
co ils w ith k < 0.01 are co n sid e red loosely                          e xcep tio n to th is is a co m m o n ly used
coupled. T ig h t co uplin g is n e c e ssa ry for                        co n sta n t v o lta g e tra n s fo rm e r (CVT). It is
m axim u m tra n s fe r of pow er w ith m in im u m                       in fa ct an e le c tric a lly co n tro lle d v a ria b le
losses in tra n s fo rm e rs . Both loose and                             inducto r. Its fe rro m a g n e tic core o p e ra tes
tig h t co u p lin g s are found in m any RF                              in fe rro re s o n a n t mode causing an o utput
c irc u its . T yp ically, a fre q u e n c y resp o nse of                vo lta g e to rem a in co n sta n t du rin g input
IF filte rs can be ad ju sted by the degree of                            vo lta g e changes.
th e ir couplin g.                                                             As I m entio ned at the be ginning of th is
                                                                          a rtic le , there are m yria d a p p lic a tio n s for
VARIABILITY                                                               in d u cta n ce in e le c tro n ics . I d id n 't dw ell on
     As the c la s sic v a ria b le c a p a c ito rs,                     re so n a n t c irc u its because I a d d ressed
                                                                                                                                                                             COLUMNS
in d u c to rs are also v a rie d by m e ch anical                        them in my C irc u it C e lla r 283 a rtic le ,
m eans,        w h e th e r   by       sq u ee zin g and                  "W ire le ss Data L in k s." In the fu tu re , I'll
s p re a d in g a ir-c o re in d u c to r tu rn s or by                   retu rn to the su b je c t to exam in e som e
m oving the fe rro m a g n e tic co res inside the                        s p e c ific a p p lic a tio n s such as RF and pow er
coils. Som e la rg e r co ils m ay have a w ip er                         tra n s fo rm e rs ,       in d u c tiv e se n so rs,   RLC
slid in g a cro ss it, e ffe c tiv e ly chang ing the                     filte rs , and m ore. 0
n um ber of tu rn s. G e n e ra lly sp ea kin g ,
v a ria b le in d u c to rs are used in the sam e
sense as trim pots. T h ey 're set once and                                  ABOUT THE AUTHOR
fo r all. There are m o n o lith ic, e le c tric a lly                        George Novacek is a professional engineer with
c o n tro lle d v a ria b le in d u c to rs w here MOS                        a degree in Cybernetics and Closed-Loop Con
sw itc h e s co nnect to d iffe re n t ta p s of an                           trol. N o w retired, he was most recently president of a multinational m a n u 
in te rn a l inductor.                                                        facturer for embedded control systems for aerospace applications. George
     A lso, M EM s-based e le c tric a lly v a ria b le                       wrote 26 feature articles for C ircu it Cellar between 1999 and 2004. Contact
in d u c to rs have been developed. They
                                                                              him at gnovacek@nexicom.net w ith "Circuit Cellar"in the subject line.
d o n 't seem to be used v e ry m uch. I
  The PP C -090T com es ready to run w ith the O perating S ystem installed on flash
  disk. A p ply pow er and w atch the Linux X -W indow s desktop user interface appear
  on the vivid color LCD. Interact w ith the PP C -090T using the responsive integrated
  touchscreen. Everything w o rks out of the box, allow ing you to concentrate on your
  application rather than building and configuring device drivers. Just W rite-It and
  Run-It... P r ic in g s ta r ts a t $ 4 9 5 f o r Q t y 1.
http://www.emacinc.com/sales/cc9
    Since 1985                  C
         OVER
          29
       YEARSOF
                                                   \IT         An
Phone: (618) 529-4525 • Fax: (618) 457-0110 • www.emacinc.com
BOARDS, BOOKS, DVDs AND MORE AT WWW.ELEKTOR.COM/STORE
                                                                                                              ADVANCED CONTROL
Elektor.STORE
The world of electronics
at your fingertips!
                                                                                                        Theory and best practices
                                                                                                        Advanced Control
                                                                                                        Robotics
                                                                                                        It doesn’t matter if you’re building a line-follow
                                                                                                        ing robot toy or tasked w ith designing a mobile
                                                                                                        system fo r an extra te rre stria l exp lo rato ry
                                                                                                        mission: the more you know about advanced
                                                                                                        robotics technologies, the better you’ll fare at
                                                                                                        your workbench. Hanno Sander’s Advanced
                                                                                                        Control Robotics simplifies the theory and best
                                                                                                        practices o f advanced ro b o t technologies.
                                                                                                        You’re taught basic embedded design theory
                                                                                                        and presented handy code samples, essential
                                                                                                        schematics, and valuable design tips (from con
                                                                                                        struction to debugging).
qw ptfny Pi'
                                                                                                                Êli-krür
    Fun to build and use projects!
                                                                                                        The RPi in Control Applications
    Create 30 PIC Microcontroller Projects
    with Flowcode 6                                                                                     Raspberry Pi
    This book covers the use o f Flowcode® version 6, a state-of-the-art, all-graphical based code
                                                                                                        Hardware Projects
    development tool, for the purpose o f developing PIC microcontroller applications at speed and      This book is about the Raspberry Pi computer
    w ith unprecedented ease. W ith o u t exception, the 30 projects in the book are fun to build and   and its use in con trol applications. Dogan
    use. A secret doorbell, a youth deterrent, GPS tracking, persistence o f vision (POV), and an       Ibrahim explains in simple terms, w ith exam
    Internet Webserver are ju st a few examples o f projects in the book waiting to be explored and     ples, how to configure the RPi, how to install
    mastered. This makes the publication a perfect source o f projects constantly challenging your      and use the Linux operating system, how to
    hardware and software skills as you progress, resulting in advanced microcontroller applica        w rite programs using the Python program 
    tions you can be proud of. All sources referred in the book are available for free download, in    ming language and how to develop hardware
    cluding the support software.                                                                       based projects.
232 pages • ISBN 978-1-907920-30-1 • $48 290 pages • ISBN 978-1-907920-29-5 • $54
                                                                       Elektor is more
                                                                 than just your favorite
                                                                 electronics magazine.
                                                                 It’s your one-stop shop
                                                                    for Elektor Books,
                                                                          CDs, DVDs,
                                                                       Kits & Modules
The Ultimate Guide!                                                                                           IO-Warrior Expansion
                                                                     and much more!
The LTspice IV Simulator                                                                                      Board
In a sturdy, hard-cover form at, The LTspice IV
                                                           www.elektor.com/store
                                                                                                              Don’t throw o u t your old PCs and notebooks
Simulator describes the operation o f the pro                                                                or leave them gathering dust in the basement!
gram , all available com mands, the various                                                                   They can be a useful resource: by adding this
editors, dealing w ith SPICE models, the use of                                                               universal interface card an old PC can be pres
non-linear components and more. This book is                                                                  sed into service as a measurement and control
more than just a manual. It also offers a variety          (         R e k t o r                              hub. An IO-Warrior module on the I/F board
o f tips, m ethods and examples, all carefully                                                                takes care o f USB communication, and source
illustrated using alm ost 500 drawings, dia               Elektor US                                         code is available th a t w orks w ith the free
grams and screenshots on high-quality paper.               111 Founders Plaza, Suite 300                      version o f Visual Studio.
The book is designed so th a t it is suitable for          East Hartford, CT 06108
both beginner and veteran SPICE users.                     USA                                                Ready-builtmodule
                                                           Phone: 860.289.0800
744 pages • ISBN 978-3-89929-258-9 • $67                                                                      Art.# 130006-91 • $54
                                                           Fax:     860.461.0450
                                                           E-mail: order@elektor.com
COLUMNS
                                                                                he Sears Kenmore Model 158 sewing                                                                 to obsolete collectibles; entire com puter
                                                                             T  machine that M ary received as a college                                                          arch itectu res rose and fell; all while that
                                                                             graduation present has produced hundreds                                                             purely mechanical sewing m achine ticked
                                                                             of her projects, ranging from sim ple pillow                                                         along, decade after decade.
                                                                             covers to     com plex   free-m otion    quilts.                                                         Contem porary sewing m achines offer
                                                                             Fashions cycled in and out of favor; electronic                                                      far more features, but m em bers of the local
                                                                             com ponents went from new -and-innovative                                                            quilting club report that five years of operation
                                                                                                                                                                                  seems typical. Even if the machine doesn't fail,
                                                                                                                                                                                  its m anufacturer m ight not keep pace with the
                                                                                                                                                                                  consequences of Moore's Law. For example, a
                                                                                                                                                                                  friend still boots an ancient PC, because her
                                                                                                                                                                                  fancy sewing machine includes a proprietary
                                                                                                                                                                                  interface card and softw are that w on't run on
                                                                                                                                                                                  any version of Windows beyond 98.
                                                                                                                                                                                       Rather than buy a new sewing machine,
                                                                                                                                                                                  M ary asked me to add a few specific features
                                                                                                                                                                                  to her dependable Model 158, including better
                                                                                                                                                                                  lighting, precise speed control, and the ability
                                                                                                                                                                                  to stop with the needle at the top or bottom
                                                                                                                                                                                  of the stroke. That doesn't seem like much,
                                                                                                                                                                                  does it?
                                                                                                                                                                                      The "b etter lighting" part involved placing
                                                                                                                                                                                  3-D printed brackets and LED strip s along
                                                                                                                                                                                  the m achine's arm , with high-pow er LEDs
                                                                                                                                                                                  replacing the incandescent lamp in its end
                                                                                                                                                                                  cap above the needle, with a DC supply to
                                                                                                                                                                                  prevent strobing. Any Circuit Cellar reader
                                                                                                                                                                                  can build that easily enough!
                                                                                                                                                                                      In th is colum n I'll describ e the fir s t steps
                                                                                                                                                                                  along the w ay to im plem enting the other
                                                                                                                                                                                  features on her list. C o n tra ry to w hat you
                                                                                                                                                                                  m ig h t e xp ect, co n tro llin g the m otor speed
          PHOTO 1
                                                                                                                                                                                  poses the h a rd e st pro b lem , because the
          T h e o r ig in a l fo o t p e d a l u se d s ta c k s o f g r a p h it e d is k s in a c e r a m ic c a s e a s a v a r ia b le r e s is to r th a t c o n v e rte c
                                                                                                                                                                                  p ro ject sp e cifica tio n s include low noise:
          e x c e s s p o w e r in to h ea t; th e s m a ll a lu m in u m h e a ts in k s lig h t ly in c re a s e s th e s u r f a c e a r e a in s id e th e B a k e lite
          c a se . T h e s m a ll ro d n e a r th e to p o f th e p ic t u r e s lid e s fo r w a r d , a p p ly in g p r e s s u r e to th e g r a p h it e d is k s
                                                                                                                                                                                  she likes the Model 158's qu iet m echanical
          th r o u g h a c o n ic a l s p rin g .
                                                                                                                                                                                  sound.
                                                                                                                                                circu itc el lar .c om          59
The Model 158, like m ost classic sewing Kcnmore Modci 15B Sewing Machine T h e s e w in g m a c h in e 's m o to r has a
m achines, contains a single universal motor AC Motor on OC lin e a r r e la tio n b e tw e e n speed anc
                                                                                                        v o lta g e . T h e b lu e c u rv e r e p r e s e n ts th e
belted to the central shaft driving the cams,             9000
                                                                                                        u n lo a d e d m o t o r re s p o n s e a n d th e re d
crank arm s, eccentrics, and accessories.
                                                                                                        c u rv e s h o w s it d r iv in g th e M o d e l 1 58 's
The m otor data plate proclaim s "100/120 V                                                             m a c h in e r y .        The    m o to r      ru n s     e q u a lly
50/60 HZ AC 1.0 AMP," but it obviously cannot                                                           w e ll fr o m       a n A C o r D C s u p p ly ; th e se
dissipate 120 W on a continuous basis.                                                                  m e a s u r e m e n ts u se d a 5 0 V D C be n ch
The series-connected rotor and arm ature                                                                s u p p ly .
                                                                                                                                                                                 COLUMNS
rheostat that controls the m otor speed by                                 OCvtils
changing the resistance in series with the
w indings: lighter foot pressure means higher
resistance, lower current, and slow er rotation;        For exam ple, the m otor ran at 3 kRPM while
heavier pressure com presses the disk stacks,       M ary quilted an intricate series of leafy vines.
reduces the resistance, and increases both          Figure 1 shows that speed requires 50 V across
current and speed. The "control loop" closes        the motor, w ith the rem aining 70 V across the
through the operator's eyes and foot, with          rheostat. Assum ing 700 mA of m otor current,
su rp risin g ly good results.                      the graphite disks have a resistance around
     With no pressure on the foot pedal, the        100 Q and dissipate 50 W in the foot pedal.
brass strip near the top of the picture doesn't     She generally stops sewing when the pedal
connect the graphite disk stacks, removing          surface reaches 140°F, generally after half an
power from the motor. Just before the pedal         hour of interm itten t use.
reaches full travel under heavy pressure, a             As you m ight im agine, the aged brass
brass disk em erges from the hole visib le near     contacts and w orn graphite disks inside the
the fron t of the ceram ic insulator, shorts the    foot pedal don't produce a clean analog signal,
two brass tabs, and connects line voltage           particula rly when operated at logic-friendly       PHOTO 2
                                                                                                        A 3 -D p r in te d f r a m e a lig n s th e b ra s s
directly to the w indings. In between those         voltages, so updating the sewing machine's
                                                                                                        tu b e      h o ld in g    a    n e o d y m iu m          m agnet
lim its, the graphite disk rheostat acts as a       perform ance m ust sta rt with m odernizing the
                                                                                                        w it h th e H all e ffe c t m a g n e t ic s e n s o r
resistance between 1 kQ and 30 Q.                   foot pedal.
                                                                                                        at    th e       b o tto m       of    th e      r e c ta n g u la r
    A universal motor can run equally well from                                                         o p e n in g . In th e tr u e               s p ir it o f ra p id
an AC or DC supply, although AC is far more         MAGNETIC PEDAL POSITION                             p r o to t y p in g , I s a n d e d          about        1 mm
common these days. Figure 1 shows the motor         SENSING                                             fr o m th e f r a m e to c le a r th e p e d a l a t
speed as a function of voltage using a 50-V DC         Contem porary    sewing    m achine   foot       its fu ll s p e e d p o s itio n ; th e fin a l f r a m e
bench supply; the blue curve from the unloaded      controls use linear potentiom eters or optical      v e rs io n w ill f it c o rr e c tly !
                                                                            sensors m echanically linked to the pedal                                                           saturates sm oothly at each end of the pedal
                                                                            motion. While I could probably reverse                                                             travel, with a nearly linear slope in the
                                                                            engineer one of those controls and adapt it                                                         middle. A potentiom eter or optical encoder
                                                                            to the Model 158, a m ore direct approach                                                           would generate a linear slope over the entire
                                                                            seemed easier: replace the rheostat inside                                                          m echanical range, with abrupt transitions
                                                                            the old pedal housing with contem porary                                                            at each end, so this sm ooth m agnetic curve
                                                                            circu itry using a low -voltage supply.                                                             seem s much more suitable for direct speed
                                                                                Photo 2 shows a prototype sensor with                                                           control w ithout any fu rth er shaping.
                                                                            an SS49 linear Hall effect sensor m easuring                                                            The first 3-D printed fram e supported and
                                                                            the m agnetic field produced by a neodym ium                                                        aligned the telescoping brass tubes with only
                                                                            m agnet that approaches the sensor as the                                                           a bit of shim m ing, which certainly came as
              ABOUT THE AUTHOR                                              foot pedal moves downward. The white 3-D                                                            a pleasant surprise. The ragged honeycomb
               Ed N is le y is a n EE a n d
                                                                            printed fram e uses the sam e mounting holes                                                        visib le along the fron t edge shows w here the
                                                                            as the ceram ic rheostat, with the m agnet on a                                                     block didn't quite fit under the fully depressed
               a u th o r        in     Poughkeep
                                                                            brass tube attached to the original actuating                                                       pedal. I thinned that edge with a belt sander,
               s ie , NY. C o n t a c t h im a t
                                                                            bar near the rear of the housing. A larger brass                                                    updated the solid model, and the next
               e d .n is le y @ p o b o x .c o m
                                                                            tube in the fram e surrounds the m agnet tube                                                       version will look much more finished: rapid
               w it h " C i r c u i t C e lla r " in
                                                                            to ensure exact fron t-to-back motion with low                                                      prototyping at work!
               th e s u b je c t lin e to a v o id
                                                                            friction. The Hall effect sensor, barely visible                                                        The num bers look good, but there's
               s p a m filte rs .
                                                                            as the thin black rectangle near the fron t of                                                      nothing like an actual test to v e rify how it
                                                                            the rectangular opening, attaches to the three                                                      works.
                                                                            w ires passing below the cylindrical magnet.
                                                                                                                                                                                STEPPER MOTOR ELIMINATION
                                                                                                                                                                                    Photo 3 shows one of the m ost astonishing
                                                                                                                                                                                coincidences I've ever seen: a NEMA 23 stepper
                                                                                                                                                                                m otor fits perfectly into the space vacated
                                                                                                                                                                                by the original AC motor, its 1/4 inch shaft
                                                                                                                                                                                m atches the original pulley, and the pulley
                                                                                                                                                                                co rrectly aligns with the drive belt. I filed a
                                                                                                                                                                                flat on the stepper shaft to accom m odate the
                                                                                                                                                                                pulley setscrew , but that was the extent of
                                                                                                                                                                                the hardw are m odifications.
                                                                                                                                                                                    The 3-D printed adapter plate isn't
                                                                                                                                                                                suitable for long-term use, because the
                                                                                                                                                                                stepper m otor case approaches the PLA
                                                                                                                                                                                plastic's 60°C glass tra n sitio n tem perature
                                                                                                                                                                                during extended operation, but it sufficed for
                                                                                                                                                                                my initial tests. As you can tell, a 3-D printer
                                                                                                                                                                                sim p lifie s designing the m echanical parts of
                                                                                                                                                                                a project, even if I m ust m achine the final
                                                                                                                                                                                parts from metal or a m ore rugged plastic.
                                                                                                                                                                                    Of course, a NEMA 23 stepper m otor can't
                                                                                                                                                                                possibly run at the sam e 11 kRPM as the
                                                                                                                                                                                original AC motor, but it has such sim ple drive
                                                                                                                                                                                requirem ents that I lashed together the test
          PHOTO 3
                                                                                                                                                                                setup in Photo 4 to check out the m odified
          A N E M A 2 3 s te p p e r m o t o r on a 3 D p r in te d b r a c k e t f it s p e rfe c tly in th e s p a c e in te n d e d fo r th e o r ig in a l A C
                                                                                                                                                                                foot pedal control. The stepper inside the
          m o t o r. I t 's a p o o r r e p la c e m e n t (fo r re a s o n s d e s c r ib e d in th e te x t), b u t it s u ffic e d to c h e c k o u t th e H all e ffe c t   sewing m achine connects to a M542 stepper
          s e n s o r in th e m o d if ie d fo o t pedal.                                                                                                                       driver powered from a 36-V DC supply. The
         E   X    P   E   R    I   E   N   C    E
   C -R U N F O R A R M
        In I A R E m b e d d e d W o r k b e n c h
          p o w e re d     fro m       th e 3 6 V D C b ric k o r
                                                                                                                                                                                     updates the tim e r accordingly. Because the
          th e left. A ll o f m y te sts use a d u p lica te
                                                                                                                                                                                     Hall effect sensor presents such a sm ooth
          " c ra s h te s t d u m m y " M od el 158 on m y                                                                                                                           curve, the direct linear m apping produces a
          w o rk b e n c h , n o t M a ry 's fa v o r it e s e w in g                                                                                                                very nice pedal response.
          m a c h in e .                                                                                                                                                                 The constants baked into the map()
                                                                                                                                                                                     function show why the stepper m otor w on't
                                                                                                                                                                                     w ork in this application: it cannot turn faster
                                                                                                                                                                                     than about 2500 RPM and, because its torque
                                                                                                                                                                                     drops off dra m a tica lly w ith increasing speed,
COLUMNS
  Y o u r G R E E N M e m b e r s h ip
  C o m p r is e s :
                                                              EXCLUSIVE OFFER
                                                                FREE E-BOOK on AVR/Software
  • 10 Editions of Elektor magazine in digital
                                                                 Defined Radio with an Elektor
    format (pdf)
  • Direct access to Elektor.LABS; our virtual,
                                                                    GREEN Membership!*
    online laboratory                                                          Order Today at
  • Direct access to Elektor.MAGAZINE; our                             www .elektor.com /m em bership
    online archive for members                       * Available through www.elektor-magazine.com after you have received your magazine download login details.
                                                                                                                                                                                                                                     COLUMNS
the point at 150 V, 1 A lies even closer to the
DC boundary.
     The "Locked Rotor" point shows the
conditions when the base drive allow s more
than the 3 A of m otor current a locked rotor
w ill draw from the power line. The collector
would saturate at about 1 V, because the
tra n sisto r doesn't lim it the current, and the
entire line voltage appears across the motor.
                                                     PHOTO 6
That's deep inside the DC SOA, w here the
                                                     T h e h u g e E T 2 2 7 NPN t r a n s is t o r on th e h e a ts in k a c ts a s a c u r r e n t lim it e r c o n t r o llin g th e m o t o r sp e e d . U n lik e
ET227 rem ains perfectly happy.
                                                     a m o r e c o m p le x a n d e f f ic ie n t PW M d riv e , it s im p ly d u m p s e x c e s s p o w e r in th e la rg e a lu m in u m h e a ts in k . T h e
     Homework:          given      the      m otor
                                                     s m a lle r h e a ts in k h o ld s a b r id g e r e c t if ie r th a t p ro v id e s p u ls a tin g D C to th e m o t o r a n d ET 227.
ch aracteristics, fill in the points for locked-
rotor conditions w ith the collector current
lim it set between 500 mA and 3 A.
     Contem porary sw itching power supply
designs can sw itch sim ila r loads with
relatively sm all MOSFETs, but only a fter
ensuring that the tra n sisto rs operate fully on
or fully off. With a stric tly lim ited transition
tim e and tight control over the energy stored
in reactive com ponents, the tra n sisto rs
venture only briefly into the up per-rig ht
corner of th eir SOA diagram and live to tell
the tale.
                                                     FIGURE 3
     The ET227 dissipates about 30 W under
                                                     B e c a u s e a u n iv e rs a l m o t o r c a n ru n on e it h e r A C o r D C, a b r id g e r e c t if ie r a n d a b r u t e - f o r c e lin e a r tr a n s is t o r
the conditions shown in Photo 5, but a quiet         ca n s u b s t itu te f o r a n e la b o ra t e PW M d riv e . T h is p ro to t y p e la y o u t u se s a n is o la tio n t r a n s f o r m e r a n d an
fan should keep that under control. There's          is o la te d p o w e r s u p p ly , w h e r e a n a c tu a l c ir c u it w o u ld d e p e n d on o p tic a l is o la to rs , g ro u n d e d e n c lo s u re s , an d
no sw itching noise, M ary's foot w on't get hot,    a d e q u a te in s u la tio n .
and I think this w ill w ork out quite well.
CONTACT RELEASE
     The sew ing m achine appearin g in this
colum n is a duplicate Kenm ore Model 158
I bought on eBay as a crash test dum m y
that allow s me to develop m o d ifica tio ns
in my shop w ith my tools and instru m ents
nearby, then update M ary's m achine with
m inim al dow ntim e. Eventually, the dum m y
w ill becom e a donor filled w ith spare parts.
       Your favorite parts d istrib u to r w on't
c a rry long-obsolete ET227 tra n sisto rs, so                                                                                                                  FIGURE 4
you should consider MOSFETs rated for linear D e s p ite its 1 kV a n d 1 00 A ra tin g s ,
                                                                                                                                                                th e S O A .
  66      CIRCUIT CELLAR • NOVEMBER 2014 #292
          Embedded Voice
          Recognition (Part 2)
COLUMNS
                                                    ast month, I dem onstrated how to use          The module also has one audio file that is
                                                L   the TIGAL EasyVR recognition module
                                                to control a PC application. The module's
                                                                                                   preprogram m ed. It is a "beep," which I
                                                                                                   used to indicate an error in recognition. The
                                                serial port accepts ASC com m ands from an         EasyVR module has room for many m inutes of
                                                application and perform s speech recognition       additional sound files.
                                                on live audio input looking for a match within        Last month, I introduced the EasyVR
                                                a selected word group. It reports status back      Com m ander application that aids in adding
                                                through the serial port and your application       and training your own SD w ords to your
                                                uses the results to determ ine w hat to do         EasyVR module. This month, I'll concentrate
                                                next. The PC application I w rote began as         on how sound files are added and accessed
                                                a manual shape-draw ing program , which            with your EasyVR module.
                                                included circles, boxes, and ellipses. Each
                                                shape has param eters like color, size, and        AUDIO
                                                position that are in itially random ly selected.       If you don't have an audio editor application
                                                Once debugged, I added serial routines to          on your PC, I recom m end checking out
                                                com m unicate with the EasyVR module. The          A udacity    (http://audacity.sourceforge.net/),
                                                param eters were added into word groups            which is a free, open-source, cross-platform
                                                on the EasyVR module. The result enables all       audio editor available for Windows, Mac,
                                                the param eters to be controlled via speech        and Linux. With Audacity, you can im port or
                                                recognition.                                       record, edit, analyze, and export audio files.
                                                     The EasyVR has 28 preprogram m ed             Of interest here is the a b ility to record a mono
                                                speaker-independent (SI) standard words            16-bit WAV file using your system 's sound
                                                divided into four groups that are available        card and an internal or external microphone.
                                                w ithout any training. You can add up to 32        You can record a sound effect, speech, music,
                                                additional speaker-dependent (SD) words by         or other noise to be played back through a
                                                training each using the attached microphone.       speaker connected to your EasyVR module. I'll
                                                                                                                                                  circu itc el lar .c om       67
be using audio output to not only indicate an         recognition as well as high-quality, low -data-
error using the preloaded "beep" file, but also       rate com pressed speech (audio). EasyVR
add an audio list of the acceptable vocabulary        comes with a design tool to help create and
should a user need a hint.                            manage speech and sound synthesis. Quick
    A few m onths ago, I showed how an IR             Synthesis 5 (QS5) gathers together your
remote can be used to access a num ber of             WAV files and checks that they are in a legal
different IR com m unication form ats. This           form at. Before building an indexed sound file,
project used a way to define IR protocols using       each WAV file is com pressed using a user-
a readable descriptive form at. This descriptive      selectable form at. Each com pressed file can
                                                                                                         TABLE 1
form at was used to identify IR form ats and          be played so you can review the effects of
                                                                                                         For     t h is    p r o je c t   I      began       c o lle c tin g
recreate them. The m icrocontroller handling          com pression.
                                                                                                         u s e fu l   com m ands              in to   w o rd     g ro u p s
the IR receiver and tra n sm itter used an                Photo 2 shows my files after com pression.
                                                                                                         and      c r e a t in g   lo g ic a l    p a th s     b e tw e e r
available serial port for user I/O. Initially, this   There are a few other interesting things that
                                                                                                                                                                                COLUMNS
                                                                                                         g ro u p s . I u se th e c o m m a n d " W h a t? "
was used to investigate som e IR rem otes I           you can do with QS5. The WAV files can be          to p r o m p t th e u s e r w it h a u d io o u tp u t.
had collecting dust. In the end, I was able to        used to create sentences from individual           th a t lis ts th e w o r d s in th e 'a c tiv e ' w o rd
replace my TV/cable rem ote and control the           words or phrases. Perhaps your scrip ts have       g ro u p .
                                                                                                                                                                                                                              COLUMNS
                                                       P                9   Group                                                    9 SND_IR_V0ICE_C0MMANDER_MENUS_9
and debug port. The user I/O now comes                              10                            0
                                                       P                    Group                                       Q           10    SNDJR.VOICE.COMMANDER.MENUSJ 0
from the EasyVR module. Anyone fa m ilia r with        P            11      Group                 0                     Q           11    SNDJR.VOICE.COMMANDER.MENUSJ 1
this m icrocontroller knows that it includes           P            12      Group                 0                     Q           12    SNDJR.VOICE.COMMANDER.MENUSJ 2
                                                                                                                                                                               re s p o n s e s     u se d    in    th is
  t                0x74        Tim eout             none                                                  OK
                                                                                                                                                                               p ro je c t.
  70      CIRCUIT CELLAR • NOVEMBER 2014 #292
          FIGURE 1
          I   added          an      E a sy V R    m o d u le     to     th e
c ir c u it th a t I u se d p re v io u s ly to
          in v e s tig a te IR c o m m u n ic a t io n s .
COLUMNS
                                                                                EasyVR module's attention, I sent the break       of any word in the "active" group. Only
                                                                                command "b." This forced the module to drop       one group is "active" at a time. While you
                                                                                everything and send back the "o" response. I      could put the total vocabulary into a single
                                                                                stayed in a loop of sending and looking for the   group, breaking this into smaller groups of
                                                                                response (with a few-second timeout) until        words with similar functions gives some
                                                                                communication was established.                    organization to the process and allows the
                                                                                    Refer to Figure 2 to get a feeling for a      recognition algorithm to be more accurate,
                                                                                command's flow, its response, and how the         especially when two words may sound similar.
                                                                                application should proceed upon recognition           It is worthwhile to pause a minute here to
                                                                                                                                  cover error responses. If you refer back to the
                                                                                                                                  "d " response in Table 2, you'll note that there
          FIGURE 2
                                                                                                                                  are a number of error values that might be
          T h is        is        th e      g e n e ra l      flo w        of
                                                                                                                                  returned as opposed to the recognized ("r"),
          c o m m u n ic a t io n s b e tw e e n th e E a sy V R
          m o d u le a n d th e a p p lic a t io n . A g ro u p
                                                                                                                                  similar ("s"), or timeout ("t") responses. An
          can      h a v e 1 to 3 2 w o r d s tr a in e d                fo r                                                     error code is available after an "e" response.
          re c o g n itio n . All g ro u p s h a v e a d e fa u lt                                                                As you can see by referring to Table 2, most
          t im e o u t       a s s o c ia te d    w it h   th e m .      For                                                      of the errors relate to what you might have
          th e f ir s t g ro u p 'A ' (0), th is is n o rm a lly                                                                  done wrong. Others have to do with a level
          in fin ite . T h is m e a n s th e re w ill be no                                                                       of confidence or other nonrecognition errors.
          t im e o u t o r re s p o n s e u n til its " t rig g e r"
          w o rd is re c o g n iz e d .
                                                                                                                                  DO TASK
                                                                                                                                      As depicted in the generalized flow chart,
                                                                                                                                  recognition begins when the application
                                                                                                                                  sends the SD Recognition command "d "
                                                                                                                                  along w ith a group number. The application
                                                                                                                                  now w aits for the EasyVR module to respond
                                                                                                                                  w ith " i," "e," "o ," "r," "s," " t ," "v," or "w ."
                                                                                                                                  The last two responses are not necessarily
                                                                                                                                  connected to a particular command. The
                                                                                                                                  "v " response is sent whenever the module
                                                                                                                                  is "vexed" or has received a character it
                                                                                                                                  doesn't understand or expect. The "w "
                                                                                                                                  response is a indication that the module
                                                                                                                                  "woke up" from Sleep mode. Of all these
                                                                                                                                  responses, only "e," "r," and "s " include
                                                                                                                                  addition data values. The responses " r " and
                                                                                                                                  "s " have 1 byte, the word index "recognized"
                                                                                                                                  or "sim ila r." The e rro r ("e") response has an
                         Unlock the power of embedded design
whenever an IR transm ission occurs. A fter all,         With a sim ple toggle flag, I prefaced the
that's the im petus for this project.                    eavesdropping    with   "CMD:"   when   the
    Based on my IR-related articles in Circuit           characters came from TX1 and "VR:" when
Cellar issues 289 and 290, I have a m echanism           the characters came from RX1 (see Photo 4).
to duplicate the IR transm issio ns of my IR             You can see the debug com m unication on
remotes. While those a rticles introduced a              TX2 between the application and the EasyVR
descriptive way of defining differing types of           module during operation. This came in handy
IR protocols, the end product gives access to            when I made the m istake of looking for a
sending those protocols. Basically, you choose           single additional response character after
the protocol necessary and the application               receiving the "e" response. Because I only
builds a list of tim ing instructions to reproduce       asked for one character, the next command
button data in the chosen protocol. You may              was seen by the EasyVR module as a m istake
need to expand the code I presented to cover             and responded with a vexing ("v") response.
                                                                                                                                                        COLUMNS
a particular protocol, but that's all part of the        The extra tim e spent coding a debug trail
learning experience, right?                              turned out quite handy!                              ABOUT THEAUTHOR
    The B u t t o n P u s h routine is responsible for
                                                                                                              Jeff Bachiochi (pro
building the transm ission characteristics for           THE END?
an IR protocol. The data carried in the protocol              I'll need som e tim e to play with this
                                                                                                              nounced BAH-key-AH-
indicates which function should be preformed             project a bit to figure out w hether it is w orthy   key) has been writing
by the device receiving the IR transm ission.            of continuing. To me it makes little difference.     for C irc u it C ellar since
For instance when you push the Power Button              A fter all, I'm not trying to hit pay d irt here     1988. His background
on your IR remote, a coded message is sent               by inventing the next w idget that will set          includes product design
out by m odulating an IR LED. All IR receivers in        me up for life. No. I have bigger fish to fry.       and manufacturing.
your AV equipm ent may see your transm ission,           I w ant to keep helping readers understand           You can reach h i m at
but only those understanding a particular                w hat kind of technologies are out there, show       jeff.bachiochi@imagine
protocol (m anufacturer's preference) can                'em how to use it, and just let it sim m er on       thatnow.com or at www.
make use of it. A fter consum ing the protocol's         the their back burner. Here's hoping all this        imaginethatnow.com.
transm ission data, they m ust interpret the             will heighten your passion for curio sity and
data as a particular function (i.e., toggle the          provide alternative paths to follow. I think we
state of system power).                                  all win no m atter what the outcome.
    In this application, Recognition of a word                I noted a couple of things while using
in an active Group brings with it an associated          EasyVR that I think would make for a better
action. The word "Cable" in Group 1 has an               product. While QS5 has a COM port lim itation
action of defining an IR protocol and making             of 1-16, this is not practical with today's USB
Group 3 active. The word "Channel" in Group              ports that can be assigned port num bers
3 has an action of making Group 5 active.                much higher than this. Fortunately, the VR
A num ber recognized from Group 5 has an                 Com m ander does not have this lim itation and
action of selecting which button 0 -9 will               can be used to im port the sound files built
be sim ulated, building an IR transm ission,             by QS5.
sending the IR transm ission, playing the                     While this sound file can be saved and
"Z A P " audio clip, and reissuing a command to          edited (to add m ore audio files), the Speaker
recognize another num ber in Group 5. When               Dependent groups built and trained cannot be
finished entering (recognizing) num bers, no             saved to a file. It is uploaded from the EasyVR
audio will respond w ith a tim eout, which will          module every tim e it's connected so it can be
revert back to Group 0, looking for the trigger.         edited, ju st not duplicated!
The cable box will receive som e num ber of                   You'll notice I used the sam e word in a
digits (IR transm issions) and change the                num ber of word groups. Each tim e the word
channel autom atically when tra nsm issions              is used, it reduces the word count and must
cease.                                                   be trained for that group. It would be nice to
    The previous project used UART1 as user              enter and train a word once and then assign
I/O for function control. For this project,              it to any group or groups.
I needed the port for com m unication to                      While I think this is a great product and
the EasyVR module; however, I still wanted               fills a void that makes recognition available
som e feedback as to what was going on. This             for the sm all projects, it would be nice if they
helps with debugging when things don't go                replied to subm issions using their support
as expected. The PIC m icrocontroller actually           form . Hey, I know I'm just a little guy. But I
has two UARTs. The second UART uses the                  ca rry a big stick! O
sam e I/O lines as the ICD debug/program m er
port. This will mean that I can use it only if
the ICD is not connected. I added code to both
the RX1 and TX1 routines to send whatever
was coming in or going out to UART2 TX2.
   74          CIRCUIT CELLAR • NOVEMBER 2014 #292
1 2
5 6
8 9
10 11
                                 12                  13
& CHALLENGES
14
15
                                                                                                      16
TESTS
17
18
19
20
                                                                           TEST YOUR EQ
                                                                                     C ontributed b y D avid Tweed
PR O BLEM 1                                                            PR O BLEM 3
   Let's talk about noise! There are different types                     When you have m ultiple sources
of noise that might be present in a system, and                        of noise in a system , how can you
it's important to understand how to deal with                          characterize their combined effect on
them.                                                                  the overall system perform ance?
   For example, analog sensors and other types
of active devices will often have AWGN, or                             PR O BLEM 4
Additive White Gaussian Noise, at their outputs.
                                                                         Broadband analog sensors and other
Any sort of analog-to-digital converter will add
                                                                       active devices often specify their noise
quantization noise to the data. What is the key
                                                                       levels in units of "m icrovolts per root-
difference between these two types of noise?
                                                                       H ertz" (pV/VHz) or "nanoam ps per
                                                                       root-H ertz" (nA/VHz). Where does this
PR O BLEM 2                                                            strange unit come from , and how do
 Signal-to-noise ratios are most usefully                              you use it?
described as power ratios. How does one
characterize the power levels for both AWGN
and quantization noise?
     G       circuit cellor
76   CIRCUIT CELLAR • NOVEMBER 2014 #292
CC SHOP
                                                                                                          A sse m b ly
                                               Q    CC VAULT                                               Language
                                                   CC Vault is a pocket-sized USB that
                                               comes fu lly loaded w ith every issue of                   E ssen tials
                                               C/raMml                   I ¡m|i M m ipre-                                     Larry Cicchin e lli
Item #: CCI/E E H i
ADVANCED CONTROL
                                                                                          the directory of
           IDEA BOX                                                                       PRODUCTS & SERVICES
     For current rates, deadlines, and more information contact Peter Wostrel
     at 978.281.7708 or circuitcellar@smmarketing.us.
       Electronic
                                                                      seeking your
       and Electro-mechanical                                       design solutions.
       Devices, Parts
       and Supplies.                                                 Magazine, e-newsletters,                      Includes IDE for PIC16F1459
       Many unique items.                                         website, advertorials, and more.                 with direct access to USB
       We have what                                                  RESERVE ADVERTiSiNG
                                                                        SPACE TODAY!
                                                                                                              \
                                                                                                              I
                                                                                                                   G et S tarted Q uickly!
       you need                                                                                                    14 example projects:
       5 “Y%yv                                                    Strategic Media Marketing, LLC                       -Analog I/O - PWM Output
                                                                                                                       - TTL RS-232 - I2C ...& More!
       project
                                                                     978.281.7708                                 www.ccsinfo.com/CC1114
                                                                                                                   PIC® M C U is a registered trademark of M icrochip Technology Inc.
                                                                  circuitcellar@smmarketing.us
        www.allelectronics.com                                                                                         sales@ ccsinfo .co m
        F r e e 9 6 p a g e catalog 1 - 8 0 0 - 8 2 6 - 5 4 3 2       www.smmarketing.us                                2 62-52 2-6 50 0x 35
                                                                                 CC14061
                                                                                                                        zm
                                                                                                                  ;,i ■j i i £
                                                                                                                                             Kintex-7, Spartan-6, Virtex-5
                                                                                                                                             and other m any FPG A boards
                                                                                                                                             are available       . * i* o C
                                                                                                                  A CM Se ries
                                                                    PCB & PCBA                                    Cyclone V, Arria II,
                                                                                                                  M AX II and other
                                                                                                                  m any FPGA boards
                                                                                                                                            *
                                                                                                                                                            •/.I
                                                                                                                  are available           ;
                                                                      Small to Mass QTY                           ■Basic and sim ple features, single power operation
                                                                                                                  ■Over 100 varieties of FPGA/CPLD boards are available
                                                                             INSTANT Q UO TE AT:
                                                                                                                                    PLCC68 Series
                                                                  www.myropcb.com                                                    Designed for 68-pin PLCC socket
                                                                                                                                     Very small size (25.3 x 25.3 [mm])
                                                                              OR CALL:                                               50 I/Os (External clock inputs available)
                                                                                                                                     3.3V single power supply operation
                                                                                                     MaxBotix
                                                                                                     H ,gh t^ rtQ rm M nc* V H r ifa n lf X m n g a tü K ie ii
                                                                                                                                 Save 20%
                                                                                                                          O n lin e W e b -O rd e r C ode:
                                                                                                                                     CC111430
                                                                                                                              V alid thru Decem ber 1, 2014
BECOME
                                                                                                 HRXL-MaxSonar®-WR™
                                                                                                 - H ig h n o is e to le r a n c e
                                                                                                 - IP 6 7 rate d
                                                                                                 - 1 m m re s o lu tio n
                                                                                                 - M u lti-S e n s o r o p e ra tio n
                                                                                                 - C a lib ra te d b e a m pa tte rn
                                                                                                 - S ta rtin g a t $ 1 0 9 .9 5
a member of
                                                                                                 XL-MaxSonar®-EZTI
                                                                                                 - G re a t fo r U A V ’s a n d ro b o tic s
                                                                                                 - In c re d ib le n o is e
Circuit Cellar!
                                                                                                   im m u n ity
                                                                                                 - S m a ll in siz e
                                                                                                 - 1cm r e s o lu tio n
                                                                                                 - A u to m a tic c a lib ra tio n
                                                                                              I - S ta rtin g a t $ 3 9 .9 5
[ P h o n e : 218-454-076 6 E m a il: s a le s @ m a x b o t ix .c o m |
www.maxbotix.com
                                                                                       '
                                                               4       V   '   4 v ^
                                                               l*      ¿ v S t vfc
                                                                    l+ \
L AS V E G A S , N E V A D A
CESWEB.ORG
#CES2015
MULTIPLE   PCBA
     NO MORE
                LINES                                             W   A   / T i t o
                                                                                hew customers :
                                                      et.com
                                                                              SET $500 TOWARDS
             (8 4 7 ) 8 0 6 - 0 0 0 3   •   sales@ PC B net.com                  FREE PAKTS!