CC278: Serial Displays Save Resources (BMP Files)

In Circuit Cellar’s September issue, columnist Jeff Bachiochi provides his final installment in a three-part series titled “Serial Displays Save Resources.” The third article focuses on bitmap (BMP) files, which store images.


A BMP file has image data storage beginning with the image’s last row. a—Displaying this data as stored will result in an upside-down image. b—Using the upsidedown=1 command will rotate the display 180°. c—The mirror=1 command flips the image horizontally. d—Finally, an origin change is necessary to shift the image to the desired location. These commands are all issued prior to transferring the pixels, to correct for the way the image data is stored.

LCDs are inexpensive and simple to use, so they are essential to many interesting projects, Jeff says. The handheld video game industry helped popularize the use of LCDs among DIYers.

Huge production runs in the industry “made graphic displays commonplace, helping to quickly reduce their costs,” Jeff says. “We can finally take advantage of lower-cost graphic displays, with one caveat: While built-in hardware controllers and drivers take charge of the pixels, you are now responsible for more than just sending a character to be printed to the screen. This makes the controllers and drivers not work well with the microcontroller project. That brings us to impetus for this article series.

“In Part 1 (‘Routines, Registers and Commands,’ Circuit Cellar 276, 2013), I began by discussing how to use a graphic display to print text, which, of course, includes character generation. In essence, I showed how to insert some intelligence between a project and the display. This intermediary would interpret some simple commands that enable you to easily make use of the display’s flexibility by altering position, screen orientation, color, magnification, and so forth.

“Part 2 (‘Button Commands,’ Circuit Cellar 277) revealed how touch-sensitive overlays are constructed and used to provide user input. The graphic display/touch overlay combination is a powerful combination that integrates I/O into a single module. Adding more commands to the interface makes it easier to create dynamic buttons on the graphic screen and reports back whenever a button is touched.

The prototype PCB I used for this project mounts to the reverse side of the thin-film transistor (TFT) LCD. The black connector holds the serial and power connections to your project. The populated header is for the Microchip Technology MPLAB ICD 3 debugger/programmer.

“Since I am using a graphic screen, it makes sense to investigate graphic files. This article (Part 3, ‘BMP Files,’ Circuit Cellar 277) examines the BMP file makeup and how this relates to the graphic screen.”

To learn more about the BMP graphical file format and Jeff’s approach to working with a graphic icon’s data, check out the September issue.


Q&A: Jack Ganssle, Electronics Entrepreneur

Jack Ganssle is a well-known engineer, author, lecturer, and consultant. After learning about oscilloscopes, transistors, and capacitors in his father’s engineering lab, Jack went on to write hundreds of articles and several books about embedded development-related topics. He also started and sold three electronics companies, worked on classified government projects, and founded The Ganssle Group, based in Reisterstown, MD. I recently spoke with Jack about some of his career highlights, his current work, and what’s next in the embedded design industry.—Nan Price, Associate Editor

NAN: You’ve been interested in electronics since the age of 9. Give us a little background information. What was your first project?

Jack Ganssle

Jack Ganssle

JACK: My first project was a crystal radio with the inductor wound on the quintessential Quaker oatmeal box! It was really exciting to get AM reception over that. Back then, pretty much no one had FM. AM was it.

Later I learned to repair TVs and made pocket money doing that. Those sets were all vacuum tubes. Usually there was just a bad tube or dried out capacitor. But from there, my friends and I learned to design amplifiers (the Beatles were very hot and everyone was starting a band). For graduation from eighth grade, my dad gave me an old oscilloscope he had built from a kit years earlier.

He was part of a startup when I was in my early teens. We kids were coerced into being the (unpaid) janitors for the place. That was annoying at first. But, we were allowed to keep anything we swept up. The engineering lab’s floor was always covered in resistors, capacitors, transistors, and the like, so my parts collection grew. (ICs existed then, but were rare.)

When I was 16 I got a ham license, built  various transmitters, and used WWII surplus receivers. One day an angry letter arrived from the Federal Communications Commission (FCC). They had picked me up on my second harmonic clear across the country. I was really proud of that contact.

But it wasn’t long before some resistor-transistor logic (RTL) digital ICs came my way. Projects included controls for tube transmitters, Estes model rocket telemetry, and even a crude TV camera that used a photomultiplier tube to scan a spiral set of holes in a spinning disk. A couple of us worked on a ham radio moon bounce, but I accidentally shorted out a resistor and my only hydrogen thyratron (sort of a tube version of an SCR) blew up. There was no money for a replacement, so that project died. The transmitter used a little lighthouse tube that had a maximum rating of a couple of watts, but it worked OK when pulsing it for a few microseconds at 1 kW.

Senior year of high school a friend and I hitchhiked from Maryland to Boston to go to a surplus store. I bought a core memory plane that was 13,000 bits in a 6 in2 cube. Long hair didn’t help. We were picked up on the New Jersey Turnpike and strip searched. The cops never believed my explanation that the thing was computer memory.

A few years later, I had a 6501 microprocessor in the glove compartment of my Volkswagen bus (which I lived in for a year while saving for a sailboat). Coming into a sleepy Maine town from Canada that event was repeated when the border cops searched the bus and found the chip. They didn’t believe in computers on a chip. But the PC was years away and computers were mostly seen in science fiction films.

Freshman year of college, I designed and built a 12-bit computer using hundreds of TTL chips soldered together using phone company wire on vectorboards. For I/O there was an old Model 15 teletype using 5-bit Baudot codes that my software drove via bit banging. The OS, such as it was, lived in a pair of 1702 EPROMs, which each held 256 bytes. The computer worked great! And then the 8008, the first 8-bit microcontroller, came out and the thing was obsolete. I junked it, and now I wish I had saved at least the schematics.

But by then I had been working part-time as an electronics technician for a few years and the company needed to update its analog products to digital. No one knew anything about computers, so they promoted me to engineer. Eventually I ran the digital group there. We designed one of the first floppy disk controllers, insanely high-resolution graphics controllers, and a lot of other products. We also integrated minicomputers (Data General Novas and DEC PDP-11s) into systems with microprocessors. We bought a 5-MB disk drive for a Nova. It cost $5,000 (back when that was a lot of money) and weighed 500 lb. How things have changed.

NAN: Tell us about The Ganssle Group ( When and why did you start the company? What types of services do you provide?

JACK:  I formed The Ganssle Group in 1997 after 15 years of running an in-circuit emulator company. Working 70 h a week was getting old and I wanted more time with my kids. So my objective was to reverse the usual model. Instead of fitting life around a job, I wanted to fit the job into life.

Goal 1: Four months of vacation a year. It turns out that is elusive, in no small part due to the cool stuff going on around here, but most years we do manage two to three months off. My wife, Marybeth, works with me. She takes care of all of the administrative/travel and the like.

Goal 2: No commute. So we work out of the house (for the first few years, we worked out of the houseboat where we raised two kids).

Now the kids are grown, so there’s a Goal 3: Have as much fun as possible with Marybeth, so when I travel to new or interesting places she often accompanies me. There’s a lot more to life than work. Some of my side projects are available at

I’m not really sure what I do. I write—a lot. Readers are incredibly smart and vocal. The dialogue with them is a highlight of my day. I also give one- and two-day seminars on pretty much every continent (except Antarctica—so far!) about ways to get better firmware done faster. Sometimes I do an expert witness gig. Those are always fascinating as one gets to dig deeply into products and learn about the law. On rare occasions, I’ll do a day or three of consulting if the problem is particularly interesting. And there’s always some experiment I’m working on, which sometimes gets written up as an article.

NAN: Speaking of articles, you’ve written hundreds—including nine for Circuit Cellar magazine—on topics ranging from the history of the embedded systems programming industry, to memory management, to using programmable logic devices (PLDs). You also write a column for Embedded ( and you are editor of the biweekly newsletter The Embedded Muse. Tell us about the types of projects you enjoy constructing and writing about.

The breadboard is discharging batteries. To the left, a battery is soldered to some coax. Using the waveform generator in the oscilloscope I’m measuring the battery's reactance (which, it turns out, is entirely capacitive). The IAR tool is profiling current consumption of an evaluation board.

The breadboard is discharging batteries. To the left, a battery is soldered to some coax. Using the waveform generator in the oscilloscope I’m measuring the battery’s reactance (which, it turns out, is entirely capacitive). The IAR tool is profiling current consumption of an evaluation board.

JACK: I have one experiment that’s running right now. For the last four months I’ve been discharging coin cells. It sounds dull, but some microcontroller vendors are making outrageous claims about battery life that are on the surface true but irrelevant in real circuits. This circuit runs a complex profile on the batteries, tossing different loads on for a few milliseconds, and an ARM microcontroller samples the batteries’ voltage (as well as the transistors, VCE drop) into a log file. That data goes into a spreadsheet for further analysis. I’m making a much bigger version of this now, which will handle far more batteries at a time. I recently gave some preliminary results at a talk in Asilomar, CA, which garnered a lot of interest. More results will be forthcoming soon…I promise!

Another aspect of this is leakage. Does handling a battery leave finger oils that can affect the decades-long life claimed by the vendors? To test this, I built a femtoammeter. A polypropylene capacitor is charged and feeds a super-low bias current op-amp. Another ARM board monitors the op-amp voltage to watch the capacitor discharge as various contaminants are electrically connected to the capacitor. With no contaminants connected, even after 48 h, the cap discharged less than 1 mV. The thing resolves to better than 10 fA. (One fA is a millionth of a nanoamp, or about 6,000 electrons/second).

In fact, the ADC’s transfer function is a proxy for temperature. We heat the house with wood and you could see a perfect correlation of op-amp output and temperature throughout the day. (It’s lowest in the morning as the fire burns out overnight.)

NAN: You wrote the two-part Circuit Cellar article series, “Writing a Real-Time Operating System” (Issue 7 and 8, 1989) about the Hitachi HD64180 Z80-based embedded microprocessor nearly 15 years ago. Circuit Cellar also featured another HD64180-based article, “Huge Arrays on the HD64180: Taking Advantage of Memory Management” (Issue 16, 1990). What was your fascination with the HD64180? Also, is either of these projects still current? Have you changed any of the design components?

JACK: Gee, I have no idea. I wrote those using Microsoft Works, but the file format has changed and Works can no longer open those articles. Alas, the HD64180 is quite obsolete. It was a grown-up version of the Z80 and very popular in its day.

In 1974, Intel introduced the 8080, which was the first really decent 8-bit microprocessor. But it needed two clocks and three power supplies. The folks at Zilog came out with the Z80 a year later. It could run 8080 code, but had one clock, a single 5-V supply, and it offered additional instructions that massively improved code density. Intel responded with the 8085, but it was really an 8080 in drag. The couple of new instructions added just couldn’t give the Z80 a run for its money. Eventually Zilog came out with the Z180, and Hitachi the 64180 clone, which included on-board peripherals and a memory management unit to address 1 MB using standard Z80 instructions. It was a great idea, but since there was no on-board memory, it couldn’t compete with microcontrollers such as the ancient, and still-going-strong, 8051.

NAN: In addition to writing, you lecture and teach at conferences and symposiums worldwide. Tell us about your one-day “Better Firmware Faster” seminar. How did it begin? What can attendees expect to gain from it?

JACK: I’m completely frustrated with the state of firmware. It’s inevitably late and buggy. While there’s no doubt that crafting firmware is extremely difficult—after all, software is the most complex engineered product ever invented—we can and must do better. It’s astonishing that so few groups keep even the simplest metrics, yet engineering is all about numbers.

The seminar is a fast-paced event that shows developers better ways to get their code to market. It covers process issues, as well as a lot of technology areas unique to embedded systems, such as managing memory and dealing with tough real-time problems.

What can attendees get from it? It varies from very little to a lot. Some groups refuse to change anything, so will always maintain the status quo. Others do better. Some report 40% improvements to the schedule and up to an order of magnitude of reduction in shipped bugs.

NAN: You started three high-tech companies prior to The Ganssle Group. Tell us about your work experience. Any highlights?

JACK: Well, there was one instrument that used infrared light to measure protein in cow poop. Though it was interesting technology, it’s hard to call that a highlight. The design I’m most proud of was my first emulator, which had only 17 ICs and used insanely complex code. Eventually we offered emulators that required hundreds of chips, but those cost $7,000, while the first one sold for $600.

Some of the government work I’ve done was very interesting and used extremely sophisticated electronics. But I can’t talk about those projects. A buddy and I did the White House security system during the Reagan administration. It was fun to work in the basement there, but the bureaucracy was stifling. We lost our White House passes the same day Oliver North did, but he got more press.

NAN: What do you consider to be the “next big thing” in the embedded design industry? Is there a particular technology that you’ve used or seen that will change the way engineers design in the coming months and years?

JACK: Everything is going to change for us over the next five to 10 years. We will have tools that automatically find lots of bugs. Everyone is familiar (and has a love/hate relationship) with lint. But static analyzers can today find lots of runtime bugs. These are currently expensive and frustrating, but they demonstrate that such products can, and will, exist. When the issues are resolved, I expect they’ll be as common as IDEs. Debugging manually is hugely expensive.

Another tool is slowly gaining acceptance: so-called virtualization products (e.g., from Wind River and others). These are not the hypervisors people think about when using the word “virtualization.” Rather, they are complete software models of a target system. You can run all—and I mean all—of your code on the model. The hardware is always late. These tools will permit debugging to start at the beginning of the project. The tools are also expensive and somewhat clumsy, but will get better over time.

A modern smartphone has more than 10 million lines of code. Automobiles often have more. One thing is certain: Firmware will continue to grow in size and complexity. The current techniques we use to develop code will change as well.


Two-Channel CW Laser Diode Driver with an MCU Interface

The iC-HT laser diode driver enables microcontroller-based activation of laser diodes in Continuous Wave mode. With this device, laser diodes can be driven by the optical output power (using APC), the laser diode current (using ACC), or a full controller-based power control unit.

The maximum laser diode current per channel is 750 mA. Both channels can be switched in parallel for high laser diode currents of up to 1.5 A. A current limit can also be configured for each channel.

Internal operating points and voltages can be output through ADCs. The integrated temperature sensor enables the system temperature to be monitored and can also be used to analyze control circuit feedback. Logarithmic DACs enable optimum power regulation across a large dynamic range. Therefore, a variety of laser diodes can be used.

The relevant configuration is stored in two equivalent memory areas. Internal current limits, a supply-voltage monitor, channel-specific interrupt-switching inputs, and a watchdog safeguard the laser diodes’ operation through iC-HT.

The device can be also operated by pin configuration in place of the SPI or I2C interface, where external resistors define the APC performance targets. An external supply voltage can be controlled through current output device configuration overlay (DCO) to reduce the system power dissipation (e.g., in battery-operated devices or systems).

The iC-HT operates on 2.8 to 8 V and can drive both blue and green laser diodes. The diode driver has a –40°C-to-125°C operating temperature range and is housed in a 5-mm × 5-mm, 28-pin QFN package.

The iC-HT costs $13.20 in 1,000-unit quantities.

iC-Haus GmbH

Low-Cost, High-Performance 32-bit Microcontrollers

The PIC32MX3/4 32-bit microcontrollers are available in 64/16-, 256/64-, and 512/128-KB flash/RAM configurations. The microcontrollers are coupled with Microchip Technology’s software and tools for designs in connectivity, graphics, digital audio, and general-purpose embedded control.

The microcontrollers offer high RAM memory options and high peripheral integration at a low cost. They feature 28 10-bit ADCs, five UARTS, 105-DMIPS performance, serial peripherals, a graphic display, capacitive touch, connectivity, and digital audio support.
The PIC32MX3/4 microcontrollers are supported with general software development tools, including Microchip Technology’s MPLAB X integrated development environment (IDE) and the MPLAB XC32 C/C++ compiler.

Application-specific tools include the Microchip Graphics Display Designer X and the Microchip Graphics Library, which provide a visual design tool that enables quick and easy creation of graphical user interface (GUI) screens for applications. The microcontrollers are also supported with a set of Microchip’s protocol stacks including TCP/IP, USB Device and Host, Bluetooth, and Wi-Fi. For digital audio applications, Microchip provides software for tasks such as sample rate conversion (SRC), audio codecs—including MP3 and Advanced Audio Coding (AAC), and software to connect smartphones and other personal electronic devices.

The PIC32MX3/4 family is supported by Microchip’s PIC32 USB Starter Kit III, which costs $59.99 and the PIC32MX450 100-pin USB plug-in module, which costs $25 for the modular Explorer 16 development system. Pricing for the PIC32MX3/4 microcontrollers starts at $2.50 each in 10,000-unit quantities.

Microchip Technology, Inc.

Low-Power, High-Efficiency Boost Regulator

The TS3300 is an ultra-low-power, load-independent, high-efficiency boost regulator. It operates from supply voltages as low as 0.6 up to 4.5 V and can deliver at least 75 mA of continuous output current.

The TS3300 can be powered from a variety of power sources including single- or multiple-cell alkaline or single Li-chemistry batteries. The boost regulator’s output voltage range can be user-specified from 1.8 to 5.25 V to simultaneously power a range of low-power analog circuits, microcontrollers, and low-energy Bluetooth radios. The TS3300 produces a 3-V output from a 1.2-V input source. Its efficiency performance is constant over a 100:1 span in output current. To power low-energy radios, the TS3300’s internal, low-dropout linear regulator can deliver up to 100 mA output current while reducing boost-converter-generated output voltage ripple.

Drawing only 3.5 µA no-load supply current, the TS3300 is ideal for “always on” and other battery-powered or portable applications where an extended battery run-time is required. The TS3300 operates from low power sources (e.g., photovoltaic cells to three alkaline cells) and is ideally suited for handheld/portable applications (e.g., wireless remote sensors, RFID tags, wireless microphones, solar cell post-regulator/chargers, post-regulators for energy harvesting, blood glucose meters, and personal health-monitoring devices).

The TS3300 is fully specified over the –40°C-to-85°C temperature range and is available in a low-profile, thermally-enhanced 16-pin 3mm × 3mm TQFN package with an exposed backside paddle. The TS3300 costs $0.85 in 1,000-unit quantities.

Touchstone Semiconductor

Member Profile: Steve Hendrix

Steve Hendrix

Location: Sagamore Hills, OH (located between Cleveland and Akron)

Education: BS, United States Air Force Academy, El Paso County, CO

Occupation: Steve began moonlighting as an engineering consultant in 1979. He has been a full-time consultant since 1992.

Member Status: He says he has been a subscriber since “forever.” He remembers reading the Circuit Cellar columns in Byte magazine.

Technical Interests: Steve enjoys embedded design, from picoamps to kiloamps, from nanovolts to kilovolts, from microhertz to gigahertz, and from nanowatts to kilowatts.
Current Projects: He is working on eight active professional projects. Most of his projects involve embedding Microchip Technology’s PIC18 microcontroller family.

Some of Steve’s projects include Texas Instruments Bluetooth processors and span all the previously mentioned ranges in the interfacing hardware. Steve says he is also working on a personal project involving solar photovoltaic power.

Thoughts on the Future of Embedded Technology: Steve thinks of embedded technology as “a delicate balancing act: time spent getting the technology set up vs. time we would spend to do the same job manually; convenience and connectivity vs. privacy, time, and power saved vs. energy consumed; time developing the technology vs. its payoffs; and connectedness with people far away vs. with those right around us.” Additionally, he says there are always the traditional three things to balance “good, fast, cheap—choose two!”

New Product: Parallax Debuts Three New Products

Parallax, which designs and manufactures microcontroller development tools and small single-board computers, recently introduced three new products, the Single Relay Board, the SCP1000 Pressure Sensor Module, and the Propeller Mini.

You can use the Single Relay Board to turn lights, fans, and other devices on or off while keeping them isolated from your microcontroller. The Single Relay Board’s on-board relay enables you to control high-power devices (up to 10 A). The relay’s control is provided via a 1 x 3 header that works well with servomotor cables and conveniently connects to many development boards.

The SCP1000 Pressure Sensor Module is an absolute pressure sensor capable of detecting atmospheric pressure from 30 to 120 kPa. The sensor also provides temperature data. A single multiplication operation using constants obtains pressure data in kilopascals or temperature in degrees Celsius. The pressure data is internally calibrated and temperature compensated. The SCP1000 features four measurement modes in addition to Standby and Power Down mode. A SPI bus handles the sensor’s communication and provides additional control lines (e.g., interrupt line and trigger input).

The Propeller Mini can embed a multi-core microcontroller system in small-sized projects where a full-sized development board is impractical. With its small size and component count, the Propeller enables you to have a complete prototyping system or project while maintaining a small footprint.

The Propeller features many options. For breadboarding, you can solder the included header onto the board. To keep your project’s control system small, you could solder your project’s wire leads directly to the board’s through holes. You can also solder sockets onto the Propeller Mini, enabling it to plug into a prototyping board containing your sensors and other components.

The Single Relay Board costs $9.99. The SCP1000 Pressure Sensor Module and the Propeller Mini cost $24.99.

Parallax, Inc.

Microcontroller-Based, Cube-Solving Robot

Cube Solver in ActionCanadian Nelson Epp has earned degrees in physics and electrical engineering. But as a child, he was stumped by the Rubik’s Cube puzzle. So, as an adult, he built a Rubik’s Cube-solving robot that uses a Parallax Propeller microcontroller and a 52-move algorithm to solve the 3-D puzzle.

Designing and completing the robot wasn’t easy. Epp says he originally used a “gripper”-type robot that was “a complete disaster.” Then he experimented with different algorithms–“human memorizable ones”—before settling on a solution method developed by mathematician Morwen Thistlethwaite. (The algorithm is based on the mathematical concepts of a group, a subgroup, and generator and coset representatives.)

Nelson also developed a version of his Rubik’s Cube solver that used neural networks to analyze the cube’s colors, but that worked only half the time.

So, considering the time he had to spend on project trial and error (and his obligations to work, family, and pets), it took about six years to complete the robot. He writes about the results in the September issue of Circuit Cellar magazine. 

Here, he describes some of the choices he made in hardware components.

“The cube solver hardware uses two external power supplies: 5 VDC for the servomotors and 12 VDC for the remaining circuits. The 12-VDC power supply feeds a Texas Instruments (TI) UA78M33 and a UA78M05 linear regulator. The UA78M05 regulator powers an Electronics123 C3088 camera board. The UA78M33 regulator powers a Maxim Integrated MAX3232 ECPE RS-232 transceiver, a Microchip Technology 24LC256 CMOS serial EEPROM, remote reset circuitry, the Propeller, a SD/MMC card, the camera board’s digital output circuitry, and an ECS ECS-300C-160 oscillator. The images at right show my cube solver and circuit board.
“The ECS-300C-160 is a self-contained dual-output oscillator that can produce clock signals that are binary fractions of the 16-MHz base signal. My application uses the 8- and 16-MHz clock taps. The Propeller is clocked with the 8-MHz signal and then internally multiplied up to 64 MHz. The 16-MHz signal is fed to the camera.

“I used a MAX3232 transceiver to communicate to the host’s RS-232 port. The Propeller’s serial input pin and serial output pin are only required at startup. After the Propeller starts up, these pins can be used to exchange commands with the host. The Propeller also has pins for serial communication to an EEPROM, which are used during power up when a host is not sending a program.

“The cube-solving algorithm uses the coset representative file stored on an SD card, which is read by the Propeller via a SparkFun Electronics Breakout Board for SD-MMC cards. The Propeller interface to the SD card consists of a chip select, data in, data out, data clock, and power. The chip select is fixed into the active state. The three lines associated with data are wired to the Propeller.

“The Propeller uses a camera to determine the cube’s starting permutation. The C3088 uses an Electronics123 OV6630 color sensor module. I chose the camera because its data format and clocking speed was within the range of the Propeller’s capabilities. The C3088 has jumpers for external or internal clocking.”

To read more about Epp’s design journey—and outcomes—check out Circuit Cellar’s September issue. And click here for a video of his robot at work.


NXP LPC800 Microcontroller Challenge

Attention microcontroller users around the world! Ready to enter NXP Semiconductor’s LPC800 Challenge? Getting started is straightforward.

Elektor and Circuit Cellar have partnered with NXP Semiconductors to promote the Challenge. Once you have your LPC800 mini-board and code, you simply register and start working. The rules and complete details are listed on the LPC800 Challenge webpage.

The entry deadline is August 30, 2013. Once all the entries are received, NXP will select the most unique, interesting and funny submissions to receive a LPC800 LPCXpresso development kit.

The LPC800 is an ARM Cortex-M0+-based, 32-bit microcontroller operating at CPU frequencies of up to 30 MHz. The LPC800 supports up to 16 KB of flash memory and 4 KB of SRAM. The peripheral complement of the LPC800 includes a CRC engine, one I2C-bus interface, three USARTs, two SPI interfaces, one multi-purpose, state-configurable timer, one comparator, function-configurable I/O ports through a switch matrix, and up to 18 general purpose I/O pins.

Need design ideas? Check out these microcontroller projects with NXP parts.

CC 276: MCU-Based Prosthetic Arm with Kinect

In its July issue, Circuit Cellar presents a project that combines the technology behind Microsoft’s Kinect gaming device with a prototype prosthetic arm.

The project team and  authors of the article include Jung Soo Kim, an undergraduate student in Biomedical Engineering at Ryerson University in Toronto, Canada, Nika Zolfaghari, a master’s student at Ryerson, and Dr. James Andrew Smith, who specializes in Biomedical Engineering at Ryerson.

“We designed an inexpensive, adaptable platform for prototype prosthetics and their testing systems,” the team says. “These systems use Microsoft’s Kinect for Xbox, a motion sensing device, to track a healthy human arm’s instantaneous movement, replicate the exact movement, and test a prosthetic prototype’s response.”

“Kelvin James was one of the first to embed a microprocessor in a prosthetic limb in the mid-1980s…,” they add. “With the maker movement and advances in embedded electronics, mechanical T-slot systems, and consumer-grade sensor systems, these applications now have more intuitive designs. Integrating Xbox provides a platform to test prosthetic devices’ control algorithms. Xbox also enables prosthetic arm end users to naturally train their arms.”

They elaborate on their choices in building the four main hardware components of their design, which include actuators, electronics, sensors, and mechanical support:

“Robotis Dynamixel motors combine power-dense neodymium motors from Maxon Motors with local angle sensing and high gear ratio transmission, all in a compact case. Atmel’s on-board 8-bit ATmega8 microcontroller, which is similar to the standard Arduino, has high (17-to-50-ms) latency. Instead, we used a 16-bit Freescale Semiconductor MC9S12 microcontroller on an Arduino-form-factor board. It was bulkier, but it was ideal for prototyping. The Xbox system provided high-level sensing. Finally, we used Twintec’s MicroRAX 10-mm profile T-slot aluminum to speed the mechanical prototyping.”

The team’s goal was to design a  prosthetic arm that is markedly different from others currently available. “We began by building a working prototype of a smooth-moving prosthetic arm,” they say in their article.

“We developed four quadrant-capable H-bridge-driven motors and proportional-derivative (PD) controllers at the prosthetic’s joints to run on a MC9S12 microcontroller. Monitoring the prosthetic’s angular position provided us with an analytic comparison of the programmed and outputted results.”

A Technological Arts Esduino microcontroller board is at the heart of the prosthetic arm design.

The team concludes that its project illustrates how to combine off-the-shelf Arduino-compatible parts, aluminum T-slots, servomotors, and a Kinect into an adaptable prosthetic arm.

But more broadly, they say, it’s a project that supports the argument that  “more natural ways of training and tuning prostheses” can be achieved because the Kinect “enables potential end users to manipulate their prostheses without requiring complicated scripting or programming methods.”

For more on this interesting idea, check out the July issue of Circuit Cellar. And for a video from an earlier Circuit Cellar post about this project, click here.


A Real-Time Fuel Consumption Monitor

Jeff Bachiochi’s real-time fuel consumption monitor for his Jeep.

Circuit Cellar columnist Jeff Bachiochi has enjoyed driving his wife’s Prius, in part because of the real-time feedback it gives him on the miles per gallon he is getting. It made him aware of how he could save gas with simple and immediate adjustments to his driving style.

With that in mind, he thought it would be a good idea to build an effective and affordable monitoring device that would give him the same real-time mpg for his Jeep.  After all, he can’t always borrow his wife’s car.

In the June issue, he shares what he came up with for an onboard diagnostics display. He explains below how he tapped into his own experience, as well as that of another Circuit Cellar author, to build the device for Jeep

“In the summer of 2011, I presented a three-part series about the on-board diagnostic system (OBD-II) built into every automobile produced since 1996 (Circuit Cellar 251–253)….”

“In 2005, Bruce D. Lightner wrote an article about his winning entry in the 2004 Atmel AVR design contest (“AVR-Based Fuel Consumption Gauge,” Circuit Cellar 183, 2005). Lightner’s project altered an analog tachometer gauge as a display for miles per gallon. I wanted to show a little more information, so my project uses a Parallax Propeller microcontroller to interrogate the OBD interpreter and drive a composite LCD.

“You can get a composite color display from Parallax or an online source. While I had a small 2.5” display to work with, I was looking for something a bit bigger. For less than $50, I found a 7” LCD, which happened to be combined with a camera (for mounting on a vehicle’s rear license plate frame)…

“I dug out my Propeller Proto Board and blew off the dust…. The Propeller microcontroller design includes eight 32-bit parallel processors (i.e., cogs) and peripheral support, including access to the 32 I/O pins, two counters, and a video generator per cog.  It is the video generator support that makes this project possible with a minimal component count…. only three resistors are required to develop a composite video output.“

To read more about Bachiochi’s OBD device, check out his article in the June issue.


New Products: May 2013


iC-Haus iC-TW8

The iC-TW8 is a high-resolution signal processor designed to evaluate sine/cosine sensors. Its automatic functions help minimize angular errors and jitters. The processor can be used for initial, push-button calibration and to permanently adapt signal-path parameters during operation. The angular position is calculated at a programmable resolution of up to 65,536 increments per input cycle and output as an indexed incremental signal. A 32-bit word, which includes the counted cycles, is available through the SPI.

As an application-specific DSP, the iC-TW8 has two ADCs that simultaneously sample at a 250-ksps rate, fast CORDIC algorithms, special signal filters, and an analog front end with differential programmable gate amplifier (PGA) inputs that accepts typical magnetic sensor signals from 20 mVPP and up. Signal frequencies of up to 125 kHz enable high rotary and linear speeds for position measuring devices and are processed at a 24-µs constant latency period.

The device’s 12-bit measurement accuracy works with one button press. Measuring tools are not required. The iC-TW8 independently acquires information about the signal corrections needed for offset, amplitude, and phase errors and stores them in an external EEPROM.

The iC-TW8 has two configuration modes. Preset functions and interpolation factors can be retrieved through pins and the device can be calibrated with a button push. No programming is required for initial operation.

The device’s functions—including an AB output divider for fractional interpolation, an advanced signal filter to reduce jitter, a table to compensate for signal distortion, and configurable monitors for errors and signal quality—can be accessed when the serial interfaces are used. Typical applications include magnetic linear displacement measuring systems, optical linear scales, programmable magnetic/optical incremental encoders, high-resolution absolute/incremental angle sensors with on-axis, Hall scanning, and the general evaluation of sine/cosine signals (e.g., PC measuring cards for 1 VPP and 11 µAPP).

The iC-TW8 operates on a 3.1-to-5.5-V single-ended supply within a –40°C-to-125°C extended operating temperature range. It comes in a 48-pin QFN package that requires 7 mm × 7 mm of board space. A ready-to-operate demo board is  available for evaluation. An optional PC operating program, in other words, a GUI, can be connected with a USB adapter.

The iC-TW8 costs $7.69 in 1,000-unit quantities.

iC-Haus GmbH


Analog Devices AD9675

The AD9675 and the AD9674 are the latest additions to Analog Devices’s octal ultrasound receiver portfolio. The devices and are pin compatible with the AD9670/AD9671.

The AD9675 is an eight-channel ultrasound analog front end (AFE) with an on-chip radio frequency (RF) decimator and Analog Devices’s JESD204B serial interface. It is designed for mid- to high-end portable and cart-based medical and industrial ultrasound systems. The device integrates eight channels of a low-noise amplifier, a variable-gain amplifier, an anti-aliasing filter, and a 14-bit ADC with a 125-MSPS sample rate and a 75-dB signal-to-noise ratio (SNR) performance for enhanced ultrasound image quality. The on-chip RF decimator enables the ADC to be oversampled, providing increased SNR for improved image quality while maintaining lower data I/O rates. The 5-Gbps JESD204B serial interface reduces ultrasound system I/O data routing.

The AD9674 offers similar functionality, but includes a standard low-voltage differential signaling (LVDS) interface. Both devices are available in a 144-ball, 10-mm × 10-mm ball grid array (BGA) package.

The AD9674 and the AD9675 cost $62 and $68, respectively.

Analog Devices, Inc.


Melexis MLX92212

Melexis MLX92212

MLX92212 digital output Hall-effect sensors are AEC-Q100-qualified devices that deliver robust, automotive-level performance. The MLX92212LSE-AAA low-hysteresis bipolar latch and the MLX92212LSE-ABA high-hysteresis unipolar switch are optimized for 2.5-to-5.5-V operation. They pair well with many low-power microcontrollers in embedded systems. The sensor and specified microcontroller can share the same power rail. The sensors’ open-drain outputs enable simple connectivity with CMOS/TTL. They exhibit minimal magnetic switch point drift over temperature (up to 150°C) or lifetime and can withstand 8 kV electrostatic discharge.

The MLX92212LSE-AAA is designed for use with multipole ring magnets or alternating magnetic fields. It is well suited for brushless DC electric motor commutation, speed sensing, and magnetic encoder applications. Typical automotive uses include anti-trap/anti-pinch window lift controls, automatic door/hatch systems, and automatic power seat positioning. The MLX92212LSE-ABA enables the use of generic/weak magnets or larger air gaps. It can be used in simple magnetic proximity sensing and interlocks in covers/hatches or ferrous-vane interrupt sensors for precise position and timing applications.

Both MLX92212 devices utilize chopper-stabilized amplifiers with switched capacitors. The CMOS technology makes this technique possible and contributes to the sensors’ low current consumption and small chip size.

The MLX92212 sensors cost $0.35 each in 5,000-unit quantities and $0.30 in 10,000-unit quantities.

Melexis Microelectronic Integrated Systems


Byte SPI Storm

Byte SPI Storm

The SPI Storm 50 and the SPI Storm 10 are the latest versions of Byte Paradigm’s SPI Storm serial protocol host adapter. The adapters support serial peripheral interface (SPI), Quad-SPI, and custom serial protocols in the same USB device.

The SPI Storm 50 and the SPI Storm 10 support serial protocols and master up to 50 and 10 MHz, respectively. The SPI Storm 10 features an 8-MB memory, while the higher-end devices are equipped with a 32-MB memory.

The SPI Storm adapters enable system engineers to access, communicate, and program their digital board and digital ICs, such as field-programmable gate array (FPGA), flash memories, application-specific integrated circuit (ASIC), and

system-on-a-chip (SoC). The SPI Storm 10 is well suited for engineering schools and universities because it is a flexible, all-around access device for hands-on digital electronics. The 50- and 100-MHz versions can be used in mid- and high-end testing and debugging for telecommunications, medical electronics, and digital imaging industries.

The SPI Storm 50 and the SPI Storm 10 cost $530 and $400, respectively.

Byte Paradigm


Microchip MCP19111

Microchip MCP19111

The MCP19111 digitally enhanced power analog controller is a new hybrid, digital and analog power-management device. In combination with the expanded MCP87xxx family of low-figure-of-merit (FOM) MOSFETs, it supports configurable, high-efficiency DC/DC power-conversion designs for many consumer and industrial applications.

The MCP19111 controller, which operates at 4.5 to 32 V, integrates an analog-based PWM controller with a fully functional flash-based microcontroller. This integration offers the flexibility of a digital solution with the speed, performance, and resolution of an analog-based controller.

The MCP19111 devices have integrated MOSFET drivers configured for synchronous, step-down applications. The MCP87018, MCP87030, MCP87090, and MCP87130 are 25-V-rated, 1.8-, 3-, 9-, and 13-mΩ logic-level MOSFETs that are specifically optimized for switched-mode-power-supply (SMPS) applications.

The MCP19111 evaluation board includes Microchip’s high-speed MOSFETs. This evaluation board includes standard firmware, which is user-configurable through an MPLAB X IDE graphical user interface (GUI) plug-in. The combined evaluation board, GUI, and firmware enable power-supply designers to configure and evaluate the MCP19111’s performance for their target applications.

The MCP19111 controllers cost $2.81 each and the MCP87018/030/090/130 MOSFETs cost $0.28 each, all in 5,000-unit quantities.

Microchip Technology, Inc.


Ironwood SG-QFE-7011

Ironwood SG-QFE-7011

The SG-QFE-7011 is a high-performance QFP socket for 0.4-mm pitch, 128-pin QFPs. The socket is designed for a

1.6-mm × 14-mm × 14-mm package size with a 16-mm × 16-mm lead tip to tip. It operates at bandwidths up to 10 GHz with less than 1 dB of insertion loss and has a typical 20 mΩ per I/O contact resistance. The socket connects all pins with 10-GHz bandwidth on all connections. The small-footprint socket is mounted with supplied hardware on the target PCB. No soldering is required. The small footprint enables inductors, resistors, and decoupling capacitors to be placed close to the device for impedance tuning.

The SG-QFE-7011’s swivel lid has a compression screw that enables ICs to be quickly changed out. The socket features a floating compression plate to force down the QFP leads on to elastomer. A hard-stop feature is built into the compression mechanism.

The sockets are constructed with high-performance, low-inductance gold-plated embedded wire on elastomer as interconnect material between a device and a PCB. They feature a –35°C-to-100°C temperature range, a 0.15-nH pin self inductance, a 0.025-nH mutual inductance, a 0.01-pF capacitance to ground, and a 2-A per pin current capacity.

The SG-QFE-7011 costs $474.

Ironwood Electronics

Q&A: Scott Potter (Engineering a Way To Clean Solar Mirrors)

Designer and technology executive Scott Potter won first prize in the 2012 RL78 Green Energy Challenge, presented by Renesas Electronics in partnership with Circuit Cellar and Elektor magazines. The global contest called on participants to develop green energy designs utilizing Renesas’s RL78 microcontrollers. Scott won with his solar-powered electrostatic cleaning robot, which removes dust and debris from the tracking mirrors of large-scale concentrating solar power plants.—Mary Wilson, Managing Editor

Scott Potter

MARY: Where do you live and what is your current occupation?

SCOTT: I live in Los Gatos, CA, and I’m a senior director at Jasper Wireless, a company providing machine-to-machine (M2M) data communications services. I have been with Jasper since the beginning in 2005 when the company started with four people and a plan. Now Jasper is approaching 150 employees and we are a global company. I have served many roles at Jasper, working on location technology, device middleware, back-end reporting, and front-end software.

My other job is as an inventor at Taft Instruments. We are just now forming around the technology I developed for the RL78 design challenge. We are finding there is a big need for this solution in the solar industry, which is poised for tremendous growth in the next few years.

MARY: How did you first become interested in embedded electrical design? What is your educational background?

SCOTT: I started working for my father at his startup in the basement of our home in Long Island when I was a teenager (child labor laws were more lax back then). We were doing embedded electronics design along with mechanical modeling and prototyping. I learned from the best and it has stuck with me all these years. I went on to get a BSEE from Tufts University and I toyed with the idea of business school, but it never gripped me like engineering.

MARY: Why did you enter the 2012 Renesas RL78 Green Energy Challenge? What about its focus appealed to you?

SCOTT: The green energy design challenge came along at the perfect time. I had been working on the cleaning robot for a few months when I saw the challenge. The microcontroller I had originally picked was turning out to be not a great choice, and the challenge made me take a look at the RL78. The part was perfect, and the challenge gave me a goal to work toward.

MARY: How did the idea of designing a robot to clean solar-tracking mirrors (i.e., heliostats) for solar power plants come to you?

SCOTT: I can’t say it came to me all at once. I have participated in solar technology development sporadically throughout my career, and I have always tried to stay abreast of the latest developments. After the lessons learned from the parabolic trough concentrators, the move to high-concentration concentrating solar power (CSP) plants, which more efficiently convert solar power to electrical power, struck me as the right thing to do.

The high-concentration CSP plant utilizes hundreds of thousands of mirrors spread over many acres. The mirrors reflect sunlight onto a centrally located tower, which creates intense heat that drives a steam turbine generator.

The efficiency gains from the higher temperatures will make this the dominant technology for utility scale power generation. But there is a high maintenance cost associated with all of those mirror surfaces, especially in environments where water is scarce. A number of people have realized this and proposed various solutions to keeping the surfaces clean. Unfortunately, none of the proposed solutions will work well at the scale of a large utility plant.

I experimented with quite a few waterless cleaning techniques before coming back to electrostatics. It was my wife, Dia, who reminded me that NASA had been cleaning dust off panels on space missions for years using electrostatic principles. She convinced me to stop working with the forced-air concept I was doing at the time and switch to electrostatics. It was definitely the right choice.

MARY: What does the system do? What problems does it solve for power plants? How is the device different from what is already available for the task of cleaning heliostats?

SCOTT: Our patent-pending device is unique in many ways. It is completely autonomous, requiring no external power or water. The installation time is less than 10 s per heliostat, after which the device will remain attached and operating maintenance free for the life of the plant. We borrowed a marketing term from the military for this: “Set it and forget it.”

Most of the competing products have a long installation time and require some external wiring and maintenance. These can be logistical problems in a field of hundreds of thousands of mirrors.

Our device is also unique in that it cleans continuously. This prevents accumulation of organic materials on the surface, which can mix with dew and make a bio-film on the surface. That film bakes on and requires vigorous scrubbing to remove. We also have a feature to handle the dew, or frost, if it’s present.

MARY: What were some of your design challenges along the way and how did you address them?

SCOTT: They were numerous. The first challenge was the power source. It is important that this device be entirely self-powered to avoid having to install any wiring. I had to find a solar-panel configuration that provided enough power at the right voltage levels. I started with lower voltages and had a lot of trouble with the boost converters.

I also couldn’t use any battery storage because of the life requirement. This means that everything has to operate intermittently, gracefully shutting down when the sun fades and then coming up where it left off when the sun returns.

The next challenge was the mechanical drive. This had to grip the mirror tightly enough to resist a stream of water from a cleaning hose (infrequent cleaning with water will probably still be performed). And it had to do this with no power applied.

Another big challenge was the high-voltage electronics. It turns out there is little off-the-shelf technology available for the kind of high-voltage circuitry I needed. Large line output power transformers (LOPTs) for old cathode ray tubes (CRTs) are too large and expensive.

Some of the resonant high-voltage circuits used for cold cathode fluorescent lighting (CCFL) can be used as building blocks, but I had to come up with quite a few innovations to be able to control this voltage to perform the cleaning task. I had more than a few scorched breadboards before arriving at the current design, which is very small, light, and powerful.

MARY: You recently formed Taft Instruments (click here for Taft website). Who are the players in the company and what services does it provide?

SCOTT: We formed Taft instruments to commercialize this cleaning technology. We have been very fortunate to attract a very talented team that has made tremendous progress promoting the company in industry and attracting investment.

We have Steve Gluck and Gary Valinoti, both highly respected Wall Street executives who have galvanized the company and provided opportunities I could never have imagined. They are now recruiting the rest of the team and we are talking to some extremely qualified people. And of course my wife, Dia, is making numerous contributions that she will probably never get credit for.

MARY: How’s business? How would you describe the market for your product and the potential for growth and reach (both domestically and globally)?

SCOTT: We are not at the commercial deployment stage just yet. Our immediate focus is on the field trials we are starting with a number of industry players and the US Department of Energy National Laboratories. We fully expect the trials to be successful and for our large-scale rollouts to begin in about a year.

The market potential for this is tremendous. I’m not sure anyone fully realizes yet the global transformation that is about to take place. Now that the “grid parity” point is near (the point where the cost of solar power is competitive with fossil fuels), solar will become one of the fastest-growing markets we have seen in a century.

Entire national energy pictures will change from single-digit percentages to being dominated by solar. It is a very exciting time in the solar industry, and we are very happy to be part of it.

MARY: Are you individually—or is your company—developing any new designs? If so, can you tell us something about them?

SCOTT: Yes. I can’t say much, but we are working on some very interesting new technologies that will improve on the electrostatic cleaning principles. This technology will vastly expand the base that we can work with.

MARY: You describe yourself as a “serial entrepreneur” with a strong technical background in electronics, software, hardware, and systems design. That combination of skills comes in handy when establishing a new business. But it also helped you land your day job eight years ago as Director of Location Technology at Jasper Wireless. What do you see as future key trends in M2M communications?

SCOTT: M2M has really taken off since we began in 2005. Back then, there were only a few applications people had envisioned taking wireless. That list has exploded, and some analysts are predicting volumes of M2M endpoints that exceed the human population by tenfold!

We have seen large growth in a number of different verticals over the years, the most apparent one right now being automotive, with all the car companies providing connected services. Jasper is uniquely positioned to offer a global solution to these companies through our carrier partners.

MARY: Over the years, you have gained expertise in areas ranging from embedded electronics and wireless, to applications of the global positioning and geographic information systems (GPS and GIS). What do you enjoy most and what are some career highlights? Is one your involvement in the development of a GPS for the New York fire department’s recovery operations after the collapse of the World Trade Center?

SCOTT: What I enjoy most is working with motivated teams to create compelling products and services. One of my proudest moments was when our team at Links Point rose to the 9/11 challenge. At the time, I was a founder and the chief technology officer of Links Point, which provided GPS and location mapping.

When the request came from the New York fire department for a solution to locating remains at the recovery site, the team dedicated themselves to providing a solution no first responder had ever had access to previously. And we did that in record time. We had to come up with a proposal in a half-day and implement it within three days. You have to realize that GPS and PDAs were very new at the time and there were a lot of technical challenges. We also had to compete with some other companies that were proposing more accurate surveying equipment, such as laser ranging.

Our product, a PDA with a GPS attachment, won out in the end. The advantages of our handheld devices were that they were rugged and that firefighters could easily carry them into Ground Zero. We got the opportunity and honor of serving the  FDNY because of the extreme talent, dedication, and professionalism of my team. I would like to mention them: Jerry Kochman, Bill Campbell, Murray Levine, Dave Mooney, and Lucas Hjelle.

MARY: What is the most important piece of advice you would give to someone trying to make a marketable product of his or her design for an electrical device?

SCOTT: Whatever the device, make sure you are passionate about it and committed to seeing it come through. There is a quote that Dia framed for me hanging in my lab—this is attributed to Goethe, but there is some question about that. Anyway, the quote is very inspirational:

“Until one is committed, there is hesitancy, the chance to draw back. Concerning all acts of initiative (and creation), there is one elementary truth that ignorance of which kills countless ideas and splendid plans: that the moment one definitely commits oneself, then Providence moves too. All sorts of things occur to help one that would never otherwise have occurred. A whole stream of events issues from the decision, raising in one’s favor all manner of unforeseen incidents and meetings and material assistance, which no man could have dreamed would have come his way. Whatever you can do, or dream you can do, begin it. Boldness has genius, power, and magic in it. Begin it now.” I

Editor’s note: For more details, schematics, and a video of Scott Potter’s solar-powered electrostatic cleaning robot, click here.

Client Profile: Parallax, Inc.

Parallax P8X32A Propeller chips

Parallax, Inc.
599 Menlo Drive
Rocklin, CA 95765

Contact: Emily Kurze

Embedded Products/Services: Parallax P8X32A Propeller chip (Part #P8X32A-Q44), Propeller family. The P8X32A Propeller chip is Parallax’s 8-core, 32-bit, 80-MHz microcontroller. P8X32A Quickstart (Part #40000), Quickstart family. The P8X32A Quickstart board, featuring the Propeller chip, is everything you need to begin designing Propeller-based applications.

Product Information: The P8X32A Propeller chip is a modern, easy-to-use and a powerful multicore microcontroller that has the flexibility to propel your design to the next tier of performance and reliability. With eight independent cores at your disposal, developers can easily instantiate any number of custom soft-peripherals from Parallax’s Object Exchange library to enable the chip to fill nearly any role. From generating graphics for a control system’s VGA display to managing fly-by-wire avionics equipment, the 80-MHz Propeller chip makes short work of embedded applications that require real-time execution.

Parallax Propeller QuickStart Board #40000

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…