Moteino M0 with BME280 Weathershield?

Started by drsprite, June 19, 2018, 10:58:20 AM

drsprite

I saw in the Moteino M0 product shop page that there's a photo of the Weathershield BME280 attached. Is that Weathershield BME280 still available? I didn't see it anywhere on the store.

Felix

They are not available yet but will be in the near future.
This is more of a BME280 breakout that can be used on a breadboard with any other Moteino or dev board, or can be mounted directly on the M0 belly for a nice compact fit.
Watch the blog for the release in the coming weeks or so.
Thanks for the patience.

drsprite

Great thanks! I have a BME280 attached to a MoteinoUSB on a breadboard now and was looking for a nice consolidated fit and came across that. Will keep an eye out

drsprite

Hi Felix, I have the MoteinoUSB. Is the BME280 Breakout able to be flush mounted on that board?

Felix

No, this will only align with the required pins on the Moteino M0.
BUT since both boards are about the same width, for a compact mount you could put some insulating tape on the belly of the MoteinoUSB to avoid any unintended shorts and wire the small BME280 breakout to the 4 required pins (GND, 3v3, SCL, SDA). It could even be double-sided sticky tape perhaps, that would help keep the BME280 attached as well.

drsprite

Interesting idea.

I was just looking at the MoteinoM0. I'm assuming my MoteinoUSB sketch can transfer over without any worry (same libraries and such)?

I've had some bad experience with the BME280 picking up ambient heat from a "very close" nearby Raspberry Pi. Any issues with the BME280 mounted to the underside of the MoteinoM0?

Felix

#6
That's a very broad assumption and I don't have a clear answer, partly because you didn't mention what libraries you use, and partly because even if you did we'd have to try them out to see if they compile and then if they work, and if not - why not.

BME280 is certainly sensitive, it's supposed to be.
If you run the M0 from a LiPo or up to the rated 6V input voltage, I would not expect any significant heat to develop in the LDO or any other M0 circuitry. If you mounted it FLAT there are still several layers between the 2 SMD component sides. If you're really worried then use headers to mount it, you can use male headers with the ~0.1" plastic spacing in between, or even male-female - which would kind of defeat the idea of having it as compact as possible. You gain something, you loose something, choose what is best for your project :)

drsprite

Yeah as soon as I hit enter I figured it was too broad. I thought about editing it out but then decided I'd just leave it there. :)

Yeah I like the idea of compact setup, and my plan is to power it via 5v USB. I don't think I'm worried about the temperature sensitivity as I am about the barometer. I think the barometer is derived from the temperature on the sensor? If not, then I guess my concerns aren't a big deal.

Felix

Quote from: drsprite on August 03, 2018, 10:25:02 AM
I think the barometer is derived from the temperature on the sensor?
How so?

drsprite

Maybe you just confirmed my concern is baseless :) It was my own assumption.

As I understand, the BME280 should report "pressure". And to get barometer (at sea level), the calculation would be pressure corrected for temperature and humidity.

Either way, if the temp/humidity isn't needed for "pressure" at the BME280, then I guess I don't care about ambient heat.

Felix

This is what I found in the datasheet searching for "compensat", sounds like the values are not interdependent but rather compensation for best accuracy is based on parameters stored in the device:

QuoteAfter the uncompensated values for pressure, temperature and humidity 'ut', 'up' and 'uh' have
been read, the actual humidity, pressure and temperature needs to be calculated using the
compensation parameters stored in the device. The procedure is elaborated in chapter 4.2.

4.2 Output compensation
The BME280 output consists of the ADC output values. However, each sensing element
behaves differently
. Therefore, the actual pressure and temperature must be calculated using a
set of calibration parameters.

4.2.2 Trimming parameter readout
The trimming parameters are programmed into the devices' non-volatile memory (NVM) during
production and cannot be altered by the customer

drsprite

Ok cool - so I think I'm all set with my concerns. I think I'll pick up an M0 and BME280 kit which will get rid of the MoteinoUSB & BME280 breadboard setup I have now (or use it as a backup).

Thanks for taking the time to search for that!

drsprite

Quote from: Felix on August 03, 2018, 09:29:05 AM
That's a very broad assumption and I don't have a clear answer, partly because you didn't mention what libraries you use, and partly because even if you did we'd have to try them out to see if they compile and then if they work, and if not - why not.

Just received the M0, thank you for the quick shipping!

I'm trying to compile the VPTools weather station receiver - specifically this sketch - and I'm getting errors about EEPROM.h and also avr/wdt.h, No such file or directory.

If I switch the board back to Moteino it works, but not for the M0. Having limited Arduino experience, I'm not sure what's wrong (other than the obvious these files are missing). Does the M0 support them? If so, is it an easy "copy/paste" of those files?

Felix

The M0 is using an ARM processor not AVR as used in the popular UNO Arduinos and regular Moteinos.
So AVR libraries like EEPROM.h and avr/wdt.h will not work on ARM. Any such sketches that specifically use AVR libraries will need to be adjusted to work on ARM.
The SAMD21 does not have dedicated EEPROM, but it can emulate EEPROM - meaning it reserves a portion of the upper FLASH memory for EEPROM use. Such a library that can achieve this is this one: https://github.com/cmaglie/FlashStorage

LukaQ

Quote from: drsprite on August 03, 2018, 10:36:39 AM
Maybe you just confirmed my concern is baseless :) It was my own assumption.

As I understand, the BME280 should report "pressure". And to get barometer (at sea level), the calculation would be pressure corrected for temperature and humidity.
Temperature only, not humidity
also that means outside temperature, 5ft above wide patch of grass with no nearby bushes or trees, to get correct pressure. You also have to know at what sea lever your sensor is.
I think I have posted the code here, you can check it out