Highly Integrated, Precision ADCs and DACs Feature Small Footprint

Texas Instruments (TI) has introduced four tiny precision data converters. The new data converters enable designers to add more intelligence and functionality, while shrinking system board space. The DAC80508 and DAC70508 are eight-channel precision digital-to-analog converters (DACs) that provide true 16- and 14-bit resolution, respectively. The ADS122C04 and ADS122U04 are 24-bit precision analog-to-digital converters (ADCs) that feature a two-wire, I2C-compatible interface and a two-wire, UART-compatible interface, respectively. The devices are optimized for a variety of small-size, high-performance or cost-sensitive industrial, communications and personal electronics applications. Examples include optical modules, field transmitters, battery-powered systems, building automation and wearables.

Both DACs include a 2.5-V, 5-ppm/°C internal reference, eliminating the need for an external precision reference. Available in a 2.4-mm-by-2.4-mm die-size ball-grid array (DSBGA) package or wafer chip-scale package (WCSP) and a 3-mm-by-3-mm quad flat no-lead (QFN)-16 package, these devices are up to 36 percent smaller than the competition. The new DACs eliminate the typical trade-off between high performance and small size, enabling engineers to achieve the best system accuracy, while reducing board size or increasing channel density.

In addition to their compact size, the DAC80508 and DAC70508 provide true, 1 least significant bit (LSB) integral nonlinearity to achieve the highest level of accuracy at 16- and 14-bit resolution – up to 66 percent better linearity than the competition. They are fully specified over a -40°C to +125°C extended temperature range and provide features such as cyclic redundancy check (CRC) to increase system reliability.

The tiny, 24-bit precision ADCs are available in 3-mm-by-3-mm very thin QFN (WQFN)-16 and 5-mm-by-4.4-mm thin-shrink small-outline package (TSSOP)-16 options. The two-wire interface requires fewer digital isolation channels than a standard serial peripheral interface (SPI), reducing the overall cost of an isolated system. These precision ADCs eliminate the need for external circuitry by integrating a flexible input multiplexer, a low-noise programmable gain amplifier, two programmable excitation current sources, an oscillator and a precision temperature sensor.

Both ADC devices feature a low-drift 2.048-V, 5-ppm/°C internal reference. Their internal 2 percent accurate oscillators help designers improve power-line cycle noise rejection, enabling higher accuracy in noisy environments. With gains from 1 to 128 and noise as low as 100 nV, designers can measure both small-signal sensors and wide input ranges with one ADC. These device families, which also include pin-to-pin-compatible 16-bit options, give designers the flexibility to meet various system requirements by scaling performance up or down.

Engineers can evaluate the new data converters with the DAC80508 evaluation module, the ADS122C04 evaluation module and the ADS122U04 evaluation module, all available today for $99.00 from the TI store and authorized distributors.

TI’s new tiny DACs and ADCs are available now with pricing ranging from $3.95 to $9.99 (1,000s).

Texas Instruments | www.ti.com

Fog-Detection Audio Project

Using Arduino UNO

Fog reduces visibility, sometimes down to a few feet. That’s why fog horns are so important. In this article, Jeff embarks on a project that makes use of humidity sensors to detect fog, and automatically plays an audio response when fog is detected. Aside from the sensors, his project also makes use of Arduino hardware and software.

By Jeff Bachiochi

Pea soup. Not one of my favorite dishes. I just can’t see green soup. All that said, as a consistency descriptor, “pea soup” is spot on for describing fog. You don’t have to live in San Francisco to appreciate the alien qualities of the scene in Figure 1. This phenomenon is commonplace to those who reside in London, Seattle, on any lake or in any valley. All we need is the right combination of temperature and humidity, and the clouds of heaven will visit us here on Earth.

Fog consists of visible water droplets suspended in the air at or near the Earth’s surface. This moisture is often generated locally from a nearby body of water, and forms when the difference between air temperature and dew point is less than about 4°F. The dew point is the temperature at which the water vapor in air (at constant barometric pressure) condenses into liquid water on tiny particles in the air, at the same rate at which it evaporates—forming fog. A change in temperature affects the relative humidity. As the dew point goes up, so does the relative humidity, creating a smaller differential between actual temperature and dew point temperature until fog forms.

The maximum amount of water vapor that can be held in a given volume of air (saturation) varies greatly by temperature. Cold air can hold less mass of water per unit volume than hot air. Relative humidity is the percentage of water found relative to the maximum possible, at a particular temperature.

Most of us have experienced the relationship between temperature and relative humidity firsthand. When the air temperature is high, our bodies use the evaporation of sweat to cool down. The cooling effect is directly related to how fast the perspiration evaporates. The rate of evaporation depends on how much moisture is already in the air and how much moisture the air can hold. If the air is already saturated with moisture (high humidity) perspiration will not evaporate, and we remain hot and uncomfortable. Discomfort can also exist when the humidity is low. The drier air can cause our skin to crack and tends to dry out the airways.

Measuring Relative Humidity

A hygrometer is an instrument used for measuring the humidity and water vapor content of the atmosphere, the soil and confined spaces. An instrument that measures humidity usually relies on the detection of some other quantity—such as temperature, pressure, mass or a mechanical or electrical change in a substance as moisture is absorbed. Today we use the electrical change of capacitance or resistance to calculate humidity.

Humidity measurement is among the more difficult problems in basic meteorology. Most hygrometers sense relative humidity rather than the absolute amount of water present. Because relative humidity is a function of both temperature and absolute moisture content, a small temperature change will translate into a change in relative humidity.

Some materials’ properties allow humidity levels to be determined based on a change in their capacitance, resistance, thermal conductivity or mass. Many humidity sensors include a temperature sensor, which allows them to approach 2-3% accuracy in a changing temperature environment. Table 1 shows several common humidity sensors. Many of them are available on some tiny PCB modules for easy interfacing.

Table 1
These are some popular humidity sensors with similar specifications.

I’ve used both the Honeywell HIH-5031 (with a Texas Instruments TMP102 temperature sensor) and a Silicon Labs Si7021 for measuring humidity in this project. The The Honeywell sensor has analog output, whereas the TI temperature sensor and Silicon Labs humidity/temperature sensor both use I2C to communicate. If you feel uneasy writing a function to perform the process, Arduino libraries are available for many sensors. This is an advantage for newbies, because you can get a program working with a library and often a sample program to get you started. Then you can go back and write the function yourself as a learning experience.

I don’t want to base the project totally on humidity, so I have added an ultrasonic distance measuring device to the project. Because fog forms as the air becomes supersaturated with water, this should mean that the humidity has reached 100% and water droplets in the air should begin to look solid. I’m hoping ultrasonics will be reflected by the droplets and cause a normal non-returned ping to be received. The combination of these two sensors exceeding some predetermined limits will satisfy my conditions to determine the presence of “fog.”

Avast, Ye Landlubber!

In a previous article (March 2011, Circuit Cellar 248), I presented the Microchip Technology (formerly Supertex) SR10, an inductorless switching power supply controller intended for operation directly from a rectified 120/240 VAC line. This was presented in support of creating a 5 V supply for a lighthouse fixture designed using LEDs. This month’s project will build upon that 5 V light, and will add audio to protect and guide boaters who find themsleves out on a lake under foggy conditions.

Figure 2
The schematic shows the connections made between the Arduino Uno headers and the sensor/module connectors mounted on an Arduino prototyping board. The finished board is shown in Figure 4.

I’m centering this project around the Arduino UNO. While I built the prototype interface (Figure 2) using the Arduino MEGA, it only uses the pins native to the UNO. The sensors/modules that are interfaced in this project are shown in Table 2.

Table 2
Each sensor/module will add some current draw to the project. Although current can be minimized in some cases while it is not active, this all becomes important if the project will run on batteries.

Because the UNO has only a single hardware serial port, I set up two additional software serial ports—one to talk with the DRPlayer and one to the optional LCD (output only). The main port and optional LCD don’t have to be used in the final project, but there is code written to display progress on each of these devices for seeing debugging information.  .  …

Read the full article in the October 339 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

NXP i.MX6-Based Boards Boast Extended Temp Operation

Versalogic has announced the Zebra, its latest in their new line of production-ready ARM-based embedded computers. Featuring models with either the NXP i.MX6 Solo (single core), or the i.MX6 DualLite (dual core) processors, the Zebra is rated for full industrial temperature operation (-40°C to +85°C). The compact 95 mm x 95 mm computer board typically consumes less than 3 W of power when operating.

Unlike many ARM-based “modules,” Versalogic’s new ARM-based products are complete board-level computers. They do not require additional carrier cards, companion boards, connector break-out boards or other add-ons to function. For ease of mounting and future upgrades, the Zebra product conforms to the size and mounting points of the industry standard COM Compact format. Unlike proprietary-format ARM products, Versalogic ARM boards provide a standardized mounting pattern for simplified upgrading in the future.
The Zebra embedded computer board is ready for off-the-shelf deployment into demanding industrial, defense and aerospace applications requiring rugged, long-life, power efficient, industrial temperature rated (-40°C to +85°C) solutions.

Both Zebra models include soldered-on memory, and a variety of I/O. The on-board I/O includes a Gigabit Ethernet port with network boot capability, two USB 2.0 Ports, serial I/O (RS-232), CAN Bus, I2C, and SPI. An on-board 6-axis e-compass is optional.

Many applications that require lower power or lower heat dissipation still need very high levels of reliability. Designed and tested for industrial temperature (-40° to +85°C) operation, VersaLogic’s Zebra also meets MIL-STD-202G specifications to withstand high impact and vibration.

ARM-based Zebra products, part numbers VL-EPC-2701, are in stock at both Versalogic and Digi-Key. with OEM pricing starting at $168.

Versalogic | www.versalogic.com

Digital Pressure Sensors Boost Design Flexibility

All Sensors has announced a new line of digital pressure sensors: the ELVR Series.  The new device series offers OEM customers increased design flexibility for pressure ranges from 2.5 to 75 mbar (1 to 30 inch H2O). The ELVR Series is a direct replacement to First Sensors’ HCLA product line.

Product highlights include an I2C or SPI interface, an analog 0.5 V to 4.5 V output signal, and significantly reduced position sensitivity. All Sensors’ CoBeam2 Technology allows for greater sensitivity while reducing package stress. The ELVR sensors can communicate directly with microcontrollers, eliminating the need for additional A/D converters. ELVR available at 3 V and 5 V supply voltage. the ELVR series is well suited for portable applications. A wide range of miniature SIP and DIP package options allows for flexible and space-saving PCB-mounting. Devices are available in bidirectional and unidirectional 2.5, 12.5, 25, 50 and 75 mbar pressure ranges.(inches of water)

Product Features

  • Miniature package with SIP, DIP and SMT lead configurations
  • PC board mountable package
  • Multiple port and lead configurations available

Electrical Features

  • Digital I2C , SPI interface and analog output
  • 12 Bit digital resolution and higher available upon request
  • Offered at 3 V and 5 V supply voltages. High Speed (cycle time 0.25 ms typical and response time 0.5 ms typical.)
  • All Sensors’ proprietary low pressure CoBeam2 Technology die

Custom pressure range and calibration outputs are available upon request. The device is well suited for applications including medical devices, pneumatic controls, instrumentation, environmental controls, HVAC and industrial controls. Samples are available for product testing.

All Sensors | www.allsensors.com 

Gesture Recognition in a Boxing Glove

Sensors Packed in the Punch

Learn how these two Boston University graduate students built a gesture-detection wearable that acts as a building block for a larger fitness telemetry system. Using a Linux-based Gumstix Verdex, the wearable couples an inertial measurement unit with a pressure sensor embedded in a boxing glove.

By Blade Olson and Patrick Dillon

Diagnostic monitoring of physical activity is growing in demand for physical therapists, entertainment technologists, sports trainers and for postoperative monitoring with surgeons [1][2]. In response to the need for a low-cost, low-profile, versatile, extensible, wearable activity sensor, the Hit-Rec boxing sensor is a proof-of-concept device that demonstrates on-board gesture recognition and high-throughput data monitoring are possible on a wearable sensor that can withstand violent impacts. The Hit-Rec’s ability to gather raw sensor values and run calculations at a high frame rate make the Hit-Rec an ideal diagnostic device for physical therapists searching for slight perturbations across a user’s gestures in a single recording session or for looking at discrepancies between the ideal motions of a healthy individual and the user’s current motions. The following sections will describe the implementation of a prototype for the Hit-Rec using a boxing glove (See Lead Photo Above).

SYSTEM OVERVIEW

The Hit-Rec sensor incorporates a Gumstix Verdex Pro running Linux, a 9-DoF (degree of freedom) inertial measurement unit (IMU), a pressure sensor that is connected to the Gumstix via a 12-bit analog-to-digital converter (ADC) and LEDs for user feedback. The ADC and IMU both communicate over I2C. The LEDs communicate to the Gumstix through general purpose input/output (GPIO). Figure 1 shows a high-level explanation of hardware interfaces and Figure 2 provides an illustration of the system overview. All software was written in C and runs exclusively on the Gumstix Verdex Pro. A Linux kernel module was written to interact with the LEDs from the user-space program that performs data capture and analysis. IMU data was smoothed and corrected in real-time with an open-source attitude and heading reference system (AHRS) provided by Mahony [3][4]. A circular buffer queue was used to store and retrieve sensor data for recording and analysis. Punch classification compares accelerometer values at each data point and chooses the gesture with smallest discrepancy.

Figure 1
This high-level diagram details the data transfer connections made between the main hardware and software components of the Hit-Rec.

Figure 2
Overview of the software architecture for translating IMU and Pressure data to user feedback

Each of three LEDs on the Hit-Rec glove represents a different gesture type. After the “punchomatic” program is started, the user is prompted to record three gestures by way of three flashing LEDs. In the background, IMU data is continuously being recorded. The first, yellow LED flashes until an impact is registered, at which point the last 50 frames of IMU data are used as the “fingerprint“ for the gesture. This gesture fingerprint is stored for the rest of the session. Two additional gestures are recorded in an identical manner using the red and blue LEDs for the subsequent punches. After three gestures have been recorded, the user can punch in any form and the Hit-Rec will classify the new punch according to the three recently recorded punch gestures. Feedback on the most closely related punch is presented by lighting up the corresponding LED of the originally recorded gesture when a new punch occurs.

SENSORS

We used the Adafruit LSM9DS0 with breakout board as an IMU sensor and a force-sensitive resistor (FSR) from Adafruit as a pressure sensor. Both sensors communicate over I2C, which the pressure sensor achieves through an ADC. …

Read the full article in the June 335 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Exploring the ESP32’s Peripheral Blocks

For IoT or Home Control

What makes an embedded processor suitable as an IoT or home control device? Wi-Fi support is just part of the picture. Brian has done some Wi-Fi projects using the ESP32, so here he shares his insights about the peripherals on the ESP32 and why they’re so powerful.

By Brian Millier

If you’re interested in IoT or home control devices, you’ve undoubtedly run across Espressif’s ESP8266. The embedded processor became ubiquitous in a very short time. The successor to the ESP8266 is the ESP32 and it’s much more powerful. Like the ESP8266, the ESP32 has on chip Wi-Fi. But it also includes Bluetooth Low Energy (BLE) and sports two high-power cores in place of the single one found on the ESP8266.

Having two main cores means one can run the wireless protocol stack on one core, leaving the other core free for the user application program. In fact, Espressif labels the cores “App” and “Pro”, with the latter referring to the Wi-Fi Protocol stack. This feature allows the application program to run without having to worry too much about how much execution time will be needed to handle the incoming/outgoing Wi-Fi data stream (which is hard to reliably predict, due to its asynchronous nature).

However, in addition to the dual cores, the ESP32 is also blessed with many unique peripheral blocks—most of which operate at a high level and thus require little or no MCU intervention during normal operation. This makes it much easier to write code for projects that have time-critical I/O operations. To appreciate the versatility of the ESP32’s peripheral function blocks, you have to dig into its Technical Reference Manual (TRM). At less than 600 pages, the ESP32’s TRM is somewhat leaner than most new 32-bit MCUs, so I didn’t mind studying it.

The ESP32 has been integrated into the Arduino IDE, and therefore Arduino
Wi-Fi, webserver, web client and UDP client libraries are available. I’ve done a few ESP32 Wi-Fi projects using these libraries, and found them to be straightforward. With all that in mind, in this article I am going to concentrate on three peripheral blocks that I consider to be very powerful and useful. I’ll present some code examples and custom libraries that I have written that make use of these peripherals—sometimes in ways that are different from their intended use).

The three peripheral blocks that I’ll be covering are:

  1. The Remote Control peripheral
  2. The Pulse Counter peripheral
  3. The LEDC controller peripheral

I’ll also briefly discuss the I2S and DAC/Cosine Generator blocks and provide some routines that enable you to generate some useful signals using these blocks.
The most serious work being done with the ESP32 centers on Espressif’s own IDF/C toolchain. But many people prefer to use the Arduino libraries developed for the ESP32, because they are accustomed to using it with many different MCUs—like AVR, ARM and ESP8266/32. Personally, I use the Visual Micro add-in to Visual Studio. It provides a much more professional development environment, while still using the Arduino tool-chain “under the hood.” All references to library files/folders or sample programs can be found on Circuit Cellar’s article materials webpage.

Figure 1
This is a simplified block diagram of the ESP32 Remote Controller peripheral.


Remote Controller Peripheral

This peripheral is rather unique among the MCUs that I have encountered. Its function is twofold:

  1. Transmitting IR signals such as used by IR remote controls
  2. Receiving IR signals from IR remote controls

IR remotes don’t send data in the same way that UARTs, SPI and I2C ports do. In other words, they don’t structure the data with each bit taking a specific amount of time. Instead, a “1” bit will consist of a burst of IR light for a specific time, followed by a specific period of no light. A “0” bit will define different periods of time for either the IR pulse, the space or sometimes both. To complicate matters, the IR light pulses are always amplitude modulated by some carrier frequency (in the 25-60 kHz range)..

Read the full article in the March 332 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!
Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Sensor Node Gets LoRaWAN Certification

Advantech offers its standardized M2.COM IoT LoRaWAN certified sensor node WISE-1510 with integrated ARM Cortex-M4 processor and LoRa transceiver. The module the  is able to provide multi-interfaces for sensors and I/O control such as UART, I2C, SPI, GPIO, PWM and ADC. The WISE-1510 sensor node is well suited for for smart cities, WISE-1510_3D _S20170602171747agriculture, metering, street lighting and environment monitoring. With power consumption optimization and wide area reception, LoRa  sensors or applications with low data rate requirements can achieve years of battery life and kilometers of long distance connection.

WISE-1510 has has received LoRaWAN certification from the LoRa Alliance. Depending on deployment requirements, developers can select to use Public LoRaWAN network services or build a private LoRa system with WISE-3610 LoRa IoT gateway. Advantech’s WISE-3610  is a Qualcomm ARM Cortex A7 based hardware platform with private LoRa ecosystem solution that can connect up to 500 WISE-1510 sensor node devices. Powered by Advantech’s WISE-PaaS IoT Software Platform, WISE-3610 features automatic cloud connection through its WISE-PaaS/WISE Agent service, manages wireless nodes and data via WSN management APIs, and helps customers streamline their IoT data acquisition development through sensor service APIs, and WSN drivers.

Developers can leverage microprocessors on WISE-1510 to build their own applications. WISE-1510 offers unified software—ARM Mbed OS and SDK for easy development with APIs and related documents. Developers can also find extensive resources from Github such as code review, library integration and free core tools. WISE-1510 also offers worldwide certification which allow developers to leverage their IoT devices anywhere. Using Advantech’s WISE-3610 LoRa IoT Gateway, WISE-1510 can be connected to WISE-  PaaS/RMM or  ARM Mbed Cloud service with IoT communication protocols including LWM2M, CoAP, and MQTT. End-to-end integration assists system integrators to overcome complex challenges and helps them build IoT applications quickly and easily.

WISE-1510 features and specifications:

  • ARM Cortex-M4 core processor
  • Compatible support for public LoRaWAN or private LoRa networks
  • Great for low power/wide range applications
  • Multiple I/O interfaces for sensor and control
  • Supports wide temperatures  -40 °C to 85 °C

Advantech | www.advantech.com

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.
www.winsystems.com

Programmable Logic Controller Board

SmartTILE illustration 6.psdThe SmartTILE (Smart TRi Integrated Logic Engine) is a programmable logic controller CPU board that plugs onto a carrier I/O board. The board integrates a 32-bit CPU, ferroelectric RAM (FRAM) and flash memory, a battery-backed real-time clock, and an Ethernet port on board. Its digital, analog, and serial I/O signals are brought to a user’s carrier board via three sets of header pins.

All critical components are already built-in on board. A user just needs to design a simple carrier PCB that contains a D/A circuit that interfaces the SmartTILE’s low-voltage signals to real-world voltages and currents (e.g., 24, 120, or 240 V).

The SmartTILE-Fx provides 16 digital inputs, 16 digital outputs (5-V CMOS logic level), eight analog inputs, and four analog outputs (12-bit, 0-5V) and can be expanded to 128 digital inputs and 128 digital outputs. The controller board -Fx provides three channels of serial ports (3.3 V, TX, RX, and /RTS) that can interface to RS-232, RS-485, or even wireless radio. An I2C port (3.3 V) is also available, allowing OEM to interface to specialty ICs that support I2Cbus.

Contact Triangle Research International for pricing.

Triangle Research International, Inc.
www.triplc.com

Raspberry Pi-Based Network Monitoring Device

In 2012, Al Anderson, IT director at Salish Kootenai College in Pablo, MT, and his team wired the dorms and student housing units at the small tribal college with fiber and outdoor CAT 5 cable to provide reliable Internet service to students. “Our prior setup was wireless and did not provide very good service,” Anderson says.

The 25 housing units, each with a small unmanaged Ethernet switch, were daisy chained in several different paths. Anderson needed a way to monitor the links from the system’s Simple Network Management Protocol (SNMP) network monitoring software, Help/Systems’s InterMapper. He also wanted to ensure the switches installed inside the sun-exposed utility boxes wouldn’t get too hot.

The Raspberry Pi is a small SBC based on an ARM processor. Its many I/O ports make it very useful for embedded devices that need a little more power than the typical 8-bit microcontroller.

Photo 1: The Raspberry Pi is a small SBC based on an ARM processor. Its many I/O ports make it very useful for embedded devices that need a little more power than the typical 8-bit microcontroller.

His Raspberry Pi-based solution is the subject of an article appearing in Circuit Cellar’s April issue. “We chose the Raspberry Pi because it was less expensive, we had several on hand, and I wanted to see what I could do with it,” Anderson says (see Photo 1).

The article walks readers through each phase of the project:

“I installed a Debian Linux distro, added an I2C TMP102 temperature sensor from SparkFun Electronics, wrote a small Python program to get the temperature via I2C and convert it to Fahrenheit, installed an SNMP server on Linux, added a custom SNMP rule to display the temperature from the script, and finally wrote a custom SNMP MIB to access the temperature information as a string and integer.”

Setting up the SBC and Linux was simple, Anderson says. “The prototype Raspberry Pi has now been running since September 2012 without any problems,” he says in his article. “It has been interesting to see how the temperature fluctuates with the time of day and the level of network activity. As budget and time permit, we will be installing more of these onto our network.”

In the following excerpt, Anderson discusses the project’s design, implementation, and OS installation and configuration. For more details on a project inspired, in part, by the desire to see what a low-cost SBC can do, read Anderson’s full article in the April issue.

DESIGN AND IMPLEMENTATION
Figure 1 shows the overall system design. The TMP102 is connected to the Raspberry Pi via I2C. The Raspberry Pi is connected to the network via its Ethernet port. The monitoring system uses TCP/IP over the Ethernet network to query the Raspberry Pi via SNMP. The system is encased in a small acrylic Adafruit Industries case, which we used because it is inexpensive and easy to customize for the sensor.

The system is designed around the Raspberry Pi SBC. The Raspberry Pi uses the I2C protocol to query the Texas Instruments TMP102 temperature sensor. The Raspberry Pi is queried via SNMP.

Figure 1: The system is designed around the Raspberry Pi SBC. The Raspberry Pi uses the I2C protocol to query the Texas Instruments TMP102 temperature sensor. The Raspberry Pi is queried via SNMP.

Our first step was to set up the Raspberry Pi. We started by installing the OS and the various software packages needed. Next, we wrote the Python script that queries the I2C temperature sensor. Then we configured the SNMP daemon to run the Python script when it is queried. With all that in place, we then set up the SNMP monitoring software that is configured with a custom MIB and a timed query. Finally, we modified the Raspberry Pi case to expose the temperature sensor to the air and installed the device in its permanent location.

OS INSTALLATION AND CONFIGURATION
The Raspberry Pi requires a Linux OS compiled to run on an ARM processor, which is the brain of the device, to be installed on an SD card. It does not have a hard drive. Setting up the SD card is straightforward, but you cannot simply copy the files onto the card. The OS has to be copied in such a way that the SD card has a boot sector and the Linux partitioning and file structure is properly maintained. Linux and Mac OS X users can use the dd command line utility to copy from the OS’s ISO image. Windows users can use a utility (e.g., Win32DiskImager) to accomplish the same thing. A couple of other utilities can be used to copy the OS onto the SD card, but I prefer using the command line.

A Debian-based distribution of Linux seems to be the most commonly used Linux distribution on the Raspberry Pi, with the Raspbian “wheezy” as the recommended distribution. However, for this project I chose Adafruit Learning Systems’s Occidentalis V0.2 Linux distribution because it had several hardware-hacker features rolled into the distribution, including the kernel modules for the temperature sensor. This saved me some work getting those installed and debugged.

Before you can copy the OS to the SD card, you need to download the ISO image. The Resources section of this article lists several sources including a link to the Adafruit Linux distribution. Once you have an ISO image downloaded, you can copy it to the SD card. The Resources section also includes a link to an Embedded Linux Wiki webpage, “RPi Easy SD Card Setup,” which details this copying process for several OSes.

The quick and dirty instructions are to somehow get the SD card hooked up to your computer, either using a built-in SD reader or a peripheral card reader. I used a USB attached reader. Then you need to format the card. The best format is FAT32, since it will get reformatted by the copy command anyway. Next, use your chosen method to copy the OS onto the card. On Linux or Mac OS X, the command:

dd bs=4M if=~/linux_distro.img of=/dev/sdd

will properly copy the OS onto the SD card.

You will need to change two important things in this command for your system. First, the
if parameter, which is the name the in file (i.e., your ISO image) needs to match the file you downloaded. Second, the of device (i.e., the out file or our SD drive in this case) needs to match the SD card. Everything, including devices, is a file in Linux, in case you are wondering why your SD drive is considered a file. We will see this again in a bit with the I2C device. You can toast your hard drive if you put the wrong device path in here. If you are unsure about this, you may want to use a GUI utility so you don’t overwrite your hard drive.

Once the OS is copied onto the SD card, it is time to boot up the Raspberry Pi. A default username and password are available from wherever you download the OS. With our OS, the defaults are “pi” and “raspberry.” Make it your first mission to change that password and maybe even add a new account if your project is going to be in production.

Another thing you may have to change is the IP address configuration on the Ethernet interface. By default, these distributions use DHCP to obtain an address. Unless you have a need otherwise, it is best to leave that be. If you need to use a static IP address, I have included a link in the Resources section with instructions on how to do this in Linux.

To access your Raspberry Pi, hook up a local keyboard and monitor to get to a command line. Once you have the network running and you know the IP address, you can use the SSH utility to gain access via the network.

To get SNMP working on the Raspberry Pi, you need to install two Debian packages: snmpd and snmp. The snmpd package is the actual SNMP server software that will enable other devices to query for SNMP on this device. The second package, snmp, is the client. It is nice to have this installed for local troubleshooting.

We used the Debian package manager, apt-get, to install these packages. The commands also must be run as the root or superuser.

The sudo apt-get install snmpd command installs the snmpd software. The sudo part runs the apt-get command as the superuser. The install and snmpd parts of the command are the arguments for the apt-get command.

Next we issued the
sudo apt-get install snmp command, which installed the SNMP client. Issue the ps -ax | grep snmpd command to see if the snmpd daemon is running after the install. You should see something like this:

1444 ? S 14:22 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid

If you do not see a line similar to this, you can issue the sudo /etc/init.d/snmpd command start to start the service. Once it is running, it is time to turn your attention to the Python script that reads the temperature sensor. Configure the SNMP daemon after you get the Python script running.

The Raspberry Pi’s final installation is shown. The clear acrylic case can be seen along with the Texas Instruments TMP102 temperature sensor, which is glued below the air hole drilled into the case. We used a modified ribbon cable to connect the various TMP102 pins to the Raspberry Pi.

The Raspberry Pi’s final installation is shown. The clear acrylic case can be seen along with the Texas Instruments TMP102 temperature sensor, which is glued below the air hole drilled into the case. We used a modified ribbon cable to connect the various TMP102 pins to the Raspberry Pi.

A Workspace for “Engineering Magic”

Brandsma_workspace2

Photo 1—Brandsma describes his workspace as his “little corner where the engineering magic happens.”

Sjoerd Brandsma, an R&D manager at CycloMedia, enjoys designing with cameras, GPS receivers, and transceivers. His creates his projects in a small workspace in Kerkwijk, The Netherlands (see Photo 1). He also designs in his garage, where he uses a mill and a lathe for some small and medium metal work (see Photo 2).

Brandsma_lathe_mill

Photo 2—Brandsma uses this Weiler lathe for metal work.

The Weiler lathe has served me and the previous owners for many years, but is still healthy and precise. The black and red mill does an acceptable job and is still on my list to be converted to a computer numerical control (CNC) machine.

Brandsma described some of his projects.

Brandsma_cool_projects

Photo 3—Some of Brandsma’s projects include an mbed-based camera project (left), a camera with an 8-bit parallel databus interface (center), and an MP3 player that uses a decoder chip that is connected to an mbed module (right).

I built a COMedia C328 UART camera with a 100° lens placed on a 360° servomotor (see Photo 3, left).  Both are connected to an mbed module. When the system starts, the camera takes a full-circle picture every 90°. The four images are stored on an SD card and can be stitched into a panoramic image. I built this project for the NXP mbed design challenge 2010 but never finished the project because the initial idea involved doing some stitching on the mbed module itself. This seemed to be a bit too complicated due to memory limitations.

I built this project built around a 16-MB framebuffer for the Aptina MT9D131 camera (see Photo 3, center). This camera has an 8-bit parallel databus interface that operates on 6 to 80 MHz. This is way too fast for most microcontrollers (e.g., Arduino, Atmel AVR, Microchip Technology PIC, etc.). With this framebuffer, it’s possible to capture still images and store/process the image data at a later point.

This project involves an MP3 player that uses a VLSI VS1053 decoder chip that is connected to an mbed module (see Photo 3, right). The great thing about the mbed platform is that there’s plenty of library code available. This is also the case for the VS1053. With that, it’s a piece of cake to build your own MP3 player. The green button is a Skip button. But beware! If you press that button it will play a song you don’t like and you cannot skip that song.

He continued by describing his test equipment.

Brandma_test_equipment

Photo 4—Brandsma’s test equipment collection includes a Tektronix TDS220 oscilloscope (top), a Total Phase Beagle protocol analyzer (second from top), a Seeed Technology Open Workbench Logic Sniffer (second from bottom), and a Cypress Semiconductor CY7C68013A USB microcontroller (bottom).

Most of the time, I’ll use my good old Tektronix TDS220 oscilloscope. It still works fine for the basic stuff I’m doing (see Photo 4, top). The Total Phase Beagle I2C/SPI protocol analyzer Beagle/SPI is a great tool to monitor and analyze I2C/SPI traffic (see Photo 4, second from top).

The red PCB is a Seeed Technology 16-channel Open Workbench Logic Sniffer (see Photo 4, second from bottom). This is actually a really cool low-budget open-source USB logic analyzer that’s quite handy once in a while when I need to analyze some data bus issues.

The board on the bottom is a Cypress CY7C68013A USB microcontroller high-speed USB peripheral controller that can be used as an eight-channel logic analyzer or as any other high-speed data-capture device (see Photo 4, bottom). It’s still on my “to-do” list to connect it to the Aptina MT9D131 camera and do some video streaming.

Brandsma believes that “books tell a lot about a person.” Photo 5 shows some books he uses when designing and or programming his projects.

Brandsma_books

Photo 5—A few of Brandsma’s “go-to” books are shown.

The technical difficulty of the books differs a lot. Electronica echt niet moeilijk (Electronics Made Easy) is an entry-level book that helped me understand the basics of electronics. On the other hand, the books about operating systems and the C++ programming language are certainly of a different level.

An article about Brandsma’s Sun Chaser GPS Reference Station is scheduled to appear in Circuit Cellar’s June issue.

Dynamic Efficiency Microcontrollers

STMicroThe STM32F401 Dynamic Efficiency microcontrollers extend battery life and support innovative new features in mobile phones, tablets, and smart watches. They help manage MEMS sensors in smart-connected devices and are well suited for Internet-of-Things (IoT) applications and fieldbus-powered industrial equipment.

The STM32F401 microcontrollers include an ART accelerator, a prefetch queue, and a branch cache. This enables zero-wait-state execution from flash, which boosts performance to 105 DMIPS (285 CoreMark) at 84 MHz. The microcontrollers’ 90-nm process technology boosts performance and reduces dynamic power. Its dynamic voltage scaling optimizes the operating voltage to meet performance demands and minimize leakage.

The STM32F401 microcontrollers integrate up to 512 KB of flash and 96 KB SRAM in a 3.06-mm × 3.06-mm chip-scale package and feature a 9-µA at 1.8 V Stop mode current. The devices’ peripherals include three 1-Mbps I2C ports, three USARTs, four SPI ports, two full-duplex I2S audio interfaces, a USB 2.0 OTG full-speed interface, an SDIO interface, 12-bit 2.4-MSPS 16-channel ADC, and up to 10 timers.

Pricing for the STM32F401 microcontrollers starts at $2.88 in 10,000-unit quantities.

STMicroelectronics
www.st.com

Turn Your Android Device into an Application Tool

A few years ago, the Android Open Accessory initiative was announced with the aim of making it easier for hardware manufacturers to create accessories that work with every Android device. Future Technology Devices International (FTDI) joined the initiative and last year introduced the FTD311D multi-interface Android host IC. The goal was to enable engineers and designers to make effective use of tablets and smartphones with the Android OS, according to Circuit Cellar columnist Jeff Bachiochi.

The FTD311D “provides an instant bridge from an Android USB port(B) to peripheral hardware over general purpose input-out (GPIO), UART, PWM, I2C Master, SPI Slave, or SPI Master interfaces,” Bachiochi says.

In the magazine’s December issue Bachiochi takes a comprehensive look at the USB Android host IC and how it works. By the end of his article, readers will have learned quite a bit about how to use FTDI’s apps and the FT311D chip to turn an Android device into their own I/0 tool.

Bachiochi used the SPI Master demo to read key presses and set LED states on this SPI slave 16-key touch panel.

Bachiochi used the SPI Master demo to read key presses and set LED states on this SPI slave 16-key touch panel.

Here is how Bachiochi describes the FT311D and its advantages:

The FT311D is a full-speed USB host targeted at providing access to peripheral hardware from a USB port on an Android device. While an Android device can be a USB host, many are mobile devices with limited power. For now, these On-The-Go (OTG) ports will be USB devices only (i.e., they can only connect to a USB host as a USB device).

Since the USB host is responsible for supplying power to a USB peripheral device, it would be bad design practice to enable a USB peripheral to drain an Android mobile device’s energy. Consequently, the FT311D takes on the task of USB host, eliminating any draw on the Android device’s battery.

All Android devices from V3.1 (Honeycomb) support the Android Open Accessory Mode (AOAM). The AOAM is the complete reverse of the conventional USB interconnect. This game-changing approach to attaching peripherals enables three key advantages. First, there is no need to develop special drivers for the hardware; second, it is unnecessary to root devices to alter permissions for loading drivers; and third, the peripheral provides the power to use the port, which ensures the mobile device battery is not quickly drained by the external hardware being attached.

Since the FT311D handles the entire USB host protocol, USB-specific firmware programming isn’t required. As the host, the FT311D must inquire whether the connected device supports the AOAM. If so, it will operate as an Open Accessory Mode device with one USB BULK IN endpoint and one USB BULK OUT endpoint (as well as the control endpoint.) This interface will be a full-speed (12-Mbps) USB enabling data transfer in and out.

The AOAM USB host has a set of string descriptors the Android OS is capable of reading. These strings are (user) associated with an Android OS application. The Android then uses these strings to automatically start the application when the hardware is connected. The FT311D is configured for one of its multiple interfaces via configuration inputs at power-up. Each configuration will supply the Android device with a unique set of string descriptors, therefore enabling different applications to run, depending on its setup.

The FT311D’s configuration determines whether each application will have access to several user interface APIs that are specific to each configuration.

The article goes on to examine the various interfaces in detail and to describe a number of demo projects, including a multimeter.

Many of Bachiochi's projects use printable ASCII text commands and replies. This enables a serial terminal to become a handy user I/O device. This current probe circuit outputs its measurements in ASCII-printable text.

Many of Bachiochi’s projects use printable ASCII text commands and replies. This enables a serial terminal to become a handy user I/O device. This current probe circuit outputs its measurements in ASCII-printable text.

Multimeters are great tools. They have portability that enables them to be brought to wherever a measurement must be made. An Android device has this same ability. Since applications can be written for these devices, they make a great portable application tool. Until the AOAM’s release, there was no way for these devices to be connected to any external circuitry and used as an effective tool.

I think FTDI has bridged this gap nicely. It provided a great interface chip that can be added to any circuit that will enable an Android device to serve as an effective user I/O device. I’ve used the chip to quickly interface with some technology to discover its potential or just test its abilities. But I’m sure you are already thinking about the other potential uses for this connection.

Bachiochi is curious to hear from readers about their own ideas.

If you think the AOAM has future potential, but you want to know what’s involved with writing Android applications for a specific purpose, send me an e-mail and I’ll add this to my list of future projects!

You can e-mail Bachiochi at jeff.bachiochi@imaginethatnow.com or post your comment here.

 

6DoF Robotic Arm

GlobalSpecialties

The R680 Banshi Robotic Arm

The R680 Banshi Robotic Arm is an affordable robot designed for educators and hobbyists. It can help users learn the basics of electronics, mechanics, and programming. The Banshi is controlled by an ATmega64 microcontroller that is programmable via open-source tools in C.

The robot includes many example programs that can be easily downloaded to the robot using the supplied USB interface and the RobotLoader software. You can also use the free open-source WinAVR software to write your own custom programs.

The robot can be controlled with the included keyboard or RACS software. The software can record and play back the Banshi’s movements. You can use I/Os and the flexible I2C bus system to add extra modules that enable the robot to react to its environment.

GlobalSpecialties-kit

The Banshi Robot kit

The Banshi Robot comes unassembled as a kit with included assembly tools. The robot’s additional features include six degrees of freedom (6DoF), a 12-V power supply, an I2C bus, a USB interface, and a complete 72-page manual.

The Banshi Robotic Arm costs $199.

Global Specialties
http://globalspecialties.com

Low-Cost SBCs Could Revolutionize Robotics Education

For my entire life, my mother has been a technology trainer for various educational institutions, so it’s probably no surprise that I ended up as an engineer with a passion for STEM education. When I heard about the Raspberry Pi, a diminutive $25 computer, my thoughts immediately turned to creating low-cost mobile computing labs. These labs could be easily and quickly loaded with a variety of programming environments, walking students through a step-by-step curriculum to teach them about computer hardware and software.

However, my time in the robotics field has made me realize that this endeavor could be so much more than a traditional computer lab. By adding actuators and sensors, these low-cost SBCs could become fully fledged robotic platforms. Leveraging the common I2C protocol, adding chains of these sensors would be incredibly easy. The SBCs could even be paired with microcontrollers to add more functionality and introduce students to embedded design.

rover_webThere are many ways to introduce students to programming robot-computers, but I believe that a web-based interface is ideal. By setting up each computer as a web server, students can easily access the interface for their robot directly though the computer itself, or remotely from any web-enabled device (e.g., a smartphone or tablet). Through a web browser, these devices provide a uniform interface for remote control and even programming robotic platforms.

A server-side language (e.g., Python or PHP) can handle direct serial/I2C communications with actuators and sensors. It can also wrap more complicated robotic concepts into easily accessible functions. For example, the server-side language could handle PID and odometry control for a small rover, then provide the user functions such as “right, “left,“ and “forward“ to move the robot. These functions could be accessed through an AJAX interface directly controlled through a web browser, enabling the robot to perform simple tasks.

This web-based approach is great for an educational environment, as students can systematically pull back programming layers to learn more. Beginning students would be able to string preprogrammed movements together to make the robot perform simple tasks. Each movement could then be dissected into more basic commands, teaching students how to make their own movements by combining, rearranging, and altering these commands.

By adding more complex commands, students can even introduce autonomous behaviors into their robotic platforms. Eventually, students can be given access to the HTML user interfaces and begin to alter and customize the user interface. This small superficial step can give students insight into what they can do, spurring them ahead into the next phase.
Students can start as end users of this robotic framework, but can eventually graduate to become its developers. By mapping different commands to different functions in the server side code, students can begin to understand the links between the web interface and the code that runs it.

Kyle Granat

Kyle Granat, who wrote this essay for Circuit Cellar,  is a hardware engineer at Trossen Robotics, headquarted in Downers Grove, IL. Kyle graduated from Purdue University with a degree in Computer Engineering. Kyle, who lives in Valparaiso, IN, specializes in embedded system design and is dedicated to STEM education.

Students will delve deeper into the server-side code, eventually directly controlling actuators and sensors. Once students begin to understand the electronics at a much more basic level, they will be able to improve this robotic infrastructure by adding more features and languages. While the Raspberry Pi is one of today’s more popular SBCs, a variety of SBCs (e.g., the BeagleBone and the pcDuino) lend themselves nicely to building educational robotic platforms. As the cost of these platforms decreases, it becomes even more feasible for advanced students to recreate the experience on many platforms.

We’re already seeing web-based interfaces (e.g., ArduinoPi and WebIOPi) lay down the beginnings of a web-based framework to interact with hardware on SBCs. As these frameworks evolve, and as the costs of hardware drops even further, I’m confident we’ll see educational robotic platforms built by the open-source community.