Microchip Technology has announced that it has expanded its solutions for industrial, communications, and automotive with the acquisition of Micrel. Details of the deal are available on Microchip’s website.
Several things inspired Electrical and Computer Engineering Professor Chris Coulston and his team at Penn State Erie, The Behrend College, to create an online vehicle-tracking system. Mainly, the team wanted to increase ridership on a shuttle bus the local transit authority provided to serve the expanding campus. Not enough students were “on board,” in part because it was difficult to know when the bus would be arriving at each stop.
So Coulston’s team created a system in which a mobile GPS tracker on the bus communicates its location over a radio link to a base station. Students, professors, or anyone else carrying a smartphone can call up the bus tracker web page, find out the bus’ current location, and receive reliable estimates of the bus’ arrival time at each of its stops. Coulston, computer engineering student Daniel Hankewycz, and computer science student Austin Kelleher wrote an article about the system, which appears in our June issue.
Circuit Cellar recently asked Coulston if the system, implemented in the fall 2013 semester, had accomplished its goals and might be expanded.
“The bus tracker team is tracking usage of the web site using Google Analytics,” Coulston said. “The data reveals that we get on average 100 hits a day during cold weather and fewer on warmer days. Ridership has increased during this past year, helping assure the long-term presence of the shuttle on our campus.”
“Over winter break, shuttle service was increased to a distant location on campus,” he added. “In order to better track the location of the shuttle, a second base station was added. The additional base station required a significant rework of the software architecture. The result is that the software is more modular and can accept an arbitrary number of base stations. There are no plans at present to add a second bus—a good thing, because this change would require another significant rework of the software architecture.”
Initially, Coulston looked to other real-time vehicle trackers for inspiration: “There are a variety of live bus trackers that motivated my early ideas, including the University of Utah’s Live Tracker and the Chicago Transit Authority’s CTA Bus Tracker. Given our single bus route on campus, I was motivated to keep the interface simple and clean to minimize the amount of time needed to figure out where the bus is and how long it’s going to take to get to my stop.”
The system, as it was originally implemented in August 2013, is fully described in the June issue, now available for single-issue purchase or membership download. The following article excerpt provides a broad overview and a description of the team’s hardware choices.
THE BIG PICTURE
Figure 1 shows the bus tracker’s hardware, which consists of three components: the user’s smartphone, the base station placed at a fixed location on campus, and the mobile tracker that rides around on the bus.
Early on, we decided against a cellular-based solution (think cell phone) as the mobile tracker. While this concept would have benefited from wide-ranging cellular coverage, it would have incurred monthly cellar network access fees. Figure 1 shows the final concept, which utilizes a 900-MHz radio link between the mobile tracker and the base station.
This information along with data about the bus stops is used to position the bus icon on the map, determine the bus’ next stop, and predict the bus’ arrival time at each of the seven bus stops. The bus’ location contained in stamp.txt is generated by a GPS receiver (EM-408) in the form of an NMEA string. This string is sent to a microcontroller and then parsed. When the microcontroller receives a request for the bus’ location, it formats a message and sends it over the 900-MHz radio link. The base station compares the bus position against a canonical tour of campus (breadcrumb) and writes the best match to stamp.txt.
Early in the project development, we decided to collect the bus’ position and heading information at 2-s intervals during the bus’ campus tour. This collection of strings is called “breadcrumbs” because, like the breadcrumbs dropped by Hansel and Gretel in the eponymously named story, we hope they will help us find our way around campus. Figure 3 shows a set of breadcrumbs (b1 through b10), which were collected as the bus traveled out and back along the same road.
The decision to collect breadcrumbs proved fortuitous as they serve an important role in each of the three hardware components shown in Figure 1.
The bus houses the mobile tracker (see Photo 1). Figure 4 shows the schematic, which is deceptively simple. What you see is the third iteration of the mobile tracker hardware.
An important starting point in the design was how to step down the bus’ 12-V supply to the 5-V required by our circuit. In terms of hardware, the best decision we made was to abandon the idea of trying to integrate a 12-to-5-V converter onto the mobile tracker PCB. Instead we purchased a $40 CUI VYB15W-T DC-DC converter and fed the mobile tracker 5-V inputs…
We used Micrel’s MIC5205 regulator to step down the 5 V for the 3.3-V GPS receiver, which easily supplied its peak 80 mA. Since we ran a Digi International XTend radio at 5 V for the best range, we ended up with mixed voltage signals. We used a Texas Instruments TXS0102 bidirectional voltage-level translator, which handles voltage-interfacing duties between the 5-V radio and the 3.3-V microcontroller.
We selected Microchip Technology’s PIC18F26K22 because it has two hardware serial ports, enabling it to simultaneously communicate with the GPS module and the radio modem when the bus is traveling around campus. We placed two switches in front of the serial ports. One switch toggles between the GPS module and the Microchip Technology PICkit 3 programming pins, which are necessary to program the microcontroller. The second switch toggles between the radio and a header connected to a PC serial port (via a Future Technology Devices FT232 USB-to-serial bridge). This is useful when debugging at your desk. An RGB LED in a compact PLCC4 package provides state information about the mobile tracker.
The XTend RF modules are the big brothers to Digi International’s popular XBee series. These radios come with an impressive 1 W of transmitting power over a 900-MHz frequency, enabling ranges up to a mile in our heavily wooded campus environment. The radios use a standard serial interface requiring three connections: TX, RX, and ground. They are simple to set up. You just drop them into the Command mode, set the module’s source and destination addresses, store this configuration in flash memory, and exit. You never have to deal with them again. Any character sent to the radio appears on the destination modem’s RX line.
The GPS receiver utilizes the CSR SiRFstarIII chipset, which is configured to output a recommended minimum specific (RMC) string every 2 s…
The mobile tracker’s firmware listens for commands over the serial port and generates appropriate replies. Commands are issued by the developer or by the base station…
Burning breadcrumbs into the mobile tracker’s flash memory proved to be a good design decision. With this capability, the mobile tracker can generate a simulated tour of campus while sitting on the lab bench.
The base station consists of an XTend RF module connected to a Raspberry Pi’s serial port (see Photo 2). The software running on the Raspberry Pi does everything from running an Nginx open-source web server to making requests for data from the mobile tracker.
From Figure 1, the only additional hardware associated with the base station is the 900-MHz XTend radio connected to the Raspberry Pi over a dedicated serial port on pins 8 (TX) and 10 (RX) of the Raspberry Pi’s GPIO header.
The only code that runs on the base station is the Python program, which periodically queries the mobile tracker to get the bus’ position and heading. The program starts by configuring the serial port in the common 9600,8,N,1 mode. Next, the program is put into an infinite loop to query the mobile tracker’s position every 2 s.
If you built your own ham radio “back in the day,” you’ll recall the frustration of putting it together with components that were basic at best.
But as columnist George Novacek points out in the second installment of his series examining wireless data links: “Today you can purchase excellent, reasonably priced low-power gear for data communications off the shelf.”
Part 2 of Novacek’s series, appearing in the March issue, looks at transmitters and antennas.
In one section, Novacek expands upon the five basic data-transmitter modules—a data encoder, a modulator, a carrier frequency generator, an RF output amplifier, and an antenna:
Low-power data transmitters often integrate the modulator, the carrier frequency generator, and the amplifier into one circuit. A single transistor can do the job. I’ll discuss antennas later. When a transmitter and a receiver are combined into one unit, it’s called a transceiver.
Modulation may not be needed in some simple applications where the mere presence of a carrier is detected to initiate an action. A simple push button will suffice, but this is rarely used as it is subject to false triggering by other transmitters working in the area in the same frequency band.
Digital encoder and decoder ICs are available for simple devices (e.g., garage door openers) or keyless entry where just an on or off output is required from the receiver. These ICs generate a data packet for transmission. If the received packet matches the data stored in the decoder, an action is initiated. Typical examples include Holtek Semiconductor HT12E encoders and HT12D decoders and Freescale Semiconductor MC145026, MC145027, and MC145028 encoder and decoder pairs. For data communications a similar but more advanced scheme is used. I’ll address this when I discuss receivers (coming up in Part 3 of this series).
Novacek’s column goes on to explain modulation types, including OOK and ASK modulation:
OOK modulation is achieved by feeding the Data In line with a 0-to+V-level datastream. ASK modulation can be achieved by the data varying the transistor biasing to swing the RF output between 100% and typically 30% to 50% amplitude. I prefer to add a separate modulator.
The advantage of ASK as opposed to OOK modulation is that the carrier is always present, thus the receiver is not required to repeatedly synchronize to it. Different manufacturers’ specifications claim substantially higher achievable data rates with ASK rather than OOK.
For instance, Photo 1 shows a SparkFun Electronics WRL-10534 transmitter and a WRL-10532 receiver set for 433.9 MHz (a 315-MHz set is also available), which costs less than $10. It is a bare-bones design, but it works well. When you build supporting circuits around it you can get excellent results. The set is a good starting point for experimentation.
The article also includes tips on a transceiver you can purchase to save time in developing ancillary circuits (XBee), while noting a variety of transceiver, receiver, and transmitter modules are available from manufacturers such as Maxim Integrated, Micrel, and RF Monolithics (RFM). In addition, the article discusses design and optimization of the three forms of antennas: a straight conductor (monopole), a coil (helical), and a loop.
“These can be external, internal, or even etched onto the PCB (e.g., keyless entry fobs) to minimize the size,” Novacek says.
Do you need advice on what to consider when choosing an antenna for your design? Find these tips and more in Novacek’s March issue article.