Input jittery

jerryk

Member
Hello!

As part of a larger project, I am reading a thermistor. It is hooked to input A4. There is a pullup resistor to 3v3. The readings are extremely jittery. It flashes back and forth over a hundred counts. This morning, I thought to look at that input with a scope, and

Lo & Behold,
There is a 3.6kHz square wave, about .7V p-p, superimposed on the thermistor voltage. I hung a 10uF capacitor off that node, and it mostly went away - although it still jitters a couple of counts.

What could be causing this? Nothing in my project works at 3.6kHz. One of the other functions of that pin? According to the Teensy 4.1 blurb, that pin is also "SDA" and is additionally capable of PWM output.

The 3v3 is perfect and stable....

Thanks in advance,

- jerryk
 
No, it didn't. Still jittering by maybe 3 counts. I'd have a better idea if I took off that big cap "bandaid" I put on it.
 
You need to do some sort of debugging to get some idea as to where the noise is coming from. Move things away from your setup, does the noise lessen? Do you still see the noise with your device powered off? Does the ADC have noisy readings even with the thermistor and its wires disconnected?
It's a bit hard to guess how a signal gets to a point in a circuit with zero information about it, other than it's connected to the teensy pin. Post a picture of your schematic, no matter how basic, and also any other information about your setup, or even a picture. Things like the quality, length, and path of your wires and connections all matter
 
You need to do some sort of debugging


The circuit is simple. There is a thermister hanging from the pin to ground. There is a resistor between the pin and the 3.3V. I am
convinced that the square wave is coming out of the Teensy. Actually, I just proved it. I disconnected the ribbon cable from my I/O
board, and *yup*, there's the square wave, in all its glory. It's 3.6kHz, .7 volts peak to peak, superimposed on DC 1.65V.

OK, I think I have a clue. The neighboring pin is a PWM output for the heatsink fan. Control of which is the purpose of the thermister.
The fan PWM is produced by an output at A5. I turned that PWM off, and the square wave on the thermistor signal went away.
Capacitive coupling through the ribbon cable? Nope, I disconnected the cable and measured at the card that the Teensy itself is
plugged into, no difference.


Clue continued. The PWM pin and the heatsink temperature pin were actually connected... sort of... a little. Through an unused Si5351a clock generator chip. I removed the chip, and things are a bit better. There still is some 3.6kHz on the temp sense lead just from capacitive coupling. An electrolytic on the the temp sense line took care of that. Temperature doesn't move very fast, and having a bunch of capacitance hanging off that line doesn't hurt anything.
 
Nice, sounds like you have a solution.
The values of the resistors might have been important, high resistances are more susceptible to coupling in noise. I imagine given your description that it probably is.

Some other things you can do if you decide you want to go further -
You can change the frequency of a PWM output, assuming your fan/control will still be happy. If your input is low frequency, pushing the noise further higher will make the filter more effective, though it might make the coupling worse, so one to play around with.
Electrolytics aren't always the best for noise removal, as they have a relatively large series resistance. Try adding a multilayer ceramic, and make sure it's as close to the T pins as you can.
Moving the pins around so they're further apart, though if you've made a board up this is unlikely to be practical. You could also look at the teensy layout, to make sure the paths are well spaced on the Teensy itself.
Lastly, you could buffer the signal with an op amp to make it far less vulnerable.
 
Nice, sounds like you have a solution.
The values of the resistors might have been important, high resistances are more susceptible to coupling in noise. I imagine given your description that it probably is.

*** The resistor value was more or less determined by the value of the thermistor - which is more or less 30K stone
cold, and more like 8 to 5K in the area of interest. Yes, I could buffer it with an emitter follower.

Some other things you can do if you decide you want to go further -
You can change the frequency of a PWM output,

*** Or, change the slew rate? I think that's programmable.

Try adding a multilayer ceramic, and make sure it's as close to the T pins as you can.

*** I did that. Not for the 3.6kHz though. There's other noise in the box. It's a 600W amateur radio linear amplifier,
working from 1.8 to 50MHz. During transmit, there's a LOT of RF in the box, even though the signal path is pretty well
bottled up, and all the inductors are self-shielding toroids. So I tacked a .22 uF ceramic capacitor
across the electrolytic. The tacked-on caps, little green wires, and cut traces are starting to add up, and I think it's time
to design a new board.
 
*** Or, change the slew rate? I think that's programmable.

Yeah, that's an idea, it's called fast edge slugging/spectrum limiting and it's basically used to remove the highest frequency components from a square wave to reduce the emissions. You can definitely do it in hardware, and It would be cool to know if the T can do it in software. I'd note that because it's the fundamental frequency you're seeing coupled, removing the harmonics might not help a huge amount, but it also might. It's worth also making sure the slugging won't affect what the signal is driving. If, for example, the signal is going to a MOSFET, decreasing the slew rate/edge slugging will increase the time the MOSFET takes to switch and hence cause it to burn more power - though you'd have to crunch the numbers to see by how much.

The tacked-on caps, little green wires, and cut traces are starting to add up, and I think it's time
to design a new board.

For sure, you might find that just getting rid of the excess helps a fair bit. It might also be a good time to move the pins around it you can. If your budget/time/skillset allows for it, you can make nice shielded enclosures/compartments with 3D printed boxes and either aluminum tape, or conductive copper spray.
 
Back
Top