20
\$\begingroup\$

Whenever I turn on my desk lamp, my board crashes. Sometimes I get garbage out of the serial port, sometimes it resets.

I tried adding some extra bypass capacitors on my breadboard, but that made no difference.

(My desk lamp uses a 20W, 12V halogen bulb. It has a transformer in the base)

Can anyone offer suggestions as to why this might happen and how I can stop it?

Here are two of the boards - they were USB dongles, but are both now powered from a single wall-wart via a 3.3V voltage regulator.

Watching on a scope, when I flick the light switch I see a spike on both 3V3 and wall wart lines.

Edit:

Here are traces of the input and output of the 3V3 regulator when turning the light on and off respectively.

5V is on the top, 3V3 on the bottom

The regulator is a ZSR330.

Edit:

Some careful reading of the datasheet threw this up:

The RESET_N pin is sensitive to noise and can cause unintended reset of the chip. For a long reset line add an external RC filter with values 1 nF and 2.7 kΩ close to the RESET_N pin.

My programming cable connects a long wire via a breadboard to the reset pin. I suspect that this was the problem.

\$\endgroup\$
  • 4
    \$\begingroup\$ You bring the most interesting questions Joby. This can be a very common occurrence, but most people are not able to reproduce it so well. \$\endgroup\$ – Kortuk Nov 23 '10 at 22:32
  • \$\begingroup\$ How far apart are the board and the lamp ?? and does the voltage fluctuation change if the lamp is further away from it ? \$\endgroup\$ – Zaxx Nov 24 '10 at 0:19
  • \$\begingroup\$ @Zaxx They were 1ft away, I've just tried 3ft and seen no voltage difference on the scope spikes \$\endgroup\$ – Toby Jaffey Nov 24 '10 at 0:27
  • 1
    \$\begingroup\$ @Joby Taffey how hard is it to move it further away from the lamp? Also can you hook one or the other up to a different outlet, preferably one on a different circuit? This might tell you a bit more about what is going on. \$\endgroup\$ – Kellenjb Nov 24 '10 at 2:46
  • \$\begingroup\$ and just connect a 10K load resistor to the output of the regulator and check whats the results. and whats the capacitance you have used for the filter capacitor ??? hope its at least 1000mico at the power supply end. \$\endgroup\$ – Zaxx Nov 24 '10 at 4:34
13
\$\begingroup\$

The transient is getting through the regulated supply.

Try adding an inductor to the power supply positive output.

That may suppress the positive-going transient.

| improve this answer | |
\$\endgroup\$
  • 3
    \$\begingroup\$ What value would you use? \$\endgroup\$ – Kellenjb Nov 23 '10 at 22:32
  • 1
    \$\begingroup\$ This is a conducted emission, but how to isolate it is nasty. \$\endgroup\$ – Kortuk Nov 23 '10 at 22:32
  • 7
    \$\begingroup\$ I think the speculation is that it's a current spike causing the problem. Inductors resist rapid changes in current, like caps resist changes in voltage. \$\endgroup\$ – pingswept Nov 24 '10 at 1:06
  • 2
    \$\begingroup\$ You've already got some capacitance, so adding an inductor turns into a better low-pass filter. \$\endgroup\$ – Tim Williscroft Nov 24 '10 at 1:09
  • 2
    \$\begingroup\$ I can't tell the capabilities of that scope but if it can FFT the 5V line you should be able to tell at what frequencies your noise exists. Choose your LC filter corner frequency based on that. \$\endgroup\$ – Mark Nov 24 '10 at 19:27
7
\$\begingroup\$

Is that mains circuit overloaded?

Halogen bulbs draw a large amount of current when they are cold, like 10+ times their normal current draw. This should only last for a split second, just long enough to heat the filament up to operational temperatures. Halogen bulbs do run very hot so perhaps this affect last longer / draws more current than your average incandescent, i'm not sure.

I would say that current spike is causing some issues on your mains lines.

Did you scope the input to the 3.3V regulator?

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ This is a good point - check the mains voltage. If necessary, probe it through an isolation transformer, like a cheap wall wart. (Don't plug your scope straight into mains because you could get all sorts of horrible transients destroying your scope - a 12V xformer will at least divide by 10 or 20 any transient.) \$\endgroup\$ – Thomas O Nov 24 '10 at 0:17
  • \$\begingroup\$ @Mark Yes, that wall socket is overloaded, I also have a 1500W electric heater on it. I tried unplugging everything but the lamp, it didn't seem to help \$\endgroup\$ – Toby Jaffey Nov 24 '10 at 0:25
  • \$\begingroup\$ @joby Those scope images make it look like the the LDO is oscillating, that parts claims no external components needed for stability but you may try some more decoupling on the input and output of the regulator. Can you make similar measurements at the input to the regulator and post them? \$\endgroup\$ – Mark Nov 24 '10 at 1:32
  • \$\begingroup\$ @Mark In the photos, the top trace is the input to the regulator, the bottom is the output \$\endgroup\$ – Toby Jaffey Nov 24 '10 at 9:40
  • \$\begingroup\$ Mark - these little 20W halogens aren't normally that bad, mainly due to the transformer limiting the inrush current significantly. Mains voltage halogens can be very bad. \$\endgroup\$ – Cybergibbons Nov 24 '10 at 11:03
4
\$\begingroup\$

I had a similar issue with my powerline ethernet network adapters. When communicating they would induce up to 200mVp-p noise on the 3.3V line of my breadboard. It didn't cause any problems, because my MCU was rated from 3V to 3.6V, but it was interfering with my ability to scope the system. I never really sorted out the problem until I moved the adapter to another plug extension. This might have provided sufficient isolation between the power supply I was using (old computer ATX), or it could have been something else.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Interesting idea. I do have powerline ethernet adapters, but they're connected to a different wall socket \$\endgroup\$ – Toby Jaffey Nov 23 '10 at 22:38
3
\$\begingroup\$

I see ground loop and may be you have lots of power, signal loops. effectively you have large area of single turn inductances. This loops work like secondary coils of air transformer (magnet antenna) which reacts to AC magnetic fields.

The midpoints of loops where you have joints are some center-points of this coils and produce variety of signals with very low source impedance and short circuit currents up to milliamperes, which make voltage of noise signals that high.

To fix it, try to rewire all inter-board symmetrically with single "grounding tree" and power, signals coming over twisted pair wires.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

If I was going to power USB dongles directly from a PSU, it would be a 5V one, not a 3V3 one, because USB VBus power is 5V not 3V3. Not sure if that's the problem, but if they're incredibly marginal on supply voltage, that wouldn't help.

But probably your problems are just the kind of craptastic grounding you get on breadboard - your supply rails probably form a vast weak loop, just waiting to have problematic voltages induced on it.

You don't say where your bypass caps were added, nor their value, but you should make sure that you have plenty of capacitance right at the point the supply is used, not the far end of 6" of cable from the load. You will probably struggle to measure induced spikes sensibly with a scope, because so much will be picked-up on the scope's ground lead, but if you're going to try, then make sure you measure with both the ground-lead and the probe at the load, not somewhere else in the circuit.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Re: the 5V suggestion - There are two chips on the board, one has an internal 3.3V regulator and supplies power to the second - a CC1110. I am trying to power this chip directly (more detail blog.hodgepig.org/2010/11/23/im-me-dongle-uart) \$\endgroup\$ – Toby Jaffey Nov 23 '10 at 23:00
  • \$\begingroup\$ @JobyTaffey, When I have worked with the CC1100 if you do not have excellent decoupling they throw a fit, but that probably has something to do with your question. \$\endgroup\$ – Kortuk Nov 24 '10 at 20:49
2
\$\begingroup\$

This doesn't apply to you, but maybe someone searching will find this: Semiconductors are light sensitive. If you have a precision analog circuit, and parts of it are in translucent cases, like glass diodes or metal-can op-amps (the bottom seal is translucent), you can expect significant offset shifts when light shines on the circuit. Modern black epoxy packages are less susceptible. It's easy enough to check if this is causing the problem: If the problem stops when the circuit is covered by a box or something, the problem is the light, not the EMI.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.