<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ref="http://purl.org/rss/1.0/modules/reference/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="https://www.xyphro.de/blog/rss.rdf">
		<title>Xyphros electronic workshop</title>
		<link>https://www.xyphro.de/blog/index.php</link>
		<description><![CDATA[No Footer]]></description>
		<items>
			<rdf:Seq>
				<rdf:li resource="https://www.xyphro.de/blog/index.php?entry=entry140316-224931" />
				<rdf:li resource="https://www.xyphro.de/blog/index.php?entry=entry121227-233617" />
				<rdf:li resource="https://www.xyphro.de/blog/index.php?entry=entry121112-233814" />
				<rdf:li resource="https://www.xyphro.de/blog/index.php?entry=entry121106-180136" />
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="https://www.xyphro.de/blog/index.php?entry=entry140316-224931">
		<title>LCR meter - Release of all design files</title>
		<link>https://www.xyphro.de/blog/index.php?entry=entry140316-224931</link>
		<description><![CDATA[Finally I decided to release all design files!<br />Do you want to have a look how it works internally?<br />...build your own version of it?<br />...or extend the functionality?<br /><br />Now It&#039;s your turn!<br /><br /><br /><h3>First of all, here the most important parts of this post:</h3><br />Sourcecode: <a href="/blog/downloads/lcr_meter_sourcecode_15-03-2014.zip" >lcr_meter_sourcecode_15-03-2014.zip</a><br />Schematic &amp; Layout: <a href="/blog/downloads/lcr_meter_schematic_layout_eagle_5_9_15-03-2014.zip" >lcr_meter_schematic_layout_eagle_5_9_15-03-2014.zip</a><br /><br /><br /><h3>License</h3><br />I spend a lot of my limited time to develop this. I really enjoy if somebody is using, improving it or usings parts to create something completely different.<br />Do whatever you like with it, as long, as the whole project or parts of it are used for non-commercial purposes. <br />Please provide credits.<br /><br />For commercial use, even if only parts of this is used in indirect or direct form, please contact me. <br /><br /><br /><h3>About the code</h3><br />The code was developed with IAR for MSP430. It should compile with other toolchains as well, with minimal changes. I did not test it myself yet.<br />The code is structured in different submodules, e.g. pga.h/c to controll the PGA, dac.h/.c to control the DAC, lcd.h/c contains the LCD code, and so on...<br /><br /><br /><h3>Behaviour of the device</h3><br />After inserting the battery, the device will start a calibration cycle.<br />This calibration will improve the common mode rejection ratio of the differential amplifier, calibrate the gain factors of the PGA, ...<br />Follow the instructions shown on screen.<br />BTW: The calibration constants of my device are the default values. Have a look at main.c for comparison with the constants you will get.<br /><br /><br /><h3>Button</h3><br />The button has 2 purposes:<br />1.) turn the device on and off. The device can be turned off by pressing the button long, until the screen turns off.<br />The devices uses the power saving modes of the MSP430 do decrease the current consumption to a minimum. The power supply of LCD and analog components is also turned off, when the device is turned off.<br />2.) Select between the different measurement frequencies.<br /><br /><br /><h3>Formulas</h3><br />I&#039;ve been asked pretty often, how the calculation of the impedance works. Here a PDF showing the formulas, and transformations to get them:<br /><a href="/blog/downloads/Basic_formulas_for_LCR_measurement.pdf" >Basic_formulas_for_LCR_measurement.pdf</a><br /><br /><br /><h3>Disclaimer</h3><br />Don&#039;t blame me, if this burns down your hose, hurts your cat, burn your fingers while soldering, ...<br />Use it at your own risk :-)<br /><br />]]></description>
	</item>
	<item rdf:about="https://www.xyphro.de/blog/index.php?entry=entry121227-233617">
		<title>Current status</title>
		<link>https://www.xyphro.de/blog/index.php?entry=entry121227-233617</link>
		<description><![CDATA[<a href="javascript:openpopup('http://www.xyphro.de/blog/images/IMG_20121220_235251.jpg',800,600,false);"><img src="http://www.xyphro.de/blog/images/IMG_20121220_235251.jpg" alt="" /></a><br /><br />I promissed to post a short status update of the project...<br /><br />I&#039;m already pretty satisfied with the current results. The measurements are reliable, repeatable and seem to have a good precision compared with my calibrated 6 digit multimeter.<br /><br />For measurement frequencies of 100Hz and 1kHz I tried successfully components in the range of:<br /><br />- Resistors: 0.3 Ohm - 5 MOhm<br />- Capacitors: 1.2 pF - 4700 uF<br />- Inductors: 10uH - 9 H<br /><br /><h6>Current consumption</h6><br />- about 8mA during measurement (including 2mA for the analog stuff)<br />- 20uA when it is turned off (can be improved by changing software, but is already acceptable)<br /><br />The low current consumption allows the meter to be powered from a single 3V CR2032 battery.<br /><br /><h3>Videos of the LCR meter</h3><br /><a href="http://youtu.be/-Tj9n1g0hIk" >http://youtu.be/-Tj9n1g0hIk</a> ...the meter in action<br /><br /><a href="http://youtu.be/vTP0RzmvsDs" >http://youtu.be/vTP0RzmvsDs</a> ...the measurement signals shown on a scope<br /><br /><br /><h3>What I learned so far</h3><br /><h6>dynamic current measurement / higher test frequencies</h6><br />The current measurement over the 1K resistor using an opamp based subtractor was not a very good approach. <br />The problem is not the CMRR. Allthough it is not that good (abt. 60dB) I was able to compensate it digitally to over 100dB in my firmware. The main problem is the different delay in the 2 inputs which leads to problems because of the quantization steps of the DAC.<br />I will rewire it to a standard opamp based single supply I to V converter.<br />This change should also allow to allow much higher measurement frequencies (10kHz / 100kHz, maybe even 600kHz with some DSP tricks).  <br /><br /><h6>Crosstalk</h6><br />2 termination resistors were put directly on the inputs of the PGA. This minimizes capacitive crosstalk of the current and voltage signal. This is not extremly important but increases the measurement range in case one of the signals is large and the other one is small (e.g. very small impedances or very large impedances).<br /><br /><h6>MSP430 ADC reference</h6><br />In first instance I used the internal 2.5V reference of the MSP430. This reference is not stable in my case, as ADC and DAC are running synchronous and the DAC has a very high conversion rate. I could see an oscillation of about +-20 digits in the ADC results. <br />I switched to use the analog supply voltage as reference. This will not decrease the precision, as DAC and ADC use the same reference.<br /><br /><h6>Digital signal processing</h6><br />The measurement of the phase and amplitudes is based on a DFT rather than an FFT. Only a single frequency bin has to be masured, so an DFT is in this case more efficient as a radix 2/4-FFT which would calculate all frequency bins.<br />The sine-tables which are output to the DAC are precalculated and are also used directly for the DFT calculation which saves memory.<br /><br /><h6>Mechanical construction</h6><br />The 2 PCB arms work well. They can be bended very easy and I don&#039;t have the feeling that they will break after a longer time of use.<br />But: It would be better to increase the length a little bit to be able to read the LCD from a better angle.<br />My current tweezer-tips are not very good but will be replaced later with better ones.<br />]]></description>
	</item>
	<item rdf:about="https://www.xyphro.de/blog/index.php?entry=entry121112-233814">
		<title>LCR meter - first results</title>
		<link>https://www.xyphro.de/blog/index.php?entry=entry121112-233814</link>
		<description><![CDATA[<a href="javascript:openpopup('http://www.xyphro.de/blog/images/DSCN1365.JPG',800,600,false);"><img src="http://www.xyphro.de/blog/images/DSCN1365.JPG" alt="" /></a><br /><br />Here my first update:<br /><br />Got the analog part up and running. Unfortunaltely I had to do some &quot;bugfixes&quot; &amp; optimizations... Nevertheless, tests have proven that it supports up to 100 kHz test frequencies.<br /><br />The low level stuff of the software is also done:<br />- Communication with PGA<br />- UART debug output<br />- LC-Display control, including &quot;printf&quot;<br />- signal generation and synchronous sampling<br />- phase angle and amplitude measurement<br />- automatic setting of PGA according to the input signal amplitude<br /><br /><h2>Measurement results</h2><br /><br />The readings are raw and uncensored data, i.e. without any compensation of imperfections of the ADC, DAC, PGA and imbalance of current measurement, which will be added in a next step.<br /><br />The imbalance and non perfections of the current measurement lead to great errors in the phase and amplitude measurement when the current signal is small. The root source is, that both inputs of the subtractor will never be 100% balanced. But the good news is, that this error can be compensated in the digital domain.<br /><br />When viewing the results, also consider, that a 10K resistor does not have a value of 10K. I double checked for example the 10K resistor which measures as 9950 Ohm with a multimeter.<br /><br /><a href="javascript:openpopup('http://www.xyphro.de/blog/images/DSCN1377.JPG',800,600,false);"><img src="http://www.xyphro.de/blog/images/DSCN1377.JPG" alt="" /></a><br /><br /><h2>Interpretation of the display content</h2><br />Line 1: phase of voltage signal<br />Line 2: amplitude of voltage signal<br />Line 3: phase of current signal<br />Line 4: amplitude of current signal<br />Line 5: phase between voltage and current signal<br />Line 6: resistance in Ohm or capacitance in pF<br /><br />Here some other measurement results:<br /><br /><a href="javascript:openpopup('http://www.xyphro.de/blog/images/firstreadings.jpg',800,600,false);"><img src="http://www.xyphro.de/blog/images/firstreadings.jpg" alt="" /></a><br /><br /><h2>Next steps</h2><br /><br />- Realize different measurement frequencies (currently fixed to 10kHz)<br />- Get more precision<br />- autodetection of equivalent circuit (in this version only R L or C only are supported)<br />- update schematic according to new changes<br />- make a fancy menu system, nicer font, ...<br /><br />]]></description>
	</item>
	<item rdf:about="https://www.xyphro.de/blog/index.php?entry=entry121106-180136">
		<title>Cheap &#039;n good LCR meter (or RLC meter?) for SMD components</title>
		<link>https://www.xyphro.de/blog/index.php?entry=entry121106-180136</link>
		<description><![CDATA[How often do I debug electronic circuits and have a lot of SMD components lying on my table. To avoid mixing up wrong values I usually throw them away.<br /><br />Sometimes it would be handy to measure the values of SMD components. <br /><br />Already quite some time ago I found a  nice device for this purpose:<br /><a href="http://www.smarttweezers.com/" >http://www.smarttweezers.com/</a><br /><br />But... It is very expensive: about <strong>400 US$</strong><br /><br />I thought: I can even build a single piece for 1/10th of the price.<br /><br />The measuring principle is quite simple and well described in literature. Dave Jones also described it in one of his videos: <a href="http://www.youtube.com/watch?v=fs2MfTW4o_Q" >http://www.youtube.com/watch?v=fs2MfTW4o_Q</a> <br />The description starts at about 03:00.<br /><br />A sinusodial signal is injected in the device under test and the amplitude and relative phase relation of voltage and current signals are measured to calculate the needed values.<br /><br />Based on the Phase shift it is possible to detect the kind of device (inductor/resistor/capacitor) while the amplitude relations in conjunction with the frequency are used to calculate the component value.<br /><br />Apart from only measuring the value and type of device it is also possible to measure for example the ESR of them.<br /><br />The problem is: To be able to measure very small and very large values it is needed to have a very high dynamic range for current and voltage measurement.<br />After some calculactions I decided to use a programmable gain amplifier (PGA) to scale up the voltages before AD conversion.<br /><br />I&#039;ve choosen components to be able to operate at 3V CR2032 con cell:<br />- PGA113 as PGA. It has 2 input channels, so one channel can be used for voltage, the other one for current measurement<br />- Nokia 3210/3310 LC Display. It tested =&gt; It can run from a single CR2032 cell<br />- MSP430F5338: The 2 DAC outputs are used to generate a DC offset for the single supply system (virtual ground) and the sinusodial exitation signal. The internal ADC digitizes the signal, which is selected by the PGA.<br />- OPA378 operational amplifiers<br /><br /><h2>Measurement accuracy (!= resolution)</h2><br /><br />I made some simulations based on the accuracy of the MSP430 DACs and ADCs, and the PGA113. For simplicity I only did this analysis for resistive DUTs.<br /><br /><a href="javascript:openpopup('http://xyphro.de/blog/images/accuracy1.png',800,600,false);"><img src="http://xyphro.de/blog/images/accuracy1.png" alt="" /></a><br /><br />Closeup look for small values:<br /><br /><a href="javascript:openpopup('http://xyphro.de/blog/images/accuracy2.png',800,600,false);"><img src="http://xyphro.de/blog/images/accuracy2.png" alt="" /></a><br /><br />+-2% for small values is fair enough. The accuracy can be further improved by calibration. BTW: The simulated results are for non-calibrated systems!<br />The &quot;small value accuracy&quot; can be improved by choosing PGAs with higher gain.<br /><br /><h2>Schematic </h2> (click to zoom in): <br /><br /><a href="javascript:openpopup('http://xyphro.de/blog/images/schematic.png',800,600,false);"><img src="http://xyphro.de/blog/images/schematic.png" alt="" /></a><br /><br />For best accuracy I decided to make a few optimizations in the schematic:<br />- to avoid capacitive coupling termination resistors are inserted at some positions<br />- A &quot;4 wire like&quot; approach is used. For this reason an operational amplifier is placed very close to one of the measuring points.<br /><br /><br /><h2>Measurement principle</h2><br /><br />As the sinusodial signal is generated by the MCU and the MCU is also digitizing the voltage and current signals it they are totally synchronous to each other. For this reason it is possible to measure first the voltage signal and afterwards the current signal. <br />This saves an additional AD converter.<br /><br />DAC0 will be set to VREF/2 (virtual ground)<br />DAC1 will output the sinusodial signal<br /><br />The MCU will generate the signal by DMA transfers. A PWM-Timer will be setup to have the same period as the sinusodial signal. <br />The Timer will automatically trigger a single AD conversion per cycle. The duty cycle selects the position. The Duty cycle is changed a few times to digitize the signal at a different position once per sine-cycle.<br /><br />This measurement principle allows high measurement signal frequencies while keeping the CPU load very low.<br /><br />This will be done for the voltage and for the current signal.<br /><br />Afterwards the phase of voltage and current signal has to be measured based on the acquired samples.<br /><br /><h2>Phase and amplitude measurement</h2><br /><br />The resulting samples will be put in an FFT function which should generate a single peak bin. No FFT leakage will occur as DAC and ADC work synchronous to each other, so it is possible to use an FFT to measure the amplitude and the phase of the signal.<br /><br />A very small FFT can be used to realize this functionality. Already a FFT of size 4 can be enough. Advantage: FFT of size 4 does not need any complex multiplications.<br /><br />An FFT over traditional methods has a few other advantages: It acts also as small band filter, so noise in non-interesting frequency bins don&#039;t affect the measurement.<br /><br /><h2>PCB</h2><br /><br />A few days ago my prototype PCBs arrived.<br /><br />Aren&#039;t they beautyful? :-)<br /><br />I also found a good way to realize the &quot;tweezers&quot;. Measurement probes (&quot;nails&quot;) are still missing, I will add some later.<br /><br />For easier development I soldered the display with a long cable to the board. Later a very short cable can be used or the original clamping contacts of the display can be used.<br /><br /><a href="javascript:openpopup('images/DSCN1276.JPG',1024,445,false);"><img src="images/DSCN1276.JPG" width="480" height="209" alt="" /></a><br /><a href="javascript:openpopup('images/DSCN1277.JPG',1024,768,false);"><img src="images/DSCN1277.JPG" width="480" height="360" alt="" /></a><br /><br />Next steps:<br />- Get circuit up and running, try analog frontends, etc...<br />- Write &quot;some&quot; software :-)<br /><br /><br /><a href="http://www.xyphro.de/blog/index.php?entry=LCR-meter---first-results" >1st update</a>]]></description>
	</item>
</rdf:RDF>
