Generating Sine Wave for LCR Meter - Page 1
Forum section: electronics / beginners

author: MattHollands
author_rank: Frequent Contributor
timestamp: May 01, 2015, 10:09:22 pm
content: Hi!I would like to design and build my own LCR meter. The way it will operate (I think) is that it will generate either a 100Hz, 1kHz or 10kHz sine wave, pass this through a known resistor in series with the DUT and measure the voltage drop across known resistor, voltage drop across DUT and potentially look at phase shifts too.What I am trying to do first is generate the sine wave to pass through the DUT. My current idea is for the uC to generate a square wave which I will then filter to get a nice sine wave.I'm using the Art of Electronics to help design a Butterworth filter (eventually hopefully 6-pole). My current tests however are giving me some odd results.I'm simulating the design for a 100Hz, 2 pole low pass filter as specified on page 408 of the 3rd edition of the Art of Electronics, however I'm not quite getting the output I would expect in LTSpice. There appears to be a DC shift in the signal! And an unusual amount of gain (see attached images).Is this what is expected with a low pass butterworth filter? Is this an error in the simulation? Do I have the circuit wrong?I'm sorry that this is only simulation as I don't have the equipment with me for a few months to actually build the circuit.Thanks

author: bugs
author_rank: Contributor
timestamp: May 02, 2015, 02:19:15 am
content: http://en.wikipedia.org/wiki/Wien_bridge_oscillator

author: MattHollands
author_rank: Frequent Contributor
timestamp: May 03, 2015, 12:23:46 am
content: Thank you, that does look like it could potentially be a good option for me. But I would still like to know where this DC shift is coming from!

author: Marco
author_rank: Super Contributor
timestamp: May 03, 2015, 12:37:07 am
content: You are getting too near the rail on the opamp ... you need to give it a negative supply. That said, it's not truly necessary to generate a sine for this ... you could just use a square and filter out the fundamental during detection (with a single frequency discrete fourier transformation, ie. multiplying with a sine and a cosine). As long as the component is linear it doesn't matter.PS. of course the square wave generally still shouldn't have a DC component.

author: LvW
author_rank: Frequent Contributor
timestamp: May 04, 2015, 01:25:24 pm
content: There are several options for creating a sine wave.In order to be able to select one of the many methods (one of various sine wave oscillator concepts or square wave generator with filtering) it is necessary to know some details of your requirements - in particular:Signal amplitudes and signal quality (THD values).

author: ivan747
author_rank: Super Contributor
timestamp: May 04, 2015, 01:35:43 pm
content: There is a DC offset on the sine wave because there is a DC offset on the square wave! The square wave goes from 0V to 5V, that is an offset of +2.5V. You'd have to generate a -2.5V to 2.5V square wave or use AC coupling on the op amp input.

author: Richard Crowley
author_rank: Super Contributor
timestamp: May 04, 2015, 02:34:17 pm
content: Magic Sinewave Sourcecode: Some PIC Programming GuidelinesQuoteEven though the title mentions PIC, the principles apply to any microcontroller.Don Lancaster is a prolific inventor, engineer and author of many popular books like "TTL Cookbook", "TV Typewriter Cookbook", "CMOS Cookbook", "Active Filter Cookbook", etc. etc.

author: Marco
author_rank: Super Contributor
timestamp: May 04, 2015, 04:13:30 pm
content: I think the most flexible excitation source would be an adjustable amplitude AC square wave current with adjustable DC offset, with some resistors you can switch in in parallel with the DUT, this would work for pretty much everything.

author: Sparc
author_rank: Contributor
timestamp: May 04, 2015, 08:53:28 pm
content: I don't know if you were looking for only an analog solution. But, a pretty good sine wave can be made with a microprocessor and a DAC. Your computer and sound card should be good.There is a published project that uses the computer and sound card to make an RLC impedance bridge. I tried it out some years ago and it worked as I remember. The downside was that it monopolized the sound card and needs a computer.http://wb6dhw.com/RLC_Meter/N%20LMS%20Impedance%20Bridge.pdfhttp://traktoria.org/files/software/LMS_Impedance_Bridge/