EMF pickup from amplifier in I2C line causing glitches. (Now with scope trace!) - Page 1
Forum section: electronics / projects

author: Starlord
author_rank: Frequent Contributor
timestamp: June 29, 2016, 10:28:44 pm
content: Hey guys,I've got a problem with a circuit I designed. The circuit features this amplifier:http://www.ti.com/lit/ds/symlink/tpa3116d2.pdfhttp://www.ti.com/lit/ug/slou341a/slou341a.pdf(Evalulation module)And this LED driver:https://ams.com/chi/content/download/.../AS1115_Datasheet_EN_v2.pdfAs well as several other I2C parts made by TI:http://www.ti.com.cn/cn/lit/ds/symlink/tlc59116.pdfhttp://www.ti.com.cn/cn/lit/ds/symlink/tca9539.pdfThe TI parts are working great. The AMS part however is glitching like crazy.After many many hours looking for bugs in my code, lowering the transmission speed, and enabling the internal pullups on the I2C lines to lower the resistance somewhat from the already low 2K resistors I'm using, I've determined the issue is that the 7' CAT5 cable I'm using, where I have the I2C data lines each twisted with a return ground, is picking up EMF interference from my speaker cables.I determined this was the case, because:- The issue goes away if I turn the volume all the way down, and comes back if I turn it up even slightly.- The issue persists even if I connect only one wire from the speaker to the amplifier.- The issue goes away if I increase the length of my speaker wires, and decreasing the length also seems to affect the amount of glitching.I suspect the issue arose because I did not include any filtering on the output of my amplifier. I didn't do this, because I have limited PCB space and I was trying to keep costs down so I didn't want to use a couple inductors and I wasn't sure how to choose a proper ferrite bead.This is my current schematic:[link removed]But I've been looking at ferrites and I've narrowed the selection down:http://www.digikey.com/short/347180I should mention that I have my amplifier set up in a mono BTL configuration, with a 12V supply, so the beads must be capable of handling around 40W into a 2 ohm load, ie 2-3A max. I see Digikey lists both a max current rating and a DC resistance. I assume those are related to one another and there's a number of beads rated for 3A or more.The bit I'm not sure about is what the best impedance to select is. TI had chosen a part for their EVM that was 90 ohms at 100MHz:http://www.digikey.com/product-search/en?keywords=EXC-ELDR35CI see a couple ferrites that ate 80 and 120 ohms at 100MHz. I guess those would be fine. But what about those rated 600-785 ohms? Too much?The amplifier datasheet says to select one with a resonant frequency around 10MHz but I can't see any specs indicating resonate frequency in the datasheet.But comparing a 120 ohm bead to the 600 ohm bead, it looks like the 600 might be better. At the low end where my audio frequencies would be they're about the same, but the one with the higher impedance looks like it would filter out higher frequencies better:http://katalog.we-online.de/pbs/datasheet/742792023.pdfhttp://katalog.we-online.de/pbs/datasheet/742792514.pdfOn page 21 of the amplifier datasheet it also states:QuoteI'm hoping I won't need to go quite that far, and that the ferrite bead filter will be sufficient?I was also thinking about testing this out with some through hole parts, or one or two of those little ferrite rings, if I can find one of them. I had a few prototypes manufactured without this filter in place and I'd like to still be able to use those boards and testing before I have another prototype made to see if it will even fix the problem would be good. If I did have one of those rings, is there some special requirement for them? Or a specific number of turns I need to wind the cable around it?Finally, is there any other solutions to this issue you might suggest? Like, would it be wise to put decoupling caps from my I2C data lines to ground at each end of the cable, or would that screw up the data transmission? I also considered the possibility of using shielded Cat5. If I did that, would I need to connect the shield to ground at both ends, or just at the main PCB where my power source is? Should I add a resistor on series with the shield? I'd rather not go this route because I'd have to buy new more expensive Cat5 cables and modify the design of one or both boards to add the shielded connectors, and I don't know if the shield would affect the I2C transmission.

author: moffy
author_rank: Super Contributor
timestamp: June 30, 2016, 12:12:47 am
content: I2C is not meant to drive 7' of cable, it is meant for near connections of devices on a PCB. If you have got some parts working it is amazing. Because it is bidirectional and open collector I don't know how you could buffer it.EDIT: Perhaps look at the TI chip: P82B715 I2C Bus Extender

author: Starlord
author_rank: Frequent Contributor
timestamp: June 30, 2016, 12:34:47 am
content: Quote from: moffy on June 30, 2016, 12:12:47 amThe I2C standard only specifies that cable capacitance must be below 200pF and even offers suggestions for how to run the signal through twisted pair:http://www.nxp.com/documents/user_manual/UM10204.pdfA Cat5 cable is around 52pF per meter, and I have my signals twisted with ground returns, as suggested.Also, there do exist ICs which are designed to convert it to a differential signal so that much longer runs can be achieved, but I figured as long as I kept within the specs, I was okay. And I would be okay, if my amplifier weren't putting out ridiculous amounts of RF noise.

author: moffy
author_rank: Super Contributor
timestamp: June 30, 2016, 12:42:01 am
content: "Also, there do exist ICs which are designed to convert it to a differential signal so that much longer runs can be achieved, but I figured as long as I kept within the specs, I was okay. And I would be okay, if my amplifier weren't putting out ridiculous amounts of RF noise."It's because it is susceptible to noise,i.e. 2k impedance and slow edges(cable capacitance), that it really isn't suitable for long runs of cable. You can't necessarily control the noise environment, but if you use low impedance differential drivers you are much less susceptible to noise.

author: Starlord
author_rank: Frequent Contributor
timestamp: June 30, 2016, 05:01:46 am
content: Where do you get 2K impedance from? Not questioning it, I genuinely don't understand.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 08:59:16 am
content: Hey guys,I just picked up my first scope and I've got a couple scope traces here, maybe this will help diagnose the issue?I'm pretty sure the noise is generated by the amplifier and picked up by the cat5 cable, and that putting the suggested ferrite beads on the output will resolve the issue, but I'd appreciate your input as to whether that will solve the issue before I send out for a board revision and have to wait 3 weeks to find out it didn't do anything.This is what I see on the scope when I disconnect the speaker cable from the amp:The rise time obviously isn't great, but its 400KHz I2C and it appears to be within spec. At least, assuming the rise time means the time to get above 0.7V. The spec states 300ns and it looks like its doing it in 200ns. The fall time also appears to be in spec.And this is with the speaker cable connected. And if you can believe it, this is the longer speaker cable that seems to attenuate the noise enough that the system actually works. I was pretty shocked when I saw this. I haven't even tested with the short cable yet to see how bad IT is:Note that when I probed this, I had the ground lead attached to the board, and I was probing the end of the cable. I'm not sure if this matters. It would be a bit more difficult to attach the alligator clip at the end of the cable, but I guess I should try that next and see if there is any difference. My intuition tells me I won't see much of a difference.

author: diyaudio
author_rank: Frequent Contributor
timestamp: July 03, 2016, 09:14:47 am
content: Quote from: Starlord on July 03, 2016, 08:59:16 amThe rise time on your waveform results from the probe itself, at 400KHz the 1:1 ratio is acting with the compensation network of the probe, try using a 1:10 ratio and observe results again.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 09:23:05 am
content: Quote from: diyaudio on July 03, 2016, 09:14:47 amI don't understand what you mean. It sounds like you're saying I should use the x10 setting on my probe, but it is set to x10, and I have the channel set to x10 on the scope as well.

author: Kleinstein
author_rank: Super Contributor
timestamp: July 03, 2016, 09:47:34 am
content: The rise time is way longer than 200 ns. Depending on what you use for the rise time (usually 10% to 90%, sometimes 0 - 70%, rarely 30-70%), the rise time is more like 500-1000ns. This low rise-time with all the noise (might not be as bad without the probe), glitches are expected. A 1:1 probe has a considerable capacitance and thus could increase the rise time. A 1:10 probe is not a problem at this speed.To get a shorter rise time, use a smaller pull-up. More like 1/5 the current value. At higher capacitance lower value pull-ups are needed.There should be filters at the output of a class D amplifier, unless the amplifier is right at the speaker.I can't imagine passing FCC limits without a filter, if a longer wire to the speaker is used without filtering.

author: Fungus
author_rank: Super Contributor
timestamp: July 03, 2016, 09:51:07 am
content: Quote from: Starlord on June 29, 2016, 10:28:44 pmIt would severely limit the data rate. Is that a problem?Quote from: Starlord on June 29, 2016, 10:28:44 pmThat would be thefirstthing I'd try. Transmitting data over long, unshielded cables simply doesn't work.Quote from: Starlord on June 29, 2016, 10:28:44 pmOnly at one end.Quote from: Starlord on June 29, 2016, 10:28:44 pmAs a quick test you could try wrapping the cable in tinfoil. Ground it at one end and see what happens.

author: Fungus
author_rank: Super Contributor
timestamp: July 03, 2016, 09:52:59 am
content: Quote from: Starlord on July 03, 2016, 08:59:16 amIt's awful. I'd definitely use lower value pullups.There'snolower limit on I2C pullups except what your devices can pull to ground. The lower the better.Those TI devices can sink 20mA or more on SDA (see datasheet) so you can gomuchlower than 2k.

author: Fungus
author_rank: Super Contributor
timestamp: July 03, 2016, 09:59:19 am
content: Quote from: Starlord on July 03, 2016, 08:59:16 amIt matters alot, especially on unshielded cable.Connect the ground lead to the return ground on the line you're probing.But remember the clip is connected to mains earth - watch this video:

author: 2N3055
author_rank: Super Contributor
timestamp: July 03, 2016, 10:05:07 am
content: Hi!Let me throw in my 2c...I2C bus is chip interconnect...something you use on a PCB with maybe 25cm (10 inches) distance...It is very prone to noise pickup and very sensitive to capacity of the com lines..What are you trying to do is realm of CAN and RS485 an the likes..I'm not saying that with enough duct tape (filters, buffers etc..) you will not be able to stabilize your prototype.. If you put enough effort you will but it will be hard to reproduce later and your product will be unreliable...And now shortly as to why...First, as they say devil is in details.. As you can see on your scope trace, your rise time is takes up whole signal.. It should resemble some kind of trapezoid with soft edges.. Slopes are OK, but there is no top...What that means is that while signal raises, at one point it will reach threshold to be recognized as HIGH (I know you know all this but bear with me).. at slow speed I2C has NO hysteresis, and at fast it has 0.05V (50mV).. which means as your signal slowly rises, reaches threshold level, and at that point when it is around the right level, even 50mv (and less for slow speed) will make it go up and down the threshold many times, potentially triggering logic transitions... What it will do at that moment nobody knows... By spec it should swallow pulses shorter that 50ns, or not... That is why you need quick, fast and clean logic transitions..The fact that you build a shortwave radio transmitter that poses as audio amplifier doesn't help..That thing is a EMI nightmare, filter everything, supplies, ground, input, output, sever pipes....Anyways, good luck with that, that will be great learning experience...Take care,Sinisa

author: radar_macgyver
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:05:56 am
content: Are you sure the I2C chip is picking up radiated interference, as opposed to conducted interference? Do they share a common power supply? Common AC power? If this is due to conducted interference being picked up through the power supply, adding ferrites there might be worthwhile.And yes, open-collector single-ended signals with 2k pullups are good candidates for all kinds of interference. Lower pullups, maybe experiment with a small (~10-100 pF) capacitors on the lines to form an RC filter.Quote from: Starlord on July 03, 2016, 08:59:16 amBig difference. Please see:http://www.cbtricks.com/miscellaneous/tech_publications/scope/abcs_of_probes.pdfSpecifically the section on ground lead effects (page 26).

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:13:18 am
content: Quote from: Kleinstein on July 03, 2016, 09:47:34 amAh crud. I just noticed that the I2C spec says 0.7Vdd. As in 0.7 * Vdd. I thought it was stating 0.7V is considered a high signal.QuoteI am already using 2K pull ups. These should be in-spec according to the I2C spec. And the I2C spec seems to prohibits anything less than around 1.56K for a 400KHz bus speed with 5V supply.So I don't know if I can go much lower. But I guess I should take a look at the datasheets for the chips I'm using and see if they all support fast mode or specify the current for those pins at 20mA. As for the Atmega I'm using to interface with them I know that doesn't support over 400KHz, but I know most of the pins can handle 20mA including the I2C pins when they're not being used for I2C, so I suspect it can handle it.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:15:45 am
content: Quote from: Fungus on July 03, 2016, 09:59:19 amThe first thing I did before I used the scope was watch that video.But this thing is battery powered, so no worries about blowing my scope up.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:25:02 am
content: Quote from: radar_macgyver on July 03, 2016, 10:05:56 amI'm not sure of anything.QuoteYes, a battery.But I don't believe it's a power supply issue because the noise is there regardless of whether I have the volume turned up. If the speaker is attached, the LEDs glitch, even if the volume is turned way down to where its almost inaudible. The glitching stopped when I turned the volume down to 0 however. In that scope capture, the volume was way down, but not off. I will have to do another test to see how the results differ with the volume all the way off, but I believe I did test that and there was still just as much noise.QuoteWell, I'll try that and report on what I see.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:38:45 am
content: Quote from: Fungus on July 03, 2016, 09:51:07 amConsidering I2C is already super slow and I need to update something like 32-64 bytes worth of data 60 times a second for smooth animation? Probably.QuoteI'd prefer to avoid that if at all possible. As I said before, I'd be throwing away money on the cables I already purchased, and the shielded cables are more expensive and have bulky connectors.Besides, you say it simply doesn't work yet the signal looks fine with the speaker disconnected, and the whole thing works great. I have to assume that the speaker is only causing a problem because it is in such close proximity to the cable. So if I can get rid of that noise, it ought to be fine. And if it does fail in some rare circumstances, well, that's acceptable for this setup.QuoteI guess if it comes to it, I'll try that. I don't have any tinfoil right now to test with.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 10:55:54 am
content: Quote from: 2N3055 on July 03, 2016, 10:05:07 amI spent a year on this thing, so I've got no choice but to make it work with minimal changes. On the upside, it doesn't matter if the thing isn't 100% reliable under all conditions. If it works 99% of the time that's good enough.QuoteI understand what you're saying. It's just that the signal looks pretty clean without that amp on. And I'm not sure I _can_ lower the value of the pullup resistors by much. I'll have to check and see if all the parts can handle lower values. The 2K I'm using right now is really close to the 1.56K minimum the I2C spec states for 400KHz operation, but I know at least some of the chips I have support higher speeds so they should be okay with lower pull ups. But dropping that to 1/5th... 400 ohms... that seems crazy. At that level I'm afraid it might start acting like a voltage divider and pull the line up from 0V when it's supposed to be low. Plus that SMT resistor is probably gonna get pretty warm.QuoteWell, I followed TI's reference design. They said the filter part was optional, so I took them at their word. :/

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 11:08:57 am
content: Quote from: Fungus on July 03, 2016, 09:52:59 amAnd the AS1115? I'm also running a MCP3021. Looking through their datasheets I can't see any clear indication they can sink 20mA. Though if the AS1115 is to spec for the 1MHz bus it supports, then that at least should be able to handle 20mA. But the MCP is a 400KHz device.And the Atmega1284P two wire serial bus electrical characteristics state the minimum pull up assuming 3mA... it's not clear if they're just referring to the minimum to remain in spec for that bus speed or if those pins have some special requirement in I2C mode.

author: 2N3055
author_rank: Super Contributor
timestamp: July 03, 2016, 11:13:59 am
content: I understand...If you just have to make it work, you should try active pullup.. It will clean up transition edges, and actually will clean up some of interference..I also agree, what you see is probably conducted interference.. So you should play with grounding things differently...And yeah, datasheet said it was OK...I heard that one before.... Believed it too..As I said, that's a 20W AM transmitter... It will spray all kinds of nastiness.. And it is doing it without any audio input, it's a PWM scheme.. It might be a bit more efficient that older chips, but it does it by keeping switching pulses short when idle... Meaning higher frequency spectra and better coupling to everything around..But as I said, I would be suspicious about noise into ground injection, so play with the grounding setup...Take care!

author: Monkeh
author_rank: Super Contributor
timestamp: July 03, 2016, 11:21:41 am
content: Quote from: Starlord on July 03, 2016, 10:55:54 amIt may well be optional.. if you're not attaching a fricking antenna.A datasheet is not a step-by-step tutorial on building a device.

author: Someone
author_rank: Super Contributor
timestamp: July 03, 2016, 11:21:57 am
content: Quote from: Starlord on July 03, 2016, 10:55:54 amWhy does ithaveto work?Quote from: Starlord on July 03, 2016, 10:55:54 amIt probably works wonders if you couple it directly to a speaker without filtering.

author: Fungus
author_rank: Super Contributor
timestamp: July 03, 2016, 12:41:38 pm
content: Quote from: Starlord on July 03, 2016, 10:38:45 am64*60*10bits=38400bits.Back-of-the envelope math suggests you can go a lot lower than 400kbps.Try the tinfoil wire shield first. Its quick to try it, it might be enough. If it works then you can look for something prettier.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 02:01:18 pm
content: Quote from: Someone on July 03, 2016, 11:21:57 amBecause it's a product that I spent the better part of a year working on and have invested thousands of dollars into. I bet everything on it - it's a revision of an earlier design that had its own share of completely different issues but sold well enough to keep me in business, barely - and I've run out of time and money.I couldn't even afford to buy this scope, but last week I was in a panic when everything stopped working as soon as I moved it from the workbench, where it had been working fine for the last three months, into the final enclosure. I spent a day running 50 different tests, mostly code changes since there wasn't much I could think to test electrically without a scope, and when I ran out of ideas for tests I ordered the scope, and the next morning I realized there were a few electrical tests I could try, like different speakers, isolating the speakers from the metal portion of the chassis, and shorter speaker wires. It was then that I found disconnecting the speakers resolved the issue, and from there I figured out that the speakers I had on the bench worked, and then I discovered those only worked because I hadn't cut their leads short.Anyway, it's not like I chose I2C without being certain I could make it work over long runs. I did my research, and if what should work in theory didn't work in practice, I could always use one of these chips:http://www.nxp.com/documents/data_sheet/PCA9615.pdfOf course I hadn't counted on this issue only rearing its ugly head in the 11th hour. Probably should have invested in the scope sooner, but I was working with an extremely limited budget.

author: Monkeh
author_rank: Super Contributor
timestamp: July 03, 2016, 03:08:18 pm
content: Quote from: Starlord on July 03, 2016, 02:01:18 pmStop.You've just built a radio transmitter with no regard for what bands it tramples. Think long and hard before you sell this.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 03, 2016, 04:11:46 pm
content: Quote from: Monkeh on July 03, 2016, 03:08:18 pmDid you miss the part where I said I'm going to be adding the suggested ferrite bead filter, also used on TI's evalulation module for this amp, which they sell?

author: georges80
author_rank: Frequent Contributor
timestamp: July 03, 2016, 04:31:34 pm
content: Quote from: Starlord on July 03, 2016, 02:01:18 pmRegardless of whether you spent a year on it or not, you unfortunately made a poor decision to assume I2C was capable of running single ended over that kind of cable distance while being directly driven by a uC etc.I2C is a chip to chip interface and designed for single board usage or at most boards connected together in close proximity (inches not feet) without adding differential or opto isolated drivers.Regardless of how you try to convince yourself you need to make it work as it is, you will have field issues. You can't even get it working reliably with your test setup and if you think this is a product you can sell, what happens when people connect it with 10' of cable or 15' feet of cable in their deployment? What happens if they have various RF sources nearby, etc?"Anyway, it's not like I chose I2C without being certain I could make it work over long runs."Umm - well you made a big mistake there... I2C could likely be made to work, but it would NEED buffering with appropriate line transceivers to deal with the cable length and interference sources. Wrapping at least some kind of CRC/retry around packet transmission seems like a good idea as well. A design we implemented at work that is intended to sell in LARGE volumes use SPI and even though the interfaces are only inches apart we have checksum and packet retry/timeout implemented (interprocessor comms) just to be sure we can detect any performance and/or signal integrity issues and deal with them.Finally, I2C given it is ONLY (most of the time) actively driven low is a poor electrical signaling scheme when you are dealing with capacitive loads, cables and external interference.Sorry, but I'd hate to purchase your product if you didn't even have a scope before to verify what your margins and signal integrity looked like. Seems like you have designed something, built it, seems to work and you're off selling it without any verification at the electrical level. That's what I'd expect from a software engineer dabbling in hardware...cheers,george.

author: Someone
author_rank: Super Contributor
timestamp: July 03, 2016, 10:48:38 pm
content: Quote from: Starlord on July 03, 2016, 02:01:18 pmYou're pushing forward on some very poor designs and then asking for a free and cheap fix so you can profit.a) businesses pay for help through hiring contractors or consultants.b) there aren't any free fixes for your problems, they're going to need substantial changes.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 04, 2016, 02:45:56 am
content: QuoteWell, if it barely works at 7' then it won't work at all if they try to use a 10' or 15' cable, so that would prevent them from doing that.But seriously... the product comes with a 7' cable, and that's what it's designed for. No more, no less. If I design an unpowered USB hub to work with cables up to 10' and it doesn't work with cables that are 25' is that a design flaw?And if they have RF sources nearby that cause the product to stop working, it's not that big a deal. If you had a circus performer wearing a suit with blinking LEDs all over it and it stopped working when he was standing next to cars with actively transmitting CB radios, would that be a big deal to them? Probably not. What is a big deal though is actually getting the suit of blinking LEDs they paid for, and getting it at a price that won't break the bank. That's not what this is, but I have actually had people contact me to construct things like that and they wanted it to cost them less than $500.Also, I should point out that in my tests, moving the speaker just one inch further away from the cable was sufficient to reduce the interference to the point where everything started working again. So thanks to he inverse square law, I can say with fair certainty that random radio transmissions would be unlikely to affect it, because they would have to be very close and/or extremely powerful.I would also ask if you think that WiFi routers are poorly designed because they stop working when a microwave is active nearby. Sometimes you have to accept interference.QuoteAnd I'd hate to contract work out to you if after paying you $500 to design it and waiting a year you said"Sorry, I'm gonna need another $500 and another year to design a new revision because I made a mistake in the present design. It works well enough for your needs, but I can't in good conscience sell this to you in its present state. It's not dangerous, but this guy on the EEVBlog forum said it was bad design and I'm a bad engineer."PS:I -am- a software engineer dabbling in hardware. I was a software engineer for 20 years, but couldn't make a successful business out of it. The most successful product I ever had only brought in $200 a month. Then I picked up an Arduino. Six years later and I'm more in love electrical engineering than I ever was with software, making quick progress, and actually making a little money for once.As for not owning a scope, I've been working on an extremely tight budget. When you're barely making rent each month, it's hard to justify spending $400 on something that might only make the thing you have that works work slightly better. And it's also hard to justify spending $100 on a crappy old used something when you have your eye on a brand new beautiful $400 something that you might be able to afford next month, maybe.

author: Monkeh
author_rank: Super Contributor
timestamp: July 04, 2016, 02:58:01 am
content: QuoteAnd how much are your random radio transmissions affecting other things?QuoteBut that does not mean you're allowed tocreateit.

author: georges80
author_rank: Frequent Contributor
timestamp: July 04, 2016, 03:08:49 am
content: Re: OP reply #29.Ok, good luck to you. That post fills in lots of your background thinking (interesting take on product reliability/functionality).And I've quoted companies to do projects and had to then re-run boards (on my dime) since I found issues with the initial prototype design/layout. That's why when you quote you have to factor in some fudge factor based on your confidence to get the initial prototype working correctly. I also have timelines in my quotes that are achievable or let my customer no if there are any delivery risks. Most of my designs are mixed hardware/firmware. Yes, I've made a living for 10+ years doing various contract designs so have a tiny bit of experience in this area.cheers,george.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 04, 2016, 03:28:52 am
content: Quote from: Monkeh on July 04, 2016, 02:58:01 amI'll answer your question with one of my own:How many of the millions of products imported from China every year by Americans do you think actually go through rigorous emissions testing processes?And just how strong do you think a signal from a device drawing only 2A at 12V is going to be? I admit, I'm no expert on analog, but I'm pretty sure electromagnetic radiation is electromagnetic radiation, so I think it's safe to say that one can visualize how powerful a transmitter is by envisioning how bright a lightbulb would be when driven with that same current. And 12V/2A? That's 24W. So imagine how dim a 40W bulb is, and then halve that, and take it outside at night. I've got a hundred watt bulb on my porch and it can barely illuminate my grill 10' away.Now if you are shipping hundreds of thousands of devices with 40W bulbs in them, then sure, I could see how that might be a serious concern. I'm shipping less than 100 devices a year, in a sea of millions of untested competing products from China. And like I already said, I'm gonna be fixing the amplifier and putting a filter on there, so we're good right? I mean maybe there's some other emissions from the circuit that I have no way to test for, but they're likely to be so weak (the rest of the circuit is 5V) I really don't see the problem.

author: Monkeh
author_rank: Super Contributor
timestamp: July 04, 2016, 03:31:52 am
content: Quote from: Starlord on July 04, 2016, 03:28:52 amOther people get away with it so you can too!Don't hold yourself to any standards or anything.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 04, 2016, 08:23:03 am
content: Message sent.Tim

author: dmills
author_rank: Super Contributor
timestamp: July 04, 2016, 12:42:16 pm
content: Quote from: Starlord on July 04, 2016, 03:28:52 amWell I can routinely send radio messages around the world at the sort of frequencies that thing will be radiating on with less then 10W of input power, but the real problem is that you might be stomping on stuff within a few miles, not that you might be stomping on weak signal comms halfway around the planet, if you cause interference to an FCC licensed service, folks will come looking, and they will find your customer, what does that do for your reputation?Light bulbs are typically < 10% efficient, and light does not really bounce off the ionosphere, radio kind of does.Class D power amps are a wonderful thing, but you do by god have to be careful about radiated emissions, especially when a speaker cable is in play (as opposed to a speaker mounted within inches of the board), it is unlikely that ferrite beads alone will get the job done, you probably need an L/C network on each output (Maybe even a couple of poles).Yes, you can do filterless class D, if the amp is right on the back of the speaker and if the whole dogs dinner is in a metallic enclosure, and if your layout is sufficiently tight, otherwise, just don't go there (Your problem is orders of magnitude worse because of the external cable).I would seriously look at a few hundred ohm pullups on that I2C link, your edges are horrible at the moment, and I would probably look at SPI instead even if I could not go for something intended for this kind of thing (485/CAN/Whatever), it has the virtue of active drive in both states, so is somewhat better behaved.A 7 foot cable will be a a quarter wave resonator at 35MHz, a halfwave in the 4M band, and a full wavelength somewhere around the 2M ham band, if it radiates they will hunt your users down.You might want to look at what the fines the FCC levied a few years ago on musical equipment makers who failed to play by the rules were like, tens of thousands of dollars and up, and they can come after US companies more easily then Chinese ones....Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 04, 2016, 09:29:13 pm
content: Quote from: dmills on July 04, 2016, 12:42:16 pmhttp://[url=http://www.ti.com/lit/ds/symlink/tpa3131d2.pdfQuoteQuoteI don't know how one could interpret that to mean anything other than that this amplifier is designed not to need an LC filter in most applications involving speaker wires which are less than 4' long. Mine are less than 2' long.Btw, without the ferrite bead filter, issue goes away with a 10' speaker cable that has been coiled up so it's 2' long. I haven't checked with the scope to see how the signal is affected, but I assume this is because the emissions are reduced somewhat. I'm not sure if it's the length or the coiling or both which is reducing the emissions though.QuoteI would seriously look at it as well, except I can't tell from the MCP3021 ADC datasheet if it can sink 20mA:http://ww1.microchip.com/downloads/en/DeviceDoc/21805B.pdfAs for using another kind of bus, I don't know why people keep suggesting CAN busses and the like. Is there any way making that switch would not result in having to almost completely redesign the circuit and rewrite all the code? There are several I2C chips at the end of this cable. I don't know if they even make LED drivers that communicate over a CAN bus, and I don't know if they make a CAN to I2C converter. Even if the latter is true, learning about how the CAN bus works and implementing such a solution would likely take weeks, and there's a high probability I'll screw something up which would then add another 3-4 weeks to get a new prototype made.What's wrong with a chip like this?http://www.nxp.com/documents/data_sheet/PCA9615.pdfOr one of these?http://www.ti.com/lit/ds/symlink/p82b96.pdfhttp://www.ti.com/lit/ds/symlink/p82b715.pdfThat last one seems like the best option, as you can just stick it inline with the existing cable and use the same number of data lines as before. In my case, if I had to give up two additional lines on the Cat5 cable, I'd have to choose between reduced functionality, or getting rid of one pair of 5V/GND lines, which I added in the first place to reduce voltage sag and I'd have to go over everything again to figure out where too much sag might cause issues.QuoteWell the I2C communications are 400KHz, and the speaker cable isn't 7' long. I don't know if the cable can re-radiate the noise from the speaker, but I already mentioned I would be dealing with that.QuoteI'm sure those were big companies selling tens of thousands of units. And they may not be able to go after Chinese companies as easily, but they can't tell the thing emitting is made in China unless they examine it. And when have you ever heard of them knocking on a random citizen's door and questioning them about their hoverboard?Also, there are 318 million people in the US, and my devices will be in the hands of a couple hundred of them, if I'm lucky. I have a better chance of winning the lottery than having the FCC show up on my doorstep over a device that will be used 3 or 4 times a year for a few hours by the end user.Anyway, I said I'll be adding the ferrite bead filter to the amp. And there's not much I can do about the I2C if you think that 400KHz data at extremely low power is an issue. Do you think that's an issue? It wasn't clear. I was considering making a switch to shielded cable at some point, but only if I was still getting glitches. Surely 3mA a 5V is not going to make a powerful enough transmitter to catch anyone's attention.

author: tautech
author_rank: Super Contributor
timestamp: July 04, 2016, 10:06:54 pm
content: Quote from: Starlord on July 04, 2016, 09:29:13 pmStarlord, remove the [ quote ] on the third line. (I think)

author: Starlord
author_rank: Frequent Contributor
timestamp: July 04, 2016, 11:23:00 pm
content: Did some more testing. Here's what I found:With no speaker or speaker cable connected my 5V supply is fairly clean:[link removed]With just the speaker cable connected and hanging in the breeze I see noise on the 5V supply:[link removed]And if I touch just one lead that is attached to the speaker to the amplifier output, the noise is much worse:[link removed]I calculated from those peaks (because I couldn't trust the triggering to report the right frequency) that they're at 1MHz. So what I think I'm seeing here is wideband noise of many frequencies all greater than 1MHz. So I'm thinking the ferrite is indeed the right way to go, but I need help selecting one.As I mentioned before, this is the ferrite TI used in their evaluation module:http://www.digikey.com/product-search/en?keywords=EXC-ELDR35C10 mOhm DC resistance, 90 Ohms @ 100Mhz, 7A current rating.I narrowed down the selection of SMT ferrite beads to these based on size, current handling, DC resistance, and impedance:http://www.digikey.com/short/348zc8I calculated the current handling by assuming two 4 ohm speakers, a 12V supply, and 90% efficiency. That gave me 3A for the worst case, a square wave at max volume. Average case with real world audio is probably more like 1.5A or less.Not sure where to go from here. Should I select a ferrite with as high an impedance at 100MHz as I can get because I need all the impedance I can get down at 1MHz? (While examining the graphs to see which are really better at those lower frequencies of course.) Will a DC resistance of 2-3x as high as the TI part be okay, but very slightly reduce the speaker volume and increase the heat dissipation in the bead? And how can I tell if it will have a self resonant frequency below 10MHz as specified in the datasheet?I've also looked at inductors as an option, but they're really too large. At least the 10uH ones specified in the datasheet and I'm not sure how to properly select a different size.

author: tautech
author_rank: Super Contributor
timestamp: July 04, 2016, 11:33:20 pm
content: You can't explicitly trust what any scope displays unless the trigger level is set within the amplitude of the displayed waveform.Channel AC input coupling is also useful for viewing ripple/noise on a DC rail at low V/div settings without needing to adjust the offset/vertical position.EditThis needs fixing too in reply #36:http://http://www.ti.com/lit/ds/symlink/tpa3131d2.pdf

author: dmills
author_rank: Super Contributor
timestamp: July 04, 2016, 11:39:01 pm
content: "There may be a few circuit instances where it is necessary to add a complete LC reconstruction filter. These circumstances might occur if there are nearby circuits which are sensitive to noise. In these cases a classic second order Butterworth filter similar to those shown in the figures below can be used."Noise sensitive circuit, sounds like the very definition of I2C to me......Note also the essential requirement that the speaker leads be twisted, this makes a huge difference to radiated B field.And the companies the FCC went after that time were folks doing boutique guitar pedals and amps, not just million selling multinationals.How are you grounding your scope probes, that three inch long lead with a croc clip the probes come with is worse then useless for the fast stuff and will turn any kind of fast transient into the mess you are seeing on the screen.SMT beads do snot all at 1MHz, you might be seeing some action by 10MHz, but really even a 1uH shielded inductor will do better.Looking at the ring down on that scope trace, I would say that your snubbers would probably benefit from some attention.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 01:27:47 am
content: Quote from: tautech on July 04, 2016, 11:33:20 pmYou you mean have the little T symbol within the region that includes the yellow waveform? I'm aware of that, I just happened to not have it there when I took the screenshots.I found that depending on where I located it within the waveform, I got different results, and as I assume it triggers on every rising slope, I could see how I might get different results based on where I put it and that because the peaks were different heights and those were really what I wanted to know the frequency off, I couldn't be sure no matter where I put the trigger it would be reading those and not some higher frequency perturbations.QuoteI don't know what that means. I only got the scope a few days ago.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 01:37:39 am
content: Quote from: dmills on July 04, 2016, 11:39:01 pmI agree. And that is a concern. But that's why I posted the scope traces. They appear to show that the noise is in the MHz band, not the 400-600KHz switching frequency of the amplifier. I'm not sure how it's generating noise in the MHz band though.QuoteTwisting the speaker wires was one of the first things I tried, and it did not appear to affect the glitching, but I didn't have a scope on hand when I tested that to see what if anything it did.QuoteI'm using that three inch long croc clip. I've never seen anyone, including Dave, use anything else, it's all I have, and I only got the scope a few days ago. What do you suggest?QuoteI assume I would have to look up an LC filter calculator, plug in 1uH and, and specify the corner frequency I want to filter to get my capacitor size? The datasheet only specified the right cap size for a 10uH inductor.QuoteSnubbers?

author: tautech
author_rank: Super Contributor
timestamp: July 05, 2016, 02:31:23 am
content: Quote from: Starlord on July 05, 2016, 01:27:47 amSelect channel #, input coupling, AC.This removes the DC component of the waveform and displays the AC component riding on the DC.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 05, 2016, 03:10:06 am
content: Quote from: Starlord on July 04, 2016, 09:29:13 pmIt will, as well as the power cord and signal input.Likely, the waveforms you are measuring are common mode. Try this: clip the probe tip to the ground clip, and poke that to circuit ground. You'll probably see the same waveform.In fact, almost all places you measure those blips, you'll be measuring the (common mode) ground error -- you have to mentally subtract that from the measurement to see the actual signal.Again, like I said in the message -- this isn't something that can easily be solved by ferrite beads.As an overall business decision, this seems to be the worst possible path, for someone struggling to make ends meet:- You've spent a year in development (possibly discounting your labor to zero in the process?)- You're creating a product which will earn a small amount of money immediately (past success, I guess, is a few hundred/mo? Are you projecting more for this?)- You're driving head first into a huge liability, likely worth more than the total sales.- Can you absorb that cost, when (not if) it comes up?If the answer is no, then as the movie said: "the best decision is not to play".Your best business (and life!) decision should be, find a job, maybe some contract work -- anything to fill immediate demands. Keep working on projects in what spare time you have, and when they're ready for the world, give it a try.Regarding Chinese products:Importers are liable for that cost. Do they cheat by diversity? (Does it matter? Would the FCC classify the products by type and levy a bigger fine for the collection?) Do they turn enough profit anyway, from the sheer quantity and variety of imports (that presumably don't violate rules) that it's a net win? (Remember, legal costs are just another operating cost -- whether the parties are rivals or the government!) Repeated violations by a company might earn them more trouble, but so it goes.)QuoteIt can. The falling edge has much more than 3mA peak at the driver, and the signal levels to meet Part 15 Unintentional Radiator are in the millivolts (and ~microamperes).The distance between functional noise levels (low enough that the system doesn't interfere with itself) and regulatory noise levels (the system doesn't interfere with most radio services) is a huge gap. 60dB or more -- a factor of a thousand in voltage or current!Tim

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 04:17:36 am
content: Quote from: T3sl4co1l on July 05, 2016, 03:10:06 amImagine if Steve Wozniak had taken your advice when he was building the first Apple in his garage. No Apple. No personal computer revolution. No "How about a nice game of chess?"https://en.wikipedia.org/wiki/Ribbon_cableQuote

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 05, 2016, 06:08:21 am
content: I don't see your point. Essentially no commercial systems from that era exist that aren't covered with heavy metal shields! Early prototypes, perhaps, but how many of those were sold? Were they recalled? Disposed of? Repaired? At whose expense? Such less-than-proud history is unlikely to be found in a company's public history file.If anything, I'd say the FCC ably performed the job they're charged with. Though it's not clear how long it took them to crack down.(Also, that's a nice paragraph, but the [citation needed]s are kind of a shame. I'd love to see some articles about that. That'd probably require digging through a lot of old, non-internet-accessible records, though..)By the way -- you're sort of implying that it's okay* to break federal rules. Which, against a different part of the federal code, is no different from suggesting that, say, drug lords are just as entrepreneurial as Woz.Which, under some cases, may be no less true (though, much less publicized!). In fact, I don't doubt at all that there are some quite skillful players in that market. But that makes it no less illegal of an act.And suggesting to others, that such action is worthwhile, is often just as criminal. (I kind of doubt that the FCC has "conspiracy to transmit illegal emanations" in the criminal books, but it would certainly be irresponsible of anyone else to follow such advice.)*Financially, legally, or otherwise. This is a legal argument only. I'm not getting morals involved here, whether the act itself is moral, nor whether the laws are.Tim

author: Someone
author_rank: Super Contributor
timestamp: July 05, 2016, 07:58:22 am
content: Quote from: T3sl4co1l on July 05, 2016, 06:08:21 amTo be fair Apple did sell a disk drive connected with a rainbow ribbon cable:http://ca.meron.cc/post/disk-ii/'78 copyright '79 date codesBut they changed to round shielded cables in future external interfaces.

author: dmills
author_rank: Super Contributor
timestamp: July 05, 2016, 09:41:15 am
content: Herehttps://e2e.ti.com/support/power_management/simple_switcher/w/simple_switcher_wiki/2243.understanding-measuring-and-reducing-output-voltage-rippleis a decent discussion of measuring high frequency stuff in switching power circuits. Note in particular the improvement when using a very short spring clip rather then the hopeless three inch wire with croc clip (The things are ok for strictly audio band measurements, but forget it for anything with RF involved).Switch mode power devices like the one TI show above have much in common with class D power amps.As to why the high speed stuff breaks the low speed I2C bus, it is down to the noise coupled into the I2C lines close to the transition threshold causing the slowly rising I2C signal to cross the threshold multiple times, the fact that I2C is only specified to 400kHz does NOT mean it is immune to energy a decade or so faster then that.What is your board stackup, and is it the same as the TI eval board for the power amp? IME such things need to be on at least 4 layer boards to work well because you need a solid ground plane to stand any real chance at all.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 10:28:37 am
content: Quote from: T3sl4co1l on July 05, 2016, 06:08:21 amAs Someone pointed out, they did indeed sell drives with exposed ribbon cables commercially.QuoteWell going by the copyright date Someone listed, and the date the Wikipedia article states they took action, then it sounds like they got away with it for 2-3 years, assuming they weren't forced to immediately change their design.QuoteWell, I have plenty of arguments to make regarding that:Consider Uber, AirBNB, and Paypal. And all those handling bitcoin. All businesses which were/are outright illegal under current codes, or whose legality was in an extreme grey area. These companies exist and are worth billions because the people running them didn't let a few pesky laws deter them. They got big first, and then forced the law to change, or changed their businesses after the fact to become compliant. And the early bird gets the worm, so even though some big retailers decided they wanted to get in on running their own electronic payment systems, it's now too late. And it's too late for anyone else that wants to run their own ride sharing or crowdsourced bed and breakfast service.Now add Segway and all those electric scooter/skateboard/hoverboard companies. All selling products whose use, under the law as written, are illegal. Could they be held liable for selling devices which count as motor vehicles which they know can only be used illegally, and to kids no less? Perhaps. Of course the flip side of this argument is hoverboards, which due to no care being taken at all in their design caused a lot of fires and bad press, and while I wouldn't advocate putting out an unsafe product, those companies did make a lot of money by rushing a product to market when that fad was at its peak. Money they wouldn't have made if they'd waited around to make sure their products were perfect. And to be fair, the problem wasn't so much with the design being rushed, but rather using recycled or out of spec lithium cells.And speaking of electric vehicles, let's add drones to the mix. The FAA would love to make them all illegal, and we might have seen a similar fight with them, if it were not for companies rushing millions of them onto the market faster than regulators could react. The FAA is trying to get people to license the things, but we all know they're only going to succeed in getting the professionals to do so. Joe Q. Public who got a drone for Christmas can't be bothered registering his new toy.Want to add drugs into the mix? Okay, let's talk about alcohol and pot. Both outlawed. Both made legal (or in the process of it) only because people rebelled for years and used them anyway. And if they hadn't, the government would have had no reason to change the law, and the public pressure wouldn't have been there to make them.So how does any of this apply to meeting FCC / CE regulations?Well, if the US / UK wants to remain a competitive player in a global market, in a world were more and more people, like me are able to design and sell electronics online, people who, like me, can't afford to spend over $14K on testing alone (https://www.quora.com/What-is-the-average-cost-to-get-FCC-and-CE-certification-for-a-very-simple-electronic-gadget), and where competition from China and Hong Kong (and soon India), aren't bound by such pithy things as regulations, and who have their shipping costs subsidized by the government on top of that, then regulations are going to have to change. If the FCC wants products to be tested, then the government, not the small business owner, should bear the brunt of those costs. And regulations, which are clearly too strict, because even with all those billions of untested products coming in from China the world has not devolved into chaos, need to be relaxed.Do you think Adafruit and Sparkfun got big by rigorously testing every device they sold? Of course not. And why should they, when their parts are just going to be stuck in people's art projects or whatever with wires going everywhere and no attempt at shielding being made? Now, legally, they might be in the clear because those items are classified as electronic kits, but speaking from an ethics standpoint, is what they're doing really any different from releasing a finished product that you know is going to emit EMF? I would say not really. The end result is the same, whether someone has to solder the battery holder and neopixels onto their blinky shoe thing or not.The long and the short of it is that in today's economy one needs to be willing to take risks and bend/break the rules if they want to be successful. Even Oculus took a huge risk when they launched that Kickstarter campaign, because even with billions of dollars from Facebook they're still having trouble delivering such a complicated device. I have no doubts that Palmer Luckey would now be branded a failure and a fraud if his campaign had only just met its funding goal and/or someone with deeper pockets hadn't come along to help out. But if he hadn't taken that risk, he wouldn't be worth $700 million dollars today, would he?

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 10:46:06 am
content: Quote from: dmills on July 05, 2016, 09:41:15 amI dunno... you're not making a very good argument here. I mean, sure, the measurements are more accurate, no argument from me there, but does it really make a difference in this application? If anything, it's merely makes the noise look a bitlesssevere. But the peaks are still clearly there. If i went to all the trouble to do this on my board, maybe I would see half the noise, but what's the point? It would still be causing glitches. I guess I could be a little more certain if my filtering would be sufficient to allow me to scrape by, but that's it.QuoteIt's a two layer. Another move to reduce costs. The ground plane is fairly unbroken around the amplifier though, and it's right next to the power input and some big capacitors. I also isolated the power plane from the rest of the circuit as best I could. I'm sure this isn't as good as a four layer board, but it is what it is.

author: Andy Watson
author_rank: Super Contributor
timestamp: July 05, 2016, 11:17:11 am
content: Quote from: Starlord on July 05, 2016, 10:46:06 amWhat is being said is that without proper grounding you could be chasing problems that do not exist or are insignificant. Here is a thread with some good links to videos about grounding scope probes:https://www.eevblog.com/forum/beginners/current-measurement-70275/

author: dmills
author_rank: Super Contributor
timestamp: July 05, 2016, 11:43:33 am
content: Seriously, pick up a cheap SDR and use it to make some frequency domain measurements, cost is only a few hundred quid (You can make reasonably satisfactory near field E and H field probes out of thin coax), and it will at least tell you where the glaring problems are (My bet, radiation from **all** the external cables, power, signal, you name it).Hell, hire a spectrum analyser and calibrated Yagi, you can do much in an open field site for a day or twos time expenditure and a few hundred in hire costs, of course this might tell you that you have a serious problem, but precompliance work like that is much cheaper then failing at the test house for something you could have caught and fixed.The FCC only got into the act after the early days of the home computer thing were over (Because they were causing so many problems), so those ribbon cable connected peripherals were ok at the time they were produced, but there was also much less use of the RF spectrum and it was mostly transmitters at far higher power levels then is common today, so the interference was somewhat less of an issue.It is one thing to do a rush to market job when you know what you are doing, sure you might stuff up, but the basics will be there (Filter the switching converter, input power and output as appropriate), design with reasonable margins, you may get it wrong, but it will probably not be horribly wrong. It is quite another to go there without the understanding to read between the lines of a datasheet (And you always have to read between the lines on a datasheet, they are as much marketing as technical in many cases).For example note that the app note for that power amp notes that if external DC power is used the cheapest way to keep radiation from the supply cables down may be to do a proper filter in the speaker output connections, major hint, also the presence of locations for snubber RC networks on the eval board, another not unreasonable hint. I would take the fact that all of the diagrams show an output filter as a sign that while it may be possible to pull off a ferrite bead filter, it is problematic to do well, doubly so if you don't have the tools to test it (Beads saturate, and they seldom give you a curve for current Vs inductance, unlike a proper inductor)....You do things like filterless (Or bead inductor) when you are doing a run of 50,000 pieces or so and you can amortise the cost of the extra prototypes needed to get it right over the volume, for a run of a couple of hundred the extra prototyping pain will kill any savings.The 10MHz thing is also not asking for a bead having a self resonance at 10MHz, but for a bead/capacitor network having a combined resonance below 10MHz, not the same thing at all.Odds are if you can find a decent experimentally oriented ham radio club, you could get some useful hints there, and those guys understand this stuff (And may well have a spectrum analyser available).In terms of bringing a product to market compliance testing is small beer, a year of engineering time (nothing much takes significantly less then this when you include everything) has a cost of at least £40K just in pay even if you ignore the hidden costs (at least 80K total is more like it), now add marketing, market research, moulded cases, production set up, all that stuff, and if you get any change out of £150K for a new product intro you are doing very well, £10K or so for the test house? Big deal.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 01:54:57 pm
content: Okay, so I'm considering the possibility of foregoing the ferrite bead and putting an LC reconstruction filter or whatever you want to call it on there. Looks like a low pass filter to me.But a 10uH inductor is too large, so I decided to do some calculations and see if I could get away with using a smaller one.I found this calculator:http://circuitcalculator.com/lcfilter.htmSo the first thing I did was I plugged in the values TI provided for the components. 10uH and .68uF.So, L = .000010H and C = .00000068F. This gave me F = 61033 Hz and Z = 3.8348 ohms.Okay, that seems to pass the sanity check. 61KHz would be in the range of what I might expect for a low pass filter that should leave the audio frequencies untouched.So let's see what I can find on Digikey for shielded SMT inductors that are small (0.1" or less) and have high current handling capability:http://www.digikey.com/short/3482r2Okay, so looks like I've gotta design around something in the 1uH range. Let's plug that into our calculator, along with a 10uF cap. L = 0.000001H, C = 0.00001F.Hm... F = 50329Hz. That's fine. And Z = 0.31623 ohms. Uh oh. My gut tells me that Z should be higher if it's to attenuate the noise as much as TI's suggested values.Well, I can't really use an inductor twice the size. I wonder if this will be good enough? Time for another calculator. I couldn't find one which graphs the frequencies with just LC input, but I found an RLC one. I'm guessing for R I should input the DC resistance of the inductor. So I'll do that and see what I get.Here's the calculator:http://sim.okawa-denshi.jp/en/RLCtool.phpLet's try this one from Bourns. Fairly typical values:http://www.digikey.com/product-detail/en/bourns-inc/SRP2512-1R0M/SRP2512-1R0MCT-ND/4876867So I input 49m ohms, 1uH, and 10uF into the calculator and...Fc = 50KHz. Okay that passes the sanity check.Well, that's interesting. The bode diagram shows a relatively flat response up to around 50Khz where there is a peak, then after 60KHz there's a linear drop, and around 1MHz it reaches a 50db reduction.How much is a 50db reduction?http://www.satsig.net/lnb/db-calculator.htm100,000x? Well damn, that's more than enough I think. And hell, 10K would probably be sufficient. I could reach a 40db reduction with a 0.5uH inductor and 10uF cap.Thoughts on going this route instead of using the ferrite bead?

author: dmills
author_rank: Super Contributor
timestamp: July 05, 2016, 03:09:29 pm
content: Better, but you are still not, I think doing it quite right, far better to use something like ltspice (Free download, and pretty standard for this sort of thing) and remember to include the speaker as a load resistor.With 10u you are going to get a lot of peaking at ~35KHz (~10dB) and the impedance seen by the amp falls off a cliff at the top of the audio band which may put the amp into current limit, I would be thinking less then 1u, maybe an order of magnitude less.(1u + 100n) in each leg into 4 ohms comes out to -23dB @ 1MHz, -65dB @ 10MHz and more or less flat below 400k, your switcher is running at 1MHz, so there is no real need to put the filter too close to the audio band, especially if it puts a deep low impedance point where it can be expected to trip the power amp overcurrent protection.Filters have two ends and you need to remember to keep an eye on the admittance at the input side or you can get into trouble, you essentially have to design the filter for a specific load impedance which means that you cannot just trade L for C (Keeping the corner frequency constant) without changing Q.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 05, 2016, 03:25:35 pm
content: Quote from: dmills on July 05, 2016, 03:09:29 pm1u + 100n? You mean, two capacitors to ground, plus a 1uH inductor in series? Why two, so close in value?Also, it's a 2 ohm load, sometimes. Two 4 ohm speakers, in parallel, configured as a mono bridge tied load.QuoteI know I've been talking about filtering a 1MHz signal, but I'm not even sure where that 1MHz signal is coming from. From what I can tell in the datasheet, the amp should be switching at 400KHz.

author: dmills
author_rank: Super Contributor
timestamp: July 05, 2016, 03:39:37 pm
content: Ok, so re do the sim for a two ohm load, and fiddle to taste, no biggie.What I meant was a 1uH inductor in series with each (Tied) output from the amp and a 100nF cap to ground from the speaker end of each inductor, very routine for class D (two inductors and caps per combined output channel).Now you are going for 2 ohms, so maybe a little more cap would not hurt, possibly 220n instead of 100n, whatever, basically you have fixed L & R, so you need to set C to avoid excessive current draw or excessive peaking (tends to be the same thing), and take the corner being what it is.IIRC that chip will go at up to 1.2Mhz, and you might be seeing spikes from both outputs, check the datasheet for the output timing diagrams.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 12:15:19 am
content: Ive never used LTSpice before, but I installed it and it looked old and shitty, so I tried setting up a circuit in Digikey's PartSim which I had working in five minutes and graphed the output, but I'm not sure the output I'm seeing is accurate and their parts don't provide many parameters to adjust, so I guess both tools have their serious flaws. I went back to LTSpice and am now trying to set up a simulation, hoping it actually has a graph and noise function like Partsim so I can see a graph of the falloff, but god this software sucks. I mean they got nothing at all right about the interface. Mouse zoom is reversed, and if you point somewhere and zoom in it doesn't zoom into that point, it also works in a mirrored fashion from how it works in Eagle and every other cad package out there. And when I move a component, the wires become detached, or maybe they were never attached in the first place. It's a mystery! How exciting.Oh, and how could I forget that you have to cut to delete, you can't just point and press delete, and for some reason to rotate you have to press CTRL-R instead of just R or simply right clicking while you're dragging the object. Ugh. Annnd, I can't find any noise function on the voltage source. I'm betting this software has no ability to graph the output either.Tell me again why people recommend this tool so much? There's gotta be something more modern out there. This looks like a Windows 3.1 application. I have literally used simulators written in Javascript that function better than this. And that even showed the flow of electrons in the circuit in real time.Okay I found a noise function on the simulation menu. I have no idea where it's planning to inject this noise into the circuit. And I don't see any probe function so I can actually pick the point in the circuit I want to measure. But it's giving me an error about an unknown parameter V so it doesn't matter anyway. :/ My earlier question about why anyone uses this piece of crap still stands.

author: Monkeh
author_rank: Super Contributor
timestamp: July 06, 2016, 12:23:35 am
content: Quote from: Starlord on July 06, 2016, 12:15:19 amBecause it's free and it works. You want better, break out the wallet.It's really not that hard to work with, you just have to learn not to assume everything works the same way.Quote from: Starlord on July 06, 2016, 12:15:19 amIf you were to spend your rant time reading the documentation, you might get further..

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 12:37:09 am
content: Quote from: Monkeh on July 06, 2016, 12:23:35 amWell PartSim is free, and I'd say it's better. I may simply have not delved deep enough into it. I recall now that it has actual part numbers you can select to create a BOM of parts to source from Digikey. That's where they're making their money. So even though the base inductor type doesn't seem to let you set its DC resistance it does have the ability to set a spice model, and I'll bet if I choose a real part it will work out better.Also a quick google search turns up a number of free options. Multisim for example looks much more advanced and there's a free edition:http://www.ni.com/multisim/I suspect people just recommend LTSpice because it was the first and it's what they're used to and learned in school, because I refuse to believe it's the best of the available free options in this era of open source software.

author: Monkeh
author_rank: Super Contributor
timestamp: July 06, 2016, 12:43:41 am
content: Quote from: Starlord on July 06, 2016, 12:37:09 amSay that when their site is down or they decide to take it away and you lose all your simulation data, and all your experience.Quote... for 30 days, afaik. It's a trial, not a free edition.Quote'it was the first'? Not by a long shot, SPICE tools date back over 40 years. You could try Qucs if you like, I promise you it's no more friendly, just different.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 06, 2016, 09:21:06 am
content: Quote from: Starlord on July 05, 2016, 10:28:37 amAnd with unknown outcomes -- discard/recall/fine users/fine mfg/etc.If nothing else, it shows they had to redesign the product; if they had done it right in the first place, they could've saved that NRE. (How much did it really cost? Obviously, not enough for them to tank. Was it less than the initial sales, with no loss of customers, so it was a net win? Did it hurt instead? No idea.)QuoteAh, now we're getting somewhere!Gray area, yes. Illegal, no. If they sat there, asking lawyers and politicians whether their thing is right or not, they wouldn't have gotten anywhere. Better to put it out in the market and see how well it does.And indeed, they did quite well.But be very mindful of the humongous selection bias: these are four successful companies, out of how many thousands that fail for various reasons?How about another selection: Silk Road. Obviously, facilitating the sales of illicit products is suuuper illegal...Likely a lot of white-to-gray market stuff was sold there, too. Does that make it wrong?Well..... yes, as it turns out.QuoteDon't believe I'd ever heard the Segway called illegal, since its introduction. But that was a long time ago, and I didn't follow the news about it.Here's a current appraisal:https://www.hg.org/article.asp?id=36294TLDR it's local only, YMMV.As for the Hoverboards -- that's under a different rule than present subject.Or, I'm honestly not really sure if it's a rule or more of a suggestion, but in any case: UL approved products must meet design and inspection standards, and must be tested in a lab (again, for a pretty penny..).Relevant blurb:http://www.ul.com/hoverboards/As with other rules, if you don't pass the certification, you're at risk of getting pricked with a nasty action. Getting sued for bodily and property damages, by just one person, would be a rather bad sight worse than getting dinged $5k by the FCC, or having to recall your products. So, UL safety is rather a bigger concern.What you get from being certified, is a guarantee that, if someone comes after you for xyz reason, you simply point to the test results and say "sorry dude, lab said go". Zero liability.That's a HUGE deal in the US. Most business operations can be followed, not so much even by the flow of money, but from the minimization of liability.Again, manufacturers, importers and sellers are at risk here. It would be unwise for them to import anything that's uncertified (or counterfeit).It looks like a Hoverboard lawsuit is brewing, but as these sorts of things happen, it'll probably be a few years (and however many more clients) before it closes. So until then, the jury's literally still out (well, literally only if it goes to trial).So... you're saying you'd much rather make a few bucks now, and... somehow dodge or neglect or avoid or abdicate your eventual liability from selling something uncertified..? Because if that's your business plan, you'd better have an aggressive plan to grow your businesssignificantlyby the time those liabilities hit.It's like getting a loan, except the bill comes randomly, at an unknown interest rate...QuoteWell,1. You're a small player. You've never mentioned making billions of things. Yes! Scale matters! You're not special, you're a nobody. If you make a billion of something, your product is in the mind of the whole country, and they will collectively bend to make that popular thing, a sure thing.2. Importers and retailers are liable for this sort of stuff, all the time. They usually have enough (capital or credit) to take a few blows. Sometimes, even if you do everything right, import good stuff, inspect it for all the marks, give it a go yourself; you still end up losing. You have to absorb that cost, and roll it into your bottom line. Retail is expensive, and this is part of the reason why. This is why consumer protection laws exist: to ensure that, okay yeah fine you'll have to pay extra for a variety of reasons, but you're much more likely to get a functioning, safe product. (EU is far more strict about this, of course.)3. You mention direct China sellers. In these cases, the buyer is the importer. They probably don't realize it, but they are liable for their own safety. There's not much they can do about the seller, except complain with some nasty e-mails or a bad rating. Absolutely no teeth. Indeed, a very large part of why that crap is so cheap, is because it's direct import and buyer-beware --caveat emptor.Indeed again: if enough people purchase goods in this way, and enough people wind up injured as a result (defective, unsafe, interfering), the ultimate effect will be even worse: an overall chill on direct-China sales. In the extreme (perhaps it wouldn't go *this* far..), trade restrictions could be increased. In short: a few bad apples spoil the bunch. Tragedy of the commons!4. Back on topic, the FCC will not raise limits, and should not. I am an electrical engineer, and I like my airwaves clean and functional. Just as I want my air clear and breathable, and my water pure and drinkable. The FCC's primary responsibility is to its licensees. There are a great many radio operators, licensed to use their segments of spectrum, who expect that spectrum to be available, and whom are given rights to take action (c/o FCC) against any sources of interference. ...Have you heard of the Tragedy of the Commons?A possible example, combining both aspects: wireless power.There's been articles about residential heating, using microwaves. In reality, it's not nearly as unsafe as it sounds, and it literally heats only the squishy meatbags that need it, so it's maximally efficient!There's been articles about chargers, using various means (ISM band RF wireless; GHz wireless; even ultrasonic power transfer!).All of these have the same liabilities -- filling the air with a huge amount of energy, that will cause a wide variety of problems (both for bodily safety, and functionality of standard devices). No matter how viral these schemes go, they cannot succeed, because you can't beat physics.QuoteMost of what they sell, is an incomplete component, and sold as such. These are FCC exempt -- given that the final manufacturer / end user still meets Part 15 requirements.Likewise, dev kits and application boards. I've seen some truly awful ones. The LTC3810 application board makes pulses <5ns, >50% overshoot, and there's nothing you can do about it. The pulse shows up all over the board. In other words, I had the same experience you did: crap everywhere.The FAE* was clueless; the best he had to offer was: "eh, toss some ferrite beads on it?"(*Field Applications Engineer; the guy who comes to your office when you phone up Linear Technologies and ask for some help with a particular product of theirs.)That particular product ended up in a heavy metal box, and the customer wound up with something like 30% higher unit cost than they wanted. That reflects poorly on us. At least it wasn't so bad they couldn't market the complete system; that would've been a disaster for all parties involved.QuoteJust to be specific -- electronic kits have a specific clause in Part 15. Whereas components don't need to meet any ratings (because... how could they?), kits, assembled according to instructions, must meet regulations.It's probably a worse deal for the manufacturer, because it's much harder to ensure the end user builds the product to their spec. In theory, they should be off the hook if the userdoesn't followspec, but who knows.In any case, the offending user is the first target (by the FCC). If it's just some dumb art project (good example), they can simply turn it off, and probably take it apart and move on to the next cutesy thing to lash together. (Hopefully being a little more cautious next time?)For much of those electronic components and Arduinos and kits things, that's about the end of it. They're not meant to be operated as a finished product, and operational performance is the user's responsibility (again, whether they realize it or not; it would be prudent of the seller to provide reminders of this..).I don't know Adafruit's full product line, but I would suppose they sell things meant for office use (e.g., computer peripherals?), or stand-alone (soldering station..?), and those should meet regulations.Tim

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 09:45:18 am
content: Quote from: dmills on July 05, 2016, 03:39:37 pmI've been trying to simulate this in Partsim because I couldn't figure out how to get LTSpice to work, but I'm not getting results that seem to make sense. Perhaps my model is wrong.The graph above is the probe of the wire between L2 and R1.By the way, I found this application note from TI detailing the design of filters for class D amplifiers. It confirms what you said about excessive peaking tripping the overcurrent protection on pg 6:http://www.ti.com/lit/an/sloa119b/sloa119b.pdfIf I'm not mistaken, Wo is the cutoff frequency in radians? How do I convert from Hz to that?

author: CJay
author_rank: Super Contributor
timestamp: July 06, 2016, 10:04:37 am
content: 'wah wah wah, the law isn't letting me do what I want'I want lots of money, it's only the law that prevents me wandering into a bank with a shotgun and taking as much as they'll hand over, so that should be fine, I mean, it's not as there aren't successful bank robbers who went on to be very rich right?Seriously, if you're betting everything on this one product then you *REALLY* need to be sure it's legal to sell and works properly or you're in for a world of pain, arguing and ranting against people who have years of experience in product design, compliance testing etc. doesn't remove the fact that your design is poor (being generous).Oh, and BTW,http://lmgtfy.com/?q=radians+to+hz

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 11:07:18 am
content: Quote from: CJay on July 06, 2016, 10:04:37 amYes, let's pretend the real world is black and white, and that there is no difference between designing an electronic product you expect to sell a hundred of a year that might emit enough EMF to interfere with someone's CB radio occasionally, and bank robbery. That's one hell of a strawman you've constructed there. Did you get the right permits for that?Also, let's pretend that EVERYONE doesn't break the law. Have you ever exceeded the speed limit? You're putting people's lives in danger so you can get to work a little faster. I'd say morally, that's less justifiable than what I'm doing.QuoteI didn't intend for this project to take over a year. It was supposed to take 3-4 months. And I've taken pre-orders from customers who bought the previous version to pay for the R&D on the new version. So you want to talk about bank robbery? How do you feel about taking people's money for a product and then delivering nothing? Because that's what you're suggesting I do.QuoteVery funny. You think I didn't google it before I asked? That conversion is for frequency to RADIANS PER SECOND. The datasheet specifies Wo is frequency in RADIANS. Are these the same thing? Are meters per second the same thing as meters? No. That's why I asked people who know better. I assume the datasheet omitted the per second part, but I don't know that for certain. And some references I found talked about the conversion requiring a sample rate, and I had no idea what to use for that.Also, I have to ask, but did you happen to miss the part where I am here asking questions specifically because I want to design a better product and get rid of these emissions? What I'm taking issue with is that the idea that I should design nothing because I don't know everything and don't have an unlimited budget to make it absolutely perfect. I feel like if I invented the microwave oven today, people like you would be giving me shit because it kills WiFi in the vicinity and in order to design something that is affordable for consumers, sacrifices need to be made.And speaking of microwaves, you know what's ironic is that WiFi only exists because of the microwave. If the microwave didn't make those frequencies nonviable for commercial use, then the businesses that wanted to design wireless routers wouldn't have had an unregulated frequency spectrum to utilize. That band would have been auctioned off to the highest bidder. One could make the argument then that interference drove innovation. And speaking of innovation, I believe that frequency hopping routers were also invented to get around the issue of potential interference. One wonders what other advances in signal processing will be made because businesses were forced to work around a too common household appliance?

author: CJay
author_rank: Super Contributor
timestamp: July 06, 2016, 11:34:12 am
content: *snipped more whinging about how unfair the world is and justification of illegal actions because 'bigger boys did it first'*Yeah, you go for it, can't wait to hear how the compliance testing goes.Oh.You've been pursuing this project and begging tech advice, relying on the charity of others then arguing against them when they've pointed out where you are in the wrong.I admire your determination to bring this thing to market but there are times when you have to grab your balls and accept you might just be wrong.You *really* need to understand a *lot* more about what you're inflicting on the world, I doubt very much you will be only interfering with CB radios, there are emergency service, military, civil aviation and many other users of the HF bands that you're merrily polluting, you claim that speeding is less morally acceptable than the risk of blanking communications by those users?

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 11:43:35 am
content: Quote from: CJay on July 06, 2016, 11:34:12 amYou also snipped the bit where I said you were in no position to judge me because you yourself break the law on a daily basis.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 11:47:40 am
content: Quote from: CJay on July 06, 2016, 11:34:12 amOver 32,000 people die on the roads each year. I challenge you to find a single instance of radio interference resulting in a death in the last 25 years.Also, do you really think military radio communications can be jammed by a tiny device powered by a 12V battery?

author: dmills
author_rank: Super Contributor
timestamp: July 06, 2016, 11:52:02 am
content: You should really be plotting the voltage across R1, not that it really changes anything, and yes radians in that datasheet means radians per second.There other ISM bands besides 2.4G you know, the need for space to use for RF heating predates the microwave oven, 2.4G was used for early domestic wifi because it was the widest ISM band for which cheap RF semiconductor components were realistic at the time (And resonant aerials there were small enough), if 2.4 had not been available then within a few years the 5GHz band would have looked reasonable. Some of us used to do wifi (We called it RTTY and Pactor) down in the HF bands, 13.56MHz ISM could be used, but the aerials become a little annoying down there, and the available baud rate is not wonderfully high.Incidentally, the door seals on a modern microwave oven are a wonder of **really** clever design (A cavity forms a quarter wave short stub, a half wave back from the edge forming a high impedance at the edge, all made from really cheap bent tin), and the door switch (a safety critical component) is a very clever thing in its own way, low cost and absolutely fail safe.Cost down is often more of a case of really clever design then blowing off the regs.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 11:58:49 am
content: Quote from: dmills on July 06, 2016, 11:52:02 amThat's cool, and clever it may be, but it's still not perfect. At my sister's place, whenever they use their microwave, the WiFi goes down. It's a pretty new microwave too, and there was no visible damage to the door that might have caused leakage.

author: CJay
author_rank: Super Contributor
timestamp: July 06, 2016, 11:59:09 am
content: Quote from: Starlord on July 06, 2016, 11:43:35 amExplain where I admitted breaking the law?I accept responsibility for my actions and do not try to argue that they are OK because other people do it too.Like I said, grow a pair and accept you are in the wrong.Compliance testing laws are put in place because irresponsible people sell products that have potential to cause significant problems for legitimate users and manufacturers of well designed products.Has it occurred to you for one second that the emissions from your 'product' won't be limited to just the HF bands?

author: dmills
author_rank: Super Contributor
timestamp: July 06, 2016, 12:08:11 pm
content: Quote from: Starlord on July 06, 2016, 11:47:40 amGet me close enough to the victim device, and NOT a problem!GPS for example is trivially easy to jam, mostly because it is so very weak at the receiver, and trashing the military codes will not be that much harder then the civil stuff.I can cite a couple of deaths where radio comms problems were at least contributory, mariners who tend to use the HF bands for ship to shore when out of range of the VHF set (Which is limited to maybe 20 miles or so off shore), and the aircraft emergency frequency on 121.5Mhz has been taken out by a malfunctioning plasma telly before now (Tracked down and confiscated by the authorities, no deaths that time but mostly by good luck).I have had a ONE TRANSISTOR reset circuit for a small micro cause an EMC fail (The thing had enough base inductance to cause it to take off at VHF, solved with a base stopper), you see the strangest things when you start looking.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 12:15:13 pm
content: Quote from: CJay on July 06, 2016, 11:59:09 amYou speed. Don't lie. Everyone does.

author: CJay
author_rank: Super Contributor
timestamp: July 06, 2016, 12:18:17 pm
content: Quote from: Starlord on July 06, 2016, 11:47:40 amThese do ya to be getting on with?http://www.nybooks.com/articles/2000/09/21/swissair-111-twa-800-electromagnetic-interference/http://www.nzherald.co.nz/nz/news/article.cfm?c_id=1&objectid=10701029As for 'jamming', it's unlikely you'd be able to effectively 'jam' communications but you can most definitely cause significant problems for legitimate users of the band you're merrily spewing interference onto.Your insistence that it doesn't matter because you will only interfere with CB radios is actually a pretty good point, in the US an FCC certified CB radio is capable of transmitting 4 watts of amplitude modulated carrier, they generally run on 12V (even the line powered solid state units are 12V internally) and consume less than 2 amps.None of your arguments for why you are entitled to eschew your responsibilities hold water.Pretty much the same power you have available for your device.

author: CJay
author_rank: Super Contributor
timestamp: July 06, 2016, 12:19:45 pm
content: Quote from: Starlord on July 06, 2016, 12:15:13 pmProve it.I can prove I don't.

author: dmills
author_rank: Super Contributor
timestamp: July 06, 2016, 12:25:11 pm
content: Quote from: Starlord on July 06, 2016, 11:58:49 amAnd thats fine, the wifi product "Must accept interference", there is not (and never has been) a guarantee that a user of an ISM band will not suffer interference from another user, or that a product may not radiate (within defined limits) power in an ISM band (They are after all unlicensed).If those door seals are good for 40 - 50dB then a 1KW oven might be radiating 10 - 100mW, not a problem because it is doing it in the ISM band, if it was the ovens power inverter radiating a load of hash via the power cord then that would likely be a problem because it would NOT be in the ISM band.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 12:35:03 pm
content: Well it seems we're at am impasse, CJay. I'm not going to give up on designing electronics, and you're not interested in helping me learn how to design them in such a way that they don't cause interference. I'm literally sitting here asking how to design filters to reduce the interference from my amplifier, and you're giving me shit because, I guess, you think I'm too stupid to be allowed to design any consumer product.Btw, all this arguing is eating into what little time I DO have left to redesign this board so it doesn't interfere with everything around it. Just putting that out there.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 06, 2016, 12:44:21 pm
content: Quote from: dmills on July 06, 2016, 11:52:02 amI tried dropping a multimeter in the schematic to measure across R1, but I can't get the voltage reading to appear in the AC analysis, and the transient analysis isn't plotting the data in a way which is useful.You said it doesn't really change anything. Does that mean that -6db drop isn't really there? And then why is the graph showing a 96db drop at 100Mhz when you suggested that a 1uH indicator + 100nF cap would lead to a much lower drop? I think you said it would be around 26db? I can't trust the graph and tweak my component values because I'm getting different results than I expect.

author: CJay
author_rank: Super Contributor
timestamp: July 06, 2016, 01:30:07 pm
content: Quote from: Starlord on July 06, 2016, 12:35:03 pmI'm being a b**tard to you because you don't seem to want to realise just how bad this could get for you if you don't do it right.Don't give up, I honestly don't want that.I have a lot of admiration for people who design and get things to market, I've done it in the dim distant past before the stringent EMC laws and know your pain, but you are trying to run before you can walk and are leaving yourself open to immense legal problems.Nothing you can do or say relieves you of the obligation to comply with the laws of your land but as others have hinted, there are *legal* ways to pass the responsibility on to the end user.That's not to say you don't have to make every effort to ensure the product is as good as it can be with regard to those laws.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 07, 2016, 01:04:09 pm
content: Well, I installed a free version of Multisim to try it out, but I'm getting nowhere fast trying to simulate an LC circuit with a 4 ohm load. I think I'm supposed to use the bode plotter, but after creating the LC circuit with an AC voltage source (since I couldn't find something that should produce noise) and attaching the inputs to the bode plotter across the load, and running the simulation, it complained my circuit wasn't grounded, which makes no sense since it I connected both the + and - sides of the AC source to make a complete circuit. I'm sure this is wrong, but it's really frustrating because it seems like the right thing to do. I added a ground on the negative side just to get the error to go away, but I'm getting nothing on my bode plot when I run the simulation. I set F and I to 100MHz and 100Hz and the AC source is 1Hz.I tried to find some Youtube tutorials on how to make this all work and was met with even more frustration because almost none of the damn things have any audio. There's no one explaining why they're doing what they're doing!I don't know why this is so difficult. It's a digital amplifier. It's an LC low pass filter / crossover. It's a common thing used everywhere. Why the hell isn't there some audio site or software out there with a graphing calculator specifically for this purpose?I mean I could just use the 1uH inductor and .1uF cap that was suggested here and hope it works, and maybe replace the caps once I have the boards made to see how different values change things, but I'd really like to see for myself what the graph looks like, and I'd like to try out a 2.2uH inductor with maybe a .22uF cap? And see how much better that is, and make sure there's no peak. And I'd like to see how large the peak is and see how things change when I reduce the load from 4 ohms to 2 ohms, because both will potentially be used.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 07, 2016, 01:22:53 pm
content: I found this one page where someone tested a Sure amplifier and made some improvements to it which includes a multisim file:http://www.trevormarshall.com/class-d-tutorial/I can see he's set it up quite differently from how I attempted to. I have no idea why two AC sources are used, but I'm guessing it has something to do with that ground in the center. I guess maybe it's simulating the push pull that the amplifier does, so the AC on the bottom has it's positive side reference to ground, and is pulling the voltage negative as a result? Sorry, I don't know how to state it properly.Anyway, I see the pair of inductors and caps that would be on the amplifier output, and I assume R1 and R2 are the DC resistance of the inductors (why isn't that built into the model of the inductor and set as one of its parameters?) but what's C3 and R3 for? And why are there three bode plots? And how did he arrive at those models for those two speakers?And why are the bode plotters connected to the circuit in such a strange manner? In other words, why do they have inputs and outputs, and why are both connected, and why to those locations?

author: Starlord
author_rank: Frequent Contributor
timestamp: July 07, 2016, 01:27:59 pm
content: Well I read back over the article again and I did find where he got those parameters for the speakers. The link was broken, but I found the datasheet for the 4 ohm driver:https://www.parts-express.com/pedocs/specs/264-1042-peerless-830983-specifications.pdf

author: Delta
author_rank: Super Contributor
timestamp: July 07, 2016, 02:05:41 pm
content: Simply tweak your circuit so that all the EMI it spews forth is in the ISM bands.... Problem solved!

author: Starlord
author_rank: Frequent Contributor
timestamp: July 07, 2016, 03:29:24 pm
content: So I got that simulation from the audio site working. At least I think it's working. Obviously I have no way of knowing if the bode plot it's showing is correct.However, I did try inputting both the suggested 1uH / 0.1uF and TI's 10uH / 1uF values to use as a reference, and then tried some a few other values for comparison.For:10uH / 1uF = 3.4db peak @ 71KHz, -52db @ 1MHz (TI suggestion)1uH / .1uF = 10db peak @ 522KHz, -9db @ 1MHz (forum suggestion)1uH / 1uF = 16db peak @ 182KHz, -32db at 1MHz (peak too high? may put amp into overcurrent protection?)2.2uH / .22uF = 9db @ 255KHz, -25db @ 1MHz (better than the forum suggestion? and tiny 2.2uH inductors that can handle sufficient current exist)2.2uH / .1uF = 6db @ 372KHz, -18db @ 1MHz (less peaking + uses capacitor value I use everywhere else, somewhat less filtering at 1Mhz range)I'm not sure if -9db @ 1MHz is a comfortable margin, so I may just go for the 2.2uH inductor instead, possibly with the .1uF capacitor so I don't need to add another part to my BOM.-9db would only reduce the noise by 1/8th, while -18db wouldr educe it by 1/63rd. That's a pretty major difference. Of course -25db would be 1/316th. But I think 1/63rd will be enough? That should take my +-400mV spikes, and reduce them to +-6mV.Btw I forgot to mention it earlier, but Mouser offers a free version of Multisim called Multisim Blue, if anyone wants to check that out. It's not perfect, it seems to have only one level of undo which is crazy in this day and age, but aside from that it's leagues better than LTspice.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 07, 2016, 07:02:41 pm
content: Ah crud, I just realized that that tiny resistance the inductors have seems to matter a lot. A 4.7uF inductor with 200mV of resistance shows a -1.5db drop in the portion of the spectrum that's supposed to be flat. That would mean a 30% reduction in volume. The 1uH inductor on the other hand with a 47mV resistance only shows a -0.2db drop, which means only a 5% reduction in volume.Of course, again, I don't know how accurate these graphs are, so perhaps the drops aren't this severe. But I suspect they are.Thankfully, I may be able to use a somewhat larger inductor without going too big to get that voltage drop down where I want it: less than 50mV.

author: dmills
author_rank: Super Contributor
timestamp: July 07, 2016, 08:15:51 pm
content: 3dB is generally figured to be at the lower end of the scale for a perceived volume change, with around 10dB (This is frequency dependent) being generally figured to be roughly a perceptual doubling in volume, there is a reason concert sound systems get so stupidly large.....Regards, Dan.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 08, 2016, 01:49:45 am
content: Simulators are first and foremost, numerical solvers. They only represent reality to the extent that you, the modeler, have created a model that will produce realistic numerical results.Ground is absolute, so you have to add a GND symbol (net 0) somewhere. Preferably on a common net, so all your voltage measurements are relative to it, without having to connect a pair of wires to read the difference. (In SPICE, there IS such a thing as absolute voltage -- 0 is global ground. In reality, you always need two wires.)There are two kinds of components, for example: SPICE standard R, L, C are pure abstract components. On the other hand, real components, can be modeled as an infinite network of abstract RLC parts!How far into that network you go, determines how good (accurate over a given frequency range or time scale) your model will be.The analyses you will be most interested in, are Transient (the "play" button, or select it from the menu), and AC Steady State.To use Transient, use pulse signal voltage sources to represent your amplifier's switching output. The rise and fall times will be short, 10ns perhaps. You specify the pulse width (say 0.5us) and period (say 1us, thus giving about 50% duty at 1MHz -- representative enough), and the voltages when 'on' and 'off'. You can also assign an AC Magnitude, which does nothing in Transient.To use AC Steady State, at least one voltage source has to have an AC Magnitude and Phase assigned (otherwise, they default to zero). This performs an AC frequency sweep, using the assumption that the circuit's DC operating point is linear. (This won't matter, because your network is linear. It does matter for nonlinear circuits, like amplifiers, where the DC condition varies with signal level.) On the sim dialog, enter a range of frequencies, usually a fair amount below and above the cutoff frequency (say, 10k to 100M). You'll want a decade plot with 200-500 points/dec. Go to the "Output" tab and pick a few circuit nodes to plot. (If you haven't named the circuit nodes, they will have default numberings. Hit OK on the dialog and double-click a wire to see what name it has, and set a user-defined name if you like.)Once you've picked the outputs, press the Simulate button. The graph view will open, and you should see something resembling a lowpass filter.Note that, since the SPICE components are ideal, your filter will also be ideal. Adding ESR to inductors and capacitors is a good first step. Inductors also have EPR (i.e., a modest sized resistor in parallel) and C, and capacitors have ESL also. A real filter will have many humps and valleys at high frequencies (because real components are complicated); in the simulator, you only get as many humps and valleys as you have reactive (L or C) components.You can also determine power dissipation. If you do a Transient simulation (from the menu), you can pick outputs. If you write an expression for power (such as VSRC[ i] * V(VSRC), the power generated by a source VSRC), you will get a plot of that. You can do this for sources and loads, and subtract to find the difference: losses.Tim

author: SteveyG
author_rank: Unknown
timestamp: July 08, 2016, 10:26:50 am
content: Quote from: Starlord on July 06, 2016, 12:15:19 amLTspice is very powerful and isn't difficult to use - electronic simulation tools don't need to show electron flow or run in Javascript to do their job. Do you know how to use SPICE?

author: Starlord
author_rank: Frequent Contributor
timestamp: July 08, 2016, 07:25:47 pm
content: Quote from: SteveyG on July 08, 2016, 10:26:50 amWell I'm sure once you learn it's quirks, you can use it, but I think it's fair to say it's design is antiquated and unintuitive.And sure, you don't need to see electron flow, but I just mentioned it because when I was learning how to design filters with resistors and capacitors long ago, being able to see what was actually going on with the electrons in real time made it so much clearer to me what the capacitors were doing. For a beginner, it's a godsend.Anyway, I got Multisim Blue from Mouser and I found an audiophile site which actually had a simulation model for a class D amplifier output filter, and from there I was able to simulate different values of inductors and capacitors and see how they affected the output. I'm still not sure how those peaks after the flat region affect the current draw of the amp, but since someone here knew something about that and suggested a certain set of values and said the current use was related to that peak, as long as my peak is less than or equal to the one his suggested values give, I think I'm safe.I finally settled on a 2.2uF inductor and .1uF cap, because it kept that peak low, but increased the attenuation of frequencies above 1MHz by a great deal more. And after looking for hours at different inductors, sorting by price and size and quantity available and DC resistance and current handling capacity... It suddenly occurred to me that I already had a tiny 2.2uF cap on my 5V switching regulator, and when I looked at the specs, it matched up precisely with my needs for the amp. So it turns out I don't need to add yet another component to my BOM which is nice, given this whole thing is already too expensive. But they're still gonna be $1 apiece with the placement costs, so, sad face.But back on the subject of Multisim... I like it a lot. Reasonably modern interface, and works exactly as you'd expect it to. I have absolutely no idea what I'm doing, but at least I can copy and paste and delete and move and rotate components in a way that makes sense, as well as easily connect wires between them. I don't know how much I'll need to use it for the simple mostly digital circuits I design, but I think it will be my go to sim tool from now on.

author: tggzzz
author_rank: Super Contributor
timestamp: July 08, 2016, 08:27:07 pm
content: Quote from: Starlord on July 05, 2016, 10:28:37 amDon't be silly.The reason for many regulations is tostopsmall businesses having to bear the brunt of the costs. The costs, that is, of being prevented from doing their business because they are being stomped by interference from someone down the street.Or maybe you would be happy to have you service disrupted by someone operating a spark-gap transmitter.I've dealt with the FCC in terms of opening up and setting newtypes ofstandards w.r.t. radio interference. The FCC were eminently reasonable, provided we ensured that pre-existing users continued to be able to operate.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 09, 2016, 02:40:07 pm
content: http://www.ti.com/lit/an/sloa119b/sloa119b.pdfOn Pg 15, why does it state "Zcm at 250 kHz represents the impedance seen by the amplifier at the switching frequency" when the point on the graph being referenced appears to be at 3.5KHz, and furthermore is not at 51 ohms as indicated, but 45 ohms instead? Is the X axis of the graph labeled incorrectly? And did they get the impedance wrong?Nevermind, I see what they did. I thought there were two red lines because there's a sharp point at the base of the graph, and I assumed they'd be pointing towards the point of interest and the point they were pointing to was close to 51 ohms. But the point they're talking about is on the opposite side of the graph, unlabeled.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 09, 2016, 06:11:32 pm
content: Yeah, it just looks weird because the semi-log plot.Tim

author: Starlord
author_rank: Frequent Contributor
timestamp: July 09, 2016, 06:46:57 pm
content: So on the subject of I2C over long cables again, I've got an idea.The issue with using less than 2K pullups on my I2C lines is that I have one chip, an ADC, which I'm not sure can withstand the higher currents.I was looking through the I2C spec sheet, and I saw mention of series resistors in there. And it got me thinking... What do you suppose would happen if I used stronger pullups on the microcontroller end of the cable, but put series resistors at the other end?For example, what if I reduced the 2K pullups to 500 ohms, and then put 1.5K series resistors at the end of my cable, so the total series resistance between the chips and the 5V bus is still 2K?Would that in any way improve the rise times, because all that cable capacitance is connected to the strong pull ups? Or would it make no difference because to discharge the cable current has to flow through the 1.5K resistors?

author: dmills
author_rank: Super Contributor
timestamp: July 09, 2016, 07:35:13 pm
content: Steady state, with the output on that remote chip pulling down, how low will the voltage seen by your controller go (Think potential divider)?Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 09, 2016, 07:49:58 pm
content: Quote from: dmills on July 09, 2016, 07:35:13 pmAh. So if the remote chip is trying to pull the line down to 0V, the voltage divider formed with the pullup will only allow it to go down to 3.75V

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 10, 2016, 03:51:11 am
content: Quote from: Starlord on July 09, 2016, 06:46:57 pmYou might use small series resistors to source-terminate the drivers, to eliminate ringing. Excessive value will ruin the logic input threshold, because you're making a voltage divider and the driving pin can't pull the line all the way down.Tim

author: 2N3055
author_rank: Super Contributor
timestamp: July 10, 2016, 09:31:35 am
content: At the very beginning of this discussion, before it became a contest who's right on many moral and legal and political issues, I mentioned to you something called active pull-up .. I guess you didn't understand so you disregarded it...ACTIVE PULL-UP !!!look it up, I don't mean to explain it here, some very good explanations in Googleverse ... If anything can help with extending I2C specs to the limit that's the ticket...A hint from just one manufacturer : Linear tech LTC4311 .. More from others and some discrete circuits too...It helps cleaning I2C signal edges.... Might help you with your spurious logic transitions on I2C...Of course, good grounding and filtering RF radiation from amplifier is a must...So much from me..Wish you luck..Sinisa

author: Starlord
author_rank: Frequent Contributor
timestamp: July 10, 2016, 01:22:38 pm
content: Quote from: 2N3055 on July 10, 2016, 09:31:35 amI appreciate the suggestion, and I did actually look it up and found that particular chip in fact, but they're $3 apiece in low quantities:http://www.digikey.com/product-detail/en/linear-technology/LTC4311CSC6-TRMPBF/LTC4311CSC6-TRMPBFCT-ND/1965058I could get two of these instead for the same price:http://www.digikey.com/product-detail/en/texas-instruments/P82B715DR/296-24729-1-ND/2092551And stick one one each end of the cable. With the chip you suggested, if I stick it on the microcontroller end, then maybe the chips can't talk back to it because of the large capacitance between them and the chip, and if I stick it on the chip end, I can't boost the microcontroller pullups to help it overcome the noise because I still have I2C chips at that end of the cable and I'd prefer not to limit myself to parts that support fast mode+.But if I were willing to accept that limitation, that chip would still probably not be the best solution available, because there's this buffer which is a third the price:http://www.digikey.com/product-detail/en/nxp-semiconductors/PCA9617ADPJ/568-10211-1-ND/3991867If I stuck that on the end of my cable with my chips, I could use the stronger pull ups on the microcontroller side, and I wouldn't have to worry about it affecting my MCP3021 ADC which is a 400KHz device of unknown sink capability, or my AS1115 multiplexing LED driver, which also does not specify its sink capability but suggests it can do 1MHz I2C which is not FM+ but maybe implies higher sink capability?Right now though, since I can implement that last solution without any changes to the main PCB, I'm gonna try it with the amplifier filter and leave the pull ups alone. I know the system works as long at the noise from the amp isn't being picked up, even with the slow rise times. I may get a board manufactured with that PCA9617 buffer though so I can test with lower value pullups, and then based on the results I can make a decision about whether I need that right now or not, or if I should manufacture them with just the pullups and then test the TI part on a future board revision.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 10, 2016, 02:58:56 pm
content: Why in the hell... would anyone buy a $3 LTC chip to do what four resistors and a pair of transistors can do for pennies?A classic current source circuit, tuned for 1-10mA perhaps, will do the same job.Tim

author: janoc
author_rank: Super Contributor
timestamp: July 10, 2016, 07:32:16 pm
content: Quote from: T3sl4co1l on July 10, 2016, 02:58:56 pmThat sadly assumes that the OP knows what they are doing. Right now I only see a level of ignorance that is only dwarfed by the arrogance of the "designer".I would still ditch the whole I2C idea over the long wire and put there I2C<->RS485 converters. However, seeing the "arguments" being put forward about the EMI not having to care about certification, I have my doubts that the OP will be able to pull that off.@Starlord, if you think you can flount the EMI compliance rules, let me just tell you that I have recently seen a startup selling a certain product with a similar attitude to regulatory compliance to yours. They are not selling it anymore, despite it being their only product and having years of R&D time in it - they were told how much they are going to have to pay in fines by the techs in the EMI compliance lab. Ignore rules at your own peril - I am sure FCC is going to be very entertained by your bizarre theories and arguments why is it ok to break the rules.FYI, most HF/VHF radios (not CB!) used by amateur radio enthusiasts or by boaters and small planes are 12V affairs radiating few watts (<100) of power. And those certainly have no issues communicating - or causing interference! Cause RFI on an airport frequency and you will have a van with a directional antenna in front of your house before you realize that you even have the gizmo on. Heck, people got located and fined for using a stupid baby monitor that was causing RFI at an airport frequency!

author: Starlord
author_rank: Frequent Contributor
timestamp: July 10, 2016, 08:05:03 pm
content: Quote from: T3sl4co1l on July 10, 2016, 02:58:56 pmWould a 3mA current source really do a much better job than a resistor sized to allow 3mA to flow?Why doesn't the I2C spec suggest this? It suggests buffers and switched pullups and other things:http://www.nxp.com/documents/user_manual/UM10204.pdfI mean, I think I see how what you're suggesting might work. I'm guessing that the reason the rise time is curved in that manner is because as the voltage rises, the difference between the pull up voltage and the voltage on the data line becomes smaller, and as a result less current flows, and the signal rises more and more slowly as it approaches equilibrium.This isn't something I had ever considered before, but it seems to make sense.That being said, since I would need two of these for each data line, that's four transistors and eight resistors, and with PCB space at a premium I'd be lucky to find room for two transistors, let alone all the rest.https://en.wikipedia.org/wiki/Current_sourceI wonder if that single jfet with resistor would do the job?Or, I could perhaps find an inexpensive chip that acts as a constant current source? I've been using one chip that's the size of a single FET that requires only one external current set resistor and provides a constant current supply, which I use for high power LEDs. I suspect some may exist that are designed for lower currents. I guess I'll have a look on Digikey.

author: 2N3055
author_rank: Super Contributor
timestamp: July 10, 2016, 08:32:40 pm
content: Quote from: T3sl4co1l on July 10, 2016, 02:58:56 pmTim, guy is a beginner, and not an expert... He admits that and asks for help....Active pull-up IS a current source... You're right.But... I did not suggest he should or must take that chip... I made a point, and Linear has good datasheets and application notes, and I thought it would be a good place for him to get acquainted with the concept... I also said there are many alternatives, including the discrete current source circuit...But if I where in hurry, running out of time and was making one of prototype, I WOULD just slap on one of these guys in the circuit, removing pull-up resistors and got it done with. This chip (and all alike ) is characterised for this task and will be pretty much quickest way to do it...If you ask me how to do it on a large scale where each penny counts... Well, I wouldn't do anything alike what he did....I would drive leds differently (i know I do on my products), would make amplifier differently... I wouldn't trust I2C bus to do what he wants to do in a first place..It all depends on many factors...Take care !!

author: 2N3055
author_rank: Super Contributor
timestamp: July 10, 2016, 09:04:28 pm
content: Quote from: Starlord on July 10, 2016, 08:05:03 pmYou guessed correctly... If you look at the shape of that signal, the front slope IS the curve of capacitor charging trough resistor..If you run it with a current source you will have linear(straight) voltage raise... How fast, depending on current... But a simple current source won't do for this.Look what datasheet says :..."During positive bus transitions, the LTC4311 provides slew limited pull-up currents to quickly slew the I2C or SMBus lines to the bus pull-up voltage.During negative transitions or steady DC levels, the currents are disabled to improve negative slew rate, and improve low state noise margins. "...So it behaves differently when voltage goes up or down... So, current source, with voltage clamping and also with a circuit that "knows" to charge capacitor with big current (fast and linear rise time), and to go high impedance what chips on a bus are pulling down, so it doesn't violate their specs and have fastest possible fall time...Of course it makes sense, it is being used in many forms for many years on other more robust data protocols...Original I2C doesn't suggest this because I2C wasn't intended to do what you try do... and also Philips won't endorse other manufactures...You have to learn that datasheets and all materials published by manufacturers are written as much by marketing and legal department as they are by engineers..Pretty much very correct most of the time, but not complete truth and info.. Many things unsaid and incomplete.Buffers are also very good, and those you found would possibly solve your problems...I suggested this active pull-up because it doesn't need ANY CHANGE to your circuit... You connect chip in parallel to existing 10K pull-p resistors and try if it helped..I would suggest you to try exactly that as a troubleshooting tool, as no other changes are needed..If it helps it means there is hope.. If it doesn't, you need linear audio ampIf it looks better, than you do a small redesign and use those Ti buffers, they look very good and might work too....Take care!

author: Howardlong
author_rank: Super Contributor
timestamp: July 10, 2016, 09:58:23 pm
content: A quick aside, I2C is used on VGA, DVI and HDMI cables for EDID and HDCP. It's also one of the main sources of failure in the HDMI world, somewhat ironic considering the speed of the uncompressed digital video is of the order of 100,000 times faster.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 11, 2016, 09:44:00 am
content: Quote from: janoc on July 10, 2016, 07:32:16 pmGeez, I knowI'mfrank, but that's just being mean...QuoteI think this was originally suggested (in a past thread), so it's kind of redundant..QuoteAnecdote: I worked several years at an industrial power conversion company, which literally was directly across from the airport. Never had a call in history.Probably the main 480V transformer, steel building, and generally-not-screaming-fast electronics, avoided putting anything in ATC range. There was even a tech on the shop floor who preferred listening to AM radio, which was only ever intermittently interrupted by operating power supplies. (Except for certain hijinx, but I will admit to none of it, I swear.)Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 11, 2016, 10:24:27 am
content: Quote from: Starlord on July 10, 2016, 08:05:03 pmYes, about halving the risetime. Expect something like this:QuoteProbably because it's not necessary. I2C isInter-IntegratedCircuit, i.e., only within a board, or spanning one or two with a short connection (board-to-board header or short ribbon).It's definitely not suitable under conditions of unshielded cables and IEC 61000-4-3 susceptibility testing.They also show bridges for other methods.SPI over three RS-422 pairs is an excellent method for unshielded cables; or RS-232 (with suitable filtering at RX) for slow channels, or most anything (bare logic, USB, etc.) for shielded cables.The lesson: so many signaling standards exist, for good reason! There are many sources of interference, and many applications that need more or less bandwidth and reliability.QuoteNah, only two transistors. Well, you can use the "ring of two" if you like, but resistors are dumber, and almost always good enough.You can use a circuit like this,The top half (22 ohm's, 470 and 2.2k) is current sourcing. You can't use this directly, because when one source saturates (pulls all the way to +V), it disables the other. In this circuit, it's a feature, not a bug, but you just need two base voltage dividers, that's all.You'd also use larger resistors, since you don't need the 10-20mA this thing makes!QuoteFor a long time, single JFETs were selected, and packaged as diodes -- CRDs. They're terribly botique, and JFETs are pretty thin on the ground as well.Better to go with the BJT circuit.You can even take advantage of the BJT's hFE (i.e., current gain), and use only one resistor (for base bias), no emitter resistor or divider. This is tricky, though: you need to use hFE-binned transistors (which are available cheaply, though!), and the tempco is awful (you get about double current at maximum temperature, and you need to make sure the transistor won't cook itself in the process).QuoteHmm, possible. Obviously a high efficiency (switching) type won't work.Tim

author: janoc
author_rank: Super Contributor
timestamp: July 12, 2016, 08:35:25 pm
content: Quote from: T3sl4co1l on July 11, 2016, 09:44:00 amNo, mean is intentionally causing interference and problems for everyone around, because some fool doesn't give a flying sausage about it. It is like peeing in the pool and thinking it is OK, because nobody will notice and others certainly do that as well.I am a licensed HAM and fellows like that make my blood boil. Screw everyone else, my business is more important!QuoteWell, if you weren't causing interference then there likely wasn't much reason for that van to show up. Occasional burst of static from switching usually doesn't bother anyone, static is the way things are with radio, especially on HF. On the other hand, if someone is using a 50W amplifier to listen to music for hours and it spews broadband hash all over the bands up to VHF because it lacks proper filtering, thatisgoing to get noticed and attract attention. With a bit of "luck" that could make a frequency completely unusable for communication.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 12, 2016, 08:46:10 pm
content: Quote from: janoc on July 12, 2016, 08:35:25 pmWell, the power conversion was in the 10s of kHz (switching frequency), and 1MW was the largest machine we had on the floor, with 100s kW machines running regularly (hours at a time, throughout the day). It doesn't take much ringing on the IGBTs/SCRs/MOSFETs to radiate that much RF, at least in the SW frequency range!Tim

author: David Hess
author_rank: Super Contributor
timestamp: July 12, 2016, 10:52:45 pm
content: Quote from: Starlord on July 10, 2016, 08:05:03 pmWhy two per data line? I do not think you need one at each end.QuoteOr a JFET without a resistor. If the IC2 supply voltage is 5 volts, then a JFET will not have enough voltage compliance unless you have a higher voltage available. The current source needs to have a minimum voltage across it to operate and for a JFET, this will be about 3 volts at 3 milliamps. A bipolar transistor current source can operate down to 0.3 volts or lower.QuoteYou cannot use a JFET or current regulator diodes without a higher supply voltage. Is one available?The LM334 3-terminal adjustable current source might work and is inexpensive. They are good down to 1 volts at 5 milliamps but are a little bit slow based on your oscilloscope measurement.Bipolar transistors in a current mirror configuration are cheaper yet, have better performance, and less voltage drop. If you match transistor Vbe, then you can get away with no emitter resistors, one resistor, and 1+N transistors for N pullups. Unmatched transistors will need an additional resistor per emitter. I use these all time to make impromptu RS-232 level shifters and for critical digital pullups.

author: janoc
author_rank: Super Contributor
timestamp: July 13, 2016, 08:36:22 pm
content: Quote from: T3sl4co1l on July 12, 2016, 08:46:10 pmWell, but you were obviously not radiating, or at least not causing interference, no? I am not going to argue about whether that system can or cannot cause interference - that's not my point and I definitely know more about brain surgery than 1MW power level machinery (i.e. nothing at all). But rest assured that interference on airport, emergency services or military frequencies is going to get you unwanted attention quickly.Few random examples:https://transition.fcc.gov/Bureaus/Compliance/News_Releases/1998/nrci8027.htmlorhttp://www.theregister.co.uk/2013/08/12/feds_arrest_rogue_trucker_after_gps_jamming_disrupts_newark_airport/or (interference by doorbells and other consumer electronics)http://www.wsj.com/articles/SB10001424052702304434104579378994224188328

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 14, 2016, 01:09:27 am
content: Like I said -- it was pretty bad indoors, but the building was probably good enough shielding.Never underestimate the capabilities of a pile of steel?Tim

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 03:54:46 am
content: You can all stop freaking out over interference; I ordered a new prototype with filtering on the amplifier today. I went with 2.2uH indicators and .1uF caps. Should attenuate the signal enough that I won't even see it on the scope.Wasn't able to do anything about the I2C since nobody could answer me as to whether the ADC could handle higher currents on the I2C lines, not even Microchip. But since the system worked fine when sitting on my bench and I expect my filter will fix the noise issue, the slow rise times should not be a problem.Btw, Microchip's support system is crap. They require you to register and enter a part number before you can submit a question but their system would not accept any variation on the part number I entered. I had to tell it I was having an issue with the website instead in order to get it to allow me to submit anything without a part number and aside from a confirmation email four days ago I haven't heard from them. I should have gone for the slightly more expensive TI part. In the future, I'll avoid them.

author: CJay
author_rank: Super Contributor
timestamp: July 14, 2016, 06:05:36 am
content: Quote from: Starlord on July 14, 2016, 03:54:46 amI can answer that, the ADC won't give a damn about the current on the I2C lines, it's not sinking any appreciable current and never will do.You could make the bus driver capable of sourcing 500 amps and the ADC would still tolerate it as long as the voltage doesn't overshoot.From your 'scope shots of the signals it looks like whatever is driving the bus isn't capable of providing enough current to charge whatever capacitance there is on the bus fast enough to provide a nice square edge at the ADC bus input.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 14, 2016, 09:51:35 am
content: AFAIK, I2C pin drivers are good for 74HC-sized currents and voltages. They pull down only, with a bit stronger strength than regular HC. Almost as if the complementary P and N channel output transistors were replaced by one N channel transistor of the same total die area -- thus, capable of sinking more current for the same voltage drop and thermal limit.The logic tests (V_OL @ I_OL) are done at something like 4mA, to guarantee < 0.5V, which is well within the V_IL threshold of 0.8V or 0.3*VDD or whatever it is. The pin itself will be capable of much more, at half- or short-circuit conditions (probably up to ~50mA), which is where line driving capability comes into play -- it only needs to deliver high current for a fraction of a microsecond, as the line discharges.So, they don't guarantee that you can operate with more DC current, and no, strictly speaking, it's not something you should extrapolate. The Rds(on) of the transistor is not a flat resistance, so at a higher current (say 10mA), it may drop more than the expected voltage (i.e., over 1.2V, say). Which may violate V_IH and then you get dubious thresholds and much more sensitivity to noise...By the way, about that capacitance -- the line capacitance consists of two parts. One wire is "ground", and the other is SDA or SCL, right? The greater part of capacitance is between these two wires. The lesser part is between SCL/SDA and free space -- each time the output pin turns on and discharges that capacitance, it's delivering current directly into free space! This is the first part of how the line can radiate EMI. (I2C isn't terribly fast, so this current isn't very high, but it's there. The second part is by inductance of the line, and the last part is by more complicated resonant effects that depend on the length and position of the cable.) By the same method, noise in the environment couples into the line, so that it only takes a few volts of incident noise to start throwing your logic thresholds into question.Tim

author: janoc
author_rank: Super Contributor
timestamp: July 14, 2016, 11:21:14 am
content: Quote from: T3sl4co1l on July 14, 2016, 09:51:35 amI think he is onlygoingto see this type of EMI. Right now his edges are so slow, that any interference caused by I2C lines is not going to have a ton of high frequency harmonics, with the parasitic wire capacitance acting as a low pass filter. However, the moment he fixes the drivers on the line and gets nice square edges, the amount of high frequency harmonics will shoot up, with the long cable acting as a nice antenna. Even 100-400kHz I2C can produce harmonics in HF/VHF bands. I hope the cable is going to be shielded.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 14, 2016, 11:42:33 am
content: Justastounded at the lack of self awarenessfound some other posts of the OP to find some schematics/layout :https://www.eevblog.com/forum/profile/?u=101656;area=showposts;start=225Would like to know what commercial products he has made.

author: janoc
author_rank: Super Contributor
timestamp: July 14, 2016, 12:29:34 pm
content: Quote from: engineer_in_shorts on July 14, 2016, 11:42:33 amI am actually curious as well because reading that the repeating pattern seems to be - "I have dug myself into a hole, I can't afford/don't know how/lack the means to climb out of it, does anyone have any other suggestion how to get out?"On the other hand, it is certainly a good learning experience, albeit a tad expensive, IMO. But who am I to criticize, I am not designing stuff for sale myself.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 14, 2016, 12:45:53 pm
content: Ha, just noticed that Starlord has started deleting his old post in the last few hours:https://www.eevblog.com/forum/projects/customer-w-unrealistic-expectations-what-would-you-have-charged-for-this-job/msg549472/#msg549472

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 12:49:22 pm
content: Quote from: engineer_in_shorts on July 14, 2016, 11:42:33 amWell thanks to you I just had to go through my entire history and delete every schematic and post with potentially identifying information because you want to initiate a witch-hunt. Guess nobody's going to be able to learn from my mistakes now. Good job.I'll tell you who I am. I'm nobody. I don't sell "commercial products" in the sense you're thinking of. I don't work for any big business designing things for them. I sell stuff in small quantities mostly to hobbyists. Hobbyists who will be prototyping circuits on breadboards and covering the airwaves with noise of all kinds. Why don't you take your anger out on Sparkfun or Adafruit, who encourage people to experiment with electronics and thus ruin your CB radio fun? Or how about Dave himself who also encourages people to experiment by teaching them, or 90% of the people on this forum who are also hobbyists and don't have EMC testing equipment and are also wreaking havoc on the airwaves?Or do those hobbyists not count because they're not making money? It's funny how the moment I mentioned I'm trying to make a meager, VERY MEAGER, living at this all the hate began to spew forth. Nobody cared when they thought I was just doing it for myself.Do you know why I pushed back against making changes to my circuit? BECAUSE I CAN'T AFFORD TO SPEND ANY MORE TIME ON IT. I'll be lucky to pay my rent next month after I manufacture a handful of these things. And that handful will only be HALF as many as I'm obligated to produce. What the hell do you want me to do? Give the people that pre-ordered these things nothing? I'm sure that will do wonders for my reputation. And I sure as hell can't give them refunds.I'm sorry you don't think I'm wealthy enough to be allowed in your little club because I can't afford thousands of dollars to get EMC testing equipment or have the FCC do it for me. I assure you though that if my business ever does grow, I'll do things right, if only because at that point I will actually have something to lose. Right now, I have nothing to lose except my shirt. Which I'm about to lose anyway.Do you think LadyAda did any EMC testing when she was starting Adafruit? Or whoever the Sparkfun people were? Hell, I wouldn't even be in this hobby were it not for some italian guys who invented the Arduino, and do you think THEY did any EMC testing on their boards when they got started? Massimo doesn't even hold an engineering degree. But me? By all means, hold a guy with $2K left to his name manufacturing a handful of boards to a higher standard.Sorry I care more about putting food on the table than a one in a billion chance of a toy that will be used twice a year interfering with some trucker using a technology that's 30 years out of date to chit chat.Maybe if you care so much about EMC compliance you should have spent all the time you spent arguing with me instead explaining how I could make my circuits more compliant without breaking the bank. All you've managed to accomplish instead is teaching me that when I am inevitably forced to create a new account and burn the old one, to never EVER mention I plan to make any money or sell anything to anyone.PS: There's thousands of people on Youtube posting their non-EMC compliant electronics projects. Lots of people designing guitar pedals and amps without any real knowledge of electronics at all, and selling them. Why don't you head on over there and tell them all what terrible people they are for trying to learn and start a business at the same time, like me.

author: tggzzz
author_rank: Super Contributor
timestamp: July 14, 2016, 01:01:51 pm
content: Quote from: Starlord on July 14, 2016, 12:49:22 pmVery revealing. More revealing than the schematics etc.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 01:04:24 pm
content: Quote from: janoc on July 14, 2016, 12:29:34 pmAnd if you were, you would be a fool to admit it on this forum, between the people who think if you're making any money you should be paying an engineer to answer your questions (I guess they think as professional engineers they know everything and would never need to go to the internet to ask for assistance), and those who will criticize you for not engineering your product to aerospace standards thus making it so expensive no consumer would ever buy it.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 14, 2016, 01:11:25 pm
content: Never said anything about EMC - don't care. I was curious about you asking for help on a forum and a number of top posters trying to point your project in a different direction, only for you to ignore them.And yes i did read the post about your business issues. In fact it is nicely archived here:http://web.archive.org/web/20141220033446/https://www.eevblog.com/forum/projects/customer-w-unrealistic-expectations-what-would-you-have-charged-for-this-job/?If you are struggling to put food on the table STOP tinkering with these projects AND GO AND FIND A SALARIED JOB --- IMMEDIATELY. If you have one and it's not enough money/hours then go and find another TODAY. Trust me, it's for your own health bothphysicallyandmentally.

author: CJay
author_rank: Super Contributor
timestamp: July 14, 2016, 01:22:07 pm
content: Wow....

author: janoc
author_rank: Super Contributor
timestamp: July 14, 2016, 01:27:09 pm
content: @Starlord, I think you need a serious attitude change to be taken seriously and not as a whiny kid with a large sense of self entitlement.Nobody is initiating any witchhunts. It isyour attitudethat is a problem, not that you are making mistakes. Start to take criticism as what it is - an opportunity to learn - rather than a personal attack.I am a semi-hobbyist myself, sometimes building props and contraptions to use at work, but mostly playing in my own little sandbox for my own education and fun. However, I am also aware of the laws and regulations that govern my hobby. I also don't have an EMC lab on hand or a ton of expensive test equipment - but heck, I do the darnedest to try to limit the possible EMC problems where I can, because I know what sort of issues I can have with that. It is fundamentally in my own interest.The lawdoesn't make a differencebetween a "little guy selling to hobbyists" and a multi-billion company like Apple, neither do the fines you can get if you are careless. Apple probably won't care too much about a few hundreds or thousands EUR/dollars/whatever fine, they would be more concerned about the bad publicity something like that would entail. However, for me, as a hobbyist, having to pay that out of my own pocket certainly would matter!Whether or not you are trying to make money is really irrelevant here, the point of it was that if you are trying to sell something, it is going to attract quite a bit more scrutiny than a teen building a wireless bug in their garage for fun. Not to mention that your future clients are likely not expecting to be fined by FCC (or whoever is your regulatory authority) in the future because of using your product. That's a good way to end up getting sued, IMO.The argument about Lady Ada and Sparkfun is not really relevant neither, because they are selling kits and components, not complete products. These don't have to be EMC tested, it is the responsibility of whoever integrates them into a final product. It doesn't make sense to test a component without the enclosure or other parts of the final system because they all can affect the performance - e.g. a metal grounded case acting as a shield vs. a plastic one which does not. And even then both Sparkfun and Adafruit are actually applying for FCC testing these days, even though they don't really have to.QuoteOh puh-leeze. You have been told and explained many times what you have to do, but you shoot down most of the proposed solutions right away. Or you lack the understanding or means to implement them. And that is somehow the fault of everyone else but you.And the deal with the new account - you somehow think that if you do that people will miraculously start solving your problems for you, because obviously the only thing standing in the way is them knowing it is @Starlord who is asking these questions?You are asking people to do free consulting for you, refuse to provide information, shoot down the proposed solutions, think that rules don't apply to you for some reason and show incredible arrogance in general and now think that making a new account will somehow change this? Do you think that everyone is an idiot?QuoteA guitar pedal with a few opamps or linear power amp is typically not going to spew interference all over the place, unlike your class D power amplifier switching in the megahertz range and connected using long wires. If you don't see or understand the difference between these, I think you really should first educate yourself more before you dig yourself into an even bigger hole than you are in already.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 01:27:20 pm
content: Quote from: janoc on July 14, 2016, 11:21:14 amI suspected that might be the case, as I'm aware of how if you try to compute a Fourier transform on a square wave you'll find an infinite number of frequencies would be required to recreate it perfectly.Anyway, I'll keep that in mind if I eventually decide to put proper drivers on the I2C lines.But I would ask why if shielding is so necessary with data transmission over CAT5 cable, why most CAT5 is not shielded? Does it operate at frequencies that aren't in important bands? Or does the differential nature of the signal cancel out the noise? If I used a differential I2C driver chip, would I not need shielded cable?

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 01:44:58 pm
content: Quote from: engineer_in_shorts on July 14, 2016, 01:11:25 pmI haven't ignored anything anyone has told me. Weighing advice against one's budget and deciding you can't afford to implement it doesn't mean you're ignoring the advice, have learned nothing, and won't take said advice into account when designing future devices.QuoteQuoteNobody's going on a witch hunt! He's just trying to find out who you are so he can publicly expose you, and digging up archives to old posts you specifically wanted to avoid having people read!QuoteAfter I posted that I was surprised and overjoyed that I got such positive and supportive and helpful responses from everyone. It made me gad I came to this forum, and think highly of the people here. What's happened in this thread... not so much.QuoteAnd do WHAT? I don't have a degree in electrical engineering. I'm all self-taught. Nobody would hire me. And my software engineering skills are for the most part 20 years out of date. Do you know anyone who's looking to hire a C++ programmer who is well versed in Arduino? Didn't think so. Right now, it's this, or work retail, and I'm earning more money doing this than I would be working for minimum wage. And as a side bonus, I don't want to die every morning when I get out of bed. I'm poor as shit and barely scraping by but I love what I'm doing, and I've learned a ton these last six years. Having no money all the time is stressful to be sure but I wouldn't be any better off in a dead end job, and I think in another six years I might be able to grow this into a sizable business, if I can just get over this hill I've been pushing this boulder up for so long.

author: janoc
author_rank: Super Contributor
timestamp: July 14, 2016, 01:50:40 pm
content: Quote from: Starlord on July 14, 2016, 01:27:20 pmActually a lot of CAT 5 wiring is shielded. I would say both the differential nature of the signal (thus the fields cancel out) and probably also the shape of the signals and termination of the cable is what makes the difference.I am not sure what you mean by "differential I2C driver chip" as I2C is defined as single-ended system. However, there are translators/drivers for e.g. RS485 with I2C interface. So you can run RS485, which is differential, over your cable instead of fighting with I2C which was not designed for that. However, doing that will likely require changing the protocol you are using, because RS485 is not I2C, obviously. So depending on what you are communicating with, you may have to add/reprogram the MCUs as well.

author: janoc
author_rank: Super Contributor
timestamp: July 14, 2016, 02:04:19 pm
content: Quote from: Starlord on July 14, 2016, 01:44:58 pmUm, well, so you solution is to pour more money down the drain, because you don't have marketable skills?It is great that you are doing what you love to do, but I think you would have been better off trying to update the skills you actually have first, solve your financial problems andonly thentry to start a business. Or at least recognize that you are way out of your skill level and get helpearly. It is going to get only much more expensive later when you have burned through a ton of cash already.Unfortunately engineering and business don't reward effort, only results, so that you have spent years "pushing a boulder up the hill" sadly doesn't mean it will pay off.I wish you luck, you will really need it. You have more balls than I would have in such situation.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 02:28:51 pm
content: Quote from: janoc on July 14, 2016, 01:27:09 pmThey are selling products to people with the knowledge that the people buying them don't know what they're doing, and will wire them up in such a way that they're likely to emit all sorts of radiation. You're just giving them a pass because they're helping people learn electronics rather than simply designing a finished product and selling it. But what if I told you my boards don't come with a battery or a power switch, or a speaker or even an enclosure, and that it's the end user's job to add those things? Is it my fault if they don't install it in a shielded metal case that is grounded or that their speaker wires won't be less than three inches long? I know they're not going to do that, but Adafruit and Sparkfun also know their end customers won't be doing that when they buy the convenient electronics "kit" that is a battery pack, microcontroller, and neopixels to solder together and stick on their clothes, sneakers, or backpack. And I know for a fact that the amplifiers Adafruit sells have no more than a ferrite bead filter on the output and just require you to plug in a 12V supply. How could they possibly expect that to be used in a manner that won't cause EM interference?QuoteI didn't shoot them down. I explained that I don't have the funds to implement them, and asked for alternatives.I can take criticism of my designs just fine. What I can't take are personal attacks because you don't like the fact that I have two hands tied behind my back and I'm doing the best I can with what I've got.QuoteI think that now nobody is going to be willing to answer any of my questions because they know I'm trying to make money at this and that I can't afford to do full EMC compliance testing.QuoteI don't know what information it is you think I've refused to provide, unless you mean my name and address, and if that's what you mean, too bad!And incredible arrogance? The more I learn about electronics, the more I realize how little I know. And being unwilling to simply take people's money and run, which what you're asking me to do, isn't arrogance, it's honesty. Also, wanting to keep a roof over one's head? Also not arrogance, just a will to survive.You mistake my unwillingness to implement the solutions presented to me because I can't afford to as me thinking I know better than everyone else.QuoteAnd yet someone relayed a story in this very thread about how I should be so scared of the FCC because they'd heard of some boutique guitar pedal designers getting fined. So either they're lying, or you're wrong. And I admit, I have no idea which is which.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 02:37:02 pm
content: Quote from: janoc on July 14, 2016, 01:50:40 pmNXP sells a buffer chip that takes I2C as input, converts it to a differential signal that can be sent over two twisted pairs, and can then convert it back at the other end:http://www.nxp.com/documents/data_sheet/PCA9615.pdfThey also sell a version with 3 lines, which I'm guessing is for I2C chips that have an interrupt:http://www.nxp.com/documents/data_sheet/PCA9616.pdfI've mentioned this chip before in the thread. I considered using it at one point early on in the project, but due to costs and my calculations indicating the system would work without it, I decided not to go with it, and I put the spare lines to use for some other stuff so I can't really go back now and use it. Unless maybe I don't have to worry about voltage droop and my logic levels with this in place, in which case maybe I could get rid of a couple of my power lines to make room for it. But though that might work it would have to be saved for a future revision.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 04:32:34 pm
content: Quote from: janoc on July 14, 2016, 02:04:19 pmTrial by fire.If I had not needed to find a way to make money six years ago when all my software endeavors failed to make ends meet, I wouldn't have picked up an Arduino and I wouldn't have been motivated to learn the black art of electronics.QuoteYou think I just jumped into this without doing any research? One of the first things I googled was whether or not I2C could be made to work over long distances. The consensus was yes, it can. I then did the math, and according to the spec, I was good to go.http://electronics.stackexchange.com/questions/106265/maximum-i2c-bus-lengthQuoteQuoteQuoteQuoteYes, there is one dissenting opinion there, talking about how it is designed for only short runs on a PCB, but overwhelmingly the response was that it can work. And I think I've proved that. It doesn't work WELL, without special driver chips, but it can work.Speaking of which here is an application note from NXP describing different drivers that can be used to make it work over long cables:http://www.nxp.com/documents/application_note/AN10658.pdf

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 14, 2016, 04:46:29 pm
content: I do not understand why you are arguing about IIC on long cables. Since it clearly is not suitable because you have communication issues, and what's more is that you have been able to identify these as line transmission issues.Secondly you didn't look very hard at your own sources of research as they are talking about 100kHz rate, not 400kHz.

author: CJay
author_rank: Super Contributor
timestamp: July 14, 2016, 05:05:15 pm
content: Quote from: engineer_in_shorts on July 14, 2016, 04:46:29 pmConfirmation bias, he's possibly unwittingly chosen to read the best out of the messages, one of them even says it's not about I2C but using a UART, another talks about cable capacitance but he's not qualified the cable, another talks about using an error correction protocol which to my knowledge isn't part of standard I2C and yet another mentions slowing down the bus speed until it works.None of those messages prove his point, at best, they prove that a protocol that was also known as Inter Integrated Circuit bus can possibly be bodged to work over greater distances

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 05:16:05 pm
content: Quote from: engineer_in_shorts on July 14, 2016, 04:46:29 pmIt clearly IS suitable, IF you drive the signals properly. Saying I2C can't be used with long cables is WRONG, and might lead someone to think they can never use an I2C chip on any board that is remotely located from their microcontroller. But you can, IF you use an appropriate buffer chip. Is that a hack? Sure, I guess one could make that argument. But it'll work nonetheless if the companies selling those chips are to be believed.Naturally, one should take into account the cost of using said buffer chips versus the advantages of using I2C instead of SPI. But if the chips you want to use are all I2C, or SPI versions are all significantly more expensive, or you can't spare all the extra CS lines you'll need, then using those buffer chips may just make sense. I suppose one could use an IO expander to circumvent the issue of requiring multiple CS lines, but then you may be no better off in the cost department than using the buffer chips.QuoteAnd you didn't pay very close attention to this thread because 100KHz vs 400KHz made absolutely no difference in this case, and furthermore no matter how much I slow the I2C bus down, the slew rate will remain the same; out of spec for both 100KHz and 400KHz with the pull-up resistor sizes I chose.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 05:27:06 pm
content: Quote from: CJay on July 14, 2016, 05:05:15 pmI read all the messages. Even if half say it works, and half say it doesn't, and there were far more saying it works, who am I to believe? I can't tell who has more experience. And the people who say it doesn't work perhaps have never even tried it. While the people so said they got it to work clearly did try it, and succeeded. This compounded with the official I2C spec itself having sections suggesting the best way to route I2C signals over twisted pairs and long cables, could lead me to only one conclusion: it must be possible.And they were right. It is possible. I got it to work. It's glitchy when there's noise, I'll give you that. And it's way out of spec and whether it will be 100% reliable is certainly questionable. But it works. And if I had only FM+ devices on there where I could use stronger pullups, perhaps it would have been immune to noise. Or, perhaps if I had used a shielded cable it would have been immune to noise. Or, I could have used one of several buffer chips to make it immune to noise.So how you come to the conclusion that it doesn't work, when it clearly does, and there are clear ways which it could be made better and much more reliable, I don't know.I mean I get why you would shy away from it if possible since it's not as immune to noise as other protocols. But in my particular usage scenario, it made the most sense.Kind of like how using a 4017 decade counter to animate some LEDs makes sense, even though the thing can barely sink any current, if you are a beginner and need something really simple and cheap and easy to implement. That's where I got my start actually.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: July 14, 2016, 05:45:37 pm
content: Quote from: Starlord on July 14, 2016, 05:27:06 pmWhy do you lie to your self? NOT RELIABLE = IT DOES NOT WORK ON YOUR PRODUCT, the very fact that you are asking for help on it confirms IT IS A PROBLEM. [This kind of pig headed attitude is why things like the batteriser mob exists.]I would love to read the manual for your board: "The user can control the device using I2C, please note that there is only control when there is zero volume and the speaker leads are disconnected."

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 14, 2016, 06:06:55 pm
content: The reason money matters is:0. If you're just giving these away, well, I believe you'd still be liable; but you wouldn't make any money off of it, so you can't do that, anyway. At most, you might make very small quantities of whatever (like, one-offs), which is still a small risk. So, there's money involved.1. Then, quantity. Sold product means production quantities, and multiplied visibility. No, you're not talking about much (hundreds), but "production" doesn't mean millions, it just means producing anything. Having that cash flow means it's scalable, that you can produce (ideally) arbitrarily as much as you can sell.2. It means you have something to loose. Well, apparently your personal finances are in such order that youdon'thave that kind of resource... but someone suing you wouldn't know, or care, about that.Between you, your customers, your customers' neighbors, and the FCC, you may have more trust in them than any of us know about, but that kind of thing is always a bad idea... I wouldn't suggest trusting a customer any further than their contract / terms of sale extends. Even if you know them... no, ESPECIALLY if you know them. If they're any good at all, they'll be that much more understanding of such an agreement.Speaking of contracts, note you can't put "avoid making this criminal" in there. IANAL, but I suspect you could construct something functionally similar, though: in this case, you might stipulate that the product is sold as test equipment only, and is to be operated in a suitably shielded and filtered test chamber. If your customers don't follow suit, that's their problem. If it looks bad to have this in the fine print, well... cost of lost sales versus cost of lost buttocks, your choice.Speaking of lawyers, being able to sell a hundred of something, is also a good reason to talk to one. You'll want to read up on things yourself, look for limited liability clauses and examples, come prepared, and within a few hours of face time, discuss how to form it into a pretty solid agreement. Lawyers are just as cheap as any other professional service (which is to say, yeah..), so make the best of it. It will be well worth it, as long as you can amortize that cost right now.Tim

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 06:09:18 pm
content: Quote from: engineer_in_shorts on July 14, 2016, 05:45:37 pmSitting on my bench, the product worked fine. If there were any glitches, they were occasional, and barely noticeable, since they would only last for 1/60th of a second in between LED updates. A tiny glitch here and there is acceptable, ESPECIALLY if it means I don't have to spend six to nine months and thousands of dollars redesigning the whole thing from the ground up.Now that I have added filtering to the amplifier, I expect there will be no glitches at all in general use.Can I guarantee that if someone is standing next to a CB radio that is transmitting that it won't glitch? No. I could not even guarantee that if I added a shielded cable and buffered the communications. I have absolutely no way to test it under every possible form of interference it might encounter. If it doesn't work in those instances though, so what? Why hold my device to a higher standard than my WiFi router designed by a company with hundreds of millions of dollars in he bank and dozens of highly trained engineers at their disposal, which stops working when the microwave is on? If there's interference, move away from the source. No big deal.QuoteWell happily that is not the case now, because I've added filtering to the amplifier's output to remove the noise that was coupling into the I2C lines. At least I hope so. I won't know for sure until next month when I get the prototype back.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 14, 2016, 06:26:38 pm
content: Quote from: Starlord on July 14, 2016, 01:27:20 pmAn ideal square wave (truly zero risetime) has harmonics out to infinity, but a real (bandlimited) square wave has only finitely many (imagine that, a real 'square' wave doesn't glow with visible band (~500THz) EM radiation!). This manifests as finite rise time, and rounded-off corners (or ringing, as the case may be).For example, you can start with a square wave, which has harmonics as 1/N.If you introduce linear sloped edges (as the SPICE PULSE source provides), then harmonics go as 1/N until a break frequency (on the order of F = 1/t_r), after which point they go as 1/N^2.A triangle wave (which is also the time integral of a square wave, so filtered as 1/N) has harmonics as 1/N^2. You can think of it this way: over suitable frequency ranges, the square wave looks "square" (at lower frequencies), or "triangular" (the linear rising/falling slopes).If you round it off again, you might turn the linear slopes into quadratic slopes (the rising edge becomes a parabolic section from zero to half voltage, and another flipped upside down, going from half voltage to full voltage). Now there's a second break frequency, where harmonics go from 1/N^2 ("triangular") to 1/N^3 ("parabolic", I suppose).If you repeat this process with an infinite series of break frequencies, you could produce a wave where, past some 'ultimate' cutoff frequency, the harmonics drop as 1/e^N, i.e., becoming (for all intents and purposes) utterly zero over not very many steps. This would be a pretty good representation of a real, physical signal -- and, because the exp(t) function has a useful property*, your signal can be real and physical, too.*It can be differentiated forever.So, all that said and done -- you can go back to the scope and make some informed guesses. The risetime defines where the harmonics start dropping off much faster; the "heel" and "knee" of the edge define where things drop even faster; and so on. You probably don't have much beyond the 10s of MHz in that waveform, so you probably don't have to worry about radiating VHF. You do still have to worry about MF and HF, but these require a lot of cable length to radiate effectively, so you can get away with things pretty well as long as your cables are limited in length.Whether that's good enough for your purpose, who knows...As for differential signals, going back to what I was saying about delivering discharge current into free space: if the '+' wire charges an equal amount that the '-' wire discharges, simultaneously, then the net change (to free space) is zero -- no radiation! It's that simple. This (and some other reasons) is why CAT5 can carry gigabits through free air, without appreciable degradation, radiation, or susceptibility. (The hardest "other" reason is, they use signals that can be coupled with transformers. Not every signal can afford such a luxury...)Tim

author: janoc
author_rank: Super Contributor
timestamp: July 14, 2016, 07:26:10 pm
content: Quote from: Starlord on July 14, 2016, 04:32:34 pmThat is not what I meant. One of the key things to being a good engineer is to recognize own limitations and ask someone more skilled in the particular domain for help instead of carrying on and digging yourself into a hole, either because of lack of finances or too large ego (or both). By that I mean an actual engineer actually looking over/helping you design your product, not you cherry-picking irrelevant bits and pieces online.That StackExchange question doesn't consider neither the several feet of cable you are using nor the output of the power amp running parallel to your signal wires. Ever heard of crosstalk? Why did you even consider that it is somehow relevant to your problem? Moreover, none of the answers really apply to your case - guy running serial connection over many meters but using UART not I2C, another one using USB, etc. The only somewhat relevant info on that page is that last guy pointing out the P82B96 line driver - but you didn't choose to use that anyway, so ...If anything, you pointing to that link only shows you don't really understand what you are doing. Electronics isn't software engineering where you can often "wing it" and it still works, only perhaps a bit slower or less memory efficient. Physics doesn't give a damn whether you are trying to feed a family, doing it as a hobby or for profit. Either you do things properly and it will work or you don't and it will not. Flailing hands in the air and whining about people being mean to you won't change anything on that.QuoteYou should stop obsessing about CB radios, those are irrelevant to the problem. There are many other devices that rely on radio communication that you can be easily interfering with. Radio isn't used only by truckers, you know. When your neighbor stops being able to open his garage door because the receiver of his garage door opener will be saturated with the noise from your amplifier, he won't be happy. The same for grandma's hearing aid picking up the noise. Or a house alarm getting triggered few houses down the street.Your wifi router is FCC certified and has to accept interference, even if it means it stops working - 2.4GHz is the same frequency band that also microwaves use. That is the nature of that frequency band - shared use. Most frequency bandsare notlike that and things that are not certified as transmitters (and licensed) are not allowed to radiate anyway, whether intentionally or not.Your devicehasto be scrutinized more carefully than that cheap router, because it is not supposed to emit any RF to begin with. And it also pushes a lot more power than the 1W or so your router does, so the potential for shenanigans is much higher.BTW, rather than complaining about your router you should ditch your cheap microwave that is obviously leaking RF due to poor or damaged shielding (likely the door seal). You could have a much more serious issue than just not working wifi with that - it could be even a health hazard.QuoteSo the occasional glitcheseven on the bench in a controlled and pretty much ideal situationdidn't actually make you wonder that something could be off with your design? If it was glitching on the bench already, in the real world it would not work at all - as you have discovered. You cannot engineer things to barely work on the bench hoping it will be good enough. But I guess you have learned that now. There is a concept of design margin that covers this. Dave uses the "belt and braces" term for it too.

author: tggzzz
author_rank: Super Contributor
timestamp: July 14, 2016, 07:31:14 pm
content: Quote from: Starlord on July 14, 2016, 05:27:06 pmAh. This is clearly a meaning of "work" that is unfamiliar to me. I wonder how long it will be before your unique definition is recorded in dictionaries.

author: tggzzz
author_rank: Super Contributor
timestamp: July 14, 2016, 07:36:36 pm
content: Quote from: janoc on July 14, 2016, 07:26:10 pmJust so.Engineeringis 10% thinking about how things will work, and 90% about thinking about how they will fail.And then avoiding the failure modes.Hackers and the less competent engineer-wannabes never quite seem to realise that.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 08:28:13 pm
content: Quote from: janoc on July 14, 2016, 07:26:10 pmI recognize my limitations. That's why I came here looking for help when I ran into a problem I wasn't sure I could solve on my own in a reasonable period of time.QuoteCan't afford to pay someone more talented than you $50/hr to look over your shoulder as you design a product? Then you're a bad engineer and shouldn't bother trying to design anything. Got it.QuoteSure I've heard of it. But until now, I was flying blind. I've been doing this for six years, and until a couple weeks ago I'd never even used a scope. I couldn't afford one. So, while I knew crosstalk was a thing, I had no idea if it was occurring in any of my circuits, or how serious of an issue it was. As long as my circuit worked, that was good enough for me. And after experiencing it once, it's not like I've suddenly gained the insight I need to know when and where it might crop up again so I can prevent it before it happens. Well, except in the case of this amplifier. I know now that I need that filter on the output if I'm gonna have a long data cable nearby.QuoteThe guy using USB isn't using USB, he just worded it poorly.QuoteAh, but I was AWARE of it. See, I didn't just jump into this like an imbecile. I did my research, like I said. And the plan ALWAYS was that if I could not make it work using just pullup resistors, that the fallback plan would be to use one of those differential buffer chips or the P82B96 to make it work. I was certain those would work.Of course, I was only certain because I wasn't aware of what my amplifier would be doing to my data transmission. But if I'd been aware of that, I would have implemented the filtering on it in the first place, and we wouldn't even be having this conversation because everything would have worked well enough for me with just the pullups.QuoteGee, you think? Personally, I think that if you think YOU know what you're doing, you're the fool. Because the more I learn about his stuff the more I'm certain that I could be at it for the next 30 years and still be learning new stuff. And frankly, that's pretty awesome. I HATED software development for the opposite reason. Once I learned a language, I basically knew everything I needed to know to write any app in it. Then it just became rote. I like solving problems.QuoteI beg to differ. I've been winging it for six years. And my stuff still works. But it may be a bit buggy. And it may fry the occasional SD card. Well, the previous version did anyway. I fixed that particular issue.And code, like electronics, can simply not work, or crash constantly if you don't know what you're doing. One can easily write into program memory by mistake if you're not careful with your pointer arithmetic (and you're not coding on an architecture that prohibits that) and then you'll get random crashes and have no idea what's causing them. Heck, even on the Atmega where you can't overwrite program memory, you can still end up having your variables crash into your stack because you've only got 2K of ram to work with and that's a fun bug to track down since there's no way to know exactly how much RAM you're using on either end.QuoteDefine work. Because in software, a program is considered to work even if it has hundreds of bugs just waiting to wreak havoc, and people have come to expect that in any software package. I wouldn't say a board that doesn't work perfectly in every instance is necessarily broken. Is a toy that glitches when the batteries run low instead of shutting off broken? Or did the toy maker decide that was an acceptable mode of failure for a product of that price range and purpose?QuoteOf course I wondered what was wrong with the thing when I saw glitching on the bench. But having no scope, I had no idea if it was a software or hardware issue. So I tweaked the software, and eventually got the glitching to go away. At least 99.9% of it. The 0.1% was barely noticeable, to the point that I wasn't even sure if I was seeing it. It could have been an artifact of multiplexing in my peripheral vision. And since I was pressed for time and money, if I couldn't even be sure it was happening myself, my customers probably wouldn't notice it.QuoteDave also says that failures can be a good learning experience:

author: Monkeh
author_rank: Super Contributor
timestamp: July 14, 2016, 08:38:47 pm
content: Quote from: Starlord on July 14, 2016, 08:28:13 pmWork: Function without error across the entire expected and acceptable range of operating conditions.Discharged batteries are outside the acceptable operating conditions. Presence of a radio transmitter in a licensed band is not outside acceptable conditions, it isinevitable. If your product craps itself when someone walks past with their phone ringing, it does not work!No, you can't test every possible source of interference, but you can test quite a range easily enough with items you have at home, and you can make a serious effort to protect it against interference. Alternatively, you can just shove a 'high' speed single ended interface down a bit of unshielded cable and hope for the best.. and receive the worst.QuoteNo, you need that filter, and a reasonably proven working example for that matter, on the output whenever you're going to have a cable attached to it. It is not about it interfering with your own product, it's about everything else it interferes with!

author: dmills
author_rank: Super Contributor
timestamp: July 14, 2016, 08:53:42 pm
content: Quote from: Starlord on July 14, 2016, 01:44:58 pmI also lack a degree and my software skills are mainly C and old C++ with a few assemblers thrown in (So also 20 years out of date to some ways of thinking), it has not stopped me being hired as lead hardware engineer (Who ends up doing a disgusting amount of software).Task domain knowledge is the key to getting jobs without a degree, by which I mean that 'electronics hobbyist' is unimpressive, electronics hobbyist who understands diving or soil mechanics or concrete engineering or hydrology or broadcast TV workflow or fleet logistics or whatever is potentially very interesting to the right sort of company (The dirty little secret is that figuring out what problem needs solving is often harder then designing something to solve it).I would second the comment that design is less about the ways it can work then about eliminating the ways it can fail, and EMC is not exactly an area that gets no discussion, you can never ignore physics, them laws need no court.Regards, Dan.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 14, 2016, 09:01:32 pm
content: Quote from: Monkeh on July 14, 2016, 08:38:47 pmI only didn't include the filter in the first place because I didn't know the amplifier would interfere with anything. Now that I know it might, I'll include it in future designs.

author: Someone
author_rank: Super Contributor
timestamp: July 14, 2016, 10:22:43 pm
content: Quote from: Starlord on July 14, 2016, 12:49:22 pmQuote from: Starlord on July 14, 2016, 01:44:58 pmIts one or the other, you keep trying to walk this line ofneedwhen you actually have a self interestedwant. This isn't the business for you, most startups fails and most of us would have taken on plans we couldn't complete, its the nature of exploring and inventing but you have to accept that you don't always get the positive outcome. You've backed yourself into a corner with promises for delivery and taking payment for a "product" that doesn't work, and thats your real problem. You've learnt a lot in the process but as my posts have mentioned already, you won't find free and easy solutions to your problems, it needs going a long way back in the design process and starting again.Quote from: Starlord on July 14, 2016, 01:44:58 pmSo you'd still like us all to subsidise your business endeavours with free consulting.

author: Starlord
author_rank: Frequent Contributor
timestamp: July 15, 2016, 01:20:19 am
content: Quote from: Someone on July 14, 2016, 10:22:43 pmWell sure, I don't need to enjoy life, I could live out the remainder of my days working a job I hate for minimum wage, every morning getting up at the crack of dawn wanting to kill myself, I GUESS.QuoteI've been trying to start a business for 20 years. I've been a failure for 17 of them. Most startups fail? Every startup fails... until it succeeds.Designing electronics is the first somewhat successful business venture I've had. And yes, I consider it a success, even if I'm only barely earning a living, because barely earning a living working for myself doing something I love is a thousand times better than barely earning a living making someone else rich while doing something I hate.But aside from that, I can now actually see my business growing. Especially in the last year, after several manufacturers targeting agile business models popped up specializing in small runs of PCBs. It only took LadyAda ten years to grow her company into a $33M juggernaut. There's no reason I can't do the same.QuoteDo you do this professionally? Do you watch Dave's videos? Do you learn anything from them? How dare you!You know in all my days, I have never seen a software developer refuse to help another software developer because they were doing it for a living. We actually have conferences where people go to give free advice to their direct competitors.In fact you might have heard of this little thing called virtual reality, and a guy named Palmer Luckey? Maybe you've also heard of John Carmack, creator of Doom and rocket scientist? Well Palmer's business, the one that just got bought out by Facebook for hundreds of millions of dollars, only took off because John decided to take him under his wing, and then Gabe Newell at Valve software did the same. To no benefit of them I might add. Aside from the fact that they wanted to push VR in their respective industries.I wouldn't refuse to help someone just because I knew they were making something to sell. And frankly if that's your attitude, I'm not even sure why you're here, because I'm sure a good half of those here requesting assistance have at some point sold something they made, or work in the industry.

author: Someone
author_rank: Super Contributor
timestamp: July 15, 2016, 03:33:44 am
content: Quote from: Starlord on July 15, 2016, 01:20:19 amRight now you're pleading how your business relies on us giving you help, and how its affecting your personal situation. Some of us don't care, and I for one as a contractor am offended at your approach to the industry. I get paid to produce designs for people, that are delivered in a certain timeframe and with a certain price. You're coming along and trying to provide a product without the ability to do so, and now want free help so you can complete on time and on budget. Its not just some experimenting and learning (as most of the contributed work on this site is) you want free advice which other people would pay for, so you can bid lower on offering designs/products and make a profit for your self. We get nothing out of this transaction unlike all the wonderful projects explored here at the expense of dedicated hobbyists who both take on and share experience about the project that we can all learn from. There are other people on here that make wildly narrow requests obviously for their paid employment and they don't get help from me, a friendly pointer or assistance but not the laid out designs they are fishing for.On that note it is amusing to watch the complicated solutions which get posted to these threads.You put it best yourself:Quote from: Starlord on July 04, 2016, 02:45:56 amThough we'd replace the end of the sentence with something more like: "It works well enough for your needs, but I can't in good conscience sell this to you in its present state. It's not dangerous, but its unlikely to work reliably and might interfere with other things around you which would put me in legal trouble"All the time you spend here is time you could have spent debugging your problems. Enjoy the ride:https://en.wikipedia.org/wiki/Scam_baiting

author: Starlord
author_rank: Frequent Contributor
timestamp: July 15, 2016, 04:30:02 am
content: Eh, you know what, I'm done with letting you waste my time.

author: janoc
author_rank: Super Contributor
timestamp: July 15, 2016, 01:38:28 pm
content: Quote from: Starlord on July 15, 2016, 04:30:02 amGood luck, you will need it.

author: andyturk
author_rank: Frequent Contributor
timestamp: July 15, 2016, 04:31:46 pm
content: Quote from: Starlord on July 14, 2016, 01:44:58 pmHey Starlord, we have a lot in common. I'm self taught too (as far as EE is concerned), with professional software skills from two decades ago (more like three, if I'm being honest). But I've never touched an Arduino, so you're ahead of me there.Even so, I've talked my way onto some fascinating projects in the past few years, and contributed firmware to two shipping consumer devices that you can buy today. I bought my first DMM in 2013, so if I can do it, you can too.You've gotten into a bad vibe here with the EEVBlog brain trust, but hopefully that's temporary. There are some really heavy-hitters here, who know their craft and are willing to help newbies like you and me. So, step a way from the keyboard for a while, chill out, get some exercise, whatever it takes, and then come back to ask good questions.These people *love* good questions, and they will help.

author: tggzzz
author_rank: Super Contributor
timestamp: July 15, 2016, 04:37:47 pm
content: Quote from: andyturk on July 15, 2016, 04:31:46 pm... and they do it because they enjoyhelpingpeople.

author: SteveyG
author_rank: Unknown
timestamp: July 17, 2016, 08:45:51 am
content: Quote from: janoc on July 14, 2016, 07:26:10 pmStarlord, please absorb what janoc has to say. The replies are factual andwill help you. It would be worth looking at a few online resources about EMC - specifically radiated and conducted immunity and emissions. There's plenty of good stuff out there, but you'll see a lot of your 'counter arguments' are not arguments at all. Rather than arguing, take a step back and read the posts without the mindset of feeling attacked - no one is actually attacking you, they're trying to help and warning you of the issues you will face or are facing.

author: 84750Erik
author_rank: Contributor
timestamp: December 31, 2019, 02:44:52 pm
content: Somehow I stumbled on this thread, and after reading the whole thing I am wondering how our StarLord might have ended up.