Page 1 of 1

I2C ignorating decimal points. MPPT solar

Posted: Wed Jun 26, 2019 9:12 am
by matness
Hi guys!

I am inside a project of building a solar MPPT with a raspberry PI.

Now, I have already finished it and I am doing some tests with this solar regulator. It seems to work very well.

My data system is the next: the rasp reads data from an I2C ADC (specifically, the ADS1015) which converts the analog values of voltage and current at the output of the solar modules, this data, then is used by an algorithm which acts on a DC/DC converter, but this is another question.

The problem is about the collection of the data, specifically the voltage values. The most part of the values gotten by the rasp are very accurate, however there are some values (maybe one or two of every 200 samples) that seems to ignorate de decimal point.

Maybe with an example it will be more understandable: If the solar panel is working at about 32 V, the rasp shows the next: 31,345V - 32,542 V, 31456 V, 32,567.

I am thinking about it could be related to the cpu and other tasks that the rasp is involved in, but I wasn't able to find anything about that.

Do you have any suggerences or help?

Thank you very much and have a nice summer ;)

//*//

Re: I2C ignorating decimal points. MPPT solar

Posted: Thu Jul 04, 2019 12:55 am
by davef
I use the ADS1115 and one thing I had to do was keep the I2C lines quite short, ie 25-50mm. Also, the ADSD1115 breakout board I used had some pull-up resistors, which I had to remove.

Just to clarify
31,345V - 32,542 V, 31456 V, 32,567
I assume you mean:
31.345V, 32.542 V, 31456 V, 32.567, ie no minus sign and decimal points.

Maybe, print out the raw ADC bits to the console to determine if it is the ADC or your conversion program.

It might help to post your ADC code.

Re: I2C ignorating decimal points. MPPT solar

Posted: Thu Jul 04, 2019 3:01 am
by Gavinmc42
I have used up to 5m cables, I just slow the clock down.
These days I mostly use baremetal with Ultibo now for Pi's that use i2c in devices.

I found Python/Linux is a bit flaky reading i2c, a lot of my code was just for error checking the i2c data.