HUGE noise on input pins.... Help!

I’m still just testing. So bare bones stuff/code. I have two sensors, Hall-effect to detect open/closed valves. Plus a serial communications ultrasonic bottom up level sensor, which only transmits data (automatically) about every 100ms or so. These use a TXS0108 chip to interface the 5V inputs to the 3.2 for the ESP32-C3.

I’m also using a cheap portable o-scope. I just keep it in the RV for quick checking, my “good one” is at home, so I don’t have access to it.

I am seeing what looks like high frequency noise. At a low sweep rate, it just looks like hash/garbage. But at a higher rate, it looks more like high frequency noise (like I said, I can’t really see it). This isn’t just “noise” on a high or a low signal, like power supply noise. This is like the whole pin switching from low to high and low again, at high frequency.

I was beating my brains out, caps, filters, shielded cables, everything I could think of. Then I though I had fixed it. But apparently, if I switch the Hall-effect input on and off, it’ll either start up or go away. Like, random.

I wasn’t even sure it was real, but my Fluke87 is reading about 1.6V on that pin, so it’s real. (and the ESP-NOW message was sending random pin data)

I’m kinda thinking (at this point) that there’s some oscillation going on, on the input. By that I mean, that for some reason, the input circuit (in the esp32) is doing something, like resetting input, output, input… or maybe pullup, pulldown, pullup, pulldown…

I’m turning off the radio when I read the signals, and the noise comes on and stays on, it’s not switching on and off (like with the radio or the serial communication). I am using ESP-NOW, so I need to turn it back on, it’s transmitting just fine.

I’m using:

gpio_set_direction(VALVE_OPEN, GPIO_MODE_INPUT);

gpio_set_pull_mode(VALVE_OPEN, GPIO_PULLUP_ONLY);

(and gpio_get_level(VALVE_OPEN); to read the pins)

to set the pins modes, I’m going to try using GPIO_MODE_FLOATING when I get a chance.

And maybe try just the Arduno pinmode() command to see if that changes anything.

If anybody has any clues or suggestions, it would be much appreciated.

Ok, this may be a clue.

It looks like… When the sensor is active (active low), it’s low. But during the transition from either hi/low, low/high, I get lots of that noise (sometimes).

Most of the time, it’s either a “hard” high, or low (very little noise of any kind). But at times, I get a lot of noise when it’s high or low. Like, what ever is happening, is still trying to happen even when it’s high or low. If that makes sense.

But when that oscillation isn’t there, its a good clean high/low. But if it’s in that oscillation mode, even though the level is high/low, you really see it during the transition. And if it’s in that oscillation mode, you’ll see it when you should have a good clean high/low.

Sometimes, it just takes over and it won’t go either high or low, just osicllates.

So it’s like “something” is turning on and taking over. But, for whatever reason, stops after a bit.

But there’s no “regular” time feature to it, it’s not like something is turning on and off at regular intervals.

The TXS0108 can be a suspect here: it is meant for auto-bidirectional level shifting and can oscillate or distort slowly changing/open-drain signals when the pull-ups and edge rates are not what it expects. As a quick isolation test, bypass the translator with a known-good 3.3 V pull-up and a short wire, or use a one-direction buffer/level shifter suited to the sensor output. Also make sure the Hall output is never floating, add a defined pull-up at the receiving side, and check the oscilloscope ground lead and probe loading before chasing firmware.

Wow, thanks for that. I was kinda suspecting that chip, but didn’t look too closely. I was thinking maybe it’s noisy like the older TTL chips, not oscillations like that.

That’s some good info to look at. I have some old VN10KM vmos FETs, close by, I’m thinking of dropping a couple of those in there as translators. I tried them in another similar circuit and then seemed to work pretty good.

I’m not doing anything fast, so… fastest stuff is 9600 BAUD on the ultrasonic transducer.

I’ll take a look at it. Right at the moment, I’m camping in the RV, and we have about another week to go before I get home again. I need a day or two before I break it all out again.

Thanks for the input, I really apreciate it.

(as a side note, the hall effect sensors, I believe can bypass that translator all together. 5V power, open collector output. The ultrasonic needs 5V minimum to “work” (transmits data at 3.2V, but it’s bogus until you get 5V). Not sure about the capacitive level sensors, open collector, but I think it has an internal pullup to supply voltage, this could simplify things a bit)

That sounds like a good next step. When you’re back at the bench, I’d test the Hall inputs with the TXS0108 removed first, then add the other sensors one at a time. A scope capture at the translator pins should show quickly whether the oscillation starts there.