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
- Tie every unused CD40106 input to GND or VDD to prevent erratic switching and oscillation. [Elektroda, Anonymous, post #21681944]
- Relay coil needs a flyback diode; connect cathode to +V, anode to the transistor side. [Elektroda, Anonymous, post #21681944]
- At 5 V with 100 Ω, LED current is approx. 26 mA; aim near 10 mA instead. [Elektroda, Anonymous, post #21681944]
- Suggested values: 5 V rails → R5/R6 ≈ 2.2 kΩ, LED resistors ≈ 270 Ω; 12 V → 10 kΩ and 1 kΩ. [Elektroda, Anonymous, post #21681943]
- Stiffen the 5 V supply with ≳470 µF across the rails to stop threshold wobble. [Elektroda, Anonymous, post #21681953]
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)
- Replace the relay with an LED and resistor; check for flicker.
- Add flyback diode to the relay; re‑test with relay.
- 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]