Monday, 19 December 2016

MSGEQ7 7 Band Graphic Equalizer Chip



I had bought a couple of MSGEQ7 chips in 2014 from eBay with plans to do something with them. So recently I found myself a bit of idle time and mounted one on the breadboard to try it out. I used the circuit straight out of the MSI datasheet (Figure 1):
Figure 1. MSGEQ7 Circuit
I had a little trouble getting this to work correctly, so I scoped pin 8, knowing this is not going to be accurate but should indicate if the RC oscillator was running at all or not (Figure 2). The trace indicated about 102 kHz, which is probably higher with the 10x scope probe removed. 

Figure 2. Trace of pin 8 (Oscillator)
The problem was that I was getting an output (pin 3), like that of Figure 3. This was with no signal applied.


Figure 3. Incorrect outputs (pin 3)
After trying several things including gain and frequency adjustments of the function generator, I decided to try the other chip (I always buy two for this reason!) This chip swap yielded the type of results I was looking for (Figure 4):

Figure 4. MSGEQ7 finally works (near 60 Hz)
The tallest signal represents the first frequency bucket which represents about 63 Hz (from the documentation). This will vary somewhat depending upon the internal RC oscillator.  I used a AVR generated oscillator to strobe this thing and used the scope's sync to drive the reset. You can see two complete traces in the middle with partials at the ends. Unfortunately the Rigol internal hardware frequency counter didn't like the low signal levels. The software frequency measurement likewise didn't grok the low function generator signal levels either.

Figure 5 shows the result of the function generator at 160 Hz. I found that the signal generator (B&K Precision Model 3050) needed to be on the 0 dB output range at about 10%. The chip was fussy about the input level going from no output to all high when the signal went out of range.

Figure 5. 160 Hz
 The next bucket is 400 Hz, shown in figure 6.
Figure 6. 400 Hz
 Figure 7 shows the 1 kHz bucket activated.
Figure 7. 1 kHz
 Setting the function generator to 2.5 kHz for the next bucket (Figure 8).
Figure 8. 2.5 kHz
 Figure 9 shows 6.25 kHz.
Figure 9. 6.25 kHz
 Finally figure 10 shows the last of the seven buckets activated with 16 kHz.
Figure 10. 16 kHz
The idea behind the chip seemed cool. I had planned to drive it from an ATmega328P, hooked up to a Raspberry Pi. But having tested it out I quickly realized that this circuit is much too finicky for a "simple project". What it needs is a circuit ahead of the MSGEQ7 with AGC to keep the signal within acceptable limits. Otherwise the MSGEQ7 will simply disappoint.

The MSGEQ7 is a CMOS chip. I was aware of this and took my usual care handling it. But the first chip may have been static damaged on the breadboard. If you choose to breadboard it, I recommend that you make all the connections without the chip and plug it into the breadboard last. This is the first damaged CMOS chip I've had in quite a long time (it might even have been damaged as part of the shipping process).

You can read more about the MSGEQ7 chip from this PDF file:

  https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf

Thanks for reading.

Tuesday, 6 December 2016

No iMac? Build a iRasp3

I've wanted to try this for a long time with the Raspberry Pi 3. The Pi 3 has built-in WiFi, making it a natural for an iMac-like terminal unit. I've held off because of work on my new book, which is will be out early next year (shameless plug here: http://www.apress.com/us/book/9781484224052).

Now that the Pi 3 is free, I just had to repurpose an old Viewsonic VG2230wm monitor with a Pi on the back (Figure 1).

Figure 1. iRasp front view.
I received the monitor some time ago from a friend without a stand. I eventually junked another monitor which had a stand that could be adapted to the Viewsonic. You can see it crudely attached in Figure 2.

Figure 2. Note the adapted stand for the monitor. Raspberry Pi 3 is mounted on the back with plastic spacers, using wood screws in the plastic casing.

The Pi is mounted on top of four plastic spacers, made from a pen cut with a small pipe cutter. The screw holes were carefully drilled over an area known to have some breathing space underneath. The monitor internals are covered in a metal shield, so I wasn't too worried about hurting anything (I had also been inside before).

The Pi 3 also has four USB ports. So even though I need two for keyboard and mouse, I still have two available. If needed, there is also a wired ethernet port.

I made sure to orient the GPIO header strip towards the bottom. This will allow me to use a longer ribbon cable down to the Cobbler-T for breadboard work.

Someday I hope to replace keyboard and mouse with wireless peripherals, since the Pi 3 also sports Bluetooth. In the meantime, I'll be looking for a shorter HDMI and audio cable.

Thanks for reading.

Monday, 5 December 2016

ESR Project Build - Part 6 of 6


This build is not done until the unit is assembled in its cabinet. I thought this last step would be a slam dunk. But I was terribly mistaken!

The W2AEW design called for a 5 volt regulator. Since the parts used didn't require 5V specifically, I tested it using a 6.5V switching supply that I had handy. After all the wiring was done, I merrily built this 7805 circuit on a tiny proto PCB assuming all would be well. Of course, once it was all nicely soldered into place the unit didn't function!  I could not get the meter to deflect with the leads shorted.  Wah, wah, wha... epic fail!

I soon discovered that if I raised the voltage, things returned to normal. So I tested it on a variable supply and found that it returned to normal over 6V. Being too lazy to rework the PCB much, I simply put a pair of diodes in the ground circuit to raise the output to 6.2V (Figure 1). If I was less lazy, I would have run a filter cap over the diodes also, but found that I could get away without.
Figure 1. 7805 regulator circuit used (for 6.2V)
My BNC test connector cannot be grounded, so I found a piece of saved orange crate plywood, painted it black and drilled a hole for it. I eventually got the unit pretty much done without the external case but ran into another problem (more about this later).

Figure 2 shows the internals of the unit -- large enough for an electrical outlet for the wall wart which delivers about 10 VDC without a load. 10V incidentally, is too much voltage for low ESR readings. So a regulator was needed.

Figure 2. Internals of the ESR unit. The PCB hanging down has the 7805 regulator.
The problem was the Fine/Coarse switch that I added to the front panel. When that switch was on Fine, a 47 ohm resistor was placed in parallel with the 10 ohm, to reduce the resistance ever so slightly from 10 ohms to 10||47=8.25 ohms. This provides wider spaced low resistance readings on the meter.

The problem turned out to be that the old switch I had used had an on resistance of several ohms! This drove me batty until I finally took the meter and read the switch resistance. So even with the 47 ohm resistor switched in, it ended up having no effect. After rummaging through the junk box again and measuring the on resistance this time, the issue was resolved with a better switch.

Figure 3 shows the unit re-assembled in the Sencore transistor tester case.

Figure 3. Assembled ESR meter. Zero pot at left, BNC for test leads in middle, power switch at upper right and Coarse/Fine switch below the power switch. BNCs at bottom are NC.

I suppose the lessons of the day includes:

  • Don't assume the last part of the build will be trivial
  • Don't assume switches will all measure 0 ohms, especially old ones!
  • Test with the intended supply voltage up front.
Thanks for reading.

Wednesday, 23 November 2016

ESR Project Build - Part 5 - Test Readings

With the opamp section soldered up and tested, I found that the range was a bit wider than I wanted. The designed range was good if you want to test down to 1 uF. However, to see more meter movement down near the 1 ohm range, I found that I could put a 47 ohm resistor in parallel with the 10 ohm resistor at the DUT terminal. This expands the scale near 1 ohms slightly, so that the readings vary between about 1 and 4 ohms. I plan to make this a "fine" switch setting on the finished meter assembly.

With the setting on "fine" you can measure about 100 uF and higher. Any caps below that, will read off scale (to the left). Turning the switch off (coarse), the unit does measure 1 uF and up.

Figure 1 below shows the Sencore transistor testor 100 uA meter that I used in the zeroed position (right).
Figure 1. ESR meter in zeroed position.
The remaining figures are readings while the switch is on "fine" at various resistances.
Figure 2. 1 ohm
Figure 3. 2 ohms
Figure 4. 3 ohms
Figure 5. 4 ohms
From these readings, you can see that on "fine" that the resistances spread out rapidly. With the switch set to coarse, 10 ohms reads about where figure 5's 4 ohm reading is. Then anything higher bunches to the left of that.

For switching power supplies where the capacitors are expected to have milliohm values of ESR, the "fine" setting should be suitable for identifying failed caps. It is still not the best arrangement for cherry picking caps because of its inability to read milliohm differences.

Later when the hardware build of the cabinet is done, I'll add some photos to the last part in this series. Thanks for reading!

Monday, 21 November 2016

ESR Project Build - Part 4 - Precision Rectifier + Meter

We've so far looked at the ~100 kHz oscillator, driver and gain stages. After the gain stage comes a precision rectifier and driver, which looks like this (Figure 1):

Figure 1. The Precision Rectifier and meter driver
I decided to breadboard this portion since I am substituting the LM358 for the AD8032, which the W2AEW design called for. The AD8032 is a bit pricey and harder to obtain (Mouser price for DIP was $8.11 US in single quantities). The AD8032 is a rail-to-rail opamp but this circuit only requires the bottom rail to function correctly.

The LM358 is a jelly bean part and operates at the V- rail (ground in this case). This part is targeted as a single supply solution. As a bonus, it uses the same pinout as the AD8032. The one other deviation from the W2AEW design is that my selected meter has a 100 uA movement instead of 200 uA. So instead of the 4.7k + 2.2k with 10k adjustment pot, I simply ran the output signal into a 100k trimpot (for this breadboard test), with the other leg of the pot going to ground. Then the meter went to the wiper arm of the pot with its negative lead going to ground. The full deflection is adjusted with the DUT leads shorted. In the final soldered up build, I'll arrange a protective limiting resistor for the meter in case the pot gets cranked.

The signal coming out of the LM358 precision rectifier and going into the driver (pin 5) appears as shown in Figure 2:
Figure 2. Input signal at LM385 pin 5

It is interesting to see that the signal actually does dip below ground by -590 mV. The positive swing of the signal goes up to 650 mV. This signal is generated when the DUT leads are shorted (zero ohms).

With the 1N4148 diode and the 0.1 uF filter cap connected, a DC voltage is established, which is then delivered to the meter. To calibrate, short the DUT leads and adjust the pot to give the meter full deflection like the old fashioned ohm meters.

Early testing has shown that low ESR values show very close to the shorted leads point on my meter. Any resistance over an ohm shows as a reading near the 10% deflection point. So presently, I found this meter to be extremely ESR sensitive.

Once you have a hammer, everything looks like a nail. So I went around the lab looking for caps to measure. All but one measured 100%. This failed cap was pulled out of an '80s power supply along with three others just like it. I had been debating whether or not to use these or to replace them in a power supply project. One of the four showed no deflection at all, while the remaining three all showed 100% good.

I also in-circuit tested this circuit on Intel Atom motherboards with caps and measured a few other boards. All indications look very good so far. Now I just need to find some time to solder this up in its final form.

In the next part, I'll present some pictures of my build into an old Sencore transistor tester case.

Sunday, 20 November 2016

ESR Project Build - Part 3 - Amp

In the amplifier input chain, we first encounter the DUT filter cap (0.1uF) and load resistor (100 ohms). This test signal conducted through the test capacitor is then AC coupled to the amplifier stage.
Figure. Device Under Test input

Amplifier


The amplifier Q1, is suggested as any general purpose signal transistor like the 2N2222 or 2N3904 etc. I chose the latter, though I had ready access to both. Figure 2 shows the basic common emitter amplifier configuration used.
Figure 2. 2N3904 Amplifier stage
The 100 ohm resistor in the emitter leg adds negative feedback and reduces the overall gain of the circuit. The input signal is coupled in with the 0.01 uF cap and then coupled out of the collector circuit with another 0.01 uF circuit.

This circuit should have been painless to add to the existing prototyped circuit, but try as I might to get the orientation of Q1 right, I got it backwards! Doh! After snipping out the failed part and replacing it with another with the correct orientation, the gain came up to what it should be (a transistor with emitter and collector reversed will still function but with low gain). Figure 3 illustrates the pinout for this device.

Figure 3. 2N3904 Pinout
The output of the amplifier stage taken from the collector's coupling capacitor is shown in Figure 4.
Figure 4. Amplifier stage output (at collector)
Here we can see that the output is 640 mVpp, with the DUT probes shorted (for zero ohms). Going out of the oscillator driver, I measured about 355 mVpp. With DUT probes shorted and the signal appearing across the 0.1 uF filter cap and 100 ohm resistor the signal coming in is about 157 mVpp (Figure 5).

Figure 5. Input signal arriving from DUT.
So if the input signal is 157 mVpp and the output voltage from Q1 is 640 mVpp, then this would represent an overall voltage gain of about 4. But don't forget that the stage also adds power gain.

Next up, we'll review the precision rectifier stage.

ESR Project Build - Part 2 - Oscillator

The basis of the tester starts with a 100 kHz oscillator circuit. The two designs are similar, but I'm building based upon the W2AEW circuit:

The oscillator consists of a pair of CD4049 inverters biased to oscillate. The remaining four hex inverters are used to drive the signal into a 10 ohm resistor. This produces the signal sent to the Device Under Test (DUT) with enough power, but low enough in voltage to avoid silicon diode conduction.

The scope trace in Figure 1, shows the oscillator signal when the circuit was powered from about 6 Volts. The rise and fall times are 80 ns and the duty cycle was about 55%.

Figure 1. Oscillator output (before drivers)
Figure 2 illustrates the output signal out of the driver stages into the 10 ohm resistor. The voltage drops to about 355 mVpp and the frequency rose to about 119 kHz. With the driver attached, there was less load upon the oscillator stage. At these lower voltage levels, you can see more of an influence from the inductance side of things in the trace output.

Figure 2. Driver stage output into 10 ohms.
Getting the oscillator to work was fairly painless. Because I am prototyping this, I always run the risk of solder blob shorts and this time was no exception. After elimination of a supply side short and then another solder blob affecting the oscillator circuit, the circuit took off with no trouble.

In the next part, we'll look at the receiving side of the DUT probes.