Author Topic: ringing in signal  (Read 2517 times)

0 Members and 1 Guest are viewing this topic.

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
ringing in signal
« on: September 04, 2023, 06:58:31 pm »
EDIT: It turned out the problem was the base on the optocoupler should not be left floating!

I have this:



I know this is not ideal and if doing it over I'd use a proper transmission line setup. I will go that route if I must, but for now I'm playing with this 1) to salvage it if possible, and 2) for the experience to improve my understanding.

I'm sending a signal at 400 baud, so 2.5ms between transitions. Most often it works perfectly, between pins 11 and 12:



Once in a while it looks like this:



When this happens, there are about 1-6 dips and they are ~0.7ms apart. In all these tests, the "long wire" is about 14" of ethernet.

This doesn't seem to be EMI, as the signal is stable except after a low to high transition, and even then it only happens once in a while.

Another pic of the anomaly:



What could be the cause? Is it reflections in the 14" cable? Why does it only happen sometimes?

Starting from the source, here's between pins 1 and 2:



Nice and clean. Between pins 4 and 5:



Some noise, I wonder if this is the problem already?

Next, how might I ignore this noise? Yes, use a proper transmission line! :D I may still do that. Scrapping everything would be a lot of work and cost. Scrapping only the receiver is less than 1/10th the effort and even less cost.

0.7ms = ~1.4kHz. I could use an RC filter < 1.4kHz and > 400Hz. Maybe 800Hz or so? Is that likely to clean up the signal enough to make receiving reliable? I know questions like that are not really unanswerable. Maybe instead: Is an RC filter the right approach to condition the signal so the dips don't interfere with decoding?
« Last Edit: September 04, 2023, 09:30:53 pm by n4te »
 

Offline wasedadoc

  • Super Contributor
  • ***
  • Posts: 1730
  • Country: gb
Re: ringing in signal
« Reply #1 on: September 04, 2023, 07:11:41 pm »
That is not ringing. Nor is it noise on the wires.  Those negative going glitches are clearly at regular intervals.  The problem most likely is the input signal to the first optocoupler.  Hang the second channel of your scope on there to prove it.
« Last Edit: September 04, 2023, 07:15:57 pm by wasedadoc »
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 2295
  • Country: us
Re: ringing in signal
« Reply #2 on: September 04, 2023, 07:22:39 pm »
And it is definitely not due to reflections on a 14-inch twisted-pair wire.  Those would be very roughly 3ns apart.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline jkostb

  • Regular Contributor
  • *
  • Posts: 77
  • Country: np
Re: ringing in signal
« Reply #3 on: September 04, 2023, 07:24:48 pm »
Have you tried to reduce R2? Reducing R2 would result in faster pullup of signal and possible solve your problem
 

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
Re: ringing in signal
« Reply #4 on: September 04, 2023, 07:30:21 pm »
The problem most likely is the input signal to the first optocoupler.  Hang the second channel of your scope on there to prove it.

That was this pic, between pins 1 and 2:
http://n4te.com/x/8111-L7ZC.jpg
It's nice and clean!

Have you tried to reduce R2?
I can give that a try, thanks!
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2892
  • Country: se
  • Country: Broken Britain
Re: ringing in signal
« Reply #5 on: September 04, 2023, 07:36:39 pm »
Is it using the MCU's internal weak pull-up, which looks too weak.
It could be software turning the weak pull-up off for a few us. :)
.  That took much longer than I thought it would.
 

Offline AndersJ

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: se
Re: ringing in signal
« Reply #6 on: September 04, 2023, 07:38:43 pm »
Is the unconnected V01.6 picking up something?
Perhaps better to not float it.
"It should work"
R.N.Naidoo
 

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
Re: ringing in signal
« Reply #7 on: September 04, 2023, 08:14:54 pm »
Is the unconnected V01.6 picking up something?
Perhaps better to not float it.

VO1.6 is the NPN phototransistor base (opto is IL2-X009T). I've read leaving it unconnected is best, else it might interfere with the sensitivity. Grounding it through a resistor would be hard, as it's down in a hole next to a connector.

Is it using the MCU's internal weak pull-up, which looks too weak.
It could be software turning the weak pull-up off for a few us. :)

The input pin is indeed using the internal pullup, which seems to be 45kOhm (ESP32-WROOM-32E). This seems promising, cheers! I'll give it try right now.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2619
  • Country: is
Re: ringing in signal
« Reply #8 on: September 04, 2023, 08:18:59 pm »
Don't leave that base floating!!! Connect the base pin to the emitter pin with something between 100K to 470K ohms.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
Re: ringing in signal
« Reply #9 on: September 04, 2023, 08:37:22 pm »
I've hacked on a 4.7K pullup on the input pin:



The signal does seem better! I can't tell if it happens less often. It seems like the same anomaly is there but less:







Don't leave that base floating!!! Connect the base pin to the emitter pin with something between 100K to 470K ohms.

OK, trying that will take some doing, but I'll give it a go.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2892
  • Country: se
  • Country: Broken Britain
Re: ringing in signal
« Reply #10 on: September 04, 2023, 08:42:30 pm »
It's a software problem, a glitch when something (re)configures that port. :)
.  That took much longer than I thought it would.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: ringing in signal
« Reply #11 on: September 04, 2023, 08:44:06 pm »
Looks like EFT, though rather slow (~kHz repeat rate), and no evidence of it elsewhere on the trace.

Note that RF noise causes charge injection in bipolar devices, so any common mode noise in the circuit can cause activation like this.  It's not clear if this is the problem.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
Re: ringing in signal
« Reply #12 on: September 04, 2023, 09:30:00 pm »
It's a software problem, a glitch when something (re)configures that port. :)

I've done such dumb things before (yesterday in fact :() but it shouldn't be the case this time. I configure the GPIOs once at start and then never again.

I rigged a 220kOhm resistor between the base (pin 6) and emitter (pin 4, SGND) and the problem has gone away! It was happening maybe once in every 8 tries. I must have tried 60+ times and didn't get a single anomaly. Sooo, I guess that solves it! Thanks everyone for your input and to AndersJ and CaptDon who nailed it!

It's annoying there's no version of the IL2-X009T optocoupler without the base, and that the datasheet doesn't bother to mention what should be done with the base. I could use something else, like LTV-816S, as I do for other things. I can't remember why I started using the IL2/ILD2/ILQ2 optocouplers over LTV-816S/826S/846S. EDIT: Ah it's because IL2-X009T has 100% min CTR while LTV-816S has 50%.

Unfortunately the fix is on the transmitter side. I need a resistor between these pins:



I don't think I can do that cleanly. Maybe it really is time to redo all my beautiful boards and use RS-485. :( Ah well, I learned a thing!
« Last Edit: September 05, 2023, 12:00:10 am by n4te »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2892
  • Country: se
  • Country: Broken Britain
Re: ringing in signal
« Reply #13 on: September 04, 2023, 09:51:15 pm »
Not far off from what T3sl4co1l said then, but on that base.
It must have been bad luck that you never saw it on the wire, which would have given a clue that it was coming from the TX.
I've always left the base floating. :)
« Last Edit: September 04, 2023, 10:28:00 pm by StillTrying »
.  That took much longer than I thought it would.
 

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
Re: ringing in signal
« Reply #14 on: September 05, 2023, 01:05:15 am »
Maybe these give you a chuckle...













Not the best of times, but it's something. Sadly my attempt on the most important boards was a melty failure:

 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 4217
  • Country: us
Re: ringing in signal
« Reply #15 on: September 05, 2023, 01:11:58 am »
Maybe use a through-hole resistor.
 

Offline n4teTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: pr
Re: ringing in signal
« Reply #16 on: September 05, 2023, 01:15:22 am »
True, soldering that might be a little easier, but not by much. My things were so pretty. :(
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->