logo elektroda
logo elektroda
X
logo elektroda

CD40106B Schmitt Inverter Relay Drive: Why Does My Relay Buzz and LED Flicker?

189 13
ADVERTISEMENT
  • #1 21681942
    Graham Rounce
    Anonymous  
  • ADVERTISEMENT
  • #2 21681943
    David Ashton
    Anonymous  
  • #3 21681944
    Aubrey Kagan
    Anonymous  
  • ADVERTISEMENT
  • #4 21681945
    Aubrey Kagan
    Anonymous  
  • #5 21681946
    Graham Rounce
    Anonymous  
  • #6 21681947
    David Ashton
    Anonymous  
  • #7 21681948
    Graham Rounce
    Anonymous  
  • #8 21681949
    Graham Rounce
    Anonymous  
  • ADVERTISEMENT
  • #9 21681950
    Aubrey Kagan
    Anonymous  
  • #10 21681951
    Graham Rounce
    Anonymous  
  • ADVERTISEMENT
  • #11 21681952
    Aubrey Kagan
    Anonymous  
  • #12 21681953
    David Ashton
    Anonymous  
  • #13 21681954
    Larry Normand
    Anonymous  
  • #14 21681955
    Larry Normand
    Anonymous  

Topic summary

✨ A circuit using a CD40106B hex Schmitt inverter to drive a BD139 transistor and relay exhibits relay buzzing and LED flickering issues. When the input voltage is below ~2V, one LED and the BD139 conduct correctly; above ~3V, the relay buzzes and the LED flickers until the voltage stabilizes. Replacing the relay with a resistor initially resolved the issue but later caused flickering again. Key troubleshooting steps include verifying the diode across the relay coil to suppress back EMF, grounding all unused CD40106B inputs to prevent undefined CMOS behavior, and checking LED orientation and resistor values to ensure appropriate current limiting (targeting ~10mA). The wired-OR transistor base configuration is unconventional but functional. Potential causes for instability include damaged CD40106B ICs, insufficient power supply decoupling, and possible oscillations in the op-amp stage. Adding decoupling capacitors (e.g., 0.1µF and 1000pF) on supply and input lines, ensuring a stable 5V regulated power supply with adequate bulk capacitance (≥470µF), and testing the circuit with LEDs instead of the relay are recommended. The flickering and buzzing likely stem from power supply fluctuations or back EMF damaging the IC, with the relay diode polarity and wiring critical to circuit stability.

FAQ

TL;DR: CD40106B relay buzz/LED flicker is usually drive, supply, or back‑EMF related. Expect ~30–35 mA with 100 Ω at 5 V, and remember: "Back EMF from relays has destroyed more circuits..." Fix with flyback diode, decoupling, and right resistors. [Elektroda, Anonymous, post #21681943]

Why it matters: This FAQ helps hobbyists and engineers quickly diagnose buzzing relays and flickering LEDs when driving loads from a CD40106B Schmitt inverter.

Quick Facts

How do I stop my relay buzzing and the LED flickering with a CD40106B?

Add a flyback diode across the relay, decouple the IC and op-amp, and use proper LED/base resistors. A weak 5 V supply shifts thresholds and causes chatter. Start by testing with an LED load instead of the relay to confirm stability. “Back EMF from relays has destroyed more circuits...” so verify the diode’s polarity. [Elektroda, Anonymous, post #21681943]

What causes a CD40106B output to chatter near the threshold?

Floating inputs, insufficient decoupling, or a sagging supply can push the input around the hysteresis. Tie every unused input to a defined level, add 0.1 µF at each IC’s Vdd–GND, and a bulk electrolytic on the rails. Replace the relay with a resistor or LED to isolate supply effects. [Elektroda, Anonymous, post #21681944]

Do I need a diode across the relay coil, and which way around?

Yes. Place the diode directly across the coil: cathode to the positive supply, anode to the transistor/low side. This clamps the coil’s back‑EMF and protects the driver transistor and logic from voltage spikes that cause buzzing or damage. [Elektroda, Anonymous, post #21681944]

Could my CD40106B be damaged—what likely killed it?

A miswired or missing flyback diode lets the relay’s back‑EMF punch the output stage or the driver transistor, propagating stress into the 40106. One helper noted the 40106 can handle about 10 mA per output, so the relay event, not LED load, is suspect. [Elektroda, Anonymous, post #21681947]

How should I size the LED resistors at 5 V?

With 100 Ω and a red LED, current lands around 26 mA. Target about 10 mA to reduce loading and noise; increase the series resistor accordingly. This also prevents supply droop that shifts the Schmitt thresholds and induces flicker. [Elektroda, Anonymous, post #21681944]

What are good resistor values for the BC547 drivers and LEDs?

For 5 V rails, use about 2.2 kΩ feeding the BC547 bases and ~270 Ω for LED series resistors. For 12 V systems, move to ~10 kΩ for bases and ~1 kΩ for LED resistors. These values limit current and reduce interaction. [Elektroda, Anonymous, post #21681943]

Is my breadboard “rat’s nest” causing the flicker?

Usually no, unless wires dangle or break. To rule it out, unplug the op‑amp and manually force the CD40106 inputs high/low; watch whether the LED still flickers. This isolates the logic and proves if the board layout is at fault. [Elektroda, Anonymous, post #21681952]

How do I check for op‑amp oscillation that makes LEDs flicker?

Probe the op‑amp outputs with a scope. Add 0.1 µF decoupling at the op‑amp and CD40106, and try small capacitors on the reference network (e.g., 1000 pF across R2/R4). Also try a small cap on “IN” to tame noise. [Elektroda, Anonymous, post #21681950]

What bulk decoupling should I add to stop threshold wobble?

Place at least a 470 µF electrolytic across the 5 V rails near the load and logic, plus local 0.1 µF ceramics. This reduces supply impedance so relay or LED current pulses don’t modulate the CD40106 thresholds. [Elektroda, Anonymous, post #21681953]

Are my unused Schmitt-trigger inputs allowed to float?

No. Floating CMOS inputs pick up noise and can latch unpredictably. Tie every unused CD40106 input to ground or VDD. This single change often eliminates weird flicker and prevents extra supply current. [Elektroda, Anonymous, post #21681944]

Is wiring two BC547 emitters together into a BD139 base okay?

It is unconventional but workable. To protect the BC547s, consider diodes to prevent reverse base‑emitter stress. The BC547’s reverse B–E breakdown is about 6 V; staying under this avoids damage when the other path drives. [Elektroda, Anonymous, post #21681945]

How can I quickly isolate whether the relay or logic is the problem? (3‑step How‑To)

  1. Replace the relay with an LED and resistor; check for flicker.
  2. Add flyback diode to the relay; re‑test with relay.
  3. Add 0.1 µF at ICs and ≥470 µF on rails; retest thresholds. [Elektroda, Anonymous, post #21681950]

My supply is 5 V—could it still be the culprit?

Yes. High‑impedance or unregulated 5 V rails can droop when the relay or a 100 Ω load pulls current. That shifts thresholds and causes chatter. Use regulation and add a ≥470 µF capacitor across the power rails to stabilize the system. [Elektroda, Anonymous, post #21681953]

Can I skip discrete fixes and use a PIC instead?

You can, but the thread shows the discrete path works once decoupling, flyback, and resistor values are correct. Fixing fundamentals gives immediate results and keeps the design simple and robust. [Elektroda, Anonymous, post #21681948]

What is a Schmitt trigger inverter (CD40106B)?

It is a CMOS inverter with hysteresis that cleans noisy signals. It switches low near one threshold and high near another, reducing flicker around boundaries. Proper supply decoupling and defined inputs are still essential for stable behavior. [Elektroda, Anonymous, post #21681944]
ADVERTISEMENT