EXPLOG needs a lot of sensors obviously and there's a large list to choose from. Some of the criteria for selection of sensors are,
- Size - must be small with less than 5 mm height, and be surface mountable and reflow solderable or through-hole solderable.
- Interface - I2C compatible.
- Operating voltage - 3.3V
- Calibration - should be either factory calibrated or user calibratable.
- Global availability
We need to make the right choices by considering the global availability and cost of each sensor to make sure that others will be able to get them to replicate/modify the device. These are what I've been able to come up with. Datasheets of all these sensors will be available at the file section of this project.
Barometric Pressure Sensor
- DPS310 from Infineon
- BMP280 from Bosch
- BMP380 from Bosch
- BMP388 from Bosch
- BME680 from Bosch
- MPL3115A2 from Maxim
We need a sensor to accurately measure barometric air pressure becasue we need accurate pressure measurements for calculating the altitude accurately. DPS310 was my first choice becasue I had received an evaluation module from Infineon as part of a give away. But not everybody is going to get these as they are not available in the usual maker markets. BMP280 on the other hand is widely available and most are familiar with. But they're not the best ones out there. Let's have a comparison of features of sensors from leading manufacturers.
|Operation range||300 - 1200 hPa||300 - 1100 hPa||300 - 1250 hPa||300 - 1250 hPa||300 - 1100 hPa||200 - 1100 hPa|
|Abs. Max. Pressure||10000 hPa||20000 hPa||20000 hPa||20000 hPa||20000 hPa||5000 hPa|
|Max. Resolution (Pressure)||24-bit||20-bit||24-bit||24-bit||20-bit||20-bit|
|Precision||0.005 hPa||0.0016 hPa||0.003 hPa||0.0016 hPa||0.0018 hPa||0.0025 hPa|
|Absolute Accuracy||± 1 hPa||± 1 hPa||± 0.5 hPa||± 0.5 hPa||± 0.6 hPa||± 4 hPa|
|Relative Accuracy||± 0.06 hPa||± 0.12 hPa||± 0.06 hPa||± 0.08 hPa||± 0.12 hPa||± 0.5 hPa|
|Temperature Coefficient Offset||0.5 Pa/K||1.5 Pa/K||1.2 Pa/K||± 0.75 Pa/K||± 1.3 Pa/K||NA|
|Sampling Rate||128 Hz||157 Hz||200 Hz||200 Hz||182 Hz||100 Hz|
|FIFO Size||32 samples||NA||512 Bytes||512 Bytes||NA||32 samples|
|Current Consumption @ 1Hz||1.7 uA||2.7 uA||2.7 uA||3.4 uA||4.2 uA||8.5 uA|
From evaluating the specifications, BMP380 and BMP388 seem to be the best choices becasue they provide better absolute and relative accuracies, higher sampling rate, highest bit depth and higher absolute maximum pressure. The BME680 is special becasue it crams a pressure, temperature, humidity and air quality sensors in a single package. It might save some PCB real estate but can't compete with specs of other single purpose sensors, and it's going to cost higher than others. So we won't be using that. The DPS310 has its problems such as lower sampling rate, lower FIFO size etc, and it is priced similar to others. So these reasons also favor BMP380 and BMP388.
Absolute accuracy is how close the output reading to the actual reading of absolute pressure (absolute pressure is the pressure reading taken with a zero pressure as reference). The more accurate the absolute pressure, more will be the accuracy of our calculated true altitude relative to seal level. So if we need more accurate altitude measurements we need more absolute accuracy. On the other hand, relative accuracy, as you guessed, is the degree of error between two relative pressure readings (absolute error on two relative readings will be same). This reading is crucial because it is what helps us to determine the relative elevation, for example how high a drone from the ground is etc.
Most pressure and humidity sensors come with internal temperature sensors to compensate for variation in temperature affecting pressure and humidity measurements. So we could simply read the temperature from any of those sensors. But there's a small problem; as suggested by many datasheets, the temperature indicated by the internal sensor of the pressure sensor can be inaccurate due to the heat produced by the sensor itself. The heat produced will depend on the voltage and frequency of measurement. Bosch's datasheet says the measured temperature will be slightly greater than the actual ambient temperature. The other possibility is to measure the temperature from a humidity sensor. The HDC1080 humidity sensor we'll be using has a temperature accuracy of ± 0.2 °C which is pretty good.
Relative Humidity Sensor
Humidity is the measure of amount of water vapor in air. Some of the best available are,
- HDC1080 from TI - ±2% humidity accuracy, ±0.2°C temperature accuracy, 14-bit humidity and 14-bit temperature.
- Si7021 from Silicon Labs- ±3 humidity accuracy, ±0.4°C temperature accuracy, 12-bit humidity and 14-bit temperature.
- SHT3x-ARP from Sensirion - ±2% humidity accuracy, ±0.3°C temperature accuracy, 0.01 %RH humidity resolution and 0.015 °C temperature resolution.
- SHT15 from Sensirion - ±2% humidity accuracy, ±0.3°C temperature accuracy, 12-bit humidity and 14-bit temperature resolutions.
We'll use the HDC1080 for its better accuracy and resolution figures. It comes factory calibrated and has I2C interface.
Air Quality Sensor
An air quality sensor, unlike a gas sensor, measures the amount of Volatile Organic Compounds (VOCs) and equivalent CO2 (eCO2) in the surrounding air. VOCs are what give the air its odor and are originated from natural and human made substances such as paints and fuels. Abnormal levels of VOCs can lead to long-term health effects. Equivalent CO2 represents the potential of mixture of all greenhouse gases in the air to produce global warming. It is a relative measure based on a standard reference and is known as Global Warming Potential (GWP). Most of the times, the measure of total mixture of compounds in air will better indicate the quality of the air, than measuring individual gases or compounds. That's where a typical gas detectors that can detect one or tow specific gases differ from an air quality sensor. CCS811 from AMS is an air quality sensor that measures the VOCs and eCO2 in air and outputs the measurements in a range of values which are 400 ppm to 64000 ppm for eCO2 and 0 ppb to 64000 ppb for TVOC. The sensor is available in an LGA package and is interfaced via I2C.
Light Intensity Sensor
For this we need one or more light sensors to detect the intensity levels of visible, infrared (IR) and ultraviolet (UV) light. Some sensors are designed to measure multiple regions of light wavelengths and some are dedicated to a single spectrum and thus blocks other ranges of light. Also a proximity sensor emits IR light in order to detect the distance to an object in the proximity field. The reflected light from the object could affect other light intensity sensors and therefore needs to be compensated (some for example Si1145 has dedicated registers for compensation values). Some sensors have filters to block the unwanted spectrum of light and some don't. So these are the considerations to be given while choosing a light intensity sensor. Our candidates are,
- Si1145 from Silicon Labs - This can measure ambient visible light, IR and UV levels as per the datasheet. The internal IR photodiode has good IR wavelength response and thus can be used for proximity sensing too for up to 50 cm. The Si1145 model has one IR LED driver pin with programmable current sink of up to 300 mA which makes it ideal for a proximity sensor. Moreover, the IR light reflected back from an object can be internally compensated for accurate ambient IR level measurement. The visible light photodiode has a nominal response range from 330 - 950 nm and therefore can also serve as a UVA (330 - 400 nm) sensor. By adjusting the integration time via registers, it is possible to measure ambient light as low as 100 mLux. The UV levels are reported as UV index range rather than raw values.
- VEML6070 from Vishay - This is a dedicated UV sensor with sensitivity range 320 - 410 nm (UVA) with all the required signal conditioning and compensation components and outputs the measurements as 16-bit values.
- MAX44009 from Maxim - This is a dedicated and low power Ambient Light Sensor (ALS) with IR and UV blocking capabilities. It has 12-bit resolution and high dynamic range of 0.045 Lux to 188,000 Lux. The on-chip photodiode’s spectral response is optimized to mimic the human eye’s perception of ambient light.
- TSL2561 from TAOS - This is also an ALS that has a spectral response of similar to human eye and outputs two 16-bit values; one for Visible+IR channel and one for a separate IR channel. The problem with using silicon detectors to measure ambient light intensity is that our eyes don't respond to IR but the photodiodes do. This is circumvented by using a separate IR sensor that only responds to IR light.
The Si1145 seems to be good for our application but tests need to be conducted before we can make the final choice becasue all of them have some pros and cons. We'll test all four sensors soon.
IR Proximity Sensor
We've seen that an IR sensor can be used as a proximity sensor if coupled with an IR emitter diode. But there are some dedicated IR proximity sensors available as single packages in the market, which reduces the overhead of adding IR emitters to a standalone IR sensor. There are multiple methods of range sensing including but not limited to Time of Flight (ToF), Phase difference, laser based etc. For compact spaces ToF or Phase Detectors are best suitable. Phase detectors work by measuring the phase (or angle) and intensity of a reflected light from an object to determine the distance where a ToF measures the time taken by a pulse of light to reflect and return from an object to calculate the distance. Our choices here are,
- APDS-9930 from Avago - is an IR proximity sensor with fully calibrated 100 mm range, 16-bit ALS and 0.01 Lux sensitivity.
- APDS-9960 from Avago - is an IR proximity, 16-bit ALS with UV and IR blocking, RGB and gesture sensor with programmable integration time, and LED current.
- TMG3993 from Avago - is an IR proximity, 16-bit ALS with UV and IR blocking, RGB and gesture sensor with programmable gain and integration time.
- VL6180X from ST Microelectronics - is an IR proximity sensor with 100 mm absolute range and ALS with 16-bit output, < 1 Lux up to 100 kLux range, and 8 level gain setting.
- VL53L0X from ST - Time of Flight (ToF) ranging sensor with absolute range up to 2 metres and gesture recognition.
- VL53L1X from ST - Long range ToF sensor with accurate measuring range of 4 metres.
- VCNL4020X01 from Vishay - IR proximity sensor and ALS with 16-bit resolution, 0.25 Lux to 16 kLux range, flicker rejection and 200 mm detection range.
- VCNL4040 from Vishay - IR proximity sensor and ALS with 16-bit resolution, 0.0125 Lux/step sensitivity, flicker rejection and 200 mm detection range.
- VCNL4010 from Vishay - IR proximity sensor with 200 mm range and 16-bit ALS.
- GP2Y0D810Z0F from Sharp - IR proximity sensor with 100 mm range.
It's going to be hard to choose one from this list without testing them first, though VL53L0X and VL53L1X seem a good choices. Our primary requirement is to detect some range of distance accurately in varying environmental conditions. All of these sensors come with integrated ALS for compensation. Having programmable gain, integration time and IR LED current will come handy for accurate measurement in all situations.
Inertial Measurement Unit (IMU)
These include standalone MEMS (Micro-Electro-Mechanical Systems) based accelerometers, gyroscopes, magnetometers, and also multi-sensor packages. I think it's better to use any sensor that has all three sensors in a single package. One such sensor is the LSM9DS1 from ST which integrates 3-axis accelerometer, 3-axis gyro and 3-axis magnetometer in an LGA package.
Ambient Noise Level Sensor
For this, we could use any high sensitivity microphone with good audio frequency response and either digital or analog output. Sensors with integrated conditioning circuits and amplifier are preferred. Analog output will be needed to sampled by a precision ADC that has I2C interface. ADMP401 MEMS microphone from Analog Devices can fulfill our requirements. For ADC we could use MCP3421 18-bit single channel ADC from Microchip.