LowPowerLab Forum

Hardware support => Projects => Topic started by: LukaQ on May 23, 2018, 05:07:19 AM

Title: Prototype automatic weather station
Post by: LukaQ 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:

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)
Title: Re: Prototype automatic weather station
Post by: LukaQ 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.
Title: Re: Prototype automatic weather station
Post by: LukaQ on May 23, 2018, 05:15:19 AM
But now it is done and it looks something like this
Title: Re: Prototype automatic weather station
Post by: LukaQ 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
Title: Re: Prototype automatic weather station
Post by: LukaQ on May 23, 2018, 06:22:26 AM
For sensors, I have:
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
Title: Re: Prototype automatic weather station
Post by: Felix 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?
Title: Re: Prototype automatic weather station
Post by: LukaQ 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
Title: Re: Prototype automatic weather station
Post by: Felix 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 :)
Title: Re: Prototype automatic weather station
Post by: LukaQ 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
Title: Re: Prototype automatic weather station
Post by: Felix 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.
Title: Re: Prototype automatic weather station
Post by: LukaQ 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?
Title: Re: Prototype automatic weather station
Post by: Felix 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 (https://lowpowerlab.com/forum/pi-gateway/gateway-to-do-list-(wanted-features-bug-fixes)/).

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 (https://lowpowerlab.com/shop/product/159)) can go below 1uA.

And to be complete - you can always use the TPL5110 system timer/watchdog (https://lowpowerlab.com/shop/product/147) 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.
Title: Re: Prototype automatic weather station
Post by: LukaQ 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
Title: Re: Prototype automatic weather station
Post by: LukaQ 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
Title: Re: Prototype automatic weather station
Post by: LukaQ 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
Title: Re: Prototype automatic weather station
Post by: TomWS on June 06, 2018, 09:11:24 AM
Nice job! 

I'm not showing the photo to the Squirrels in my yard because they would surely go to your place and have a fun time jumping all over it!  Hmmmm, on second thought... ;)

Tom
Title: Re: Prototype automatic weather station
Post by: LukaQ on June 06, 2018, 09:22:29 AM
hahaha, let them... I do have a dog and hunting cat, where I have to save little creatures from them
Anyway, it stands by itself.. hurray, my first welding job went as expected, could do better of course. Each "leg" is extendable by ~90cm or ~3', so slope of the hill could be steep, to the point where I wouldn't be able to stand. Added power supply, so I don't have to use power bank, also are now running 12v fan, which blows onto sensor all the time. Thinking of removing offsets I used before
Title: Re: Prototype automatic weather station
Post by: LukaQ on June 07, 2018, 01:40:32 AM
This is with fan, as far as I can see, all sensor track each other pretty damn good. So, I think I know, what to look for in the next one, what to use,...
Maybe even use circular buffer with 10 values (1 per minute), as it isn't important to see all the peaks and dips throughout the day. That is, IF Moteino will have enough space on it with so many sensors, when I'll settle for one, this won't even be a question
Title: Re: Prototype automatic weather station
Post by: LukaQ on June 10, 2018, 11:02:48 AM
Just had massive rainfall, with over 140mm/h rain (over 5.6inch) with 20 mph constant wind (32 km/h). There was some water ingress, but I would count that in few 10 raindrops right after wall inside. I am damn impressed, also some more data to take with me onto next box
Title: Re: Prototype automatic weather station
Post by: TomWS on June 10, 2018, 11:58:03 AM
So, I think I know, what to look for in the next one, what to use,...
Which sensor would you use at this point?

Tom
Title: Re: Prototype automatic weather station
Post by: LukaQ on June 10, 2018, 01:38:58 PM
I think the "best one"(reference) I have is ADT7420, eval board from ADI. This one was below 10€, you can get it also on Ebay, but more expensive and unknown IC origin (why was it put on ebay, maybe it failed some spec?). But early tests show, that many different sensors are VERY comparable, some from Ebay, some bought from trusted seller, samples from manufacturers,...

Maybe you or someone else knows of some other sensors, that would compete or are even better

But it's not that easy to compare on gateway, I can't change it to the point, that I would have all graphs at once or see only delta from reference sensor
Title: Re: Prototype automatic weather station
Post by: LukaQ on September 26, 2018, 04:13:01 AM
I guess, to finnish this topic, here are my findings and opinions

For sensing outdoor temperature ADT7420 is my preference. For pressure and humidity, BME280.
I didn't go with SI7021 because at many times, humidity was all over the place, by that I mean, reading were up to 115% humidity, on two sensors and no, there is not that much offset from BME

Attached file is DPlot file, very powerful program, does things that are not possible in Excel or very hard.
Show picture shows sensors smoothened deviation from ADT7420 sensor.
It's not much, some still have offset, which could be removed

Dplot file (http://www.classdaudio.tk/slike/Sensors/Sensors.grf)