# How to get a stable 5V Supply to get stable readings from ADC on Raspberry Pi using SPI

I have been working on a way to get very accurate measurements of the tilt of a surface. The signal I use is a bipolar one that ranges between +/-2V. I started by trying the MCP3008, but the since the signal is bipolar, I had to add a resistor potential divider, then a buffer. Those components added some uncertainty, along with the fact that 8 bits with a 3.3V supply only gives 3mV accuracy ( I need at least 1 mV). The circuit worked but only to about 10mV after averaging over time.

To get a better solution, I decided to use an LTC1867 chip which accepts bipolar inputs. I also added an external 2.5V reference LTC6655 to improve accuracy. However for this I had to use the 5V supply (which I have read is more unstable). The reading I got where very unstable but in the right range.

My main question: 1. Is there a way to obtain a different 5V supply that is stable i.e, using batteries/ step down from mains and capacitors and a voltage regulator/ reference. I would like to use this supply just for the ADC and not to power the whole Pi. How would I take care of isolation and the different grounds.

2.This is more of a code question. On my ADC, I have the 2.5V Reference. Using spidev, how to I call spi.xfer2 on two different channels? I ask this because I wanted to use the error from the channel with the 2.5V as an offset to add to the ADC output of my actual signal to reduce the errors. Whenever I tried the code below, one of the values was always wrong compared to when I called spi.xfer2 only once

spi.max_speed_hz = 10000