Noise filter - power supply, digital input

My project is based on a Nano ESP32. I’m trying to figure out the correct capacitor configurations to reduce noise on the power supply and digital input. The digital signal protocol is unique to the device. My app uses a digital interrupt to record the duration of the last state for processing. Sometimes the state change event is triggered then when read, the state is the same as the last. I flag this as an error. The serial signal has check bits that are also used to flag a byte as an error. These data points provide an easy way to measure the error rate/signal quality. When I look at the signals on an oscilloscope, I see a small amount of noise but no significant spikes.

The power supply is vehicle battery which will range from 12v to 14.5v. The serial signal is 4.5v then lowered to 3.3v using voltage divider resistors. The ceramic capacitor is being placed on the 4.5v side. This is happening without the engine running. Connecting a battery charger or running the engine doesn’t increase error rates much.

On a solderless breadboard using trial and error, I got the error rate under 0.5% by adding capacitors to the power supply and digital input. I don’t have a large selection of capacitors on hand so in some instances I either put them in series or parallel. The power supply seemed to do best with 200nf to 330nf. The 200nf was two 100nf parallel. The digital input worked well around 2.4nf. I had to put two 4.7nf in series.

I moved the design to perforated prototype board with soldered connections on the backside. The error rate went up to 30% which is about the same that it was without any capacitors. I’m not sure what introduced the noise. I’m going to end up putting this onto a custom PCB with a ground plane so I don’t think that there’s any value troubleshooting the perforated prototype. I needed it to test a SSR that couldn’t be used on the solderless breadboard.

Any advice on how to reduce the noise? Specific capacitor values or configurations?

First, show a picture of the noise so the rise time and rep rate can be determined.

The 30% is likely correct. The reason it was so low on the solderless breadboard was that some connections were not made or burnt, a common issue with run-of-the-mill breadboards.
I would get the perforated prototype working before committing to a PCB.

On the 12v supply, I set the scope to AC then then increased the sensitivity and sample rate until I discovered a repeating wave. The frequency seems to vary.

On the serial signal, zoomed in on the low state then captured random screenshots while it was low. I couldn't figure out how to do the same for the high state.

When you compare the 1us samples, the peak to peak frequency is almost identical.

So, you are showing AC on your DC supply line. Are you working in a garage with florescent lights? Does your car have an alarm system? They are powered on all the time! Does your car have one or more computer? They are also on all the time. But I suspect the lights!

It appears to be coming from the ESP32. I connected it directly to the battery to rule out the vehicle computer. Turned off the lights. The wave is still there. It stops when I unplug the ESP32.

Well, you are not getting AC from your ESP32. Are you sure you are not using the ESP32 as an antenna? Is it’s ground and negative supply connected directly to the automobile frame?

Hi,
Some images of your project and a schematic would help a lot.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

There's not much to it.

Hi,
First off I would not feed 12V Automotive voltage directly to Vin.
Us a DC-DC converter to say 5V.

Use say 100uF and 0.1uF capacitor in parallel across the supply.

Tom.... :smiley: :+1: :coffee: :australia:

What is this protocol?
What are the voltage levels?
What is the bit rate?
Is there error detection?

The noise you see is from the buck regulator on the ESP board and should not be an issue.

Not needed.
The Nano ESP32 already has a built-in switching buck converter, which could be the source of analogue noise.
Leo..

I missed that, haven't used a Nano ESP32, but I would be putting some noise filtering at the Nano, to protect it against the car electrics.

@sdlee
Can you please post some images of your project?
So we can see your component layout.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Why the 100 Ohm resistor across the opto LED.
Remove that 100 Ohm resistor and change the 137 Ohm to 330 Ohm.
The opto datasheet recommends >=5mA LED currend at elevated temps (Car?).

Caps are more effective (can be smaller in value) at the analogue pin instead of before the voltage divider. Use 100n.
Leo..

Hi, @sdlee
What is the magnitude of your input signal?
What value is the capacitor you have across the signal input?

What is the input signal?

Tom.... :smiley: :+1: :coffee: :australia:

My novice understanding of the optocoupler is that the current draw can vary, most likely depending on heat. It will be a in a small enclosure and there may be a need to drive around with it connected to capture data. I thought that the divider would be necessary to provide a more predictable voltage if the current draw varies. This chart has the characteristics for the SSR that I will likely use.

When I moved the capacitor to the pin side, it increased the error rate. I think it was too large. The solderless board worked best with under 4.7nf. Higher increased the error rate. I'm going to order a capacitor kit then do trial and error on a custom pcb that I ordered.

Thanks for help.

4.4 volts. A whopping 125 baud.
Two 4.7nf in series seemed to work best.
Pre OBD2 Engine ECU.

The opto fet is a bi-directional switch.
Not sure what you mean with variable current.
A switch is certainly the wrong part to vary a current.

Please tell us the exact signals you are putting on the analogue inputs and what you expect on the output.

Is this thread related to your previous one?
Leo..

Can you answer my questions?
The maybe we can solve your problem.

All of your questions have been answered. 3 of the 4 were in the original post.

Thanks for your help.