Bode Plot on an Oscillscope
August 16, 2013 11 Comments
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.
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.
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)
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!
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!
Pingback: Bode plots on an oscilloscope
Pingback: rndm(mod) » Bode plots on an oscilloscope
Pingback: Bode plots on an oscilloscope - RaspberryPiBoards
Pingback: Bode plots on an oscilloscope — Blog of MPRosa
Pingback: Bode plots on an oscilloscope | Daily IT News on IT BlogIT Blog
Just found this from a reply on hackaday
http://essentialscrap.com/dsoquad/freq.html
Pingback: Bode Plot on an Oscilloscope « adafruit industries blog
Pingback: АЧХ на осциллографе
Pingback: Bode Plot on an Oscillscope | Make, Electronics projects, electronic Circuits, DIY projects, Microcontroller Projects - makeelectronic.com
Pingback: Bode Plot on an Oscillscope -Arduino for Projects
Hello, great article, very useful.
I just like to say that I have been designing or been trying to design a LCRZ-Meter(LCR-Meter that also display values as complex impedance and a couple other features) based on a dual-channel lock-in amplifier, the design contains a couple of DDS IC’s, though it is still only theoretical, anyway whatever your design for an LCR-Meteri is I would love to get to read something about it.
Best regards.