Jump to content


Photo
- - - - -

Solar readings again


  • Please log in to reply
18 replies to this topic

#1 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 06 November 2008 - 12:50 PM

I have been following both the post below on making some sense from the solar readings on a HB solar board.
http://www.cocoontec...?showtopic=4072
http://www.cocoontec...?showtopic=6452

Problem is, there's so much to sift through and the info changes if you changes resitor values, etc.
I am looking for a simple formula to use with The HB Solar board (390 ohm) that will give me some sort of useable number that I can plot on a graph.
I don't need exact solar figures that would be calibrated and accurate with some sort of solar measurement device.
My graph would just show the swings up and down during the course of the day.

Based on the Solar post above, I used this formula
Note that my variables below are set up as Double precision

Voltage2 is the reading I get from the DS2438 on the HB board using .net SDK
Voltage2 = Owd5.getADVoltage(2, state)

Volts = Voltage2 / 4096
Current = Volts / 390
SolarEnergy = Current * 1157598

The SolarEnergy value I get doesn't make much more sense that the Voltage2 value I get by reading the DS2438

Here's some typical values I just got at 12:23 in the afternoon with the sensor in full sun
See calculation formula above

12:23:29 - Solar Reading in full sun

-0.25 = Voltage2 from ds2438
-6.103515625E-05 = Volts
-1.56500400641026E-07 = Current
-0.18116455078125 = SolarEnergy

When I throw a towel over the sensor Voltage2 reading goes to 0, so the sensor is being read correctly.
Just trying to make sense from the readings.
confused????

#2 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 06 November 2008 - 01:03 PM

I forgot to add this in the post above.

Just curious why current calculations are being performed in the two post links above, when the DS2438 can tell you the exact current it is reading across the Vsens+ and Vsens- terminals, through a load
All you have to do is set the Vsens value in the DS2438 to whatever value the Vsens resistor is.

I made a couple DS2438 boards and used very precise .05 ohm (50 milliohms) current sensing resistors to read solar panel charging currents and current drains on my solar storage batteries
I set the Vsens resistor value in the DS2438 to 50 milliohms (.050 ohms) and then read the exact current flowing through my 50 milliohm current sensing resistor.
My boards are based on this Dallas circuit
Posted Image

more info here on that project
http://www.el34world...olar/Solar1.htm

Here's how I do it in Visual Basic using .net
Note: These are code sections copied from my program, so it's not stand alone code.

' first read the DS2438, SensorID is the long dallas chip Id number

				ElseIf SensorType = "DS2438" Then
					Try
						owd = adapter.getDeviceContainer(SensorId)
						Owd5 = DirectCast(owd, com.dalsemi.onewire.container.OneWireContainer26)
						state = Owd5.readDevice ' read the device						
					Catch DS2438Error As Exception						
						TextBoxSensors.AppendText(TimeString & " Error: Reading DS2438 " & SensorName & " - " & SensorId & vbCrLf)
						ErrorIndicator = 1
					End Try


' then set the sens resistor value, in this case I am using a 50 milliohm resistor stored in a variable called SenseResistor0

	Sub SetSenseResistor()
		ErrorIndicator = 0
		Try
			Owd5.setSenseResistor(SenseResistor0) ' set sense resistor value
		Catch ex As Exception
			TextBoxSensors.AppendText(TimeString & " Error: Setting Sens Resistor" & vbCrLf)
			ErrorIndicator = 1
		End Try
	End Sub



' set this flag to true

	Sub SetFlags()
		ErrorIndicator = 0
		Try			
			Owd5.setFlag(1, True)
		Catch ex As Exception
			TextBoxSensors.AppendText(TimeString & " Error: Setting flag" & vbCrLf)
			ErrorIndicator = 1
		End Try
	End Sub


' get your current reading

	Sub GetCurrentReading()
		ErrorIndicator = 0
		Try
			'get current reading
			Current = Owd5.getCurrent(state)
			Current = Current * 1000000
			Current = Math.Round(Current, 3)
		Catch Error2 As Exception
			TextBoxSensors.AppendText(TimeString & " Error: Reading Current" & vbCrLf)
			ErrorIndicator = 1
		End Try
	End Sub

Edited by EL34, 06 November 2008 - 01:26 PM.


#3 Dubravko

Dubravko

    Cocooner

  • Registered
  • PipPip
  • 37 posts

Posted 07 November 2008 - 02:49 AM

Hi,

every reading have are good enough if you know what are you reading ... make any sense to you ? :) ...

To be clear what are you doing , need also knowledge how system work, what you expect to be happened, and what are working parameter.

I didnt produce this solar panel reading sensor jet, but from my previous HB solar board work I know that DS 2438 have some specific, in your case that mean Vsens can measure from -0.25 mV till 0.25 mV . If your value goes out of range that will resualt with foult reading.

Second not all solar panel result with same output parameters, sou you will need some specification also, then you need to do some calibration with knowing value and condition, and after then you will be able to said what exactly is value you measure.

Dubravko

P.S: Try to measure your value with multimeter, just to be sure you connected everything well, and value is like you expected

#4 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 07 November 2008 - 06:48 AM

Hi, I am not sure what you are saying.
I don't have any problems with my solar panel or any of my one wire sensors.

I was asking about the readings I got from my HB solar board, and how to make sense of the readings.

The second post above was just giving a tip on how to read current from a DS2438 Vsens load.

Edited by EL34, 07 November 2008 - 06:49 AM.


#5 Dubravko

Dubravko

    Cocooner

  • Registered
  • PipPip
  • 37 posts

Posted 07 November 2008 - 07:24 PM

Hi, I am not sure what you are saying.
I don't have any problems with my solar panel or any of my one wire sensors.

I was asking about the readings I got from my HB solar board, and how to make sense of the readings.

The second post above was just giving a tip on how to read current from a DS2438 Vsens load.


Very simply,

float energy = (float) (Vsens/meResistor*1730463);

Energy is in W/m2
meResistor is 390

With second post you make some confusion, because HB solar part doesnt work on that way.

Dubravko

#6 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 08 November 2008 - 08:23 AM

Actually it does.
I am reading the current flowing through the 390 ohm resistor on the HB Solar board.
You set the Vsens resistor value to 390,000 in the DS2438 and then ask for a current reading.

A more precise current sesning resistor in line with the 390 ohm resistor would give you a much better reading than the 390 ohm resistor.

#7 Dubravko

Dubravko

    Cocooner

  • Registered
  • PipPip
  • 37 posts

Posted 08 November 2008 - 05:49 PM

Actually it does.
I am reading the current flowing through the 390 ohm resistor on the HB Solar board.
You set the Vsens resistor value to 390,000 in the DS2438 and then ask for a current reading.

A more precise current sesning resistor in line with the 390 ohm resistor would give you a much better reading than the 390 ohm resistor.


Are you read DS2438 documentation ?

...
The DS2438 features an A/D converter that effectively measures the current flow into and out of the
battery pack by measuring the voltage across an external sense resistor.
...
This register actually stores the voltage measured across current sense resistor RSENS.
This value can be used to calculate battery pack current using the equation below.


And very precise that voltage may be from -0.25V till +0.25V. Chip doesnt measure any current at all. But software may return you current if you provide measuring resistor value.

Finally I double check HB schematic, and doesnt see any similarity in that two schema.

Also I dont see any benefit of new resistor value because precision of Vsens AD is only 0.2441 mV in 1024 steps . Resistor of 390 ohm is good balanced to measure actual solar power flux from 0 slightly over max possible value when CLD240E is ussed.

DUbravko

#8 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 09 November 2008 - 07:37 AM

Listen, I think we have a language probelm here.

If you are interested, please read the DS2438 data sheet.
http://www.maxim-ic....qv_pk/2919/t/al

Here's a snipet from the data sheet
The DS2438 smart battery monitor provides several functions that are desirable to carry in a battery pack: a means of tagging a battery pack with a unique serial number, a direct-to-digital temperature sensor which eliminates the need for thermistors in the battery pack, an A/D converter which measures the battery voltage and current, an integrated current accumulator which keeps a running total of all current going into and out of the battery

I showed you the code in VB .net. and how I am doing it
I am reading current in all my DS2438's

Please do not reply again saying there is no way to read current in a Ds2438 chip.

#9 Dubravko

Dubravko

    Cocooner

  • Registered
  • PipPip
  • 37 posts

Posted 09 November 2008 - 10:02 AM

Listen, I think we have a language probelm here.

If you are interested, please read the DS2438 data sheet.
http://www.maxim-ic....qv_pk/2919/t/al

Here's a snipet from the data sheet
The DS2438 smart battery monitor provides several functions that are desirable to carry in a battery pack: a means of tagging a battery pack with a unique serial number, a direct-to-digital temperature sensor which eliminates the need for thermistors in the battery pack, an A/D converter which measures the battery voltage and current, an integrated current accumulator which keeps a running total of all current going into and out of the battery

I showed you the code in VB .net. and how I am doing it
I am reading current in all my DS2438's

Please do not reply again saying there is no way to read current in a Ds2438 chip.



Sorry but I must replay to your post , because you read commercial material instead of technical documentation which is provided on follow URL:
http://datasheets.ma...n/ds/DS2438.pdf

You are not able to read current directly from DS 2438 chip (no memory register for that) , especial not from Vsens register. Finally all register which correspond to current reading store voltage, and outside "software" must recalculate to current (nicely explained in technical documentation), in Your case that is VB .net library in my case it is Java library, but all that library are only communication between 1-Wire native protocol and program language.

Be very honest, we misuse one nice chip for our, not intent on time of projecting, function. And yes, it is always better to carefully read technical document, then believe what some commercial try to convince us. Also I must said I didnt found any chip which convert A/D of current readings, we even learn that current is measure like voltage over shunt resistor. Sorry once again, but you are not right.

Dubravko

#10 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 09 November 2008 - 12:59 PM

http://datasheets.ma.../ds/DS2438K.pdf

You are a very strange person.
Now where is that ignore button?

Oh yes, there is it.

Click!!! :o

#11 Dubravko

Dubravko

    Cocooner

  • Registered
  • PipPip
  • 37 posts

Posted 09 November 2008 - 04:05 PM

http://datasheets.ma.../ds/DS2438K.pdf

You are a very strange person.
Now where is that ignore button?

Oh yes, there is it.

Click!!! :P


Yes I am strange person, ask every one who know me :o ...
If is up to you or me I wouldnt care about fact we written here, but I reed a lot of wrong information on this forum, because people dont read technical documentation or dont understand how system is working... finally we talk about DS2438 chip and HB solar board implementation, not about some other kit (like link you post in previous post).

However i like to read documentation, and your document provide clear information that DS2438 chip store only voltage in registers, but on page 4. it is very unclear in text writen that DS2438 store data about current ... on other hand if you look on picture on same page it will be clear that text dont follow a picture.

DUbravko

#12 ericvic

ericvic

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 757 posts
  • Location:Birmingham, AL

Posted 10 November 2008 - 11:32 AM

I have been following both the post below on making some sense from the solar readings on a HB solar board.
http://www.cocoontec...?showtopic=4072
http://www.cocoontec...?showtopic=6452

Problem is, there's so much to sift through and the info changes if you changes resitor values, etc.
I am looking for a simple formula to use with The HB Solar board (390 ohm) that will give me some sort of useable number that I can plot on a graph.
I don't need exact solar figures that would be calibrated and accurate with some sort of solar measurement device.
My graph would just show the swings up and down during the course of the day.

Based on the Solar post above, I used this formula
Note that my variables below are set up as Double precision

Voltage2 is the reading I get from the DS2438 on the HB board using .net SDK
Voltage2 = Owd5.getADVoltage(2, state)

Volts = Voltage2 / 4096
Current = Volts / 390
SolarEnergy = Current * 1157598

The SolarEnergy value I get doesn't make much more sense that the Voltage2 value I get by reading the DS2438

Here's some typical values I just got at 12:23 in the afternoon with the sensor in full sun
See calculation formula above

12:23:29 - Solar Reading in full sun

-0.25 = Voltage2 from ds2438
-6.103515625E-05 = Volts
-1.56500400641026E-07 = Current
-0.18116455078125 = SolarEnergy

When I throw a towel over the sensor Voltage2 reading goes to 0, so the sensor is being read correctly.
Just trying to make sense from the readings.
confused????


There is no real formula for our Solar sensor, it is meant to be used on a relative scale where you determine what reading you want to call your 0% and what reading you want to call 100%. Then you just do some interpolation to get the % of any reading.

On the DS2438 it is true that it doesn't directly measure current. The VSENS input measures voltage which can be converted into a current value if you know the value of the resistor.

Eric

#13 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 11 November 2008 - 07:43 AM

Eric,
You can set the vsens resistor value in a DS2438.
Once you do that, you can ask for a current reading across the vsens resistor, which is an internal calculation of the voltage drop across the vsens resistor.
I don't think this is widely known, seems to be so far.
See the object browser screen shot below.

If you use a very high precision vsens resistor, like the .05 ohm that dallas suggest in their documents, you get a very nice resolution.
I am reading up to about 1.7 amps on my solar panel and about 600ma load on my green house fans
Both these measurements have been confirmed with digital meters and calbrated on the DS2438 circuit bard.

The max is about 3 amps that you can read, which is fine for many applications.

Posted Image

Edited by EL34, 11 November 2008 - 07:48 AM.


#14 ericvic

ericvic

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 757 posts
  • Location:Birmingham, AL

Posted 11 November 2008 - 11:43 AM

When setting the vsens resistor value it doesn't actually set anything in the DS2438, just in the driver. Then when you call GetCurrent() it does the calculation for you from the voltage reading it gets from the DS2438. But those are handy functions to have so that you don't have to code them yourself.

Eric

#15 EL34

EL34

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 138 posts

Posted 11 November 2008 - 12:05 PM

Well I do not know where the Vsens value is being set, but you can set it for the DS2438 current calculation.
The value is not set forever, the DS2438 will revert back to a 50 milliohm default

You have to set the IAD flag to true and then set the vsens value just before you ask the DS2438 for a current calculation.

' set sense resistor value from container 26 to 100 milliohms
Owd5.setSenseResistor(100)

' read sens resistor value
SenseResistorValue = Owd5.getSenseResistor()


Note that I use a .05 (50 milliohm value) for my greenhouse monitor boards, but I just set one of them to 100 milliohms as an experiment.
I set it to 100 milliohms and then read the value back into a variable and displayed it in the screenshot below.
The PV array charge current figure is not correct now that I set the Vsens to 100 milliohms.

After I set it back to 50 milliohms, my current calculation was correct again.
Look at this screen shot
Posted Image

Edited by EL34, 11 November 2008 - 12:18 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users