Accel32 for Linux Software Supports 4.xx Kernel

Microstar Laboratories recently released version 3.00 of the Accel32 for Linux software. The software compiles a Loadable Kernel Module (LKM) for the GNU/Linux system, extending capabilities for control of the Data Acquisition Processor (DAP) boards to systems using GNU/Linux operating systems with kernel versions in the 4.xx series.

Photo caption: Real time acquisition on generic platforms: Accel32 for Linux v.3.0 supports GNU/Linux 4.xx kernels. Penguin: Julien Tromeur/

Real-time acquisition on generic platforms: Accel32 for Linux v.3.0 supports GNU/Linux 4.xx kernels. Penguin: Julien Tromeur/

Accel32 for Linux is offered under the BSD license for free download. DAP boards provide an Intel x86-family embedded processor to support operation of the embedded DAPL 2000 system and data acquisition hardware devices. The DAPL 2000 system is part of the DAPtools software, which Microstar Laboratories provides for free for operating the DAP boards. The DAPL 2000 system provides the configuration scripting and the multitasking real-time control of data acquisition hardware devices. A host system must provide PCI or PCI-X (extended) I/O bus slots to host the DAP boards. This software runs under 32-bit versions of the GNU/Linux system, which you can install on 32- or 64-bit hardware platforms.

Source: Microstar Laboratories

Data Acquisition Issues (2 Free Downloads)

As Maurizio Di Paolo Emilio noted in his essay “The Future of Data Acquisition,” data acquisition “is a necessity, which is why data acquisition systems and software applications are essential tools in a variety of fields.”

For a limited time, we’re sharing two past Circuit Cellar Data Acquisition issues (CC266 and CC278), which you can download for free. These two free downloads will be available only until Friday, September 19.


Issue #266 September 2012

  • TASK MANAGER—The Ubiquitous Importance of Data, p. 2
  • QUESTIONS & ANSWERS—Embedded Systems Education: An Interview with Miguel Sánchez, p. 28
  • MCU-Based Environmental Data Logger, by Brian Beard, p. 18
  • DesignSpark chipKIT Challenge Winners, p. 32
  • Miniature Accelerometers: DIY Acceleration Data Acquisition, by Mark Csele, p. 38
  • EMBEDDED SECURITY—Hardware-Accelerated Encryption, by Patrick Schaumont, p. 48
  • THE CONSUMMATE ENGINEER—Project Configuration Control: Family Tree Drawing & Document Archiving, by George Novacek, p. 58
  • LESSONS FROM THE TRENCHES—Software & Design File Organization, by George Martin, p. 62
  • FROM THE BENCH—Flowcharting Made Simple: Use the Flowcode Flowcharting IDE to Write Code, by Jeff Bachiochi, p. 66
  • PRIORITY INTERRUPT—Managing Expectations, by Steve Ciarcia, p. 80

Issue #278 September 2013

  • QUESTIONS & ANSWERS—Electronics Entrepreneur: An Interview with Jack Ganssle, p. 10
  • Rubik’s Cube-Solving Robot, by Nelson Epp, p. 24
  • Raspberry Pi I/0 Board (Part 2): ISO-Pi Circuit Description and Firmware, by Brian Millier, p. 32
  • Experiments in Developmental Robotics (Part 1): Artificial and Evolving Neural Networks, by Walter O. Krawec, p. 42
  • THE CONSUMMATE ENGINEER—Battery Basics (Part 1): Battery Types, by George Novacek, p. 48
  • ABOVE THE GROUND PLANE—Pulsed LED Characterization, by Ed Nisley, p. 54
  • GREEN COMPUTING—Energy-Efficient Cooling Strategies for Servers Analyze and Control Leakage and Fan Power, by Ayse Coskun, p. 60
  • FROM THE BENCH—Serial Displays Save Resources (Part 3): BMP Files, by Jeff Bachiochi, p. 64
  • TECH THE FUTURE—Electronics Beyond Silicon, by Jeremy Ward and Oana Jerchescu, p. 80

Flexible I/O Expansion for Rugged Applications

WynSystemsThe SBC35-CC405 series of multi-core embedded PCs includes on-board USB, gigabit Ethernet, and serial ports. These industrial computers are designed for rugged embedded applications requiring extended temperature operation and long-term availability.

The SBC35-CC405 series features the latest generation Intel Atom E3800 family of processors in an industry-standard 3.5” single-board computer (SBC) format COM Express carrier. A Type 6 COM Express module supporting a quad-, dual-, or single-core processor is used to integrate the computer. For networking and communications, the SBC35-CC405 includes two Intel I210 gigabit Ethernet controllers with IEEE 1588 timestamping and 10-/100-/1,000-Mbps multispeed operation. Four Type-A connectors support three USB 2.0 channels and one high-speed USB 3.0 channel. Two serial ports support RS-232/-422/-485 interface levels with clock options up to 20 Mbps in the RS-422/-485 mode and up to 1 Mbps in the RS-232 mode.

The SBC35-CC405 series also includes two MiniPCIe connectors and one IO60 connector to enable additional I/O expansion. Both MiniPCIe connectors support half-length and full-length cards with screw-down mounting for improved shock and vibration durability. One MiniPCIe connector also supports bootable mSATA solid-state disks while the other connector includes USB. The IO60 connector provides access to the I2C, SPI, PWM, and UART signals enabling a simple interface to sensors, data acquisition, and other low-speed I/O devices.

The SBC35-CC405 runs over a 10-to-50-VDC input power range and operates at temperatures from –40°C to 85°C. Enclosures, power supplies, and configuration services are also available.

Linux, Windows, and other x86 OSes can be booted from the CFast, mSATA, SATA, or USB interfaces, providing flexible data storage options. WinSystems provides drivers for Linux and Windows 7/8 as well as preconfigured embedded OSes.
The single-core SBC35-CC405 costs $499.

Winsystems, Inc.

Integrated Wi-Fi System in Package Module

EconaisThe EC19W01 is a small, smart, highly integrated 802.11b/g/n Wi-Fi system in package (SiP) module. The module is well suited for home automation and smart appliances; Wi-Fi audio speakers and headphones; wireless sensors and sensor networks; wireless monitoring (audio and video); smart appliances; health care and fitness devices; wearable devices; security, authentication, and admittance control; lighting; building/energy/industrial management/control; cloud-connected devices; remote control, data acquisition, and monitoring; and machine-to-machine (M2M) and Internet of Things (IoT) design.

The EC19W01’s features include an integrated 32-bit processor to support application customization, on-board flash and antenna, low power consumption, support for Serial-to-Wi-Fi and SPI-to-Wi-Fi, wireless transmit/receive rates of up to 20 Mbps, and a small 14-mm × 16-mm × 2.8-mm footprint.

Contact Econais for pricing.

Econais, Inc.

PC-Programmable Temperature Controller

Oven Industries 5R7-388 temperature controller

Oven Industries 5R7-388 temperature controller

The 5R7-388 is a bidirectional temperature controller. It can be used in independent thermoelectric modules or in conjunction with auxiliary or supplemental resistive heaters for cooling and heating applications. The solid-state MOSFET output devices’ H-bridge configuration enables the bidirectional current flow through the thermoelectric modules.
The RoHS-compliant controller is PC programmable via an RS-232 communication port, so it can directly interface with a compatible PC. It features an easily accessible communications link that enables various operational mode configurations. The 5R7-388 can perform field-selectable parameters or data acquisition in a half duplex mode.

In accordance with RS-232 interface specifications, the controller accepts a communications cable length. Once the desired set parameters are established, the PC may be disconnected and the 5R7-388 becomes a unique, stand-alone controller. All parameter settings are retained in nonvolatile memory. The 5R7-388’s additional features include 36-VDC output using split supply, a PC-configurable alarm circuit, and P, I, D, or On/Off control.

Contact Oven Industries for pricing.

Oven Industries, Inc.

Data Acquisition Instrument

The DI-145 USB data acquisition instrument features four ±100-V analog channels and two dedicated digital inputs. The included DATAQ WinDaq data acquisition software (DAS) enables you to display and record data to a PC hard drive in real time. Once recorded, data can be played back, analyzed, or exported to an array of data acquisition and spreadsheet formats.

DATAQ also provides access to the DI-145 data protocol, which enables access to the DI-145 on any Windows, Linux, or MAC OS. In addition, .NET control is available to Windows users who wish to use a third-party programming language (e.g., Microsoft’s Visual Basic or National Instruments’s LabVIEW) to interface with the DI-145.

The four ±10-V fixed differential channels are protected from transient spikes up to ±150 V peak (±75 V, continuous). A 10-bit ADC provides 19.5-mV resolution across the full-scale measurement range. Digital inputs are protected up to ±30 VDC/peak AC. The digital inputs enable you to use a switch closure or TTL signal to remotely insert event marks or record data to disk.

The DI-145 measures 1.53” × 2.625” × 5.5” (3.89 cm × 6.67 cm × 13.97 cm) and weighs 3.6 oz. The data acquisition instrument costs $29 and includes a mini screwdriver, a USB cable, WinDaq/Lite DAS, access to the data protocol, and .NET control.

DATAQ Instruments, Inc.

Embedded Sensor Innovation at MIT

During his June 5 keynote address at they 2013 Sensors Expo in Chicago, Joseph Paradiso presented details about some of the innovative embedded sensor-related projects at the MIT Media Lab, where he is the  Director of the Responsive Environments Group. The projects he described ranged from innovative ubiquitous computing installations for monitoring building utilities to a small sensor network that transmits real-time data from a peat bog in rural Massachusetts. Below I detail a few of the projects Paradiso covered in his speech.


Managed by the Responsive Enviroments group, the DoppelLab is a virtual environment that uses Unity 3D to present real-time data from numerous sensors in MIT Media Lab complex.

The MIT Responsive Environments Group’s DoppleLab

Paradiso explained that the system gathers real-time information and presents it via an interactive browser. Users can monitor room temperature, humidity data, RFID badge movement, and even someone’s Tweets has he moves throughout the complex.

Living Observatory

Paradiso demoed the Living Observatory project, which comprises numerous sensor nodes installed in a peat bog near Plymouth, MA. In addition to transmitting audio from the bog, the installation also logs data such as temperature, humidity, light, barometric pressure, and radio signal strength. The data logs are posted on the project site, where you can also listen to the audio transmission.

The Living Observatory (Source:


The GesturesEverywhere project provides a real-time data stream about human activity levels within the MIT Media Lab. It provides the following data and more:

  • Activity Level: you can see the Media Labs activity level over a seven-day period.
  • Presence Data: you can see the location of ID tags as people move in the building

The following video is a tracking demo posted on the project site.

The aforementioned projects are just a few of the many cutting-edge developments at the MIT Media Lab. Paradiso said the projects show how far ubiquitous computing technology has come. And they provide a glimpse into the future. For instance, these technologies lend themselves to a variety of building-, environment-, and comfort-related applications.

“In the early days of ubiquitous computing, it was all healthcare,” Paradiso said. “The next frontier is obviously energy.”

Embedded Wireless Made Simple

Last week at the 2013 Sensors Expo in Chicago, Anaren had interesting wireless embedded control systems on display. The message was straightforward: add an Anaren Integrated Radio (AIR) module to an embedded system and you’re ready to go wireless.

Bob Frankel demos embedded mobile control

Bob Frankel of Emmoco provided a embedded mobile control demonstration. By adding an AIR module to a light control system, he was able to use a tablet as a user interface.

The Anaren 2530 module in a light control system (Source: Anaren)

In a separate demonstration, Anaren electrical engineer Mihir Dani showed me how to achieve effective light control with an Anaren 2530 module and TI technology. The module is embedded within the light and compact remote enables him to manipulate variables such as light color and saturation.

Visit Anaren’s website for more information.

The Future of Data Acquisition Technology

Maurizio Di Paolo Emilio

Maurizio Di Paolo Emilio

By Maurizio Di Paolo Emilio

Data acquisition is a necessity, which is why data acquisition systems and software applications are essential tools in a variety of fields. For instance, research scientists rely on data acquisition tools for testing and measuring their laboratory-based projects. Therefore, as a data acquisition system designer, you must have an in-depth understanding of each part of the systems and programs you create.

I mainly design data acquisition software for physics-related experiments and industrial applications. Today’s complicated physics experiments require highly complex data acquisition systems and software that are capable of managing large amounts of information. Many of the systems require high-speed connections and digital recording. And they must be reconfigurable. Signals that are hard to characterize and analyze with a real-time display are evaluated in terms of high frequencies, large dynamic range, and gradual changes.

Data acquisition software is typically available in a text-based user interface (TUI) that comprises an ASCII configuration file and a graphic user interface (GUI), which are generally available with any web browser. Both interfaces enable data acquisition system management and customization, and you don’t need to recompile the sources. This means even inexperienced programmers can have full acquisition control.

Well-designed data acquisition and control software should be able to quickly recover from instrumentation failures and power outages without losing any data. Data acquisition software must provide a high-level language for algorithm design. Moreover, it requires data-archiving capability for verifying data integrity.

You have many data acquisition software options. An example is programmable software that uses a language such as C. Other software and data acquisition software packages enable you to design the custom instrumentation suited for specific applications (e.g., National Instruments’s LabVIEW and MathWorks’s MATLAB).

In addition to data acquisition software design, I’ve also been developing embedded data acquisition systems with open-source software to manage user-developed applications. The idea is to have credit-card-sized embedded data acquisition systems managing industrial systems using open-source software written in C. I’m using an ARM processor that will give me the ability to add small boards for specific applications (e.g., a board to manage data transmission via Wi-Fi or GSM).

A data acquisition system’s complexity tends to increase with the number of physical properties it must measure. Resolution and accuracy requirements also affect a system’s complexity. To eliminate cabling and provide for more modularity, you can combine data acquisition capabilities and signal conditioning in one device.

Recent developments in the field of fiber-optic communications have shown longer data acquisition transmission distances can cause errors. Electrical isolation is also an important topic. The goal is to eliminate ground loops (common problems with single-ended measurements) in terms of accuracy and protection from voltage spikes.

During the last year, some new technological developments have proven beneficial to the overall efficacy of data acquisition applications. For instance, advances in USB technology have made data acquisition and storage simpler and more efficient than ever (think “plug and play”). Advances in wireless technology have also made data transmission faster and more secure. This means improved data acquisition system and software technologies will also figure prominently in smartphone design and usage.

If you look to the future, consumer demand for mobile computing systems will only increase, and this will require tablet computers to feature improved data acquisition and storage capabilities. Having the ability to transmit, receive, and store larger amounts of data with tablets will become increasingly important to consumers as time goes on. There are three main things to consider when creating a data acquisition-related application for a tablet. Hardware connectivity: Tablets have few control options (e.g., Wi-Fi and Bluetooth). Program language support: Many tablets support Android apps created in Java. Device driver availability: Device drivers permit a high-level mode to easily and reliably execute a data acquisition board’s functionality. C and LabVIEW are not supported by Android or Apple’s iOS. USB, a common DAQ bus, is available in a set of tablets. In the other case, an adapter is required. In these instances, moving a possible data acquisition system to a tablet requires extra attention.

For all of the aforementioned reasons, I think field-programmable arrays (FPGAs) will figure prominently in the evolution of data acquisition system technology. The flexibility of FPGAs makes them ideal for custom data acquisition systems and embedded applications.

Microcontroller-Based Heating System Monitor

Checking a heating system’s consumption is simple enough.

Heating system monitor

Determining a heating system’s output can be much more difficult, unless you have this nifty design. This Atmel ATmega microcontroller-based project enables you to measure heat output as well as control a circulation pump.

Heating bills often present unpleasant surprises. Despite your best efforts to economise on heating, they list tidy sums for electricity or gas consumption. In this article we describe a relatively easy way to check these values and monitor your consumption almost continuously. All you need in order to determine how much heat your system delivers is four temperature sensors, a bit of wiring, and a microcontroller. There’s no need to delve into the electrical or hydraulic components of your system or modify any of them.

A bit of theory
As many readers probably remember from their physics lessons, it’s easy to calculate the amount of heat transferred to a medium such as water. It is given by the product of the temperature change ΔT, the volume V of the medium, and the specific heat capacity CV of the medium. The power P, which is amount of energy transferred per unit time, is:

P= ΔT × CV × V // Δt

With a fluid medium, the term V // Δt can be interpreted as a volumetric flow Vt. This value can be calculated directly from the flow velocity v of the medium and the inner diameter r of the pipe. In a central heating system, the temperature difference ΔT is simply the difference between the supply (S) and return (R) temperatures. This yields the formula:

P = (TS – TR) × CV × v × pr2

The temperatures can easily be measured with suitable sensors. Flow transducers are available for measuring the flow velocity, but installing a flow transducer always requires drilling a hole in a pipe or opening up the piping to insert a fitting.

Measuring principle
Here we used a different method to determine the flow velocity. We make use of the fact that the supply and return temperatures always vary by at least one to two degrees due to the operation of the control system. If pairs of temperature sensors separated by a few metres are mounted on the supply and return lines, the flow velocity can be determined from the time offset of the variations measured by the two sensors…

As the water flows through the pipe with a speed of only a few metres per second, the temperature at sensor position S2 rises somewhat later than the temperature at sensor position S, which is closer to the boiler.

An ATmega microcontroller constantly acquires temperature data from the two sensors. The time delay between the signals from a pair of sensors is determined by a correlation algorithm in the signal processing software, which shifts the signal waveforms from the two supply line sensors relative to each other until they virtually overlap.The temperature signals from the sensors on the return line are correlated in the same manner, and ideally the time offsets obtained for the supply and return lines should be the same.

To increase the sensitivity of the system, the return line sensor signals are applied to the inputs of a differential amplifier, and the resulting difference signal is amplified. This difference signal is also logged as a function of time. The area under the curve of the difference signal is a measure of the time offset of the temperature variations…

Hot water please
If the heating system is also used to supply hot water for domestic use, additional pipes are used for this purpose. For this reason, the PCB designed by the author includes inputs for additional temperature sensors. It also has a switched output for driving a relay that can control a circulation pump.

Under certain conditions, controlling the circulation pump can save you a lot of money and significantly reduce CO2 emissions. This is because some systems have constant hot water circulation so users can draw hot water from the tap immediately. This costs electricity to power the pump, and energy is also lost through the pipe walls. This can be remedied by the author’s circuit, which switches on the circulation pump for only a short time after the hot water tap is opened. This is detected by the temperature difference between the hot water and cold water supply lines…

Circuit description
The easiest way to understand the schematic diagram is to follow the signal path. It starts at the temperature sensors connected to the circuit board, which are NTC silicon devices.

Heating system monitor schematic

Their resistance varies by around 0.7–0.8% per degree K change in temperature. For example, the resistance of a KT110 sensor is approximately 1.7 kΩ at 5 °C and approximately 2.8 kΩ at 70 °C.

The sensor for supply temperature S forms a voltage divider with resistor R37. This is followed by a simple low-pass filter formed by R36 and C20, which filters out induced AC hum. U4a amplifies the sensor signal by a factor of approximately 8. The TL2264 used here is a rail-to-rail opamp, so the output voltage can assume almost any value within the supply voltage range. This increases the absolute measurement accuracy, since the full output signal amplitude is used. U4a naturally needs a reference voltage on its inverting input. This is provided by the combination of R20, R26 and R27. U5b acts as an impedance converter to minimise the load on the voltage divider…

Thermal power

PC connection
The circuit does not have its own display unit, but instead delivers its readings to a PC via an RS485 bus. Its functions can also be controlled from the PC. IC U8 looks after signal level conversion between the TTL transmit and receive lines of the ATmega microcontroller’s integrated UART and the differential RS485 bus. As the bus protocol allows several connected (peer) devices to transmit data on the bus, transmit mode must be selected actively via pin 3. Jumper JP3 must be fitted if the circuit is connected to the end of the RS485 bus. This causes the bus to be terminated in 120 Ω, which matches the characteristic impedance of a twisted-pair line…


Infrared Communications for Atmel Microcontrollers

Are you planning an IR communications project? Do you need to choose a microcontroller? Check out the information Cornell University Senior Lecturer Bruce Land sent us about inexpensive IR communication with Atmel ATmega microcontrollers. It’s another example of the sort of indispensable information covered in Cornell’s excellent ECE4760 course.

Land informed us:

I designed a basic packet communication scheme using cheap remote control IR receivers and LED transmitters. The scheme supports 4800 baud transmission,
with transmitter ID and checksum. Throughput is about twenty 20-character packets/sec. The range is at least 3 meters with 99.9% packet receive and moderate (<30 mA) IR LED drive current.

On the ECE4760 project page, Land writes:

I improved Remin’s protocol by setting up the link software so that timing constraints on the IR receiver AGC were guaranteed to be met. It turns out that there are several types of IR reciever, some of which are better at short data bursts, while others are better for sustained data. I chose a Vishay TSOP34156 for its good sustained data characteristics, minimal burst timing requirements, and reasonable data rate. The system I build works solidly at 4800 baud over IR with 5 characters of overhead/packet (start token, transmitter number, 2 char checksum , end token). It works with increasing packet loss up to 9000 baud.

Here is the receiver circuit.

The receiver circuit (Source: B. Land, Cornell University ECE4760 Infrared Communications
for Atmel Mega644/1284 Microcontrollers)

Land explains:

The RC circuit acts a low-pass filter on the power to surpress spike noise and improve receiver performance. The RC circuit should be close to the receiver. The range with a 100 ohm resistor is at least 3 meters with the transmitter roughly pointing at the receiver, and a packet loss of less then 0.1 percent. To manage burst length limitations there is a short pause between characters, and only 7-bit characters are sent, with two stop bits. The 7-bit limit means that you can send all of the printing characters on the US keyboard, but no extended ASCII. All data is therefore sent as printable strings, NOT as raw hexidecimal.

Land’s writeup also includes a list of programs and packet format information.

Electrostatic Cleaning Robot Project

How do you clean a clean-energy generating system? With a microcontroller (and a few other parts, of course). An excellent example is US designer Scott Potter’s award-winning, Renesas RL78 microcontroller-based Electrostatic Cleaning Robot system that cleans heliostats (i.e., solar-tracking mirrors) used in solar energy-harvesting systems. Renesas and Circuit Cellar magazine announced this week at DevCon 2012 in Garden Grove, CA, that Potter’s design won First Prize in the RL78 Green Energy Challenge.

This image depicts two Electrostatic Cleaning Robots set up on two heliostats. (Source: S. Potter)

The nearby image depicts two Electrostatic Cleaning Robots set up vertically in order to clean the two heliostats in a horizontal left-to-right (and vice versa) fashion.

The Electrostatic Cleaning Robot in place to clean

Potter’s design can quickly clean heliostats in Concentrating Solar Power (CSP) plants. The heliostats must be clean in order to maximize steam production, which generates power.

The robot cleaner prototype

Built around an RL78 microcontroller, the Electrostatic Cleaning Robot provides a reliable cleaning solution that’s powered entirely by photovoltaic cells. The robot traverses the surface of the mirror and uses a high-voltage AC electric field to sweep away dust and debris.

Parts and circuitry inside the robot cleaner

Object oriented C++ software, developed with the IAR Embedded Workbench and the RL78 Demonstration Kit, controls the device.

IAR Embedded Workbench IDE

The RL78 microcontroller uses the following for system control:

• 20 Digital I/Os used as system control lines

• 1 ADC monitors solar cell voltage

• 1 Interval timer provides controller time tick

• Timer array unit: 4 timers capture the width of sensor pulses

• Watchdog timer for system reliability

• Low voltage detection for reliable operation in intermittent solar conditions

• RTC used in diagnostic logs

• 1 UART used for diagnostics

• Flash memory for storing diagnostic logs

The complete project (description, schematics, diagrams, and code) is now available on the Challenge website.


CC269: Break Through Designer’s Block

Are you experiencing designer’s block? Having a hard time starting a new project? You aren’t alone. After more than 11 months of designing and programming (which invariably involved numerous successes and failures), many engineers are simply spent. But don’t worry. Just like every other year, new projects are just around the corner. Sooner or later you’ll regain your energy and find yourself back in action. Plus, we’re here to give you a boost. The December issue (Circuit Cellar 269) is packed with projects that are sure to inspire your next flurry of innovation.

Turn to page 16 to learn how Dan Karmann built the “EBikeMeter” Atmel ATmega328-P-based bicycle computer. He details the hardware and firmware, as well as the assembly process. The monitoring/logging system can acquire and display data such as Speed/Distance, Power, and Recent Log Files.

The Atmel ATmega328-P-based “EBikeMeter” is mounted on the bike’s handlebar.

Another  interesting project is Joe Pfeiffer’s bell ringer system (p. 26). Although the design is intended for generating sound effects in a theater, you can build a similar system for any number of other uses.

You probably don’t have to be coerced into getting excited about a home control project. Most engineers love them. Check out Scott Weber’s garage door control system (p. 34), which features a MikroElektronika RFid Reader. He built it around a Microchip Technology PIC18F2221.

The reader is connected to a breadboard that reads the data and clock signals. It’s built with two chips—the Microchip 28-pin PIC and the eight-pin DS1487 driver shown above it—to connect it to the network for testing. (Source: S. Weber, CC269)

Once considered a hobby part, Arduino is now implemented in countless innovative ways by professional engineers like Ed Nisley. Read Ed’s article before you start your next Arduino-related project (p. 44). He covers the essential, but often overlooked, topic of the Arduino’s built-in power supply.

A heatsink epoxied atop the linear regulator on this Arduino MEGA board helped reduce the operating temperature to a comfortable level. This is certainly not recommended engineering practice, but it’s an acceptable hack. (Source: E. Nisley, CC269)

Need to extract a signal in a noisy environment? Consider a lock-in amplifier. On page 50, Robert Lacoste describes synchronous detection, which is a useful way to extract a signal.

This month, Bob Japenga continues his series, “Concurrency in Embedded Systems” (p. 58). He covers “the mechanisms to create concurrently in your software through processes and threads.”

On page 64, George Novacek presents the second article in his series, “Product Reliability.” He explains the importance of failure rate data and how to use the information.

Jeff Bachiochi wraps up the issue with a article about using heat to power up electronic devices (p. 68). Fire and a Peltier device can save the day when you need to charge a cell phone!

Set aside time to carefully study the prize-winning projects from the Reneas RL78 Green Energy Challenge (p. 30). Among the noteworthy designs are an electrostatic cleaning robot and a solar energy-harvesting system.

Lastly, I want to take the opportunity to thank Steve Ciarcia for bringing the electrical engineering community 25 years of innovative projects, essential content, and industry insight. Since 1988, he’s devoted himself to the pursuit of EE innovation and publishing excellence, and we’re all better off for it. I encourage you to read Steve’s final “Priority Interrupt” editorial on page 80. I’m sure you’ll agree that there’s no better way to begin the next 25 years of innovation than by taking a moment to understand and celebrate our past. Thanks, Steve.

Autonomous Mobile Robot (Part 2): Software & Operation

I designed a microcontroller-based mobile robot that can cruise on its own, avoid obstacles, escape from inadvertent collisions, and track a light source. In the first part of this series, I introduced my TOMBOT robot’s hardware. Now I’ll describe its software and how to achieve autonomous robot behavior.

Autonomous Behavior Model Overview
The TOMBOT is a minimalist system with just enough components to demonstrate some simple autonomous behaviors: Cruise, Escape, Avoid, and Home behaviors (see Figure 1). All the behaviors require left and right servos for maneuverability. In general, “Cruise” just keeps the robot in motion in lieu of any stimulus. “Escape” uses the bumper to sense a collision and then 180 spin with reverse. “Avoid” makes use of continuous forward looking IR sensors to veer left or right upon approaching a close obstacle. Finally “Home” utilizes the front optical photocells to provide robot self-guidance to a strong light highly directional source.

Figure 1: High-level autonomous behavior flow

Figure 2 shows more details. The diagram captures the interaction of TOMBOT hardware and software. On the left side of the diagram are the sensors, power sources, and command override (the XBee radio command input). All analog sensor inputs and bumper switches are sampled (every 100 ms automatically) during the Microchip Technology PIC32 Timer 1 interrupt. The bumper left and right switches undergo debounce using 100 ms as a timer increment. The analog sensors inputs are digitized using the PIC32’s 10-bit ADC. Each sensor is assigned its own ADC channel input. The collected data is averaged in some cases and then made available for use by the different behaviors. Processing other than averaging is done within the behavior itself.

Figure 2: Detailed TOMBOT autonomous model

All behaviors are implemented as state machines. If a behavior requests motor control, it will be internally arbitrated against all other behaviors before motor action is taken. Escape has the highest priority (the power behavior is not yet implemented) and will dominate with its state machine over all the other behaviors. If escape is not active, then avoid will dominate as a result of its IR detectors are sensing an object in front of the TOMBOT less than 8″ away. If escape and avoid are not active, then home will overtake robot steering to sense track a light source that is immediately in front of TOMBOT. Finally cruise assumes command, and takes the TOMBOT in a forward direction temporarily.

A received command from the XBee RF module can stop and start autonomous operation remotely. This is very handy for system debugging. Complete values of all sensors and battery power can be viewed on graphics display using remote command, with LEDs and buzzer, announcing remote command acceptance and execution.

Currently, the green LED is used to signal that the TOMBOT is ready to accept a command. Red is used to indicate that the TOMBOT is executing a command. The buzzer indicates that the remote command has been completed coincident with the red led turning on.

With behavior programming, there are a lot of considerations. For successful autonomous operation, calibration of the photocells and IR sensors and servos is required. The good news is that each of these behaviors can be isolated (selectively comment out prior to compile time what is not needed), so that phenomena can be isolated and the proper calibrations made. We will discuss this as we get a little bit deeper into the library API, but in general, behavior modeling itself does not require accurate modeling and is fairly robust under less than ideal conditions.

TOMBOT Software Library
The TOMBOT robot library is modular. Some experience with C programming is required to use it (see Figure 3).

Figure 3: TOMBOT Library

The entire library is written using Microchip’s PIC32 C compiler. Both the compiler and Microchip’s 8.xx IDE are available as free downloads at The overall library structure is shown. At a highest level library has three main sections: Motor, I/O and Behavior. We cover these areas in some detail.

TOMBOT Motor Library
All functions controlling the servos’ (left and right wheel) operation is contained in this part of the library (see Listing1 Motor.h). In addition the Microchip PIC32 peripheral library is also used. Motor initialization is required before any other library functions. Motor initialization starts up both left and right servo in idle position using PIC32 PWM peripherals OC3 and OC4 and the dual Timer34 (32 bits) for period setting. C Define statements are used to set pulse period and duty cycle for both left and right wheels. These defines provide PWM varies from 1 to 2 ms for different speed CCW rotation over a 20-ms period and from 1.5 ms to 1 ms for CC rotation.

Listing 1: All functions controlling the servos are in this part of the library.

V_LEFT and V_RIGHT (velocity left and right) use the PIC32 peripheral library function to set duty cycle. The other motor functions, in turn, use V_LEFT and V_RIGHT with the define statements. See FORWARD and BACKWARD functions as an example (see Listing 2).

Listing 2: Motor function code examples

In idle setting both PWM set to 1-ms center positions should cause the servos not to turn. A servo calibration process is required to ensure center position does not result in any rotation. For the servos we have a set screw that can be used to adjust motor idle to no spin activity with a small Philips screwdriver.

TOMBOT I/O Library

This is a collection of different low level library functions. Let’s deal with these by examining their files and describing the function set starting with timer (see Listing 3). It uses Timer45 combination (full 32 bits) for precision timer for behaviors. The C defines statements set the different time values. The routine is noninterrupt at this time and simply waits on timer timeout to return.

Listing 3: Low-level library functions

The next I/O library function is ADC. There are a total of five analog inputs all defined below. Each sensor definition corresponds to an integer (32-bit number) designating the specific input channel to which a sensor is connected. The five are: Right IR, Left IR, Battery, Left Photo Cell, Right Photo Cell.

The initialization function initializes the ADC peripheral for the specific channel. The read function performs a 10-bit ADC conversion and returns the result. To faciliate operation across the five sensors we use SCAN_SENSORS function. This does an initialization and conversion of each sensor in turn. The results are placed in global memory where the behavior functions can access . SCAN_SENOR also performs a running average of the last eight samples of photo cell left and right (see Listing 4).

Listing 4: SCAN_SENOR also performs a running average of the last eight samples

The next I/O library function is Graphics (see Listing 5). TOMBOT uses a 102 × 64 monchrome graphics display module that has both red and green LED backlights. There are also red and green LEDs on the module that are independently controlled. The module is driven by the PIC32 SPI2 interface and has several control lines CS –chip select, A0 –command /data.

Listing 5: The Graphics I/O library function

The Graphics display relies on the use of an 8 × 8 font stored in as a project file for character generation. Within the library there are also cursor position macros, functions to write characters or text strings, and functions to draw 32 × 32 bit maps. The library graphic primitives are shown for intialization, module control, and writing to the module. The library writes to a RAM Vmap memory area. And then from this RAM area the screen is updated using dumpVmap function. The LED and backlight controls included within these graphics library.

The next part of I/O library function is delay (see Listing 6). It is just a series of different software delays that can be used by other library function. They were only included because of legacy use with the graphics library.

Listing 6: Series of different software delays

The next I/O library function is UART-XBEE (see Listing 7). This is the serial driver to configure and transfer data through the XBee radio on the robot side. The library is fairly straightforward. It has an initialize function to set up the UART1B for 9600 8N1, transmit and receive.

Listing 7: XBee library functions

Transmission is done one character at a time. Reception is done via interrupt service routine, where the received character is retrieved and a semaphore flag is set. For this communication, I use a Sparkfun XBee Dongle configured through USB as a COM port and then run HyperTerminal or an equivalent application on PC. The default setting for XBee is all that is required (see Photo 1).

Photo 1: XBee PC to TOMBOT communications

The next I/O library function is buzzer (see Listing 8). It uses a simple digital output (Port F bit 1) to control a buzzer. The functions are initializing buzzer control and then the on/off buzzer.

Listing 8: The functions initialize buzzer control

TOMBOT Behavior Library
The Behavior library is the heart of the autonomous TOMBOT and where integrated behavior happens. All of these behaviors require the use of left and right servos for autonomous maneuverability. Each behavior is a finite state machine that interacts with the environment (every 0.1 s). All behaviors have a designated priority relative to the wheel operation. These priorities are resolved by the arbiter for final wheel activation. Listing 9 shows the API for the entire Behavior Library.

Listing 9: The API for the entire behavior library

Let’s briefly cover the specifics.

  • “Cruise” just keeps the robot in motion in lieu of any stimulus.
  • “Escape” uses the bumper to sense a collision and then 180° spin with reverse.
  • “Avoid” makes use of continuous forward looking IR sensors to veer left or right upon approaching a close obstacle.
  • “Home” utilizes the front optical photocells to provide robot self-guidance to a strong light highly directional source.
  • “Remote operation” allows for the TOMBOT to respond to the PC via XBee communications to enter/exit autonomous mode, report status, or execute a predetermined motion scenario (i.e., Spin X times, run back and forth X times, etc.).
  • “Dump” is an internal function that is used within Remote.
  • “Arbiter” is an internal function that is an intrinsic part of the behavior library that resolves different behavior priorities for wheel activation.

Here’s an example of the Main function-invoking different Behavior using API (see Listing 10). Note that this is part of a main loop. Behaviors can be called within a main loop or “Stacked Up”. You can remove or stack up behaviors as you choose ( simply comment out what you don’t need and recompile). Keep in mind that remote is a way for a remote operator to control operation or view status.

Listing 10: TOMBOT API Example

Let’s now examine the detailed state machine associated with each behavior to gain a better understanding of behavior operation (see Listing 11).

Listing 11:The TOMBOT’s arbiter

The arbiter is simple for TOMBOT. It is a fixed arbiter. If either during escape or avoid, it abdicates to those behaviors and lets them resolve motor control internally. Home or cruise motor control requests are handled directly by the arbiter (see Listing 12).

Listing 12: Home behavior

Home is still being debugged and is not yet a final product. The goal is for the TOMBOT during Home is to steer the robot toward a strong light source when not engaged in higher priority behaviors.

The Cruise behavior sets motor to forward operation for one second if no other higher priority behaviors are active (see Listing 13).

Listing 13: Cruise behavior

The Escape behavior tests the bumper switch state to determine if a bump is detected (see Listing 14). Once detected it runs through a series of states. The first is an immediate backup, and then it turns around and moves away from obstacle.

Listing 14: Escape behavior

This function is a response to the remote C or capture command that formats and dumps (see Listing 15) to the graphics display The IR left and right, Photo left and Right, and battery in floating point format.

Listing 15: The dump function

This behavior uses the IR sensors and determines if an object is within 8″ of the front of TOMBOT (see Listing 16).

Listing 16: Avoid behavior

If both sensors detect a target within 8″ then it just turns around and moves away (pretty much like escape). If only the right sensor detects an object in range spins away from right side else if on left spins away on left side (see Listing 17).

Listing 17: Remote part 1

Remote behavior is fairly comprehensive (see Listing 18). There are 14 different cases. Each case is driven by a different XBee received radio character. Once a character is received the red LED is turned on. Once the behavior is complete, the red LED is turned off and a buzzer is sounded.

Listing 18: Remote part 2

The first case toggles Autonomous mode on and off. The other 13 are prescribed actions. Seven of these 13 were written to demonstrate TOMBOT mobile agility with multiple spins, back and forwards. The final six of the 13 are standard single step debug like stop, backward, and capture. Capture dumps all sensor output to the display screen (see Table 1).

Table 1: TOMBOT remote commands

Early Findings & Implementation
Implementation always presents a choice. In my particular case, I was interested in rapid development. At that time, I selected to using non interrupt code and just have linear flow of code for easy debug. This amounts to “blocking code.” Block code is used throughout the behavior implementation and causes the robot to be nonresponsive when blocking occurs. All blocking is identified when timeout functions occur. Here the robot is “blind” to outside environmental conditions. Using a real-time operating system (e.g., Free RTOS) to eliminate this problem is recommended.

The TOMBOT also uses photocells for homing. These sensitive devices have different responses and need to be calibrated to ensure correct response. A photocell calibration is needed within the baseline and used prior to operation.


The TOMBOT was successfully demoed to a large first-grade class in southern California as part of a Science, Technology, Engineering and Mathematics (STEM) program. The main behaviors were limited to Remote, Avoid, and Escape. With autonomous operation off, the robot demonstrated mobility and maneuverability. With autonomous operation on, the robot could interact with a student to demo avoid and escape behavior.

Tom Kibalo holds a BSEE from City College of New York and an MSEE from the University of Maryland. He as 39 years of engineering experience with a number of companies in the Washington, DC area. Tom is an adjunct EE facility member for local community college, and he is president of Kibacorp, a Microchip Design Partner.

Q&A: Andrew Spitz (Co-Designer of the Arduino-Based Skube)

Andrew Spitz is a Copenhagen, Denmark-based sound designer, interaction designer, programmer, and blogger studying toward a Master’s interaction design at the Copenhagen Institute of Interaction Design (CIID). Among his various innovative projects is the Arduino-based Skube music player, which is an innovative design that enables users to find and share music.

The Arduino-based Skube

Spitz worked on the design with Andrew Nip, Ruben van der Vleuten, and Malthe Borch. Check out the video to see the Skube in action.

On his blog, Spitz writes:

It is a fully working prototype through the combination of using ArduinoMax/MSP and an XBee wireless network. We access the API to populate the Skube with tracks and scrobble, and using their algorithms to find similar music when in Discover mode.

The following is an abridged  version of an interview that appears in the December 2012 issue of audioXpress magazine, a sister publication of Circuit Cellar magazine..

SHANNON BECKER: Tell us a little about your background and where you live.

Andrew Spitz: I’m half French, half South African. I grew up in France, but my parents are South African so when I was 17, I moved to South Africa. Last year, I decided to go back to school, and I’m now based in Copenhagen, Denmark where I’m earning a master’s degree at the Copenhagen Institute of Interaction Design (CID).

SHANNON: How did you become interested in sound design? Tell us about some of your initial projects.

Andrew: From the age of 16, I was a skydiving cameraman and I was obsessed with filming. So when it was time to do my undergraduate work, I decided to study film. I went to film school thinking that I would be doing cinematography, but I’m color blind and it turned out to be a bigger problem than I had hoped. At the same time, we had a lecturer in sound design named Jahn Beukes who was incredibly inspiring, and I discovered a passion for sound that has stayed with me.

Shannon: What do your interaction design studies at CIID entail? What do you plan to do with the additional education?

Andrew: CIID is focused on a user-centered approach to design, which involves finding intuitive solutions for products, software, and services using mostly technology as our medium. What this means in reality is that we spend a lot of time playing, hacking, prototyping, and basically building interactive things and experiences of some sort.

I’ve really committed to the shift from sound design to interaction design and it’s now my main focus. That said, I feel like I look at design from the lens of a sound designer as this is my background and what has formed me. Many designers around me are very visual, and I feel like my background gives me not only a different approach to the work but also enables me to see opportunities using sound as the catalyst for interactive experiences. Lots of my recent projects have been set in the intersection among technology, sound, and people.

SHANNON: You have worked as a sound effects recordist and editor, location recordist and sound designer for commercials, feature films, and documentaries. Tell us about some of these experiences?

ANDREW: I love all aspects of sound for different reasons. Because I do a lot of things and don’t focus on one, I end up having more of a general set of skills than going deep with one—this fits my personality very well. By doing different jobs within sound, I was able to have lots of different experiences, which I loved! nLocation recording enabled me to see really interesting things—from blowing up armored vehicles with rocket-propelled grenades (RPGs) to interviewing famous artists and presidents. And, documentaries enabled me to travel to amazing places such as Rwanda, Liberia, Mexico, and Nigeria. As a sound effects recordist on Jock of the Bushvelt, a 3-D animation, I recorded animals such as lions, baboons, and leopards in the South African bush. With Bakgat 2, I spent my time recording and editing rugby sounds to create a sound effects library. This time in my life has been a huge highlight, but I couldn’t see myself doing this forever. I love technology and design, which is why I made the move...

SHANNON: Where did the idea for Skube originate?

Andrew: Skube came out of the Tangible User Interface (TUI) class at CIID where we were tasked to rethink audio in the home context. So understanding how and where people share music was the jumping-off point for creating Skube.

We realized that as we move more toward a digital and online music listening experience, current portable music players are not adapted for this environment. Sharing mSkube Videousic in communal spaces is neither convenient nor easy, especially when we all have such different taste in music.

The result of our exploration was Skube. It is a music player that enables you to discover and share music and facilitates the decision process of picking tracks when in a communal setting.

audioXpress is an Elektor International Media publication.