Strange behavior of UNL2003 (all pins turn on together)

Hi everyone.

I'm having a problem with the ULN2003A IC. When I connect this specific type of buzzer to one of its pins, all the pins turn on together for a brief period of time (~50us).

For clarification I have made a simplified circuit that is able to reproduce the error.

Here is the schematic of the circuit:

It is very simple.
Outputs 1 and 2 of the IC are pulled up to +5v, and are connected to channels 2 and 3 of my logic analyzer.

Output 7 is connected to a buzzer's negative terminal.
The buzzer's positive terminal is connected to a 12v switching power supply.
Input 7 is connected to a simple push button to turn the output on and off.

Expected behavior:
When pushing the button output 7 should go LOW, turning on the buzzer.
Other outputs of the IC should be unaffected.

Observed behavior:
When pushing the button output 7 goes LOW, turning on the buzzer.
All other outputs also go low for a brief period of time (~50us).

Here is a logic analyzer capture of the button presses and the corresponding switching of other pins.

It's not just the two pins. Here's all other pins connected to the analyzer:

Interestingly this only happens with this specific kind of buzzer. It only draws about 10mA. I've connected 400mA loads to this same circuit and this glitch doesn't happen with them.

Here's a capture of the exact same setup. Only this time the buzzer is replaced with an LED (draws 400mA).

Anyone has any idea what's going on here?

Try pulling pin9 (COM) to +12 volts.

I did that and the glitch stopped on pins 13-16

I am not any less confused :thinking:

Could lower the sampling frequency, however glitches of only a few samples don't concern me. Have you tried using the glitch filter?
image

Why tho? Are you implying this is an analyzer software glitch?

It is not. This is just a sample circuit. In my main circuit one pins of the ULN2003 is is connected to the RESET pin of a microcontroller. When I turn on this buzzer the microcontroller resets.

A buzzer is electrically very noisy and the circuit benefits from a flyback diode across the buzzer to control this.
The IC you are using (ULN2003) has a provision for this. However, you have to connect it explicitly. In this case the connection between COM and +12V.
Unused inputs should be pulled low.

@6v6gt I did try adding a 1n4148 flyback directly to the buzzer and it did nothing. Also why are pins 11 and 12 still glitchy if that's the case?

@dlloyd Here's a capture with 100 samples glitch filter and 8MS/s

You've pulled the corresponding inputs, that is pins 5 and 6, LOW (say 10k) ?

They are internally pulled low. But to make sure I shorted all inputs to the ground. And here's the result:

All inputs shorted to ground and 4148 across the buzzer:

All inputs shorted to ground and pin 9 connected to +12v:

  • Try a different logic threshold ... 1.8V or 3.3V
  • Try a 0.1μF cap at the output that switches the buzzer.
  • Add a 0.1μF decoupling cap at the power pins of the UNL2003
  • Connect all grounds separately to a common point (at the supply ground).

The main circuit uses 5V logic. I need to find out what's going on here instead of changing the circuit.

That doesn't help. But adding a 10uF stop the issue. However it makes the buzzer continuously buzz with a low volume. I assume it messes with the internal oscillator cause it's an active buzzer.

ULN doesn't really have power pins. It's just seven transistors stacked together with a common emitter which you connect to ground.

All my grounds go to the breadboard power rail which is connected to the 12v and 5v supply negatives. I think I already have a "star" ground as you'd call it.

As I was trying different things I added a diode in series with the buzzer and pins 13-16 stopped glitching. Then I connected pin 9 to +12v and the issue is now gone.

Can anyone give any explanation with this new insight?

Thought you were already connecting COM to +12V as suggested in reply#2.
This is needed for the internal clamp diodes to work for inductive loads (i.e. buzzer).

I did but pins 11 and 12 still showed the erroneous behavior.
When I connect a diode in series AND connect com to 12v all pins behave normally.

I still don't understand how this can affect other pins tho.

Also if this is happening because of induced voltage why does adding a flyback diode directly to the buzzer have no effect?

I think the fact that the ULN2003 uses darlington type transistors (high VCEsat voltage) and your probes (referenced to 5V?) and your logic threshold setting (1.2V? or 1.8V? or 3.3V?) could make things overly sensitive to show glitches. I would try changing the threshold setting to 3.3V.

I'm not sure what you mean by that. What threshold?

I use the Logic Pro 8 ... perhaps this isn't available on your logic device.

The actual threshold values are quite low ... within the VCEsat voltage, so I think this could explain the glitches.

1.2V Voltage Option

- Voltage threshold: 0.6V

1.8V Voltage Option

- Voltage threshold: 0.9V

+3.3V Voltage Option

- Voltage threshold: 1.65V

Oh I see.
Mine doesn't have that option.

Tho if my understanding is correct, the VCEsat you mention could only trigger a false HIGH. But I'm measuring LOW signals here because the IC is a bunch of "open collector" transistors.

BTW as I was searching I stumbled upon a forum post that said a resistor can also be used as a flyback protection. I added a 1k resistor across the terminals of the buzzer and the issue is gone now.

I assume something within the oscillator circuitry of the buzzer was creating this.

I may open up one of them to see what exactly is going on.