Hello!

I lead product marketing for Meraki, a cloud networking group now part of Cisco, where I focus on the needs of our customers and how Meraki solutions address those needs. (resume)

Outside of work, I enjoy tinkering on hardware, lining up telltales on a close reach, running along trails in the Marin Headlands (NPS pdf), and nearly all things dairy.

I live in San Francisco and have also lived on the east coast, midwest, in Guatemala, and in Germany.

A personal MUNI display

iPhone-4S-muni-San-Francisco-0079

 

I recently built a device that displays MUNI bus and train arrival predictions in real-time. I live in a rare pocket of MUNI route richness in San Francisco, the Lower Haight, and am lucky to be within short walking distance of nine MUNI lines. When a line is delayed, has three buses backed up in a row, or I simply need to go downtown, I can pick from a number of options. The NextBus website is easy to use, and iPhone transit apps abound, but it’s still nice to just glance up to a screen as I’m running out the door and see which bus or train I should take.

The display shows up to three upcoming times for inbound and outbound routes I selected. Each route and its predictions are shown for three seconds before the display shows the next route. At the end of the route list, the display returns to the beginning of the list and starts over. A single button lets the user cycle quickly to a route of interest instead of waiting through each route in the list. The prediction times are updated about once per minute.

 

Hardware

The core is an Arduino Uno Ethernet, which is very similar to the Arduino Uno with an Ethernet shield, except the Ethernet interface is integrated into the same board as the Uno. A protoboard shield holds a few peripheral components, such as a potentiometer for setting the LCD contrast and hardware button de-bouncing. The LCD is a 16×2 character amber-on-black display to keep in style with SFMTA’s bus shelter indicators. The single button is an SPST momentary on-on switch.

 

Software

The NextBus API is reasonably documented and gives not only MUNI predictions, but also info for transit agencies in a few other cities. The API can give route details, such as a list of all the stops in a route, or even the list of all the routes in a transit agency, from which one could systematically build a list of all the stops for all the routes. All that’s needed for this project is to call the API for a particular route and stop ID pair, and handle the response from the server. For the curious, I’ve made the Arduino code available on Github.

The API response for a single route and stop, which can hold several prediction times, is often in the range of 800 bytes. Since the Uno has only 1 kB of RAM, it’s a bit of a challenge to accept and manipulate the response to find the times of interest. I started using Arduino String objects, but wasn’t able to get it to work reliably with the long string responses returned by the NextBus API. I eventually used character buffers and C string.h substring matching and copying instead. Rather than holding the entire response in memory, the device captures single line responses from the server and extracts prediction times from each line, if available. After the third route time is extracted, the rest of the route API response is discarded.

The list of route and stop pairs is hard-coded into the Arduino sketch. The Nextbus API format is also hard-coded into the UNO, but I assume this changes very infrequently.

 

Enclosure

The enclosure is made of layers of laser-cut 0.5mm thickness wood from Ponoko (timber core with a timber veneer on each side). I designed each layer in Illustrator, stacked them on top of each other, and glued them together. This is how the laser-cut wood came shipped from Ponoko:

iPhone-4S-muni-San-Francisco-0076

 

Prototype showing the layers before they were glued together:

iPhone-4S-muni-San-Francisco-0077

After gluing the layers together, I added wood fill to smooth the gaps between the layers, then sanded it down to smooth it further, and stained it to give it a darker look.

 

Enhancements

I’m considering adding a few things now that the display works reliably and is installed in the hallway:

  • A great enhancement would be to add a software-based route and stop selector / menu that updates the UNO’s sketch so users can add or delete routes and stops.
  • Over-the-wire firmware updates would allow for tweaks, such as updating routes and stops, without needing to connect a computer directly to the device.
  • Moving from wired to wireless: this certainly isn’t necessary, but would allow for installation in many more locations and without requiring connecting the device with an Ethernet cable.

A simple AM/FM radio

I’ve been working on building a simple AM/FM radio, operated through just a few buttons and knobs, and with decent audio quality. It has a simple display and fits in a fairly compact package, more or less the size of hardcover book.


Not long ago, I would have built a traditional receiver design using discrete components, probably a superheterodyne (used in the vast majority of inexpensive alarm clocks and portable AM/FM radios lying around in homes) or perhaps a regenerative receiver for novelty. Today, the popularity of small, digital, low-cost devices with integrated AM/FM radios has driven more parts of the radio into integrated circuits (though often keeping the superheterodyne design).


Radio hardware

I was excited to find the Silicon Labs Si473x family of radio ICs. The Si4735 includes AM/FM/SW/LW reception in a single IC that requires just a few external components and two external antennas. Essentially, the chip replaces what traditionally requires a few dozen discrete components and it eliminates manual adjustment of tuning sub-circuits.


The reduced bill of materials doesn’t simplify everything. Instead of sourcing, assembling, and tuning discrete RF/IF components, the radio IC must be interfaced over a serial, 2-wire, or 3-wire connection. Silicon Labs provides guidance through its datasheet and a few application notes, but I found some steps, such as the power-on sequence, could have been more clearly documented.


Sparkfun sells the Si4735 AM/FM IC and an Arduino shield that includes the IC, a crystal, and a few components that support the AM and FM antennas. Using the shield absolves one of any SMD soldering or source the diodes, crystals, and inductors that support the chip.


Sparkfun wrote some code to help users get started with the shield, and a few others have extended it and added some very cool features, such as querying the IC to get its current frequency and adding RDBS processing to get FM station and programming information off the air. Wagner Sartori Junior (Trunet) and Jon Carrier added quite a bit of this functionality, so it’s thanks to them and Sparkfun that getting the Si4735 up and running with these cool features is so easy.


Other hardware

I needed some other hardware besides the Si4735 shield and Arduino board. For the display I used a serial enabled white-on-black 16×2 character LCD display. A rotary encoder is used as the tuning knob and band-switching push button, and a simple 10 kΩ potentiometer controls the volume. The Si4735 support volume adjustments via software, but I chose an analog potentiometer for simplicity.


The Si4735 shield outputs a very small audio signal (I haven’t tried to measure it yet), so an off-shield audio amplifier is mandatory. I opted for a mono amplifier based on a single NE5534 op amp. It has good performance, is reasonably priced, and doesn’t require too many supporting components. I considered adding stereo support but the radio didn’t require very high quality FM output, and there is a stereo headphone jack in case it’s really desired. The circuit I used is from http://www.electronics-diy.com/

Arduino, shield, and LCD


Software

Jon Carrier’s code is hosted on Github and includes example sketches. I played with them quite a bit before using bits and pieces in my own sketch. Jon put a lot of effort into making RDBS work, and while it’s quite cool to see the station and song information scroll across the screen, I don’t use it. I do like to see the station’s callsign, so I kept this part and display the callsign on the second line of the LCD display. Many stations don’t transmit RDBS data, so in case the station callsign is unknown, my LCD doesn’t display any information on the second line. I also removed the volume and seek states, since I’m handling the volume level through an analog potentiometer and I don’t care for a separate seek mode at this time (perhaps I will later).


I experienced a few of the issues that have been brought up in the comments on Jon’s page. In particular, I frequently saw the system start or very quickly jump to its initial frequency + 0.1 MHz, and I also found the LCD screen locking up when I turned the rotary encoder very quickly. I used a serial connection of 9600 baud (the default value for the serial enabled LCD) and I wasn’t able to really troubleshoot this behavior. I’ve read in a few places that these LCDs can lock up when they receive data too quickly, so my wild guess is that this was somehow happening, perhaps from other things coming unintentionally on the serial line. A few times I also reproduced the 655.3 MHz and 0.0 MHz frequency change that Jon mentioned, even though the code is supposed to restrict the frequency to the broadcast band range when using the rotary encoder for tuning. It seems some of these issues may come from the rotary encoder, debouncing (or lack thereof), and/or the rotary callback function.


There are many sample rotary encoder implementations, some using interrupts, some using the digitalRead function in the main loop, and so on. Since the tuning knob and responsiveness is so central to the radio’s operation, I wanted to make sure the rotary encoder’s data was reliably read and displayed on the LCD, even for very fast rotation rates. I made a separate sketch to prototype this part of the system and ended up using Arduino’s built-in interrupts based on the code found here. Once this was working on its own, I integrated it as the interrupt and callback in the radio sketch.


An important note about using the shield

The Si4735 and the shield communicate through 3.3V, not the 5V that boards like the Arduino Uno, Duemilanove, and Diecimilia expect. This is documented in the comments of the Sparkfun product page and on a few forums/blogs. The two generally accepted workarounds are to:

  1. Insert a silicon diode between pin D12 and the GPO1 line on the shield. Trunet also documents how to do this on his wiki.
  2. Use a level-shifter to convert between 3.3V and 5V signals.

Both are hacks for using the shield with 5V Arduino boards and require a bit of surgery in severing a trace on the shield. Using the level-shifter is the more “robust” approach and I chose this because it gives the flexibility to send and receive SPI commands to the Si4735. Inserting the silicon diode allows reading SPI data, but not writing it. However, it takes up space on the shield and limits the possibility of adding other components on top of it. Another issue with the shield is that it connects the GND and AREF pins – meaning AREF is permanently tied to ground, unless you break that connection. This is important if you need to use the Arduino’s analog pins.


Next steps

The radio works as designed, the audio amplifier is built out on a protoboard (and is certainly loud enough), and the display and tuning are smooth, so all that’s left is to connect the power supply, mount the components inside the enclosure, which is made from Ampersand Hardbord. The tuning knobs are simple diamond knurled cylindrical knobs from Digikey.


Conferencing

My participation in conferences is almost always limited to the speaker’s side, behind a podium, or simply at a booth or on the show floor. I rarely participate as an attendee, but recently I had the chance to attend a conference simply to, well, do the things one does at conferences: attend talks and sessions, meet/greet others, and go to the demo booths!

Sitting in the audience I realized some speakers kept me quite engaged and others let my attention lapse a bit during their talk. Some conclusions from notes I took during talks I attended:

  • Don’t labour on the obvious
    If you represent a large, well-known company, say Intel* for example, but you are talking about a narrower topic, don’t spend five minutes repeating what your company is already known for (in Intel’s case, that would be semiconductors and processors). It’s ok to discuss the larger area to give context and perspective, but please don’t spend more than absolutely necessary (yes, Intel is in the semiconductor and processor businesses, I GET IT).
  • Unreadable slides are pointless
    If I can’t read the material on the slide it’s almost pointless to present it, especially if it has all text and no visual cues. And then to go on and read the unreadable-to-me text is simply punishment.
  • Easily digested slides build rapport
    As a counter to the previous point: easily read and digested slides are the opposite of pointless. Rather than alienate the audience, they help build rapport with the speaker as the audience internalizes the content and forms an opinion about it. And an easily digested slide ensures the audience won’t drown in details or attempt to listen to the speaker and read the slide at the same time, which may reduce comprehension.
  • Simple is beautiful
    Be clear, confident, and concise. Make a point and back it up. Don’t try to make ten points in the space of five, and don’t make references to related points unless they are in proper context. Stay on-topic and don’t ramble.
  • Make it worthwhile
    Make it valuable to the audience. If the objective is to introduce your product or service, make sure the audience leaves with a clear understanding of it. If the objective is to demonstrate complex and difficult achievements, let the audience leave with a sense of wonder. Don’t regurgitate a press release or blog. In most cases, people are in the audience attending your talk and skipped others that may be of interest because they felt yours would be more worthwhile.

By no means is this list even remotely comprehensive or unbiased, rather, it has just a few things I’ll keep in mind the next time I’m behind the podium.


*pure*

I do hope HTML5 and CSS3 are not the next

<table><tr><th></th></tr><tr><td></td></tr></table>

of the web.

I kid. Mostly.

VII Network photographer Donald Weber: Interrogations

VII Network photographer Donald Weber’s series Interrogations, a work-in-progress, is captivating and provocative:

http://www.viiphoto.com/showstory.php?nID=1180

If you’re not familiar with his photography, I encourage you to see some of his other projects, such as:
Bastard Eden, Our Chernobyl or Zek: In the Prison of the East.

Copyright © 2013 Pablo Estrada. All rights reserved. RSS Feed. Wordpress theme based on Modern Clix.