Cascata - an Arduino Waterfall by WA5ZNU

Cascata

What is Cascata?

Cascata is an Arduino Waterfall display program built using the Arduino and the Sparkfun Color LCD Shield.

It has a selectable 0-4 kHz or 0-2 kHz audio range, and can display a waterfall, a spectrum graph, or both. It features variable attenuation and automatic DC centering.

Background

Ham radio operators use a signal visualization display called a "Waterfall" to plot signal strength and frequency against time on a scrolling display. This type of display is common in both digital mode radio programs and in software-defined radio displays.

Cascata is a simple project using an Arduino and a Nokia LCD color display to provide a pocket-sized display for field operations, or for computer-free operations.

Cascata requires a small amount of soldering and and can serve as an introduction to the Arduino for ham radio operators, or an introduction to ham radio for Arduino enthusiasts.

Video

Source Code

Here is the Arduino Sketch, including the updated LCD and FFT code:

The software is built using enhanced versions of the Mark Sproul LCD library and the FFT Code is the Roberts/Slaney/Bourras/DEIF FFT library with bug fixes in 8-bit conversion. All is included in the zip file, which you can unzip into your Arduino Sketches directory. It will create a new project called Cascata.

Operation

The voltage reference is set to the internal 1.1v band-gap, and the bias network below sets the center point to about half of that value, when referenced to the 5v supply. The firmware automatically determines the DC reference point and the 0.1uF input capacitor AC couples the signal.

If your input signal voltage is too low, use the Attenuator adjustment to change to lower values.

LCD Construction

The SparkFun Color LCD Arduino Shield requires headers be soldered on.

A convenient option is the Sparkfun stackable header set. These headers allow easy access to the Arduino pins, but they stick up a bit above the LCD board and may make it hard to put in a case. If you have plans for build this project in a case, you may want to use a non-standard Arduino (such as the Ardweeny) and in that case you may want the SparkFun Color LCD Breakout Board, but you will sacrifice one button.

Interfacing

The Arduino 2009 and Uno have a choice among 5V ADC reference, internal 1.1V ADC reference, or external reference. 5V is too high for audio input, so we'll chose the simply 1.1V internal reference. A resistor divider produces approximately 0.55v using standard value resistors, and a 0.01uF capacitor tacked onto the bottom of the Arduino bypasses the VREF signal to ground to reduce noise.

I built my input network on a protoboard first, then "flying-lead" style, but you could put it on a small piece of perfboard and use header pins to attach to the LCD Shield. A 3.5mm audio jack completes the interface, which I plugged into the headphone jack of my radio.

Schematic

VREF Bypass Capacitor

  1. Tack a 0.01uF capacitor on the bottom of the Arduino from VREF to ground.
  2. Install the Arduino LCD Shield with socketed headers.
  3. On the shield headers, put a 15 k Ohm resistor into the Arduino 5V pin to the ground pin below the LCD.
  4. Solder a 1.8 k Ohm resistor from the ground side of the above resistor. Put the other end into Analog input 1.
  5. Solder a 0.01 uF capacitor to the 1.8 k Ohm resistor at the Arduino analog input 1 pin.
  6. Input voltage should be +/- 0.5v max.

Drawbacks

Noise: The default value of the Attenuator is 1, which eliminates the LSB of ADC and cuts down on some of the noise. The 0.1uF capacitor added to the bottom of the Arduino board before VREF and ground helps with the noise some, but doing any better would require quiescing the CPU before the ADC measurement, further reducing the signal bandwidth and processing time available.

Sample time: Sampling at 8kHz takes 125μs, and it takes 100μs for each ADC operation. That leaves only 25μ per sample or 6.4ms for a 256 sample row. That's not enough time to do the FFT or Display, so we drop samples between lines.

Future Directions

Cascata is designed to be a project for you to undertake and extend. Here are some ideas for ways to move forward:

Put it in a box?
The SparkFun LCD board doesn't fit nicely in the SparkFun Arduino Shield Case, however with the Sparkfun Color LCD Breakout Board and the SolarBotics Ardweeny and a 5V regulator, you could make a much smaller device in a nice case.
Decode PSK31?
Add a mode to disable display and decode PSK31. Is there enough time in 6.4ms/row to do the decimation, filtering, phase detection, bit decoding, and Varicode conversion?
Make it faster?
At 16 MHz, the Arduino is a wonder at getting this DSP done. Switch to a 72 MHz Maple Board and you could have enough cycles left over to do something really interesting.
Expand the bandwidth?
Can you use aliasing to sample a much wider bandwidth? Since the output display size is limited to about 128 pixels, you would need to do decimation anyway.
Narrow the bandwidth?
David (WB4ONA) asks if you could narrow the bandwidth to 200 Hz, for use as a display with QRSS or other ultra-low bandwidth modes. I think you need to integrate over time; perhaps the Joe Taylor (K1JT) WSTJ source code would be a good start for techniques.
Oscilloscope Output?
Instead of an LCD display, display on an attached oscilloscope using a single DAC (either an I2C DAC from SparkFun or an op-amp/integrator DAC). Use one of the digital out pins for trigger. You could use a green-screen CRT scope, or a portable digital scope that you already have. You won't get a waterfall, but instead a spectrum display.

Similar Projects

Mentions

Thanks for Hack-a-day for publishing a complimentary writeup: Waterfall signal visualizer from Arduino and cellphone LCD under their neat-o radio hacks tag.


WA5ZNU