There is rolling average in the current sense as well to keep it from bouncing so much. Glad you found something that kind of works.
I think we should look more into this before working on the BP8 with the new ADC - we should have a good baseline to compare the new ADC against. Not that this issue is just an easy fix in firmware.
After using my averaging code, I can see that the stable values always read about 0.6% low.
This matches quite well with my measurements of the filter for AVDD reducing the reference voltage to below 3.3V. So at least this part will most probably improve with 7Rev1.
Ok, after playing with this some more it looks like the ADC noise depends on input impedance:
I was injecting the voltage from my calibrator output through a 100k resistor into the BP. When I directly go from the calibrator to the BP it is much less noisy and just the last digit is twitching.
I thought the opamps on the IOs should mitigate this, but it looks like they don’t. It could very well be noise coupling in from nearby traces or the supplies.
Is it the leakage through the protection diodes?
I would have expected the leakage to be more constant and less noisy. But it could very well be the leakage.
I think I’ll investigate a bit into this later, with probing the signal before and after the opamp on the scope, removing the protection diode on one channel and maybe see if I can improve the power filtering on the opamp.
If I can get a clear trace on the scope it could be that the frequencies give a hint which kind of signal(s) are coupling in, like the LCD SPI, I2C, ADC mux switching,…
I’ve now hooked up my scope behind the opamp to see what kind of signal it picks up, but without interfering much with it by attaching the scope probe.
And the source becomes obvious from the picture: it is mostly mains hum, with a bit of digital activity on top. But the biggest part of it is clearly mains hum.
The mains hum directly goes up or down when I vary the input resistor.
I didn’t remember that we have a 100k in front of the opamp. And when I add another 100k in series to the source, they add up and the final impedance just seems to become too high, so stronger and stronger levels of mains hum couple in.
I tried adding a 30pF to ground after the 100k in front of the opamp. It helped well against the digital noise and dampened the mains hum a little, but the bulk of it is not affected. I guess we’d have to go all out with caps when trying to filter 50 Hz… Stuff like shielded cables and thick metal enclosures around the BP would probably also help, but interfere with the other goals like being small, easy to use and affordable.
Averaging in software works quite well against this kind of noise. So I guess this should be part of the mitigation strategy. I will look at the code and look for the best place to add it in a way that all subsystems can use it, not just the display code.
In 7Rev1 we now have the improved input protection. So if we ever do a 7Rev2 (and not go straigt to 8 with the new ADC) we could revisit the protection concept for the opamps. And try to lower the series resistance a bit, maybe also use smaller or no diodes to reduce the board space required.
Let’s see what the next rev with the new avdd filter is like. It should go to production this week.
Looking forward to trying & frying the 7Rev1. Please reserve two units for me, one for regular testing, the other for destructive testing of the new input protection.
Maybe you could also send me some samples of the exact model opamps used. This could help when testing a new opamp protection scheme like described in my post above.
Got it. Will do my best.
The same op-amp die comes in a bunch of packages. Do you have a preference for large vs small?
- SOT23
- DFN (dual, on board now)
- TSSOP (quad)
SOT23 would be more convenient for prototyping, but DFN would be handy for replacing failed ones on the BP sample. So maybe some of both if it isn’t too much hassle?
Got it. Will order them tomorrow.