Real-Time Trailer Monitoring System

Dean Boman, a retired electrical engineer and spacecraft communications systems designer, noticed a problem during vacations towing the family’s RV trailer—tire blowouts.

“In every case, there were very subtle changes in the trailer handling in the minutes prior to the blowouts, but the changes were subtle enough to go unnoticed,” he says in his article appearing in January’s Circuit Cellar magazine.

So Boman, whose retirement hobbies include embedded system design, built the trailer monitoring system (TMS), which monitors the vibration of each trailer tire, displays the

Figure 1—The Trailer Monitoring System consists of the display unit and a remote data unit (RDU) mounted in the trailer. The top bar graph shows the right rear axle vibration level and the lower bar graph is for left rear axle. Numbers on the right are the axle temperatures. The vertical bar to the right of the bar graph is the driver-selected vibration audio alarm threshold. Placing the toggle switch in the other position  displays the front axle data.

Photo 1 —The Trailer Monitoring System consists of the display unit and a remote data unit (RDU) mounted in the trailer. The top bar graph shows the right rear axle vibration level and the lower bar graph is for left rear axle. Numbers on the right are the axle temperatures. The vertical bar to the right of the bar graph is the driver-selected vibration audio alarm threshold. Placing the toggle switch in the other position displays the front axle data.

information to the driver, and sounds an alarm if tire vibration or heat exceeds a certain threshold. The alarm feature gives the driver time to pull over before a dangerous or damaging blowout occurs.

Boman’s article describes the overall layout and operation of his system.

“The TMS consists of accelerometers mounted on each tire’s axles to convert the gravitational (g) level vibration into an analog voltage. Each axle also contains a temperature sensor to measure the axle temperature, which is used to detect bearing or brake problems. Our trailer uses the Dexter Torflex suspension system with four independent axles supporting four tires. Therefore, a total of four accelerometers and four temperature sensors were required.

“Each tire’s vibration and temperature data is processed by a remote data unit (RDU) that is mounted in the trailer. This unit formats the data into RS-232 packets, which it sends to the display unit, which is mounted in the tow vehicle.”

Photo 1 shows the display unit. Figure 1 is the complete system’s block diagram.

Figure 1—This block diagram shows the remote data unit accepting data from the accelerometers and temperature sensors and sending the data to the display unit, which is located in the tow vehicle for the driver display.

Figure 1—This block diagram shows the remote data unit accepting data from the accelerometers and temperature sensors and sending the data to the display unit, which is located in the tow vehicle for the driver display.

The remote data unit’s (RDU’s) hardware design includes a custom PCB with a Microchip Technology PIC18F2620 processor, a power supply, an RS-232 interface, temperature sensor interfaces, and accelerometers. Photo 2 shows the final board assembly. A 78L05 linear regulator implements the power supply, and the RS-232 interface utilizes a Maxim Integrated MAX232. The RDU’s custom software design is written in C with the Microchip MPLAB integrated development environment (IDE).

The remote data unit’s board assembly is shown.

Photo 2—The remote data unit’s board assembly is shown.

The display unit’s hardware includes a Microchip Technology PIC18F2620 processor, a power supply, a user-control interface, an LCD interface, and an RS-232 data interface (see Figure 1). Boman chose a Hantronix HDM16216H-4 16 × 2 LCD, which is inexpensive and offers a simple parallel interface. Photo 3 shows the full assembly.

The display unit’s completed assembly is shown with the enclosure opened. The board on top is the LCD’s rear view. The board on bottom is the display unit board.

Photo 3—The display unit’s completed assembly is shown with the enclosure opened. The board on top is the LCD’s rear view. The board on bottom is the display unit board.

Boman used the Microchip MPLAB IDE to write the display unit’s software in C.

“To generate the display image, the vibration data is first converted into an 11-element bar graph format and the temperature values are converted from Centigrade to Fahrenheit. Based on the toggle switch’s position, either the front or the rear axle data is written to the LCD screen,” Boman says.

“To implement the audio alarm function, the ADC is read to determine the driver-selected alarm level as provided by the potentiometer setting. If the vibration level for any of the four axles exceeds the driver-set level for more than 5 s, the audio alarm is sounded.

“The 5-s requirement prevents the alarm from sounding for bumps in the road, but enables vibration due to tread separation or tire bubbles to sound the alarm. The audio alarm is also sounded if any of the temperature reads exceed 160°F, which could indicate a possible bearing or brake failure.”

The comprehensive monitoring gives Boman peace of mind behind the wheel. “While the TMS cannot prevent tire problems, it does provide advance warning so the driver can take action to prevent serious damage or even an accident,” he says.

For more details about Boman’s project, including RDU and display unit schematics, check out the January issue.

Solar Array Tracker (Part 1): SunSeeker Hardware

Figure 1: These are the H-bridge motor drivers and sensor input conditioning circuits. Most of the discrete components are required for transient voltage protection from nearby lightning strikes and inductive kickback from the motors.

Figure 1: These are the H-bridge motor drivers and sensor input conditioning circuits. Most of the discrete components are required for transient voltage protection from nearby lightning strikes and inductive kickback from the motors.

Graig Pearen, semi-retired and living in Prince George, BC, Canada, spent his career in the telecommunications industry where he provided equipment maintenance and engineering services. Pearen, who now works part time as a solar energy technician, designed the SunSeeker Solar Array tracker, which won third place in the 2012 DesignSpark chipKit challenge.

He writes about his design, as well as changes he has made in prototypes since his first entry, in Circuit Cellar’s October issue. It is the first part of a two-part series on the SunSeeker, which presents the system’s software and commissioning tests in the final installment.

In the opening of Part 1, Pearen describes his objectives for the solar array tracker:

When I was designing my solar photovoltaic (PV) system, I wanted my array to track the sun in both axes. After looking at the available commercial equipment specifications and designs published online, I decided to design my own array tracker, the SunSeeker (see Photo 1 and Figure 1).

I had wanted to work with a Microchip Technology PIC processor for a while, so this was my opportunity to have some fun. I based my first prototype on a PIC16F870 microcontroller but when the microcontroller maxed out, I switched to its big brother, the PIC16F877. Although both prototypes worked well, I wanted to add more features and

The SunSeeker board, at top, contains all the circuits required to control the solar array’s motion. This board plugs into the Microsoft Technology chipKIT MAX32 processor board. The bottom side of the SunSeeker board (green) with the MAX32 board (red) plugged into it is shown at bottom.

The SunSeeker board, at top, contains all the circuits required to control the solar array’s motion. This board plugs into the Microchip Technology chipKIT MAX32 processor board. The bottom side of the SunSeeker board (green) with the MAX32 board (red) plugged into it is shown at bottom.

capabilities. I particularly wanted to add Ethernet access so I could use my home network to communicate with all my systems. I was considering Microchip’s chipKIT Max32 board for the next prototype when Circuit Cellar’s DesignSpark chipKIT contest was announced.

I knew the contest would be challenging. In addition to learning about a new processor and prototyping hardware, the contest rules required me to learn a new IDE (MPIDE), programming language (C++), schematic capture, and PCB design software (DesignSpark PCB). I also decided to make this my first surface-mount component design.

My objective for the contest was to replicate the functionality of the previous Assembly language software. I wanted the new design to be a test platform to develop new features and tracking algorithms. Over the next two to three years of development and field testing, I plan for it to evolve into a full-featured “bells-and-whistles” solar array tracker. I added a few enhancements as the software evolved, but I will develop most of the additional features later.

The system tracks, monitors, and adjusts solar photovoltaic (PV) arrays based on weather and atmospheric conditions. It compiles statistics on these conditions and communicates with a local server that enables software algorithm refinement. The SunSeeker logs a broad variety of data.

The SunSeeker measures, displays, and records the duration of the daily sunny, hazy, and cloudy periods; the array temperature; the ambient temperature; daily minimum and maximum temperatures; incident light intensity; and the drive motor current. The data log is indexed by the day number (1–366). Index–0 is the annual data and 1–366 store the data for each day of the year. Each record is 18 bytes long for a total of 6,588 bytes per year.

At midnight each day, the daily statistics are recorded and added to the cumulative totals. The data logs can be downloaded in comma-separated values (CSV) format for permanent record keeping and for use in spreadsheet or database programs.

The SunSeeker has two main parts, a control module and a separate light sensor module, plus the temperature and snow sensors.

The control module is mounted behind the array where it is protected from the heat of direct sunlight exposure. The sensor module is potted in clear UV-proof epoxy and mounted a few centimeters away on the edge of, and in the same plane as, the array. To select an appropriate potting compound, I contacted Epoxies, Etc. and asked for a recommendation. Following the company’s advice, I obtained a small quantity of urethane resin (20-2621RCL) and urethane catalyst (20-2621CCL).

When controlling mechanical devices, monitoring for proper operation, and detecting malfunctions it is necessary to prevent hardware damage. For example, if the solar array were to become frozen in place during an ice storm, it would need to be sensed and acted upon. Diagnostic software watches the motors to detect any hardware fault that may occur. Fault detection is accomplished in several ways. The H-bridges have internal fault detection for over temperature, under voltage, and shorted circuit. The current drawn by the motors is monitored for abnormally high or low current and the motor drive assemblies’ pulses are counted to show movement and position.

To read more about the DIY SunSeeker solar array tracker, and Pearen’s plans for further refinements, check out the October issue.

 

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.

Photo1

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.

 

A Well-Organized Workspace for Home Automation Systems

Organization and plenty of space to work on projects are the main elements of Dean Boman’s workspace (see Photo 1). Boman, a retired systems engineer, says most of his projects involve home automation. He described some of his workspace features via e-mail:

My test equipment suite consists of a Rigol digital oscilloscope, a triple-output power supply, various single-output power supplies, and several Microchip Technology in-circuit development tools.

I have also built a simple logic analyzer, an FPGA programmer, and an EPROM programmer. For PCB fabrication, I have a complete setup from MG Chemicals to expose, develop, etch, and plate boards up to about 6” × 9” in size.

Photo 1: Boman’s workbench includes overhead cabinets to help reduce clutter. The computer in the foreground is his web server and main home-automation system controller. (Source: D. Boman)

Photo 1: Boman’s workbench includes overhead cabinets to help reduce clutter. The computer in the foreground is his web server and main home-automation system controller. (Source: D. Boman)

Boman is currently troubleshooting a small 1-W ham radio transmitter (see Photo 2).

Photo 2: Boman is currently troubleshooting a small 1-W ham radio transmitter (Source: D. Boman)

Photo 2: Here is his workbench with the radio transmitter. (Source: D. Boman)

Boman says the 10’ long countertop surface (in the background in Photo 3) is:

Great for working on larger items (e.g., computers). It is also a great surface for debugging designs as you have plenty of room for test equipment, drawings, and datasheets.

Photo 3: Boman’s setup includes plenty of spacefor large projects. (Source: D. Boman)

Photo 3: Boman’s setup includes plenty of room for large projects. (Source: D. Boman)

Most of Boman’s projects involve in-home automation (see Photo 4).

My current system provides functions such as: security system monitoring, irrigation control, water leak detection, temperature monitoring, electrical usage monitoring, fire detection, access control, weather monitoring, water usage monitoring, solar hot water system control, and security video recording. I also have an Extra Class ham radio license (WE7J) and build some ham radio equipment.

Here is how he described his system setup:

The shelf on the top contains the network routers and the security system. The cabinets on the wall contain an irrigation system controller and a network monitor for network management. I was fortunate in that we built a custom home a few years ago so I was able to run about two miles of cabling in the walls during construction.

Photo 4: Boman has various elements of his home-automation control system mounted on the wall. (Source: D. Boman)

Photo 4: Boman has various elements of his home-automation control system mounted on the wall. (Source: D. Boman)

Boman uses small containers to hold an inventory of surface-mount components (see Photo 5).

Over the past 10 years or so I have migrated to doing surface-mount designs almost exclusively. I have found that once you get over the learning curve, the surface-mount designs are much simpler to design and troubleshoot then the through-hole type technology. The printed wiring boards are also much simpler to fabricate, which is important since I etch my own boards.

Photo 5: Surface-mount components are neatly corralled in containers. (Source: D. Boman)

Photo 5: Surface-mount components are neatly corralled in containers. (Source: D. Boman)

Overall, Boman’s setup is well suited to his interests. He keeps everything handy in well-organized containers and has plenty of testing space In addition, his custom-built home enabled him to run behind-the-scenes cabling, freeing up valuable workspace.

Do you want to share images of your workspace, hackspace, or “circuit cellar”? Send your images and space info to editor<at>circuitcellar.com.

CC25 Is Now Available

Ready to take a look at the past, present, and future of embedded technology, microcomputer programming, and electrical engineering? CC25 is now available.

Check out the issue preview.

We achieved three main goals by putting together this issue. One, we properly documented the history of Circuit Cellar from its launch in 1988 as a bi-monthly magazine
about microcomputer applications to the present day. Two, we gathered immediately applicable tips and tricks from professional engineers about designing, programming, and completing electronics projects. Three, we recorded the thoughts of innovative engineers, academics, and industry leaders on the future of embedded technologies ranging from
rapid prototyping platforms to 8-bit chips to FPGAs.

The issue’s content is gathered in three main sections. Each section comprises essays, project information, and interviews. In the Past section, we feature essays on the early days of Circuit Cellar, the thoughts of long-time readers about their first MCU-based projects, and more. For instance, Circuit Cellar‘s founder Steve Ciarcia writes about his early projects and the magazine’s launch in 1988. Long-time editor/contributor Dave Tweed documents some of his favorite projects from the past 25 years.

The Present section features advice from working hardware and software engineers. Examples include a review of embedded security risks and design tips for ensuring system reliability. We also include short interviews with professionals about their preferred microcontrollers, current projects, and engineering-related interests.

The Future section features essays by innovators such as Adafruit Industries founder Limor Fried, ARM engineer Simon Ford, and University of Utah professor John Regehr on topics such as the future of DIY engineering, rapid prototyping, and small-RAM devices. The section also features two different sets of interviews. In one, corporate leaders such as Microchip Technology CEO Steve Sanghi and IAR Systems CEO Stefan Skarin speculate on the future of embedded technology. In the other, engineers such as Stephen Edwards (Columbia University) offer their thoughts about the technologies that will shape our future.

As you read the issue, ask yourself the same questions we asked our contributors: What’s your take on the history of embedded technology? What can you design and program today? What do you think about the future of embedded technology? Let us know.