matness
Posts: 4
Joined: Sun Mar 31, 2019 8:24 am

I2C ignorating decimal points. MPPT solar

Wed Jun 26, 2019 9:12 am

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 ;)

//*//

davef
Posts: 64
Joined: Wed Feb 20, 2013 8:39 pm
Location: Christchurch, NZ

Re: I2C ignorating decimal points. MPPT solar

Thu Jul 04, 2019 12:55 am

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.

User avatar
Gavinmc42
Posts: 4863
Joined: Wed Aug 28, 2013 3:31 am

Re: I2C ignorating decimal points. MPPT solar

Thu Jul 04, 2019 3:01 am

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.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Interfacing (DSI, CSI, I2C, etc.)”