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?
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.
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?
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..
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.