Projects

The Raspberry Pi Wobbulator - by Gerry EI8DRB

This project was on display at the Mayo Radio Experimenter's Club Rally earlier this year. The Wobbulator project was a small board that would piggy-back on a Raspberry Pi and utilise an Analog Devices AD9840 Direct Digital Synthesiser (DDS) as an RF source.  The purpose of a Wobbulator is to generate an RF sweep which can be routed through a device under test and captured, in this case, using an RF-voltmeter, but traditionally using an oscilloscope, to determine the characteristics of the device to be tested. It can be used to determine the response of filters and crystals and other RF circuits.

A Wobbulator would, in the past, have cost hundreds of euros, so to see the full kit available for a Rally special price of €40 was the perfect excuse to buy one. A DDS was purchased from E-Bay and the Raspberry Pi was already available in the shack. The kit included a well manufactured board and all the various parts, including some header strips to connect to the GPIO array on the Pi and some high quality SMA ports for the RF in and outputs. 

The assembly started by soldering some SMD devices and then a few capacitors, diodes, resistors and two 1mm pitch DIL chips. A 0.5mm tip on the soldering iron and 0.3mm silver-bearing solder was used to mount these. Firstly the pads on the board were tinned and then, using fine tweezers, held each device while the solder was flowed to one side, and then other. The chips were a little more tricky, keeping all of the legs aligned while tacking one corner and then the other. The rest of the components are through-hole and a relatively trivial install. A set of headers are installed to take the DDS, and a doubleheader on the other side to connect to the Pi.


Once the board was assembled, a basic install of Rasbian on an SD card was performed. A few tweaks were necessary to enable the functionality of the Wobbulator, and install the Wobbulator control software.

The default configuration for Rasbian is that i2c is disabled. It is necessary to re-enable this first. Edit /etc/modprobe/raspi-blacklist.conf and comment out the line that blacklists i2c.

blacklist spi-bcm2708
#blacklist i2c-bcm2708blacklist snd-soc-pcm512x
blacklist snd-soc-wm8804

Then edit /etc/modules and add a line to load i2c-dev.

snd-bcm2835i2c-dev

Install i2c-tools, add the 'pi' user to the 'i2c' group and power-down the Pi.

$ sudo apt-get install i2c-tools
$ sudo adduser pi i2c
$ halt

While the Pi is powered-off, attach the Wobbulator board to the GPIO array and power up the Pi.

When it restarts, check that the Wobbulator has been detected.

$ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

The '68' indicates that the Wobbulator has been successfully detected. Next, install the required Python libraries.

$ sudo su 
# curl https://bootstrap.pypa.io/ez_setup.py -o - | python3
# exit
$ git clone https://github.com/quick2wire/quick2wire-python-api.git
cd quick2wire-python-api/
$ sudo python3 setup.py install 
$ cd ~


Finally, install the Wobbulator software
.
$ git clone https://github.com/mi0iuo/RPi_Voltmeter.git
$ git clone https://github.com/mi0iuo/RPi_Wobbulator.git

Once this is done, it is necessary to test and calibrate the Wobbulator, as follows:
  
$ startx

Once LXDE has started, open a Terminal window and enter the following:

$ cd RPi_Voltmeter-master
$ python3 rpi_voltmeter.py

A small window will display.


Leave Channel on channel 1, and click the Measure button. This will likely display a voltage up to around 2v. This is around the maximum voltage the RF voltmeter can sample, so it is necessary to reduce this greatly since there is currently no input. On the board, there are two variable resistors (little blue boxes) with a little brass adjustment screw on each. Start to turn the one in the channel 1 section on the board anti-clockwise, clicking Measure periodically, until you get a voltage around 0.1v.

Do the same for Channel 2, except the target voltage is around 0.6v.

At this point, the Wobbulator is calibrated. Now exit the voltmeter and run the Wobbulator control software by entering the following in the Terminal:

$ cd ../RPi_Wobbulator-master
$ python3 rpi_wobbulator.py
 
A test was performed on a filter built a year ago. The results, were excellent. The trace, see below, showed the filter to be out by about 1MHz, so there are a couple of toroids to be rewound. The MFJ 259b will be used with a 'custom' connector as an L/C meter to verify the toroids. This process will be documented at a later date.


Further Information from www.gerryk.com  ----  Ref: The Raspberry Pi Wobbulator

--- ooo00O00ooo---

A Signal Generator using Adafruit SI5351 Clock Generator - by Gerry EI8DRB

The DDS and related clock generation circuitry has made possible high accuracy, broad-banded programmable VFO functionality for very little money. Analogue Devices' AD9850 series offer HF frequencies for about 5. Higher frequencies can be had for not much more money, with the Silicon Labs SI570 with its near GHz maximum frequency offering the highest. Recently 2 interesting devices were found - an interesting little device from Adafruit and again, from Silicon Labs, the SI5351 offers 3 independent clock outputs from a single 25MHz reference, programmable via i2c, a maximum frequency of 160MHz and all for less than 10 shipped.

The order, along with some of the other wonderful goodies from Adafruit arrived and work commenced by getting the encoder knob working. The plan was to have a rotary encoder with push button for setting the frequency, an i2c LCD for display, and the clock gen, all hanging off an Arduino - in this case, a Leonardo clone.


The sample code first tried for the encoder worked well, but then the built-in 'encoder' library was found and employed. It was far better, and no there was no "messing" with interrupts.

The next task was to get the display working - no joy using the standard Liquid Crystal_I2C library. An i2c scanner was run to find out if the device perhaps had a different address from standard. This revealed a 'no devices' error... something was wrong! After a bit more research, it was discovered that the pins used for i2c on the Leo' are not the same as on the Uno. The Uno uses Analog pins 5 and 6 , whereas the Leo' uses Digital pins 2 and 3. The scanner was run again, and it immediately detected the display on 0x27  and the clock-gen on 0x60. The address was plugged into some display testing code and the display was now functional.

A few lines of code were added to include the Adafruit si5351 library and program one of the clocks to output 14Hz. The AOR8200 MkIII was tuned to 14MHz AM to detect the clock on the receiver. Nothing was heard. A little more research and another library for the SI5351 was found, this one managing to avoid all the divider/multiplier calculations necessary with the Adafruit library. The code was modified to include this, and instead of doing any calculations, just wrote the required frequency directly to the clock. This time, a tone was heard on the receiver. As the encoder knob was turned, the frequency on the display changed, and the tone became slightly higher in pitch... success by any measure.

The programming code for this Project may be found at www.gerryk.com

Ref:  Signal Generator using Adafruit SI5351 Clock Generator www.gerryk.com

 --- ooo00O00ooo---