Author Topic: Prototype automatic weather station  (Read 7789 times)

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Prototype automatic weather station
« on: May 23, 2018, 05:07:19 AM »
Hello,

I have many different and the same temperature / pressure / humidity sensors, that I would like to test and compare. Two of the problems you first have is, sensors need weather protection and exposure to irradiance (which heat up sensor above ambient temp.), may that be from sun or big mass like building/road (also has thermal mass, which you don't want).

For this, sensors are in weather boxes which protect sensors from unwanted elements. Most of the time you see white boxes with what looks like windows shutters. In fast, they can almost can be. But one step above that is double-louvered design.
Since the best practice is to use Stevenson screen box about 1.2 meters above the ground.  The best site for temperature measurements is over level ground with grass surface, freely exposed to sunshine and wind and not shielded by obstructions. And as far as I know, there is no cheap way of having this kinda box, so I made one myself with no plans, just dependent of simple materials, that were cheap and available locally. This means construction was wooden with plastic right angle trim pieces for the screen. Finished with white paint for outdoor.

There are already few things that would be changed:
  • More ventilation (exposure to sun does heat sensors about 0.6° for about 450w/m2 irradiance)
  • instead of plastic right angle trim pieces, I would use wooden
  • paint first, then assemble box
  • depending of tools that you have.. have your wood cut with CNC
  • Use water based paint (very easy to thin, wash after you are done), or paint with one, that you can thin more than 5% (is lower viscosity)
  • probably something else also

First I wanted to do right angle saw cuts into which would slide plastic trim pieces (this took so much time, would be much more simple to use wooden right angle and just glue them directlly)

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #1 on: May 23, 2018, 05:14:07 AM »
SInce that was WAY too much work by hand and no one said they you do it with their CNC, I was left with DIY. That means, take 1cm x 1cm wood and cut MANY ~3cm long pieces. One of the mistakes was done here. Used right angle as spacer, while this does work, had trouble when fitting them after paint, there was no slack even before paint.

Do this 2x for side, for 4 sides... yes, a lot of cutting and gluing.

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #2 on: May 23, 2018, 05:15:19 AM »
But now it is done and it looks something like this

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #3 on: May 23, 2018, 05:17:23 AM »
It has double roof, don't know if needed, but heat does not affect it from the top, though wood is good insulator
« Last Edit: May 23, 2018, 06:26:33 AM by LukaQ »

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #4 on: May 23, 2018, 06:22:26 AM »
For sensors, I have:
  • SI7021 x2
  • BME280
  • BMP280
  • ADT7420
  • MCP9808 x2
I still have SI7051, few ds18b20, but not any way easy to add them now

Internal free space is about 35cm x 35cm x 35cm, or just over 1cu ft
« Last Edit: May 23, 2018, 06:25:08 AM by LukaQ »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Prototype automatic weather station
« Reply #5 on: May 23, 2018, 08:58:10 AM »
Nice job!
Is this post mainly about the enclosure?
Any details on eletronics, code, Gateway defs/additions?

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #6 on: May 23, 2018, 09:30:05 AM »
Hello Felix,

it can be about anything related to it, just ask the questions.

Code can be provided, it's nothing special, just glued together from seperate working sketches. It's already 21k big and I don't have OTA in it, which would be nice for this, to make changes and don't have to walk there every time.

As far as electronics go, there is MI power bank, which feeds Moteino, to it's I2C are connected sensors listed above apart from SI7021's. Those two are special case, since all of them have the same fixed address of 0x40, I used two channels of tca9548a, which I switch between, to get both (up to 8) sensors readings. All reading are done first, stored in seperate variable, converted into string, ready to be sent. Then I send 4 temperature values, 4s delay, 3 temp values, 4s delay and two pressure measurements (above sea level corrected) and 3 humidity readings.

Each sent item has its own name, so that in gateway you can easy see what is from what. That is done in user metrics file.

The only thing that is missing from gateway is the ability to plot more than one graph at the same time (to compare two or more readings), so that has to be done in excel or similar program

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Prototype automatic weather station
« Reply #7 on: May 23, 2018, 10:07:33 AM »
Awesome, well if you end up having some time and can share the following details that would be great and would make this a good candidate for a guide:

- electronics photos detailing the build
- working code/solution (which can even be upgraded later)
- gateway metrics and any other related details, some screenshots

RE the gateway multi-graph - that is high on my TODO list and I would like that as well. I think that feature will go on the node main screen, let's call this the node "master graph", where you can customize it with data from chosen metrics. So for instance when you graph a metric (in the metric page) you could also make it to be added to the node's "master" graph via a similar option. Then this graph should also have the option to be exported with all the graphed metrics together. Lots of work for that for sure :)

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #8 on: May 23, 2018, 11:12:57 AM »
Awesome, well if you end up having some time and can share the following details that would be great and would make this a good candidate for a guide:

- electronics photos detailing the build
- working code/solution (which can even be upgraded later)
- gateway metrics and any other related details, some screenshots

RE the gateway multi-graph - that is high on my TODO list and I would like that as well. I think that feature will go on the node main screen, let's call this the node "master graph", where you can customize it with data from chosen metrics. So for instance when you graph a metric (in the metric page) you could also make it to be added to the node's "master" graph via a similar option. Then this graph should also have the option to be exported with all the graphed metrics together. Lots of work for that for sure :)
I'll redo the box, with the steps that will make building it much more easy and faster at the same time, I'll take lots of pictures then. Now that I know, what to watch for, should be done pretty fast.

I can give current code, so someone could already use it, but libraries are not included (are also being tested, which I like better).

Wow, that sounds like it would be a bomb to have in gateway, will see how that will turn out. Also to be able to edit readings (i'm sure that is on the list also)

The things that will be added to AWS are:
SI1145 for UV index
VEML6075  for UV index and irradiance - W/m2 (I think I have that working, but can't fully test, don't have sensor only under sky, wall of the house is inflating readings)
BH1750 for lux (65klux)
TSL45315 for lux (can read direct sunlight (~120klux) and even up to >220klux)
TSL2561 for lux (~40klux)

There is so much stuff, I don't even thing it will all fit into Moteino  :(
And don't even get me started on wind and rain, I think I would neet 2560 for that

First few hours of measurement reveals, that sensors behave as expected, some some amount of offset, but same deltas in change
« Last Edit: May 23, 2018, 11:18:59 AM by LukaQ »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Prototype automatic weather station
« Reply #9 on: May 23, 2018, 11:19:03 AM »
I'll redo the box, with the steps that will make building it much more easy and faster at the same time, I'll take lots of pictures then. Now that I know, what to watch for, should be done pretty fast.
In this case more is better ;)

I can give current code, so someone could already use it, but libraries are not included (are also being tested, which I like better).
Whenever you're ready, and more testing is also better!

Wow, that sounds like it would be a bomb to have in gateway, will see how that will turn out. Also to be able to edit readings (i'm sure that is on the list also)
Edit readings - not on the list but the labels are taken from the metrics - is that not flexible enough?

The things that will be added to AWS are:
SI1145 for UV index
VEML6075  for UV index and irradiance - W/m2 (I think I have that working, but can't fully test, don't have sensor only under sky, wall of the house is inflating readings)
BH1750 for lux (65klux)
TSL45315 for lux (can read direct sunlight (~120klux) and even up to >220klux)
TSL2561 for lux (~40klux)

There is so much stuff, I don't even thing it will all fit into Moteino  :(
And don't even get me started on wind and rain, I think I would neet 2560 for that
Have you considered the MoteinoMEGA? It has a bunch more GPIO.
If not ... the new soon-to-be-released MoteinoM0 may be useful.

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #10 on: May 23, 2018, 12:11:43 PM »
Edit readings - not on the list but the labels are taken from the metrics - is that not flexible enough?
No not that, but in some cases like testing, lets say you take sensor outside then in and back outside, in that time sensor heats up (or cools down), messing up graph. Would be great if there was a way to select band (just like you would like to zoom in) and say, delete everything that is between that range (or if you have not optimized code and you get totally wrong reading (lets say you didn't put in code enough time, for sensor to complete reading))
Have you considered the MoteinoMEGA? It has a bunch more GPIO.
If not ... the new soon-to-be-released MoteinoM0 may be useful.
I did just after I wrote, I remembered that you DO already have MoteinoMEGA, that one would have plenty of code space (I/O in my case is not the problem, since most of the stuff is on two pins). And I haven't dealt with M0 yet
How does M0 compare to atmegas as far as sleep and low power goes?
« Last Edit: May 23, 2018, 12:13:17 PM by LukaQ »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Prototype automatic weather station
« Reply #11 on: May 23, 2018, 01:22:38 PM »
No not that, but in some cases like testing, lets say you take sensor outside then in and back outside, in that time sensor heats up (or cools down), messing up graph. Would be great if there was a way to select band (just like you would like to zoom in) and say, delete everything that is between that range (or if you have not optimized code and you get totally wrong reading (lets say you didn't put in code enough time, for sensor to complete reading))
Oh so you meant labels on the graph (for data ranges). That's one feature, would be nice yes.
Then deleting ranges of data. Yes that's also a to-do.
The Gateway TO-DO list is here.

I did just after I wrote, I remembered that you DO already have MoteinoMEGA, that one would have plenty of code space (I/O in my case is not the problem, since most of the stuff is on two pins). And I haven't dealt with M0 yet
How does M0 compare to atmegas as far as sleep and low power goes?

The MoteinoM0 is not released yet but I hope it will be ready in the next few days.
But it will be a SAMD21 Cortex M0+ running at 48mhz, lowest sleep mode will be 6uA, 7uA with watchdog periodic sleep, +1uA for FLASH-MEM, +100nA for radio. So still very good and I'm guessing the lowest power SAMD21 on the market.

The AVR Moteinos still cannot be beat in terms of low power. The stock AVR Moteinos can do 2uA in "forever sleep", 6uA in watchdog periodic sleep, and with modifications (LDO removal, see 8mhz Moteino) can go below 1uA.

And to be complete - you can always use the TPL5110 system timer/watchdog to bring total sleep time to just 35nA, with periodic wakeup. Then you can do this with any Moteino and any other board in fact.

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #12 on: May 24, 2018, 01:20:13 PM »
This will have to go in its own thread, but comparing ADT7420 with BME280 (from china) you get first graph, yellow being BME
In the second picture, it's the same, just with whole (yellow) graph offset by constant, to get red. As you can see, they read THE SAME

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #13 on: June 01, 2018, 02:20:47 AM »
This is the data for few days, some offsets were applied, only both SI didn't get any. BME/P I was close, but wrong offset is still there. You can also see, that this two sensors respond different to others, high are lower, low are higher.
MCP1 is almost spot on, MCP2 is close by with a bit missed offset, but all (ADT, MCP1,MCP2) are basically the same. Same goes for both SI's, if there was correct offset, they would be the same as MCP's and ADT.
BME and BMP were both with mid way averaging, filtering.. will have to test without filters or just a small ones and have better offsets in the first place

All in all, not bad and cheap sensors if I do say so myself

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Prototype automatic weather station
« Reply #14 on: June 06, 2018, 05:43:35 AM »
All finished, stand is made larger, since next box will be a bit bigger
Sensors are convection cooled only, I think I will have to get power to the box and force air onto sensors, that way you can eliminate anything sun adds