Weather board for SHOW.

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Weather board for SHOW.

Unread post by odroid » Tue Jun 24, 2014 3:36 pm

Add-on sensor board for ODROID-SHOW !

The Weather board is an easy to use ODROID-SHOW Add-on that grants you access to UV Index, barometric pressure, altitude, relative humidity, illumination and temperature.

- Dimension is only 20 x 20 mm
- Sensors : Si7020, BMP180, Si1132

Image

You can buy this board now.
http://www.hardkernel.com/main/products ... 0264897696

With a few batteries, you can make a portable weather station.
Image

If you connect it to your ODROID or PC via USB interface, you can make a weather data logger with a Qt application.
Image

Full schematics and firmware and host software source code are available.
http://odroid.com/dokuwiki/doku.php?id=en:weather-board

User avatar
memeka
Posts: 4143
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Contact:

Re: Weather board for SHOW.

Unread post by memeka » Tue Jun 24, 2014 4:39 pm

cool addon!

* will this work connected to the odroid (u3 + shield, xu) or just Odroid SHOW? (can't see why is just for SHOW...)
* does it work with 5V power instead of 3.5V?

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Tue Jun 24, 2014 7:03 pm

It can be connected to ODROID with a couple of level shifter on the I2C bus.
VCC could be 2.7~3.6Volt.

But we need to develop an example code for each sensors. :cry:

User avatar
memeka
Posts: 4143
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Contact:

Re: Weather board for SHOW.

Unread post by memeka » Tue Jun 24, 2014 8:44 pm

i think vcc is the big problem here, that you cannot get it from board :(
i would probably go with other sensors that work at 5V (or 1.8V) :(

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Wed Jun 25, 2014 2:20 pm

Yes.. there should be voltage regulator for 5V to 3.3V.

User avatar
sert00
Posts: 745
Joined: Sun Feb 24, 2013 12:26 am
languages_spoken: english,italian
ODROIDs: ODROID-U2*2__ODROID-U3__ODROID-XU-E__ODROID-XU-Ebeta__ODROID-C1__ODROID-XU4
Contact:

Re: Weather board for SHOW.

Unread post by sert00 » Thu Jun 26, 2014 8:45 pm

great addon,time to place an order of this,show and ups!love this kind of gadgets! :D
2x Odroid-U2
2x Odroid-XU-E
Odroid-U3
Odroid-C1+
Odroid-XU4
Lcd touch panel 10.1"
....and many of the goodies available....

magnum_pi
Posts: 198
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Contact:

Re: Weather board for SHOW.

Unread post by magnum_pi » Fri Jun 27, 2014 10:15 am

Looks nice. I was only very recently looking at similar sensors for use in a poly tunnel. This board looks very nice in comparison. I don't think I'd want to pair it up with the SHOW, though, especially not in a humid environment like a greenhouse or poly tunnel. I think it would work much better with the USB I/O (since it's easier to waterproof and I wouldn't mind so much if it broke), but the voltages are wrong :(.

This is not quite right for my application. I would suggest a couple of things, though:
  • * supply a cable for connecting between the module and the arduino board so that it's easier to waterproof the board and sensor can be placed where it will give most consistent readings for, eg, light values
    * release a data logger board: even with SHOW, you've still got SPI pins available, so you could turn it into a real weather station (apart from the conflict between measuring light levels, keeping it weatherproof and measuring temperature in the shade).
A data logger module would be great because you could run the entire thing off batteries and solar cells and only occasionally connect up to a PC to download the readings. Both the SHOW and the USB I/O have usb connectors, but it seems that it would be easier to rig up the USB I/O and most of the time the screen on the SHOW would be going to waste in a weather monitoring station...

So anyway, as I said, it's a really nice board (and good value), but just not right for me at the moment.

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Fri Jun 27, 2014 11:16 am

Thank you for the feed back.

BTW, you can connect the Weather board to the USB IO board.
USB IO board is 3.3Volt and the Weather board accepts 2.7V~3.6V.
Arduino Sketch and Libs can be ported to USB IO software easily.

User avatar
memeka
Posts: 4143
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Contact:

Re: Weather board for SHOW.

Unread post by memeka » Fri Jun 27, 2014 1:00 pm

odroid wrote:Thank you for the feed back.

BTW, you can connect the Weather board to the USB IO board.
USB IO board is 3.3Volt and the Weather board accepts 2.7V~3.6V.
Arduino Sketch and Libs can be ported to USB IO software easily.
that's good advice :)

thanks @odroid

magnum_pi
Posts: 198
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Contact:

Re: Weather board for SHOW.

Unread post by magnum_pi » Fri Jun 27, 2014 1:03 pm

odroid wrote:Thank you for the feed back.

BTW, you can connect the Weather board to the USB IO board.
USB IO board is 3.3Volt and the Weather board accepts 2.7V~3.6V.
That's interesting. So I wouldn't need to modify the USB I/O board at all, and both would work at 3v3? That makes it quite a bit more attractive.
Arduino Sketch and Libs can be ported to USB IO software easily.
In theory, yes, but I don't think it's quite as easy as you say it is. I only have the free sdcc PIC compiler, which I think only supports C, whereas most Arduino libraries are C++? Also there's the issue of all the registers being pretty different, even though both of them have relatively similar architectures. I'm sure I can manage the differences, but it strikes me as being more of a reimplementation than a straight port if you take the support libs (like for serial) into account ...

Anyway, thanks for the extra info. Do you have any idea about whether this could be available from a European reseller or would I have to order direct from Korea?

Cheers!

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Fri Jun 27, 2014 2:18 pm

It may take 3~4 days to port the Weather board Sketch source to pure C version for the USB IO board.
But we are too busy these days. So we will start it from middle of July.

The resellers don't sell the Weather board now.
If you push them, they might move. ;)

User avatar
venkatbo
Posts: 488
Joined: Mon Feb 25, 2013 3:10 pm
languages_spoken: english
ODROIDs: C0/C1+/C2 U3+ XU3-Lite/XU4 VU/VU7+ Touchscreen Show TFT Cloudshell SmartPower mAHRS DAC GPS Multiscope
Location: Bay Area, California
Contact:

Re: Weather board for SHOW.

Unread post by venkatbo » Fri Jun 27, 2014 2:45 pm

odroid wrote:VCC could be 2.7~3.6Volt.
Since this is the case, wouldn't it be possible to use this on say, an Arduino Due (a 3.3v board) ? If so, will any hardware mods to this add-on weather-board be needed to get it to work with a Due ?

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Fri Jun 27, 2014 8:20 pm

Just connect VCC/GND/SDA/SCL signals to your Due board.
But you need to modify the sketch file for the Due pinout.

smitna
Posts: 8
Joined: Mon Feb 03, 2014 2:45 am
languages_spoken: english, german
ODROIDs: ODROID-X, ODROID-U3, ODROID-XU, 3x ODROID-C2
Location: Germany
Contact:

Re: Weather board for SHOW.

Unread post by smitna » Sun Jul 06, 2014 1:23 am

I have ordered 4 Weather boards and found some issues:
- Temperatures on both sensors (Si7020 and BMP180) are showing wrong values (about 4-5 C higher than compared with 2 thermometers)
- Humidity value differs about 8 % (lower than expected and measured)
- Altitude value differs about 40 meters (lower than expected and measured via gps)

I have checked this with all boards.
Board voltage is in range (3.4 V)

Is there something wrong with the software/firmware? The sensors should be calibrated (data sheeds) and I can't find something wrong in the weather Sketch

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Sun Jul 06, 2014 12:39 pm

Yes, most sensors are calibrated in their factory.

I think the wrong Relative-Humidity and Temperature might be caused by PCB temperature.
BTW, what is the tolerance of your thermometers?

As far as I know, GPS altitude might not be accurate.
Refer this link.
http://www.gpsinformation.net/main/altitude.htm

smitna
Posts: 8
Joined: Mon Feb 03, 2014 2:45 am
languages_spoken: english, german
ODROIDs: ODROID-X, ODROID-U3, ODROID-XU, 3x ODROID-C2
Location: Germany
Contact:

Re: Weather board for SHOW.

Unread post by smitna » Sun Jul 06, 2014 10:34 pm

odroid wrote:Yes, most sensors are calibrated in their factory.

I think the wrong Relative-Humidity and Temperature might be caused by PCB temperature.
BTW, what is the tolerance of your thermometers?

As far as I know, GPS altitude might not be accurate.
Refer this link.
http://www.gpsinformation.net/main/altitude.htm
The tolerance of the thermometers is +1/-1 degree and they show nearly the same temperature.
I agree, it's possible the PCB temperature.
Yes, calculated altitude is slightly different between network/google and GPS, but close enough to the officially value for my city.
That's not the reason. I see the altitude from the sensor is calculated in the library from the pressure reading:
altitude = 44330 * (1.0 - pow(pressure /sealevelPressure,0.1903));
So we need a "correction calculation" for both the altitude (or pressure) and the temperature in the libraries.

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Mon Jul 07, 2014 12:02 am

This one seems to be the temperature compensated "Pressure to Altitude" conversion library.

https://github.com/adafruit/Adafruit_BM ... P085_U.cpp

smitna
Posts: 8
Joined: Mon Feb 03, 2014 2:45 am
languages_spoken: english, german
ODROIDs: ODROID-X, ODROID-U3, ODROID-XU, 3x ODROID-C2
Location: Germany
Contact:

Re: Weather board for SHOW.

Unread post by smitna » Mon Jul 07, 2014 4:59 am

odroid wrote:This one seems to be the temperature compensated "Pressure to Altitude" conversion library.

https://github.com/adafruit/Adafruit_BM ... P085_U.cpp
Thanks!

Yes, this library calculates temperature and pressure with compensation but needs some modification to use it for the ODROID show/weatherboard...

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Mon Jul 07, 2014 9:54 am

We will try that ...

smitna
Posts: 8
Joined: Mon Feb 03, 2014 2:45 am
languages_spoken: english, german
ODROIDs: ODROID-X, ODROID-U3, ODROID-XU, 3x ODROID-C2
Location: Germany
Contact:

Re: Weather board for SHOW.

Unread post by smitna » Mon Jul 28, 2014 12:30 am

odroid wrote:This one seems to be the temperature compensated "Pressure to Altitude" conversion library.

https://github.com/adafruit/Adafruit_BM ... P085_U.cpp
I think there is no big difference to this library.
So I changed only this lines for temp1 (BMP180) and temp2 (Si7020) calculation:

file Adafruit_BMP085.cpp
// step 1
X1 = (UT - (int32_t)ac6) * ((int32_t)ac5) / pow(2,15);
X2 = ((int32_t)mc * pow(2,11)) / (X1+(int32_t)md);
B5 = X1 + X2;
temp = (B5+8)/pow(2,4);
// original
//temp /= 10;
temp /= 12;

file ODROID_Si70xx.cpp
rawTemp = read16(CMD_MEASURE_TEMPERATURE_HOLD);
// original
//temp = (rawTemp*175.72/65536) - 46.85;
temp = (rawTemp*175.72/65536) - 50.85;

Then the temps are nearly the same compared with 2 other thermometers.

I also wrote a client-server solution for the command line (with help from the qt_weather example)

The first file is the "server". It only writes the values constantly from serial to a fifo (formated to JSON) and must be running before executing the reader.
The second file is the reader. It reads the values from the fifo. First stop a possibly running "Qt based GUI application", it will be blocked because only one application is allowed to read from the serial port at the same time.
The third file is a PHP example for outputting the data to a web page (for example an available web server on the connected ODROID U3). It should be possible to use this also for an Ajax solution.

Sorry, I am an absolute C rookie. So feel free to report bugs...
Attachments
weather.php.txt
(204 Bytes) Downloaded 215 times
reader.c
(1.4 KiB) Downloaded 189 times
server.c
(4.05 KiB) Downloaded 180 times

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Mon Jul 28, 2014 10:15 am

We will chech your code carefully.
It seems to be decreasing 4 degree...

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Wed Jul 30, 2014 12:08 pm

This patch is really nice! More accurate temperature!

We've merged it into our github and change the revision to 1.1
https://github.com/hardkernel/ODROID-SH ... 1aa2b1eddd

Appreciate your work. :)

User avatar
sert00
Posts: 745
Joined: Sun Feb 24, 2013 12:26 am
languages_spoken: english,italian
ODROIDs: ODROID-U2*2__ODROID-U3__ODROID-XU-E__ODROID-XU-Ebeta__ODROID-C1__ODROID-XU4
Contact:

Re: Weather board for SHOW.

Unread post by sert00 » Wed Jul 30, 2014 10:36 pm

wow!i'm excited to have this board!it's great to see someone help to have better support on this addons! :)
2x Odroid-U2
2x Odroid-XU-E
Odroid-U3
Odroid-C1+
Odroid-XU4
Lcd touch panel 10.1"
....and many of the goodies available....

crossblade
Posts: 9
Joined: Thu Aug 14, 2014 6:46 pm
languages_spoken: english, german
ODROIDs: ODROID U3 (x3)
ODROID U3 UPS (x2)
ODROID SHOW
Weather Board
Contact:

Re: Weather board for SHOW.

Unread post by crossblade » Sat Aug 16, 2014 8:41 pm

I've been playing around with the Weather board.

The sensors are realy nice
but the Si1132 seems to have a problem with low light / indoor at the default settings. It always displays a minimum illuminescence of about 250 lux even if it is nearly completely dark. Also the Visible and IR seem to be swaped. At least if I shine with a realy bright LED flashlight on it the IR value goes up by default :roll:

Could someone confirm if they are swapped?

also is there a Possibillyty to increase the sensitivity by e.g.
ALS_VIS_ADC_GAIN=4
IR_GAIN=3
or increase the integration time
from the Data Sheet at
http://www.silabs.com/Support%20Documen ... Si1132.pdf

I have no clue on how to do this (Because I never programmed I2C devices before)

The other sensors seem perfectly stable and have only a small setup compared to the reference :D

Also I've programmed a small algorythm for calculating the absolute humidity and dew-point from the available values (quite easy). If there is interest for that I can post them here...

crossblade
Posts: 9
Joined: Thu Aug 14, 2014 6:46 pm
languages_spoken: english, german
ODROIDs: ODROID U3 (x3)
ODROID U3 UPS (x2)
ODROID SHOW
Weather Board
Contact:

Re: Weather board for SHOW.

Unread post by crossblade » Sun Aug 17, 2014 10:36 pm

After I've done some experimenting with the board it seems to me the calibration is off.

At least the values I have references here right now seem a bit doubtful in their absolute accuracy of the values.
The temperature of the Si7020 and BMP180 are off by 0.8 °C where the mean value of these is of by as much as 1.0°C to a calibrated SHT25 sensor and some other thermo sensors I have around. :?

The Si1132 not only has a problem with low light environments showing at least 250 lux in completely dark surroundings. Also the Visible and IR are most definitely switched! :!: :evil:

The absolute values seem also to be off by a huge factor. A calibratet 500Lumen Light source should give 500 Lux @ 1m and 2000 Lux @ 0.5m the sensor detected 297Lux@1m and 450Lux@0.5m
This leads me to think there is an Offset and a Factor not correctly considered by the Arduino lib : :(

A TSL 2561 Sensor by adafruit gave (close to) the correct values.

Also the overcast sky outside today only gave ~900 Lux where it should give at least a value of over 3000 – all in the IR channel – the Visible channel stays below 300 inside and 400 outside all the time. :?

I have not had the references yet to check the Pressure and humidity levels, but don’t completely trust them either untill I've checked them...

So is there a possibility to calibrate them for inside use and increase the accuracy at least in the range of the data sheets provided or is the light sensing ability of the board a failure :?:

EDIT:
Only the peperature of the BMP180 semms to have a offset - the Si7020 has a ofset of 0.4 °C that is only slightly outside of the givven tolerances of 0.3 °C (and in Range if you consider a tolerance of the reference...

EDIT2:
After I’ve done some reading in the datasheet I am sure the Si1132just needs to be set up differently for indoor use. At integration time to 410 µs, the ADC can detect light levels as low as 1 lx.

The offset is maybe a shift in the RESPONSE register (that can be FF or 255)

Also I think the sensor is set to “High Signal Range” (Gain divided by 14.5) explaining the reduced sensitivity.
Since I don’t exactly understand the Bit acrobatics in the library and the settings are NOT exposed to the user can you please point me to the according lines of code for me to try this out?

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Mon Aug 18, 2014 10:10 am

We will look into the switched Visible and IR issue first.

lsc1117
Posts: 98
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Contact:

Re: Weather board for SHOW.

Unread post by lsc1117 » Mon Aug 18, 2014 3:48 pm

We checked our weather board source code about the swapped Visible and IR.
but, I could not find the problem.
The Visible register have value at "0x22" and IR register hava value at "0x24"
Please check the datasheet.
Thank you.

crossblade
Posts: 9
Joined: Thu Aug 14, 2014 6:46 pm
languages_spoken: english, german
ODROIDs: ODROID U3 (x3)
ODROID U3 UPS (x2)
ODROID SHOW
Weather Board
Contact:

Re: Weather board for SHOW.

Unread post by crossblade » Tue Aug 19, 2014 2:50 am

Thank you for the quick response.
These addresses are correct according to the data sheet, but then the problem seems to go way deeper.

I’ve rustled up some quick testing. The pictures are done with the curret odroid show example sourcecode, downloaded and compiled just today.
At the first stage I put the ODROID Show and weather in a makeshift dark box with ambient light conditions of about 10-15Lux

Image

Al you can see the visible channel shows 259 Lux and the IR 255 Lux – that is way to much.
Also below you see my calibrated shat 21 sensor that gives me a readout of 20.7 C, whereas the si7020 gives 21.22 and the BMP180 gives 22.00 – but at least the si7020 seems to be about in range of it’s error bars.

Image

In the second picture I used a 6500K LED light with a known angular distribution and output power.
At the utilized distance it should produce about 6000 Lux (+- 1000 Lux)
As you can see the IR channel rises to 2663 Lux where it should not rise that dramatically (LEDs are no Black body radiators) while the Visible Channel only rose to 778 Lux – a factor of 10 to low!
Also the UV Index rose to 3.1 what is possible because the White LEDs generate its light via a Broad band phosphor illuminated by a deep blue LED internally. I don’t actually know the Amount of UV light put out (Because the spectrometer at the physics department only goes to 400nm Wavelength…)

Can you confim these findings with your own tests. At least it seems the way to high low illumination light detection is consistent with the Screenshots on your website. The sensor should be precise in the area of 10-15% with a low light resolution of below 1Lux (right now these valuaes are not even in the right order of magnitude)
These test are easy so please confirm these elephant size bugs (why have they not been found while initial testing)
These make the SI 1132 utterly useless for practical measurements in the current condition :-(
Or is my weather board broken on arrival?

If you have some improved source code I’m willing to beta test it as long I have not send it back to pollin (what I’m considering right now…)

Krautmaster
Posts: 2
Joined: Thu Aug 21, 2014 12:31 am
languages_spoken: english
Contact:

Re: Weather board for SHOW.

Unread post by Krautmaster » Thu Aug 21, 2014 12:34 am

I have the same Problem here

the light shows always to high values at low light und to low at high.

the weather board ist useless for my untill this is not fixed :evil:

is there anny solution yet?

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Thu Aug 21, 2014 10:29 am

We will try it under low light environment by early next week.
We are terribly busy in this week. Sorry about that.

crossblade
Posts: 9
Joined: Thu Aug 14, 2014 6:46 pm
languages_spoken: english, german
ODROIDs: ODROID U3 (x3)
ODROID U3 UPS (x2)
ODROID SHOW
Weather Board
Contact:

Re: Weather board for SHOW.

Unread post by crossblade » Thu Aug 21, 2014 8:48 pm

Thank you for looking into the matter.

I am quite convinced right now it is only a Library / firmware problem and not a hardware problem.

while trying to understand the Library I just removed these Lines

Code: Select all

  // in high range mode (not normal signal)
  writeParam(Si1132_PARAM_ALSVISADCMISC, Si1132_PARAM_ALSVISADCMISC_VISRANGE);
and it got slightly bether - still ~ 255 Lux in dark conditions but the daylight value gets closer to a plausible.

I am not familiar enough with the I2C systematics jet to meddle around with these.
Maybe you yould expose this funtionality via some boilerplate code in a future revision of the library

I imagine soething in the way of funtions the user can set

Code: Select all

Si1131.highrange(boolean); \\ true / false default false
Si1131.gain(int); \\ 0-16 default 0
Si1131.integrationTime(int) \\ 1-500ms default ???;

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Fri Aug 22, 2014 9:49 am

Yes, we know well the I2C communication.
But we don't know well the characteristic of this light sensor to adjust/compensate the sensitivity. :(
Time to study the libraries we got it from Internet. Yes, we didn't check the functionality of the libraries carefully at all. ;)

crossblade
Posts: 9
Joined: Thu Aug 14, 2014 6:46 pm
languages_spoken: english, german
ODROIDs: ODROID U3 (x3)
ODROID U3 UPS (x2)
ODROID SHOW
Weather Board
Contact:

Re: Weather board for SHOW.

Unread post by crossblade » Fri Aug 22, 2014 10:01 pm

Well that is great news. (not that it does not work currently, but that we seem to have the complementary skill sets needed to get this to work)

You can program an I2C communication :)
I have a good idea of how to find working settings for the sensor at indoor and outdoor conditions and some crude but effective measurement setup. ;) Maybe in the final stage I could even access my university references in the off time to get a finer calibration (that is how I calibrated the SHT 21 Sensor)

If you in a first step could just expose the settings for IR and Visible via a refreshed library something like :idea:

Code: Select all

Si1131.visHighrange(boolean); \\ true / false default false
Si1131.visGain(int); \\ 0-16 default 0
Si1131.visIntegrationTime(int) \\ 1-500ms default ???; 

And

Code: Select all

Si1131.IRHighrange(boolean); \\ true / false default false
Si1131.IRGain(int); \\ 0-16 default 0
Si1131.IRIntegrationTime(int) \\ 1-500ms default ???;   
I could try to give you some default values for Indoor and outdoor use to program into the library at default ;)

Maybe in a second step to try to do a quick algorithm to compensate for the overlap of these two sensors in the red color regime since the response coves are already printed in the data sheet. I imagine someething of

Code: Select all

LuxVis = LuxVis - (IntegralOfOverlap / IntegralOfVisible * LuxIR) + (IntegralOfOverlap / IntegralOfIR * LuxIR)
But for that to work both sensors have to be calibratet in ther response at first... :roll:

But no rush – I’m convinced now the sensors cold be calibrated to a quite high sensitivity and this will be possible quite soon. The hardware specs seem to be impressive – let’s make the results obtained equally impressive.
Tis process could be done with support of you by the community – especially the testing in a variety of setups. But since you are bussy I expect you are working on some other interesting new products. Cant wait to see what you came up with now?
It seems you come up every month wit another interesting product :mrgreen:
I can’t wait for the ODROID-W to become available locally – it seems nearly to perfect for a Raspi-Cam setup (being compatible and battery powered)

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Wed Aug 27, 2014 9:39 pm

We've tried a few modification on the configuration and we found improved measurement.
But we don't know how much it was better. :(

So we ordered a digital Lux meter to have reliable reference value.
It will be here early next week hopefully. ;)

Krautmaster
Posts: 2
Joined: Thu Aug 21, 2014 12:31 am
languages_spoken: english
Contact:

Re: Weather board for SHOW.

Unread post by Krautmaster » Sat Aug 30, 2014 1:08 am

Mine went back for a full refund complete with the show
It wass still not usable and the problem seems deeper
Now I'm using the sensors from adafruit - maybe a little bit more expensive and several breakout boards but at leas they work.

maybe I'll consider some product from hardkernel in the future - but after this experience the function shold be confirmd in front.

Not doing at least the most basic testing before the product is shipped is in my opinion not a sign for a competent development team :evil:

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Wed Sep 03, 2014 11:28 am

We will update the firmware to fix the wrong Lux measurement tonight.

[Update]
It has been uploaded.
Now we can have more reliable Lux data.
lux.jpg
lux.jpg (110.83 KiB) Viewed 19340 times

crossblade
Posts: 9
Joined: Thu Aug 14, 2014 6:46 pm
languages_spoken: english, german
ODROIDs: ODROID U3 (x3)
ODROID U3 UPS (x2)
ODROID SHOW
Weather Board
Contact:

Re: Weather board for SHOW.

Unread post by crossblade » Sun Sep 07, 2014 12:20 am

Thank you verry much for this upgrade.

The light sensor seems to to now just also work verry good. :)
The dark still does not go down to absolute 0 but I guess that is because of the LED giving of some light that is reflected back...
The values in low amient and high light conditions now are at most 5% of - so it is realy nice calibrated und has a perfect range!
From 5 Lux to 30000 Lux with one sensor :D


Also I have made some code for calculating the abolute hunidity and dew point from the values of the Si7020 sensor.
Feel free to use this calculations if you want to (physics formulas are not subeject to copyright ;) )

Code: Select all

void getData()
{
        temp = si7020.readTemperature();
        tempPressure = bmp180.readPressure();
        pressure = tempPressure/100;
        relHum = si7020.readHumidity();
        IlluVis = si1132.readIR();
        IlluIR = si1132.readVisible();
        UVindex = si1132.readUV()/100.0;
}

void calculateData()
{
        satVaporPressure = 6.1078 * pow(10,((7.5*temp)/(237.3+temp)));
        vaporPressure = relHum / 100 * satVaporPressure;
        absHum = pow(10,5) * 18.016 / 8314.3 * vaporPressure / (temp + 273.15);
        vaporVol = log10(vaporPressure/6.1078);
        dewPoint = 237.3 * vaporVol / (7.5-vaporVol);
        
        altitude = bmp.pressureToAltitude(SENSORS_PRESSURE_SEALEVELHPA, pressure, temp);
}

smitna
Posts: 8
Joined: Mon Feb 03, 2014 2:45 am
languages_spoken: english, german
ODROIDs: ODROID-X, ODROID-U3, ODROID-XU, 3x ODROID-C2
Location: Germany
Contact:

Re: Weather board for SHOW.

Unread post by smitna » Tue Sep 09, 2014 8:23 am

odroid wrote:We will update the firmware to fix the wrong Lux measurement tonight.

[Update]
It has been uploaded.
Now we can have more reliable Lux data.
lux.jpg
Thanks a lot for the update - much better!

Two things needs further fixes:
1. Temperature at both sensors are still about 4 degrees too high (see my past posts in this thread) and the fix not part of the changes at github
2. At a level of about 40000 Lux (or about 10000 Lux IR) reached with help of a bright LED lenser the sketch stops working/freezes and the SHOW needs a reboot. - Yes, I know that's not part of the daily use, but...

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Tue Sep 09, 2014 1:03 pm

1. Do you know which temperature value is more accurate?
2. We will look into the freezing issue.

We will also add the absolute humidity and dew point which were contributed by crossblade.

TheColoredLindorBall
Posts: 3
Joined: Tue Nov 04, 2014 8:27 pm
languages_spoken: english
ODROIDs: U3
Contact:

Re: Weather board for SHOW.

Unread post by TheColoredLindorBall » Wed Dec 17, 2014 8:54 pm

Is it possible to use the weather board with the U3 IO Shield yet?
And did you write an example code for the sensors?

magnum_pi
Posts: 198
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Contact:

INT0/D2 pin

Unread post by magnum_pi » Thu Dec 18, 2014 1:18 pm

Hi,

I've been looking at the schematics and other docs for the board and it seems that even though the INT0/D2 pin is connected to the Si1132 chip, the library doesn't actually use it.

Is it OK to use that pin on the SHOW2 for some other purpose? If I do, should I tie the Si1132 INT input to ground, +3.45v or can I just leave it floating?

Thanks...

User avatar
odroid
Site Admin
Posts: 29651
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Weather board for SHOW.

Unread post by odroid » Thu Dec 18, 2014 3:37 pm

The INT pin of Si1132 is output. So you can leave it floating.
And the INT0/D2 of MCU can be used for other purpose.

jl303
Posts: 53
Joined: Wed Dec 31, 2014 12:08 am
languages_spoken: english
Contact:

Re: Weather board for SHOW.

Unread post by jl303 » Wed Dec 31, 2014 12:10 am

What's the best way to access data from the Weatherboard from Java?

User avatar
venkatbo
Posts: 488
Joined: Mon Feb 25, 2013 3:10 pm
languages_spoken: english
ODROIDs: C0/C1+/C2 U3+ XU3-Lite/XU4 VU/VU7+ Touchscreen Show TFT Cloudshell SmartPower mAHRS DAC GPS Multiscope
Location: Bay Area, California
Contact:

Re: Weather board for SHOW.

Unread post by venkatbo » Wed Dec 31, 2014 3:50 am

... What's the best way to access data from the Weatherboard from Java?...
Jython/Nailgun along with python-based GPIO, maybe ;?) - granted its indirect... Another non-java option is CPython. Python only because it is quite developer/debugging friendly, allowing for incremental code/debug/enhancement cycles.

jl303
Posts: 53
Joined: Wed Dec 31, 2014 12:08 am
languages_spoken: english
Contact:

Re: Weather board for SHOW.

Unread post by jl303 » Wed Dec 31, 2014 9:49 pm

Would this possible by directly reading/writing through serial port?
I think javax.comm allows communication through serial port like /dev/term/a.

usee
Posts: 113
Joined: Thu Sep 26, 2013 4:28 am
languages_spoken: english
ODROIDs: ODROID-XU, U3, XU3, C1, Weather board, show1
Contact:

Re: Weather board for SHOW.

Unread post by usee » Thu Jan 01, 2015 9:27 pm

Yes, the serial port can be read directly with Java. With appropriate keywords one can
find from the Internet blogs and material that explains how to do it. For instance
one can goole with "rxtx java with arm". Then of course, if one wants to read the sensor output
in Windows or Linux on X86, then one needs native libaries for those platforms.
For reading on an ODROID I was using Java jars with ARM native libs in here:
https://packages.debian.org/wheezy/armh ... a/download
Then you must know, how to give the library path to javac or to Java IDE.

The data stream that is coming from the show board uses 'w' as delimiter and the first
number after delimiter is 0-7 and it tells, which sensor does the next floating point number
belong to. :D

usee
Posts: 113
Joined: Thu Sep 26, 2013 4:28 am
languages_spoken: english
ODROIDs: ODROID-XU, U3, XU3, C1, Weather board, show1
Contact:

Re: Weather board for SHOW.

Unread post by usee » Tue Jan 06, 2015 5:57 pm

I have been exercising with reading of the sensor values of weather board with Java.
Probably there has been enough verification done, so I think that the made implementation
could be useful for someone else and some other use case than mine alone.

Let's see, whether this can be uploaded properly as attachments.

usee
Posts: 113
Joined: Thu Sep 26, 2013 4:28 am
languages_spoken: english
ODROIDs: ODROID-XU, U3, XU3, C1, Weather board, show1
Contact:

Re: Weather board for SHOW.

Unread post by usee » Tue Jan 06, 2015 6:12 pm

The attachment upload was not succesful for unknown reason. So, code blocks are used below.

Code: Select all

package serial;
import gnu.io.CommPortIdentifier;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;

public class PortFinder {

    public static void main(String[] args) {
        PortFinder inspector = new PortFinder();
        for (String name: inspector.listSerialPorts()) {
            System.out.println(name);
        }
    }

    public String[] listSerialPorts() {
        Enumeration ports = CommPortIdentifier.getPortIdentifiers();
        ArrayList portList = new ArrayList();
        String portArray[] = null;
        while (ports.hasMoreElements()) {
            CommPortIdentifier port = (CommPortIdentifier) ports.nextElement();
            if (port.getPortType() == CommPortIdentifier.PORT_SERIAL) {
                portList.add(port.getName());
            }
        }
        portArray = (String[]) portList.toArray(new String[0]);
        return portArray;
    }
}
Wather board abstraction

Code: Select all

package serial;

import gnu.io.*;
import java.io.InputStream;
import java.util.*;

public class WeatherBoard {
    public static final int TIMEOUT_AS_MILLISEC = 2000;
    public static final int BAUDRATE = 500000;
    private static InputStream in;
    private static Map<String, Measurement> data;

    public static void main(String[] args) {
        try {
            (new WeatherBoard()).readContinuously("/dev/ttyUSB0", 5, 1);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public Map<String, Measurement> readContinuously(String portName, int maxTimeAsSec, int logLevel)
            throws Exception {
        if (in == null) {
            data = new HashMap<String, Measurement>();
            SerialPort port = connect(portName);
            if (port != null) {
                in = port.getInputStream();
                (new Thread (new SensorDataReader(in, data, new ContinueForEver(), logLevel))).start();
                Thread.sleep(maxTimeAsSec * 1000);
            }
        }
        return data;
    }

    public Map<String, Measurement> readOnce(String portName, int maxTimeAsSec, int logLevel)
            throws Exception {
        Map<String, Measurement> data = new HashMap<String, Measurement>();
        SerialPort port = connect(portName);
        if (port != null) {
            InputStream in = port.getInputStream();
            Continuable condition = new ContinueUntilEnoughData(maxTimeAsSec);
            (new SensorDataReader(in, data, condition, logLevel)).read();
            in.close();
            port.close();
        }
        return data;
    }

    private SerialPort connect(String portName)
            throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException {
        CommPortIdentifier id = CommPortIdentifier.getPortIdentifier(portName);
        if (id.isCurrentlyOwned()) {
            logError("Port is currently in use");
            return null;
        } else {
            return initialize(id);
        }
    }

    private void logError(String text) {
        System.out.println("Error: " + text);
    }

    private SerialPort initialize(CommPortIdentifier id)
            throws PortInUseException, UnsupportedCommOperationException {
        CommPort port = id.open(this.getClass().getName(), TIMEOUT_AS_MILLISEC);
        SerialPort serialPort = (SerialPort)port;
        serialPort.setSerialPortParams(BAUDRATE,
                SerialPort.DATABITS_8,
                SerialPort.STOPBITS_1,
                SerialPort.PARITY_NONE );
        return serialPort;
    }

    class ContinueForEver implements Continuable {
        public boolean isContinue(int measurementCount) {
            return true;
        }
    };

    class ContinueUntilEnoughData implements Continuable {
        private final int maxTime;
        private long startTime;

        ContinueUntilEnoughData(int maxTimeAsSec) {
            this.maxTime = maxTimeAsSec;
        }

        public boolean isContinue(int sensorCount) {
            boolean isReadOnce = true;
            if (startTime == 0) {
                startTime = System.currentTimeMillis();
            }
            long currentTime = System.currentTimeMillis();
            long deltaTime = (currentTime - startTime) / 1000;
            if (deltaTime > maxTime)
            {
                return false;
            }
            boolean goOn = (isReadOnce ? sensorCount < 7 : true);
            return goOn;
        }
    }
}
Then there is data reader

Code: Select all

package serial;
import java.io.InputStream;
import java.util.Map;
import java.util.Scanner;

public class SensorDataReader implements Runnable {
    public static final String DELIMITER = "w";
    private final int logLevel;
    private final Continuable endCondition;
    private final InputStream in;
    private final Map<String, Measurement> data;

    public SensorDataReader(InputStream in, Map<String, Measurement> data, Continuable condition, int logLevel) {
        this.in = in;
        this.data = data;
        this.endCondition = condition;
        this.logLevel = logLevel;
    }

    public void run() {
        read();
    }

    public void read() {
        Scanner scanner = null;
        try {
            scanner = new Scanner(in, "UTF-8");
            scanner.useDelimiter(DELIMITER);
            while (scanner.hasNext() && isContinue()) {
                String str = scanner.next();
                int length = str.length();
                int endIndex = length - 1;
                if (endIndex > 0) {
                    parseContent(str);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (scanner != null) {
                scanner.close();
            }
        }
    }

    private boolean isContinue() {
        return endCondition.isContinue(data.values().size());
    }

    private void parseContent(String content) {
        String measurementIdentifier = content.substring(0, 1);
        int length = content.length();
        if (0 < length) {
            int endIndex = length - 1;
            String textValue = content.substring(1, endIndex);
            if (!textValue.isEmpty()) {
                String name = Measurement.getMeasurementName(measurementIdentifier);
                if (!"".equals(name)) {
                    Double value = Double.parseDouble(textValue);
                    if (value != null) {
                        addMeasurement(name, value);
                    }
                } else {
                    logInfo("     content=" + content);
                }
            }
        }
    }

    private void addMeasurement(String name, Double value) {
        if (!"".equals(name) && value.doubleValue() > 0.01) {
            Measurement measurement = data.get(name);
            if (measurement == null) {
                measurement = new Measurement(name);
                data.put(name, measurement);
            }
            measurement.addValue(value);
            String info = measurement.toString();
            logInfo(info);
        }
    }

    private void logInfo(String info) {
        if (logLevel > 0) {
            System.out.println(info);
        }
    }
}
Measurement and definition of data stream interpretation

Code: Select all

package serial;

import java.util.ArrayList;
import java.util.List;

public class Measurement {
    public static final String PRESSURE = "Pressure";
    public static final String ALTITUDE = "Altitude";
    public static final String TEMPERATURE = "Temperature";
    public static final String HUMIDITY = "Humidity";
    public static final String UV_INDEX = "UV Index";
    public static final String VISIBLE = "Visible";
    public static final String IR_INFRA_RED = "IR InfraRed";
    private String name;
    private List<Double> values;

    public static String getMeasurementName(String id) {
        String measurement = "";
        // we don't handle 0 (zero), it is also a thermal measurement
        if (id.equals("1")) {
            measurement = PRESSURE;
        } else if (id.equals("2")) {
            measurement = ALTITUDE;
        } else if (id.equals("3")) {
            measurement = TEMPERATURE;
        } else if (id.equals("4")) {
            measurement = HUMIDITY;
        } else if (id.equals("5")) {
            measurement = UV_INDEX;
        } else if (id.equals("6")) {
            // not, we swap here IR and VISIBLE
            measurement = IR_INFRA_RED;
        } else if (id.equals("7")) {
            measurement = VISIBLE;
        }
        return measurement;
    }

    public Measurement(String name) {
        this.name = name;
        this.values = new ArrayList<Double>();
    }

    public String getUnit() {
        String unit = "Not known";
        if (PRESSURE.equals(name)) {
            unit = "Pa";
        } else if (ALTITUDE.equals(name)) {
            unit = "meter";
        } else if (TEMPERATURE.equals(name)) {
            unit = "*C";
        } else if (HUMIDITY.equals(name)) {
            unit = "%";
        } else if (UV_INDEX.equals(name)) {
            unit = ""; // no unit
        } else if (VISIBLE.equals(name)) {
            unit = "Lux";
        } else if (IR_INFRA_RED.equals(name)) {
            unit = "Lux";
        }
        return unit;
    }

    public String getName() {
        return name;
    }

    public List<Double> getValues() {
        return values;
    }

    public void addValue(Double value) {
        // We could also collect values, now we keep only the latest.
        if (values.isEmpty()) {
            values.add(value);
        } else {
            values.set(0, value);
        }
    }

    public Double getLatestValue() {
        int index = values.size() - 1;
        if (index > -1) {
            return values.get(index);
        } else {
            return null;
        }
    }

    public String toString() {
        return "" + name + " " + getLatestValue() + " " + getUnit();
    }
}
We can define when to stop or continue data reading with an interface

Code: Select all

package serial;
interface Continuable {
    boolean isContinue(int sensorCount);
}
The hope that this is helpful for someone.

jl303
Posts: 53
Joined: Wed Dec 31, 2014 12:08 am
languages_spoken: english
Contact:

Re: Weather board for SHOW.

Unread post by jl303 » Wed Jan 07, 2015 3:35 am

Wow, this is amazing! Exactly what I was looking for!
Thank you so much!!!

jl303
Posts: 53
Joined: Wed Dec 31, 2014 12:08 am
languages_spoken: english
Contact:

Re: Weather board for SHOW.

Unread post by jl303 » Wed Jan 07, 2015 5:00 am

How do I fix this error?
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
I downloaded mfz-rxtx-2.2-20081207-linux-i386.
The files are copied as:
/lib/jvm/jdk1.8.0/jre/lib/arm/librxtxSerial.so
/lib/jvm/jdk1.8.0/jre/lib/arm/librxtxParallel.so
/lib/jvm/jdk1.8.0/jre/lib/ext/RXTXcomm.jar
Any suggestion?
Thanks,

Post Reply

Return to “SHOW”

Who is online

Users browsing this forum: No registered users and 1 guest