Thursday, 9 January 2014

Setting up and Testing the Raspberry Pi Wobbulator - Part 3

With my Raspberry Pi Wobbulator powered up and ready for action the first task I decided to give it was to examine the frequency response characteristics of an RF crystal. If this sounds familiar, then it is because it is. I performed the same test using the revised Raspberry Pi prototype - see this previous post for details. I'm repeating the same test using the "production version" of the RPi Wobbulator to provide a direct comparison.

The first test was performed using Channel 1 - the linear input. The frequency sweep was performed with nothing connected to the input of Channel 1 (bottom blue trace), with the output from the DDS module fed directly into the input of Channel 1 (top blue line) and finally with the RF crystal connected between the output from the DDS and the input of Channel 1 (red plot).


The results obtained were virtually identical to those obtained when using the revised prototype.

The same test was then performed using Channel 2 - the logarithmic input.


Once again the results were very similar to those obtained using the revised prototype.

So, the "production version" of the Raspberry Pi Wobbulator seems to be performing very well! For details of further testing and details of other users experiences building and using the RPi Wobbulator please visit the Yahoo group.

If you would like to purchase a Raspberry Pi Wobbulator PCB or PCB and full component kit then please visit www.cutpricecables.co.uk/irpiwobbulator.html . The PCB is priced at £12.00, and the PCB plus kit of components is priced at £40. This includes all sales taxes and free worldwide delivery. You can purchase online and pay by credit or debit card, or PayPal.

Wednesday, 8 January 2014

Setting up and Testing the Raspberry Pi Wobbulator - Part 2

Before downloading and running the RPi Wobbulator software, there are a couple of small adjustments that need to be made to the Raspberry Pi hardware, and the following adjustment procedure will also serve as a check that the hardware is working as it should.

I've written a small program called RPi Volt Meter to help you make the necessary adjustments. The source code for the program can be downloaded from Github, or you can  you can use the "git clone" command to download a copy of the program and associated files on to your Raspberry Pi. To do this, type the following at the command line prompt and press Enter:

pi@raspberrypi ~ $ git clone https://github.com/mi0iou/RPi_VoltMeter.git_

When you execute this command, a new folder called "RPi_VoltMeter" will be created under "/home/pi" and the source code (and other files) will be downloaded and saved in this folder. Launch IDLE 3 and open the file "rpi_voltmeter.py". Run the program by selecting "Run->RunModule" or by pressing "F5".




The RPi Volt Meter window should now appear:


This simple program allows the user to measure the voltage on any one of the four input channels on the ADC chip on the RPi Wobbulator PCB. Channels 1 and 2 are the two input channels for the RPi Wobbulator. Channels 3 and 4 are not used but are terminated with PCB pins so that you can measure any external voltage connected to the pins. The maximum voltage the ADC chip can measure is just over 2 Volts DC.

Leave Channel 1 selected and measure the voltage by clicking on the "Measure" button. Since at this point there is no signal being fed into Channel 1 this will measure the quiescent bias voltage. When I did this, I found that the voltage was about 2 Volts. This is far too high and is causing the input to the ADC chip is totally saturated. Turn the adjustment screw on VR1 screw anti-clockwise, taking a measurement of the voltage after each adjustment is made, until the bias voltage comes down to about 0.1 Volt.


Now select Channel 2 and measure the quiescent voltage. I found that it was about 0.6 Volts. If the measured voltage is not around 0.6 Volts, turn the adjustment screw on VR2 until you get a value of 0.6 Volts (or just under)


VR2 provides very fine adjustment of the quiescent voltage from about 0.3 Volts to just over 0.6 Volts. This corresponds to a variation in the "Slope" of the output from the AD8307 Log Amp of between about 11 mV/dB and 22 mV/dB respectively, so setting the quiescent voltage to about 0.6 Volts corresponds to Slope of  about 20 mV/dB.

Enough tinkering! If all has gone well you can now close the RPi Volt Meter window, and then close the source code file "rpi_voltmeter.py".

Now its time to download and run the Raspberry Pi Wobbulator software. Once again, the source code for the Raspberry Pi Wobbulator software can be downloaded from Github, or you can use the "git clone" command to download a copy of the repository on to your Raspberry Pi. To do this, type the following at the command line prompt and press Enter:

pi@raspberrypi ~ $ git clone https://github.com/mi0iou/RPi_Wobbulator.git_

When you execute this command, a new folder called "RPi_Wobbulator" will be created under "/home/pi" and the source code (and other files) will be downloaded and saved in this folder. If it isn't already running, launch IDLE 3 and open the file "rpi_wobbulator.py". Run the program by selecting "Run->RunModule" or by pressing "F5". The RPi Wobbulator window should appear:




The user can enter parameters for the frequency sweep along the bottom of the screen. The various buttons down the right hand side of the main window allow the user to select the input channel (Ch) on the ADC chip, the gain for the PGA (on the ADC chip), and the line colour used to plot the response curve. The user can choose whether or not to display a grid over the results area using the "Grid" check box, and the "Bias" check box activates the bias compensation feature of the software. The “CLS” button clears the results area of any previous plots and the “RUN” button initiates the frequency sweep.

The response curve of the circuit under test is plotted in the “results area” (the large cyan coloured area taking up most of the main window). The X-axis on the results area represents frequency from the “start frequency” on the left to the “stop frequency” on the right and the Y-axis represents the magnitude of the signal passing through the circuit under test, as measured by the ADC  chip.

So that's it! The Raspberry Pi Wobbulator is now ready for action...

In my next post I'll explain how to use the Raspberry Pi Wobbulator to examine the frequency response characteristics of an RF crystal, and this also serves as a good way to check that the hardware is working as it should.

Tuesday, 7 January 2014

Setting up and Testing the Raspberry Pi Wobbulator - Part 1

Now you've built the Raspberry Pi Wobbulator kit it's time to check that it is working as it should!

The ADC chip on the RPi Wobbulator uses the I2C protocol to communicate with the Raspberry Pi, but I2C is not enabled by default on the Raspberry Pi,  so if you've not used an I2C device with your Raspberry Pi before then there are a few preparatory tasks you need to perform (this has been covered on a previous post, so if you've already done this you can skip this post and go straight to part 2).

Power up your Raspberry Pi, log in and then launch the LXDE desktop GUI. Open the file “/etc/modprobe.d/raspi-blacklist.conf” in Leafpad, go to the end of the file and "comment out" the last line by inserting a ‘#’ at the start of the line so that it looks like as shown below. Then save and close the file but please note that you will need root privileges to do so.


Open the file “/etc/modules” in Leafpad and add the line "i2c-dev" to the end of the file so that it looks like as shown below. Then save and close the file.


Now you need to install the “i2c-tools” package. Entering the following at the command prompt and press Enter:

pi@raspberrypi ~ $ sudo apt-get install i2c-tools_

Add your user name to the i2c group by entering the following at the command prompt (assuming your user name is “pi”) and pressing  Enter:

pi@raspberrypi ~ $ sudo adduser pi i2c_

Now it's time to power down your Raspberry Pi and connect the Raspberry Pi Wobbulator. The complete assembly should now look like the following photo.


Power up your Raspberry Pi, log in and then launch the LXDE desktop GUI. Open an LXTerminal window and type the following at the command line prompt and press  Enter:

pi@raspberrypi ~ $ i2cdetect -y 1_

This should detect the presence of the ADC chip on the RPi Wobulator and display the address of the i2c bus as shown below.



You now need to install the Quick2Wire library to allow easy access to the I2C port from Python 3, but first you need to download and install Setuptools.

Download the most up-to-date version of Setuptools (currently v1.1.6) from the Python website. Extract the “.tar.gz” package, go to the folder called “/setuptools-1.1.6” and enter the following at the command line prompt and press Enter:

.../setuptools-1.1.6 $ sudo python3 ez_setup.py_

Now download the Quick2Wire Python API package from GitHub. Extract the ".zip" file, go to the folder called “/quick2wire-python-api-master” and enter the following at the command line prompt and press Enter:

.../quick2wire-python-api-master $ sudo python3 setup.py install_

Now you should be ready to download and run the Raspberry Pi Wobbulator software. I'll explain how to do this and how to setup the hardware in my next post.