Important news about HackSpace

We have some important news to share about HackSpace: Issue 81 was the last issue of HackSpace as a standalone magazine, and HackSpace has become part of The MagPi, the official Raspberry Pi magazine. Starting with issue 145, We’ll be adding pages to The MagPi to make room for the stories and tutorials you’ve come to expect from HackSpace.

AmbiMate MS4 review

By Ben Everard. Posted

The AmbiMate MS4 series of modules combine a range of environmental sensors with a small microcontroller that collates the data and sends it via I2C to a host. Code examples are available for Arduino and Raspberry Pi, though anything with an I2C bus should work. Different versions of the sensor come with different combinations of motion, light, sound, temperature, and humidity sensors, at prices ranging from $15 to $80.

There are seven pins that you can use to hook up the MS4 – two take input from a microphone (it adds an audio sensor), two connect power, two connect I2C, and one is an event out that allows the motion sensor to work in the same way as a traditional PIR sensor.

Connecting the device is pretty straightforward, though, given the nature of the sensors, you’ll need to make sure it’s housed in a way to allow temperature, humidity, light, etc. to reach the sensors. The I2C communication takes up just two pins on your microcontroller to access all the sensors.

The example code ran for us on an Adafruit Grand Central without any problems. Unfortunately, the example code is a bit of a mess. Maybe it’s just us, but we like to be able to copy and paste from the example code wholesale when building our own software, but in this case, the process of reading the sensors is too closely tied to the actual flow of the example for this to work.

You can certainly gut the code and adapt it to your needs, but for this to work, you’ll need to be comfortable working with sending binary commands over I2C. For example:

  Wire.beginTransmission(0x2A); // transmit to device   // Device address is specified in datasheet   Wire.write(byte(0xC0));       // sends instruction to read sensors in next byte   if (opt_sensors & 0x01)       // If gas sensor is installed, include it in the data request     Wire.write(byte(0x7F)); // 0x7F indicates to read all connected sensors   else     Wire.write(byte(0x3F));    // exclude gas sensor from data request   // 0xFF indicates to read all connected sensors   Wire.endTransmission();       // stop transmitting   // Delay to make sure all sensors are scanned by the AmbiMate   delay(100);

To anyone used to working with embedded hardware, this shouldn’t pose any problems, but if you’re more used to working with maker-level hardware that typically comes with a wrapper library to get the data you need, it’ll take a bit more work.

Putting it to use

TE Connectivity advertises this sensor as being suitable for indoor lighting, thermostats, and motion sensor ceiling-mounted devices. This is certainly the sort of area we’d expect the MS4 to find use – anything that needs a microcontroller to respond to the environment in some way.

The sensors aren’t accurate enough for scientific measurement, but can be useful for general automation. For example, temperature is read to plus or minus 0.3 degrees Celsius, humidity to plus or minus 2%, but bear in mind that the sensors are mounted on the board, so can’t be positioned to take readings in other orientations unless the whole board can be repositioned.

The six pins come prepopulated, so you can get started sensing the environment with no soldering

It is a sad reflection of the world today that the eCO2 sensor is only accurate above 400 ppm. This means that it would have been unable to accurately read CO2 levels as recently as 2010, but unfortunately, it’s unlikely that this is going to be a problem for this sensor in the foreseeable future. The ‘e’ at the start of eCO2 stands for estimated. It’s a calculated value, based on the volatile organic compounds (VOC) reading that attempts to work out how much CO2 is present, based on people breathing it out – and for that, it can be a useful measure – but it’s not suitable for measuring the CO2 output from things other than people.

Given the range of sensors on the module, the size has been kept impressively small, which means that it should fit well into most smart devices. The downside of the form factor is that you have to design your enclosure so that all the sensors will be able to get the light and environmental readings they need – and there’s no flexibility to reposition anything that gets in the way.

Perhaps the best feature of this product is that the different sensor options all come with the same footprint. This means that if you’re looking to build a device with multiple different options, you can design it so the only difference is the particular module that slots in. For small-run manufacturing, this could be a useful feature.

The MS4 is probably most suited to small- to medium-run smart home/office devices. For these, the form factor and range of sensors make it something that could come in useful in many different applications.  

TE Connectivity  From $15    te.com

VERDICT

A standard format for environmental measuring in your smart home.

8/10


https://hsmag.cc

From HackSpace magazine store

Subscribe to our newsletter