# Bode Plot on an Oscillscope

Maybe you’re learning about filters and want to see the how your filter responds in the 10Hz to 1MHz range. This guide will show you how to make a low frequency ‘spectrum analyzer with tracking generator’ using a few cheap modules and an oscilloscope — Based off of a video done by Dave Jones over at EEVBlog. Dave does a great job going into the theory, so check out the video if you want to see how it works! He will also show you how to set up the scope. Check out my video below for the reader’s digest version.

Some important notes

For the audio crowd — the vertical scale is still in volts, not decibels. There is also no information on phase shift.

Arduino math

Brief Theory

The circuit from this guide generates a sine wave and the frequency of this sine wave ramps up exponentially. This creates a logarithmic axis on the horizontal axis of your scope. The filter under test will then react differently as the frequency is ramped up. Finally everything will be displayed on the oscilloscope which is synced via the external trigger. The oscilloscope and the arduino will also need  the same time settings.

15Hz-10Khz sweep with simulation

15Hz-1Mhz sweep with simulation. marker at 50Khz (approx peak)

One major problem is that the oscilloscope’s horizontal axis markings aren’t going to be placed correctly all the time. To solve this the microcontroller will calculate where the axis bars should be and generate a 1ms pulse at 10Hz, 100Hz, 1000Hz, etc… The two screenshots show different generated axis and there are some simulations to compare results.

Hardware

For this project I used an arduino (breadboard friendly) to do the timing/math/markings, but the star of the show here is the AD9850 DDS sine wave generator. It’s easiest if you are using a breakout for the AD9850. Luckly they can be found on ebay for about 5\$ with free shipping! This seems to be the breakout specs from the original creator — EIM377_AD9850 (pdf)

Schematic, add some decoupling caps as in the next photo

The AD9850 also needs a buffer amplifier. I decided to use the TS922IN from adafruit as a unity gain amplifier. Many op amps will do the job just fine, but get one that doesn’t require a dual power supply and has a high current output. If you want to do any impedance matching or if your filter is low impedance, be sure to add an appropriate terminating resistor.

Wire everything up and get you scope hooked up!

Completed circuit (with filter on the right)

Code

What a mess! I coded this pretty quick and fudged a few things =P You’ll want to jump down to sweepTime_mS and get ready to input the correct values — I’ll cover these in the video.

https://github.com/thefatmoop/bode

Why did I have a bunch of these DDS modules floating around? They had something to do with an LCR meter I built ;p — more on that hopefully soon!

Electrical Engineer who loves to bike!

### 11 Responses to Bode Plot on an Oscillscope

1. Pingback: Bode plots on an oscilloscope

2. Moser says: