Solar sensor Digitemp

Hi,

I have got the humidity/temperature/solar sensor and are using Digitemp 3.3.2 in Linux.
I am able to read the temperature and humidity, but not the solar.
Is it possible to read the solar from this sensor with Digitemp?

Code:
# digitemp_DS9097U -qa
Aug 02 09:50:54 Sensor 0 C: 26.94
Aug 02 09:50:55 Sensor 1 C: 26.41 H: 42%

Thanks.

Best regards, Mats
 
I have now been told that it should be possible to measure the raw value for the solar with Digitemp by using the -A switch.
I have tried that with some simple tests, but can't see any correlation between the
amount of light and the AD value. Maybe I am doing something wrong?
I read somewhere here that the resistor used by Hobby Boards is too small. Could that be an issue, or could my sensor be broken?

Dark:
Code:
# digitemp_DS9097U -qA -t1
Aug 03 09:24:29 Sensor 1 VDD: 4.02 AD: 1.67 C: 27.12

Daylight:
Code:
# digitemp_DS9097U -qA -t1
Aug 03 09:12:50 Sensor 1 VDD: 4.02 AD: 1.63 C: 27.81

Daylight + lamp
Code:
# digitemp_DS9097U -qA -t1
Aug 03 09:35:18 Sensor 1 VDD: 4.00 AD: 1.67 C: 27.03

Best regards, Mats
 
It is pretty easy to modify the source code of digitemp to add readout of the current.
In the routine "read_humidity" add:

/* Read the solar radiation */
solar_rad = Get_Current(0);

you have to pass the variable to the "log_humidity" function and add
it to the printout...
 
So, what you say is that if I don't change the source code I will not be able to read the solar?
The AD value that I was looking at shows something different?
 
So, what you say is that if I don't change the source code I will not be able to read the solar?
The AD value that I was looking at shows something different?

Yes I believe so...

The "AD" reading is the raw voltage output from the humidity sensor.

The DS2438 can read both voltage and current on separate inputs. digitemp currently only reads the
voltage output. If you want to add current readout you can add a function to userial/ad26.c
and then call it from digitemp.c

The function to read the current looks like:

int Get_Current(int portnum)
{
int ret=0;
uchar send_block[50];
int send_cnt=0;
int i;
ushort lastcrc8=255;

if(owAccess(portnum))
{
// Recall the Status/Configuration page
// Recall command
send_block[send_cnt++] = 0xB8;

// Page to Recall
send_block[send_cnt++] = 0x00;

if(!owBlock(portnum,FALSE,send_block,send_cnt))
return FALSE;
send_cnt = 0;
}

if(owAccess(portnum))
{
// Read the Status/Configuration byte
// Read scratchpad command
send_block[send_cnt++] = 0xBE;

// Page for the Status/Configuration byte
send_block[send_cnt++] = 0x00;

for(i=0;i<9;i++)
send_block[send_cnt++] = 0xFF;

if(owBlock(portnum,FALSE,send_block,send_cnt))
{
setcrc8(portnum,0);

for(i=2;i<send_cnt;i++)
lastcrc8 = docrc8(portnum,send_block);

if(lastcrc8 != 0x00)
return ret;
}
else
return ret;

ret = (int)((send_block[8] << 8) | send_block[7]);
}
return ret;
}
 
Thanks a lot for the code!
Before I give it a try I have two more questions :)
If you look on the schematic for the sensor: Schematic, I guess that you want to measure the current through R2, correct?
If I do the reading like I did above
Code:
# digitemp_DS9097U -qA -t1
Aug 03 09:24:29 Sensor 1 VDD: 4.02 AD: 1.67 C: 27.12
would I then not be able to calculate the current by using the VDD value, i.e. current=VDD/390?
Or, is it the AD value that I shall use?
 
Thanks a lot for the code!
Before I give it a try I have two more questions ;)
If you look on the schematic for the sensor: Schematic, I guess that you want to measure the current through R2, correct?
If I do the reading like I did above
Code:
# digitemp_DS9097U -qA -t1
Aug 03 09:24:29 Sensor 1 VDD: 4.02 AD: 1.67 C: 27.12
would I then not be able to calculate the current by using the VDD value, i.e. current=VDD/390?
Or, is it the AD value that I shall use?

"AD" is the voltage reading of the humidity sensor. It is VAD in the schematic. In order to
get the current measurement you need to send the DS2438 chip a different command
sequence. This is done in the Get_Current routine that was previously posted.
 
Good day -- this is my 1st post here.
May you please say more on how to implement these changest to digitemp for Vsens functionality?
I'm Linux newbie... I add these two lines to... digitemp.c yes? And then what?
Thanks in advance | Piotr

It is pretty easy to modify the source code of digitemp to add readout of the current.
In the routine "read_humidity" add:

/* Read the solar radiation */
solar_rad = Get_Current(0);

you have to pass the variable to the "log_humidity" function and add
it to the printout...
 
Hi,

I'm using some home grown software based on Digitemp which has support for Humidity but not Solar. I am just about to modify the code to add in the Solar and came across the helpful posts by "pbarp". Rather than reinventing the wheel, I plan on cribbing that code. Before I start messing with my setup I just wondered if anyone else had tried this and had good results ?

Also, can I just read the solar value right after the humidity calculation ? No need for any delays etc. ?

regards
Dave
 
Hi,

I'm using some home grown software based on Digitemp which has support for Humidity but not Solar. I am just about to modify the code to add in the Solar and came across the helpful posts by "pbarp". Rather than reinventing the wheel, I plan on cribbing that code. Before I start messing with my setup I just wondered if anyone else had tried this and had good results ?

Also, can I just read the solar value right after the humidity calculation ? No need for any delays etc. ?

regards
Dave

Dave,

I have not tried the code you mentioned but you can read for the solar value without any delay.

Eric
 
does anyone have the modified source code files so I can just build this? I admit to not being a programmer. Trying to run solar on a NSLU2/Debian box

-Jim
 
Back
Top