board_voltage_channel is just an integer representing the ADC output channel. readadc() is the function that returns a single reading from the channel passed to it.

Since my last reply, I’ve been busy incorporating the remaining 2 CT sensors on the board. I also increased the MCP clock speed to 1 MHz where I can now read about 95 samples per 60Hz cycle, or about 4588 SPS, per channel, for a total rate of 22.9K SPS (5 channels total). The Pi is handling the processing of the data flawlessly.

Here is how the data looks from all 4 CTs and the voltage sensor with a ADC clock speed of 1MHz.

Anything over a 1 MHz clock speed on the ADC yields inaccurate data which appears to not be of concern since I’m able to achieve a fairly high sample-per-cycle rate. Now I have first hand experience of why the original ADS 1115/1105 chip that I started with is not fast enough!

I was totally incorrect on my suspicion. I had mistaken the Python spidev’s library max_speed_hz attribute for the max sample speed possible. The MCP3008 ADC reportedly has a max sample rate of 200k SPS when run @ 5V (slower, if run at 3.3), and I made the assumption that setting the max_speed_hz attribute was the same as setting the sample rate. When I incorrectly suspected I was hitting the limitations of the Pi’s clock speed, I was under the assumption that it wouldn’t make a difference if I set the max_speed_hz variable higher than 200k. Boy was I wrong!

Very cool! I am a private pilot as well (though I am fully current) :smiley:

I am preparing to move my project to the Adafruit Perma-Proto boards I purchased - unfortunately, all but one of the 5 individual circuits fit on a single Perma-Proto board. I’m going to have to either stack two boards and deal with wiring the ADC input from the top board to the bottom board, or come up with a different prototype board solution. I feel that my circuits are already as small as I can get them, with a single CT circuit taking up 6 rows, and the voltage sensor taking up 9 rows (with a female DC jack).

1 Like