Show Posts
Pages: [1] 2 3 ... 92
1  Using Arduino / General Electronics / Re: RC filter on MCP4921 DAC Vref on: September 26, 2014, 06:00:36 am
Well, I (probably) figured out why nothing happened when I enabled the buffer on the DAC.  I'd been expecting a volume change, if in fact the 100K resistor formed a voltage divider with the pin's inductance. 

Turns out I must have read that other post two years ago, and taken the advice given in it when I designed my first board, which is the one I tested the buffer on, because when I looked at the schematic to see which resistor I should bypass to test no resistance on the Vref pin to see if that had effect, I saw that I had changed the resistor to 1K and the capacitor with 10uF to keep the 16hz LPF, but avoid most of the voltage drop.  The 100K would have dropped 2V, while the 1K should drop only 0.03V. 

So that would explain why enabling the buffer, which is supposed to greatly increase the inductance of the pin, and should have reduced the voltage drop a great deal, had no effect on the volume.  There's no way I could tell by ear if the volume was a mere 3% louder.
2  Using Arduino / General Electronics / Re: RC filter on MCP4921 DAC Vref on: September 23, 2014, 01:07:45 pm
So I'm still not clear on what's going on with this pin.  As I mentioned above, I've been told there is a voltage divider being formed, yet if I am interpreting the data sheet correctly, enabling buffered mode should force the pin impedance to be much higher, which I would assume should make the voltage divider affect the voltage much less, and thus, make the voltage on the output of my DAC higher, and thus increase the volume of my audio... at the very least. 

Yet that did not happen when I enabled the buffer.  So either I am misinterpreting what the data sheet has to say about buffered mode, or there isn't a voltage divider.
3  Using Arduino / General Electronics / Re: RC filter on MCP4921 DAC Vref on: September 22, 2014, 11:52:42 am
> Never use a DC-DC converter for analog supply if you want noise-free audio, BTW!

Do you mean a switching converter?  Because Wikipedia says a linear regulator is a DC-DC converter, and I have to use one or the other.

In this circuit's case, I have a 5V supply from a wall adapter.  I was going to put a 100uF cap at the power input and .1uF decoupling caps around the board, and 1uF where specified in datasheets.  My power hungry components are right next to the 100uF capacitor.

I could, if necessary use a linear regulator to drop the voltage for the Audio portion of the circuit to 4.5V.  The amp is a bit louder than needed, and I would imagine dropping half a volt would be sufficient to smooth whatever noise there ends up being.  Unless of course the noise is a result of the ground being noisy.  I have room on the PCB for a regulator, it's just cost that is the issue.
4  Using Arduino / General Electronics / Re: RC filter on MCP4921 DAC Vref on: September 22, 2014, 11:45:17 am
Regarding star grounding, I have been reading a bunch of stuff about ground planes the last few days because in my last design I tried having a single point connection to my analog ground plane, and noise still got in, and I've found a number of recent documents stating that a solid ground plane is likely best, and that the layout is more important.  Ie, make sure the path for power to your noisy stuff doesn't cut through your analog circuitry.

I lost the links to the papers, but found some discussion of it here:

One fellow towards the end recommends a solid ground plane, but a split power plane.  Perhaps I could try that.  Seems non-intuitive though to split one but not the other.
5  Using Arduino / General Electronics / RC filter on MCP4921 DAC Vref on: September 22, 2014, 10:15:57 am
Hey guys, I've got a question about an RC filter on the VRef of the same DAC used on Adafruit's Wave Shield.

Here is the datasheet for the DAC in question:

And here is the schematic for the Wave Shield:

You can see they've placed a 16Hz LPF comprised of a 100K resistor and .1uF capacitor on the DACs VRef/REFA pin.

I used this same DAC in a previous design and ended up with a lot of noise from my servos and LED drivers getting into my audio system, so in my next design in addition to including more capacitors to supply power to those I've also been double checking the audio system.  I'm not looking for decoupling tips for the LED drivers in this thread, I just want to understand how this filter functions in conjunction with the chip.

Anyway, the reason for my question is I noticed that with this DAC you can enable a "buffered" VRef mode.  The data sheet wasn't very clear on what that is, but I'd hoped enabling it would reduce the noise somewhat.  Doing so appears to have done nothing however.

The datasheet seems to indicate that buffered mode greatly increases the input impedance on VRef, but it also indicates the voltage reference then needs to be slightly below Vdd.   The input to Vref was 5V I assumed.  So I'm not sure if enabling buffered mode would be bad for the chip or lead to clipped audio, but again, I tried it on my old circuit and it seemed to function the same as before.

I then did some googling and found this thread on the Arduino forum:,199374.0.html

Someone there suggested that the 100K resistor was a bad choice and that the 100K resistor in the LPF formed a voltage divider with the input impedance of the VRef pin. In unbuffered mode, that is 165K.  In buffered mode, the datasheet doesn't appear to say, other than that it is much higher. 

If that forms a voltage divider however I would have assumed my audio volume level would be affected.  Passing 4096 to the DAC if Vref is 2.5V after all, should result in a 2.5V output.  That doesn't seem to be the case though.  Because again, I attempted to enable that buffer, and it did nothing.  If the buffer's impedance is far higher than the unbuffered mode, as the datasheet indicates, then I would have expected Vref to be much closer to 5V, and for my audio to therefore be twice as loud.  But like I said, in enabling it, I heard no change.

Since I'm redesigning the circuit, I could reduce that resistor, or stick a 1uF cap on there to reduce the LPF to 1.6Hz instead of 16Hz as it is now, and I assume that would reduce the noise further.  I could also stick two capacitors and two resistors on there to make a second order filter.  But the question remains whether I should even bother.  I could leave some pads there and just not populate them I suppose.  But if this isn't going to actually reduce the noise in the audio by any perceptible amount, then I'd rather not go overboard and take up board space with additional unnecessary pads.

Any insight into what's going on here would be appreciated.  I really need to wrap this design up this week.
6  Using Arduino / Audio / Re: Anyone have an Adafruit Wave Shield? I need a few measurements taken. on: August 18, 2014, 02:25:39 pm
Thanks a bunch, I hadn't been able to get to ordering that part yet, so these measurements will be a big help.

I'm actually designing a board that uses that thumbwheel, so I can make sure they're all soldered flush with the pcb.
7  Using Arduino / Audio / Re: Anyone have an Adafruit Wave Shield? I need a few measurements taken. on: August 14, 2014, 06:09:54 pm
I could still use these measurements...
8  Using Arduino / Audio / Re: Anyone have an Adafruit Wave Shield? I need a few measurements taken. on: August 11, 2014, 03:36:05 pm
Sure that would be great.  Otherwise I'll have to wait a week for parts to arrive to do what I need to do.
9  Using Arduino / Audio / Anyone have an Adafruit Wave Shield? I need a few measurements taken. on: August 10, 2014, 06:45:45 am
Specifically, I need to know, to a fair level of precision (1/32" would be ideal):

1. The diameter of the thumbwheel.
2. The thickness of the thumbwheel.
3. The distance from the face of the PCB to the underside of the thumbwheel.
 (The distance from the face of the PCB to to the center of the edge would be good as well.)

I've already looked at the datasheet for the part, but it doesn't show the size of the wheel itself and I need to know that so I can size and position a cutout for it in a panel.
10  Using Arduino / General Electronics / Re: How do I calculate the values for an LC or PI filter? on: July 28, 2014, 05:31:08 pm
I don't understand what you mean.
What is hard about putting a 4K7 resistor across the input?

I didn't understand what you meant earlier when you said load the output side of the transformer with a 4K7 resistor. 

I'm also not sure what this is supposed to accomplish.  I don't want the transformer there.  And I don't want to have to create special audio cables for every kit I ship with a resistor spliced in parallel.

The amplifier and isolator are also currently inside an enclosure which is difficult to get open and close back up again, so while I may try this at some point to see if it does anything, unless there's a compelling reason why I need to do this to solve the overall issue, which is that I'm stuck with that ground loop isolator / transformer in the first place, I'm not itching to open the shell up to try that out.

I did try putting a 1.5K resistor across the line out (I don't have a 4.7K and I figured the smaller the better anyway), aka, the input to the transformer, as that is outside the shell and easily accessed, and that didn't seem to do anything.  Perhaps that's exactly what you expect would happen, but if adding a resistor can't be done on the output side, then I would prefer not to use that approach.  Can you imagine Apple selling an iPod and telling their customers they have to stick a resistor on the line-in to their portable speaker amps to make them work?

Actually, I could imagine Apple selling their customers an expensive cable to do just this, but that's not the point. smiley

I'm looking for a nice, clean, non-kludgy, miniaturized solution that doesn't involve any big ugly expensive through-hole transformers that look like they came out of a 1980's telephone.

This is what my boards look like by the way:

You can see how little room there is there with that all installed, and that's a relatively large space, as far as where these boards end up being used (nerf guns and tricorders and such don't have a whole lot of space inside).  That's version 1.0, and for version 2.0 I want to make it even more compact and ditch those 2.54mm headers in favor of more compact 2mm versions. 

This was a concept of such a board using an Xmega:

I decided that I don't have the luxury of spending months trying to figure out how to port a bunch of Arduino libraries (like WaveHC and Servo) that use timer interrupts to the Xmega though, so I have to redesign that around the Mega1284 I'm using in the current model.  (Then again, it might take less time to port the libraries than redesign the board...  But with the Zero coming out soon, I feel like I'd be wasting my time getting familiar with the Xmega.)
11  Using Arduino / General Electronics / Re: How do I calculate the values for an LC or PI filter? on: July 28, 2014, 06:28:17 am
> One approach you have not attempted yet is to lower the input impedance of your amplifier to reduce the pickup of the noise.
I would use the transformer and load the output side with something like a 4K7 resistor going into your amplifier.

I don't understand what you mean.

In case there's any confusion, when I mention an external amplifier, it is a battery powered class D 20W amplifier running from the same 12V power supply as the board's external 5V switching regulator.

There is also a 3W on board amplifier which runs from the same 5V supply which powers the logic and LEDs.

There is no transformer in this setup other than the one which is inside the ground loop isolator, and the goal is to get rid of the ground loop isolator.  I don't want to use a transformer as these boards need to be super small, transformers are expensive, and I've yet to find a transformer that will work across the whole audio range.
12  Using Arduino / General Electronics / Re: How do I calculate the values for an LC or PI filter? on: July 28, 2014, 01:15:39 am
As for the schematic and layout of my board, here those are:

The DAC and amp are in the lower right hand corner, isolated from the power and ground planes except at one point.

The LEDs on this board are driven by TLC5947's that are on little modules connected to the LED pins.  Those boards only have a couple small decoupling caps on them, 10uF, and 0.1uF.

The power is supplied by a separate 5V switching regulator which has 220uF caps on the inputs and outputs.

I get noise on the audio from the LEDs when they dim, due to the PWM, and I also get noise when I drive any other modules off the pins on the left side of the board with PWM.

But that's when connecting a speaker to the 3W onboard amp.  If I connect an external amplifier to the line out pins, all hell breaks loose and the quiet PWM noist turns into a loud screeching that overpowers the rest of the audio... unless I stick a ground loop isolator... which is just an audio transformer, in between the board and whatever external amp I'm using.  Then I just get the quiet PWM noise.

I had one suggestion to break the connection from my line out voltage divider to reference that to the amp's grounf to solve that isolator issue, and I haven't tried that yet, but that wouldn't solve the primary issue which is that pwm noise that's getting into the audio subsystem in the first place.

Given the PI filter with its inductor seems easier and the inductor will take up the same space as a 100uF cap, I would be inclined to go that route... were it not for the fact that those 1mH inductors appear to have resistances in the range of 3-6 ohms, which I think it's safe to assume would result in a far worse voltage drop than the 1 ohm resistor that still seems too large:

So, I'm not sure what to do at this point.  I could use a larger capacitor to make the resistor smaller but my boards need to be small.  A linear regulator might do the trick, but I was hoping to use a switching regulator in the next iteration of the boards to allow for a 16v input.  And that adds a lot of cost.

Perhaps adding a resistor to Vcc on the LED drivers is the key?  I don't need 5V for those.  And I have room on there for a 100uF capacitor.   I think someone suggested such an approach in the earlier thread to "get the current flowing around there".   Just a question of what wattage that resistor needs to be.  Can't calculate that since I don't know how much voltage it will drop.
13  Using Arduino / General Electronics / Re: How do I calculate the values for an LC or PI filter? on: July 28, 2014, 01:11:59 am
Hey guys,

So I'm back at work on this part of the circuit. 

I was originally leaning towards the PI filter because it seemed simple enough to implement, but when looking for a suitable inductor I realized during my original search I must have mistakenly selected nH instead of mH,, because the inductors I found this time around were much larger and more expensive than what I found before. 

I would like to keep my design small, because even though the board I'm working on now has room to spare, the next board I'll be designing has to be as small as possible.

I decided to look into that RC filter that was suggested as an alternative, and plugged some values into this calculator:

If I plug in 1khz and 100uF I get 1.6 ohms for my resistor. 

Good so far, but I was warned that doing this would cause a voltage drop, and that I should take care to make sure that's acceptable.  I selected such a large capacitor because I have no idea how to calculate the voltage drop here, but I figured the smaller the resistor the better.  Still, if I could get away with a smaller capacitor, so that I could use a tiny ceramic one instead of a hulking electrolytic, that would be great.

In my audio circuit, I have these two chips:

At best I can guesstimate, the DAC is probably not going to draw more than 25mA, but the absolute max on the input is 50mA so it may be wise to assume that. 

The amp, well that's going to be powered by something less than 5V, the voltage drop will determine that.  But assuming 5V and a 4 ohm speaker, with 10% harmonic distortion as a worst case, that looks to be about 2.75W max.  Which with a 5V supply gives 550mA.

So worst case, this portion of the circuit would be drawing 600mA.

Now, I have no idea if this is correct or not, but I'm thinking I should plug that into R = E / I, and that gives me 8.3 ohms for the resistance of this portion of the circuit.

Then I think I would use the voltage divider equation to determine what my voltage drop would be:

Here, I would set R2 to 8.3 ohms, as that represents my audio circuit in the worst case, and R1 would be the resistor in my low pass filter.

R2 / (R1 + R2) would then = .89 if R1 = 1 ohm.

And if R1 = 1.6ohms, which was the value calculated for the 1khz LPF, then I get .84, which multiplied by 5V gives me 4.2V.  That's quite a voltage drop.

The thing is, if the voltage drops, then the current the amp is putting into the speaker would as well, so that's probably incorrect.  Perhaps I should just use the 4 ohms for the speaker as my resistance? 

In that case, R2 / (R1 + R2) would be 4 / (4 + 1.6), which is .71, which is even worse actually.  And I doubt that is correct either since I think the speaker resists the flow of electricity more than its impedance implies.

Anyway I'm totally confused here.  All I can really say for certain at this point is the circuit would probably work but be quieter than it should be if the voltage drop is really that large.  Even in my worst case there, that's still 3.5V and that's still more than the amp and DAC need.  Except... I'll be talking to them with 5V logic and they may not like that with Vcc being lower than expected. :/
14  Using Arduino / Project Guidance / Reccomendations for laser/cnc cut acrylic service? on: July 25, 2014, 02:48:35 am
Hey guys,

I'm working on a project for which I'm going to need first 10, an then 100 11x11" sheets of 1/8" acrylic cut.

I'm not sure if laser or CNC cutting would be less expensive, but I'm on a budget, so if one is going to be half the cost of the other, but the quality of the cuts isn't as good, then I'd prefer the cheaper service.  This will be a base plate so it's not going to be seen much.

Each sheet would have six holes for screws, two SD card size slots, and square holes for a DC jack and rocker switch.  In the center, there will also need to be a 'grill' with holes for screws at the corners, behind which will be mounted a small speaker. 

The speaker portion will probably add the most cost.  Right now it's a fancy design with oval shapes, but that might actually make it cheaper to cut than something with a lot of much smaller holes.

I'm not looking for random suggestions; I know how to use google. smiley   What I'm looking for are reviews from those who've actually used particular services and been happy with the results or might have an idea of the cost difference between CNC and laser cutting for panels like this. 

I'm also not sure what format they'll want the data in, but I would like to be able to just create the design in Eagle since that's what I know and I'll have the board right there for reference.  I think most places will want DXF, though maybe some can accept gerbers?  I'm not sure if I can export DXF form Eagle, that's something I still need to look into.
15  Using Arduino / Audio / Re: Need help determining which speaker is louder on: July 14, 2014, 01:00:07 am
Oh and as Grumpy mentioned, the speaker housing is important.  The waves from the back side of the speaker are 180 degrees out of phase with the ones from the front and they cancel eachother out like noise canceling headphones.  The speaker cabinet prevents that from happening.  They sell tiny speakers on Digikey with plastic housings.  I haven't tried them myself as they are fairly new, but I would imagine they'll give you the most bang for your buck with minimal effort. 
Pages: [1] 2 3 ... 92