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.

It’ll take at least a day to pull that chip off my board (I wire 'em up well).

I did go back to mow the grass, so… I picked up a few FETs I have, some good for this purpose. I used those TXS0108 chips, basically “because I could”. I had 'em, they “seemed” to work on something else. I needed two for the ultrasonic, but had 6 more inputs, and 6 open channels on this chips, so…

I actually found some MLX92231LSE Hall-Effect switches I had ordered (I don’t even remember ordering them). They may work better than the A3144s I got off Amazon. A bit harder to make sensors with though.

Plus some spiffy new shieled cable…

I’ll test it a bit before I pull that chip. (forgot my good scope too dang it! got back to the house and found out the GFCI in the kitchen popped off, so the fridge went with out power for who knows how long, so I was “busy”… peew, what a mess!)

Looks like you were right.

I pulled that chip off of one of the boards, and replaced the level shifter one the ultrasonic transducer and Hall effect sensors, used one of those little boards with just a couple of FETs and resistors, and it seems to work great. I did update the ultrasonic transducer with a better shielded cable also.

I used that TXS chip for some testing on the capacitive level sensors, and I saw a lot of level bounce (between 1 and 0). I ASSuMEd the devices were just not working properly. But now I’m pretty sure it was that dang chip. Same issue, should have been a 1 or a 0, but the ESP32 was reporting kinda random 1s and 0s.

So I’m betting it was just noise just like the Hall-effect inputs. I’m betting it was also on the ultrasonic Rx/Tx (Tx isn’t really used), but internal error correction hid the errors from me. I did get a lot of “odd” readings, a good number, then a report of level 0 value and what amounts to an error report. So I’m thinking that’s what that was all about.

It’s clear I can’t get this working and installed this (camping) year, so I have to modify lots of cables, and will probably have a PCB made up.

PCBs have always been the bane of my prototyping area. I just never could make suitable PCBs, but not for lack of trying. I think I did tape and lithographs about 40 years ago, never had any luck with the toner transfer method (no matter how I did it). I did have pretty good luck with some UV sensitive film, but the etching process ruined them. I can’t believe I can get 5 of these made at Seeed for a cost of about $10 (after the coupon).

And I had no luck with the MLX9223, not sure how that was even supposed to work. I’d have to have more circuitry just to read the millivolt change. Plus, these “old man tremors” make soldering 0402 to a SOT23, (and then adding wires…) next to impossible. (could have done it with ease in my younger days!)

Thanks for confirming that—the TXS0108 isolation really narrows it down. As a next check, I’d test the Hall input with the level shifter completely disconnected and a short jumper to a known clean 3.3 V pull-up or pull-down, then reconnect one sensor at a time. That should separate any remaining sensor or cable coupling from the board-level input.

I just dumped the whole TSx010x chip. Not even going to mess with it (I’m mad at it now).

I’m just going with the single FET/2 pull up resistor interface. That seems to work pretty well.

I’ll keep one board for testing over the winter (we don’t camp during the cold months, that cold wind coming off the lake is brutal!). Then have a couple of PCBs made up and hopefully, next spring I’ll install them and run with it.

Thanks for your insight, no telling how long I would have been chasing “noise”.