Kemet EC2-5NU relay problem

Started by ElectricDruid, December 29, 2020, 08:02:54 AM

Previous topic - Next topic

anotherjim

Do you mean the relay coil is making the noise like the inductors in some old switchmode PSU's do?
Is the micro output pulsing? Are you using an analog_write instead of digital_write to switch the BJT?
Do you have a flyback diode across the coil (can kill the BJT if no diode).
Schematic! Code snippet!



Ripthorn

Hi Jim, you are right that I was a little light on details. I don't have the schematic on this computer at the moment, but here are some notes:

- microcontroller is using a digital write to energize the transistor
- flyback diode is in place
- The noise on my signal line is the same noise as is heard on the relay coil contacts using an audio probe, just at a reduced level
- I realized after posting that my signal input trace is routed between the relay coil contact pads on the PCB. I have cut the track and soldered in a jumper wire from the source point on PCB to test, but haven't had a chance to plug it in yet.
- I'll post schematic snippet after I get home.
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

Ripthorn

As promised, here is a schematic snippet of how I have the relay coil contacts configured. Anything look amiss here?



Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

Ripthorn

Below is a more complete picture of the situation. I found that if I short R12, the hissing goes away. The point marked L2 is the +5V from the microcontroller pin. Unfortunately, I am trying to also use this pin for turning on an LED, but when I short R12, the LED essentially turns off. I am assuming this is because the base of the transistor gets pulled to the B-E voltage, which is low enough that my LED with CLR doesn't have enough juice to shine. Any ideas?

Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

Rob Strand

#24
QuoteBelow is a more complete picture of the situation. I found that if I short R12, the hissing goes away. The point marked L2 is the +5V from the microcontroller pin. Unfortunately, I am trying to also use this pin for turning on an LED, but when I short R12, the LED essentially turns off. I am assuming this is because the base of the transistor gets pulled to the B-E voltage, which is low enough that my LED with CLR doesn't have enough juice to shine. Any ideas?
Shorting R12 is essentially shorting the output of the micro through the BE junction.   It's going to be a low impedance.   It loads the micro pin down and that's why the LED goes out.  Not a good test, wiring R12 to +5V better.

Try putting a cap across the BE junction of the transistor.  Start with 100n, then 1uF, then 10u.  Make sure the cap is discharged before soldering.

I'm with Jim in that I suspect the micro output is not a stable 5V.    The software might be doing something weird like toggling the pin state or toggling between an input and output definition.  One way that can happen is writing bytes which sets the bit you want but destroys the other bits on the same port.   In this case you need to keep a mask of set bits in a variable then output the whole lot at once at each location.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

anotherjim

Depends on the platform.
Arduino I/O is designed around the hardware in the MCU so it doesn't present so much pin contention. When you start to use library code, then you need to be careful as it can then have to use a standard I/O pin for another purpose.

I wonder is the controller has an active USB connection? This can carry a 1kHz whine due to polling every 1ms (the bane of cheap soundcards). Having USB in an audio system obviously can be done, but needs better filtering.

If you want USB for a debugging serial monitor of your code, all might be well when you take that out and disconnect the USB.


This looks ok to me. One thing I don't see is a larger cap on the regulator output. I'd fit at least 100uF in addition to the 100nF (keep that). Regulators can be unstable without enough capacitance (should be some on the regulator input too).

Rob Strand

#26
Quote(the bane of cheap soundcards). Having USB in an audio system obviously can be done, but needs better filtering
FWIW,  the PC front panel connector has both USB and audio. They shared the same ground wire which is a total disaster for noise.   You can split the USB and audio ground wiring to the front panel.  You also have to cut the common ground tracks between the USB and audio on the small PCB behind the front panel of the PC.  Using USB connectors at the rear of the PCB and not on the front panel helps enormously.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

anotherjim

I was thinking of the cheap (really cheap) single-chip USB soundcards. Codec & USB in one. They are generally useless for recording due to noise. You can cut the whine with extra filtering, but line input has the same preamp gain as the mic and relies on digital volume control to reduce the level. Sound quality is hideous!

All that said, we don't yet know if USB is relevant yet. But another USB issue is that it has no ground isolation from the host device, so there are common ground induced noises too.


ElectricDruid

Rather than driving the LED from the micro's output pin, you might be better off putting it in parallel across the relay coil with whatever series resistor it needs for 4.4V (about what it'll get once you take the BE drop off). The transistor can handle loads of current, so there's no problem there, and it avoids the load on the micro's pin.

Plus I know it works, cos I tried it! ;)



anotherjim

I didn't see the LED on the scheme. It would be better run off the transistor switch with the relay, but it should work off the micro's pin IF it has its own series resistor. Without a resistor, the LED will clamp the digital output to its forward voltage drop and overload the pins drive circuit in the micro. If fitted across the relay, the LED still needs a series resistor.

On an Arduino, one of the pins is already driving a LED on the board (pin13?) - avoid that pin if you want to drive any kind of load off it.


Ripthorn

Good suggestions, guys. I'll give them a try!
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home