====== Raspberry Pi Weather Station Board ====== ===== Private Sections ===== [[private:weather_station_private_section|Click here]] ===== Project Updates ===== I bought an Arduino, another I2C logic level shifter. Now the goal has been moved to running BME280 and the PM2.5 sensor off an Arduino. The constraint is still the 4-wire connection to the outdoor environment. ===== Bill of Material ===== This is the current estimate of the minimum cost for constructing the whole thing. It doesn't include the cost of the enclosure and the delivery charges. ^Name ^Cost (£) | | Raspberry Pi Zero | 4 | | DN7C3CA006 | 14.04 | | BME280 | 13.28 | | ADS1115 | 9.96 | ^Current BOM cost (£) |~~=sum(range(1,1,1,row()-1))~~| ===== Specification ===== This weather station board should be able to performed the following functions: - Sense temperature - Sense humidity - Sense air pressure - Sense PM 2.5 [(Fine particle (PM2.5) Designations > http://www3.epa.gov/pmdesignations/faq.htm)] ===== Choosing the component ===== ==== Raspberry Pi ==== I have decided that this extension board should comply with the RPi GPIO connector standard. This is because RPi 0 is the cheapest development board you can get in the market [(Raspberry Pi Foundation - Raspberry Pi Zero > https://www.raspberrypi.org/products/pi-zero/)] . It means that I am not afraid of breaking things. I suppose Arduino is more suitable for interacting with random sensors, but it is just way too expensive. For prototyping, I will be using RPi 0, simply because it is cheap. The actual device will use either RPi 2B ir RPi 0. RPi 2B is more powerful than RPi 0, but I am not sure if I need the extra power. It all depends on whether the RPi itself will be used for other things. ==== Temperature Sensors ==== I have decided to use I2C temperature sensors only, below is a list of possibilities: ^Name ^Price (£) ^Accuracy ($\mathbf{^{\circ}C}$) ^URL ^Other notes | | HDC1008 |7 | 0.2(typ)/0.4(max) | http://www.modmypi.com/raspberry-pi/breakout-boards/adafruit/adafruit-hdc1008-temperature-and-humidity-sensor/ | Also senses humidity | | MCP9808 | 9.3 | 0.25(typ)/0.5(max) | http://thepihut.com/products/adafruit-mcp9808-high-accuracy-i2c-temperature-sensor-breakout-board | | | HTU21D-F | 13.50 | 0.3(typ)/0.4(max) | https://shop.pimoroni.com/products/sparkfun-htu21d-humidity-sensor-breakout | The quoted accuracy is only for the operating range we are expecting, also senses humidity | | BME280 | 18.50 | 1 | https://shop.pimoroni.com/products/adafruit-bme280-i2c-or-spi-temperature-humidity-pressure-sensor | Measures humidity and pressure as well! | | HIH6130 | 24 | 1 | https://shop.pimoroni.com/products/sparkfun-humidity-and-temperature-sensor-breakout-hih6130 | Also measures humidity, a bit expensive though | | MPL115A2 | 10 | Unknown | https://shop.pimoroni.com/products/adafruit-i2c-barometric-pressure-temperature-sensor | Recommended for pressure only | | MPL3115A2 | £9 | 1 @ 25 $^\circ$C| https://shop.pimoroni.com/products/adafruit-mpl3115a2-i2c-barometric-pressure-altitude-temperature-sensor | The accuracy is 3 $^\circ$C over the the whole operating range. | | BMP180 | 10 | 2 | http://thepihut.com/products/bmp180-barometric-pressure-temperature-altitude-sensor | Also measures pressure. | I have listed them in the order of desirability. The top two options are both okay. ==== Pressure Sensors ==== I have no idea how atmospheric pressure is related to the weather. It is a fun thing to measure anyway. I have decided to only use I2C sensors, for simplicity. Please note that I chose to use relative accuracy in the table. Different manufacturers use different ways to measure relative accuracy. For more details, refer to their individual datasheet. Below is a list of possible pressure sensors: ^Name ^Price (£) ^Relative accuracy (hPa) ^URL ^Other notes | | BME280 | 18.50 | 0.12 | https://shop.pimoroni.com/products/adafruit-bme280-i2c-or-spi-temperature-humidity-pressure-sensor | | BMP180 | 9 | 0.12 | https://shop.pimoroni.com/products/adafruit-bmp180-barometric-pressure-temp-altitude-sensor-5v-ready | | BMP280 | 9.50 | 0.12 | https://shop.pimoroni.com/products/adafruit-bmp280-i2c-or-spi-barometric-pressure-altitude-sensor | | MPL115A1 | 10 | 10 | https://shop.pimoroni.com/products/sparkfun-barometric-pressure-sensor-breakout-mpl115a1 | | MPL3115A2 | 9 | 1 | https://shop.pimoroni.com/products/adafruit-mpl3115a2-i2c-barometric-pressure-altitude-temperature-sensor | Absolute accuracy is 4 hPa | | T5403 | 11 | 0.15 | https://shop.pimoroni.com/products/sparkfun-barometric-sensor-breakout-t5403 | Absolute accuracy is 5hPa (worst case scenario) | ==== Humidity Sensors ==== The local temperature is required for calculating relative humidity. This means that humidity sensors come with temperature sensor. ^Name ^Price (£) ^Relative humidity accuracy (%) ^URL ^Other notes | | HTU21D-F | 13.50 | 2 |https://shop.pimoroni.com/products/adafruit-htu21d-f-temperature-humidity-sensor-breakout-board | Also measures temperature | | BME280 | 18.50 | 3 | https://shop.pimoroni.com/products/adafruit-bme280-i2c-or-spi-temperature-humidity-pressure-sensor | Also measures temperature humidity | | HDC1008 | 7.00 | 4 | http://www.modmypi.com/raspberry-pi/breakout-boards/adafruit/adafruit-hdc1008-temperature-and-humidity-sensor/ | Also measures temperature | | HIH6130 | 24 | 4 | https://shop.pimoroni.com/products/sparkfun-humidity-and-temperature-sensor-breakout-hih6130 | Also measures temperature | ==== The PM2.5 Sensor and the ADC ==== Well, there is only one PM2.5 sensor exist on the market [(Sharp - PM2.5 Sensor Module > http://www.sharp-world.com/products/device/lineup/selection/rf/pm25/index.html)]. It is made by Sharp. So I will have to get it. The PM2.5 sensor outputs analogue voltage, so I need an ADC. I have decided to pick one from Adafruit - since every other breakout board I bought are from Adafruit. This ensures compatibility. I have decided to go for the 16-bit 4-channel ADC [(https://www.adafruit.com/products/1085)]. The 16-bit version is about £3 more expensive than the 12-bit version. I have no idea if the extra sensitivity makes that much of a difference (probably not), however it is better to be safe than sorry. After all, it is only £3. ==== Final Decision ==== I have decided to buy the following sensors: ^Name ^Price, excluding VAT / £ ^Price, including VAT / £ ^URL ^Datasheet ^Instructions ^Notes | | BME280 | 13.28 | ~~=round(cell(col()-1,row())*0.2+cell(col()-1,row()),2)~~ |http://www.digikey.co.uk/product-detail/en/2652/1528-1359-ND/5604372 | https://www.adafruit.com/datasheets/BST-BME280_DS001-10.pdf | https://learn.adafruit.com/downloads/pdf/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout.pdf | Measures temperature, humdity and pressure - one chip that measures it all! | | ADS1115 | 9.96 | ~~=round(cell(col()-1,row())*0.2+cell(col()-1,row()),2)~~ | http://www.digikey.co.uk/product-detail/en/1085/1528-1461-ND/5761229 | https://www.adafruit.com/datasheets/ads1115.pdf | https://learn.adafruit.com/downloads/pdf/adafruit-4-channel-adc-breakouts.pdf| ADC for Raspberry Pi, required by the PM 2.5 sensor | | DN7C3CA006 | 14.04 | ~~=round(cell(col()-1,row())*0.2+cell(col()-1,row()),2)~~ | http://www.digikey.co.uk/product-detail/en/DN7C3CA006/425-2896-ND/5114242 | http://media.digikey.com/pdf/Data%20Sheets/Sharp%20PDFs/DN7C3CA006_Spec.pdf | | Measure PM 2.5 | ^Total | ~~=sum(range(1,1,col(),row()-1))~~ | ~~=round(cell(col()-1,row())*0.2+cell(col()-1,row()),2)~~ | ===== Asembly and development ===== ==== DN7C3CA006 ==== DN7C3CA006 is an analogue PM2.5 sensor, that needs to be installed in a peculiar way. The voltage source of the sensor's LED requires some sort of RC circuit. The sensor itself seems to require to drive it. I have tried pulling down the LED pin (pin 3) and read the the voltage from Vout, but it doesn't work. === Existing tutorials using DN7C3CA006 and its variants === * https://github.com/rccursach/SAM_i2c_Dust_Sensor (Attiny85 -> I2C) * https://github.com/miaoski/pm25 (Arduino) * http://arduinodev.woofex.net/2012/12/01/standalone-sharp-dust-sensor/ (Arduino) * https://www.hackster.io/edwios/air-quality-monitor-3f422f (Particle Photon) * http://www.ti.com/lit/ug/tidub68a/tidub68a.pdf (TI MSP430) === Datasheets === * https://www.sparkfun.com/datasheets/Sensors/gp2y1010au_e.pdf - GP2Y1010AU0F * http://www.sharp-world.com/products/device/lineup/data/pdf/datasheet/gp2y1010au_appl_e.pdf - Application note of Sharp dust sensor GP2Y1010AU0F * http://media.digikey.com/pdf/Data%20Sheets/Sharp%20PDFs/DN7C3CA006_Spec.pdf - DN7C3CA006 ==== The bunch of transistors that I bought ==== I bought a bunch of transistors off taobao.com. Here is a summary of their datasheet: ^Transistor ^$V_{CBO}$ / V ^$V_{CEO}$ / V ^$V_{EBO}$ / V ^$I_{C}$ / mA| Application Notes | 8050 | 40 | 25 | 6 | 1500 | 2W Output Amplifier of Portable Radios in Class B Push-pull Operation | | 9014 | 50 | 45 | 5 | 100 | Pre-Amplifier, Low Level & Low Noise | | 9013 | 40 | 25 | 5 | 500 | 1W Output Amplifier of Portable Radios in Class B Push-pull Operation | | 9018 | 30 | 15 | 5 | 50 | AM/FM Amplifier, Local Oscillator of FM/VHF Tuner | | 3906 | -40 | -40 | -5.0 | -200 |General purpose amplifier and switching applications at collector currents of 10 µA to 100 mA | | 3904 | 60 | 40 | 6.0 | 200 | General purpose amplifier and switching applications at collector currents of 10 µA to 100 mA | | 5401 | 160 | 150 | 5.0 | 600 | Amplifier Transistor | | 9012 | -40 | -20 | -5 | -500 | 1W Output Amplifier of Portable Radios in Class B Push-pull Operation | | 1815 | 60 | 50 | 5 | 150 | Audio Frequency Amplifier & High Frequency OSC | | 5551 | 180 | 160 | 6 | 600 | General-purpose high-voltage amplifiers and gas discharge display drivers | Note that for NPN transistors, collector is at the top, emitter is at the bottom, base is at the side. To make an NPN switch, the emitter goes to the ground, the collector goes to Vcc, the Base goes to control [(https://learn.sparkfun.com/tutorials/transistors/applications-i-switches )]. ==== Table of symbols ==== ^Symbols ^Meaning | |$V_{CEO}$ | Collector-Emitter Voltage | |$V_{CBO}$ | Collector-Base Voltage | |$V_{EBO}$ | Emitter-Base Voltage | |$I_C$ | Collector Current Continuous | ===== External Links ===== * [[https://g0v.hackpad.com/IoT-DIY-B1xkj9fUqqH | IoT 空污偵測 DIY (Translation: IoT Air Pollution Monitoring DIY)]] * [[https://github.com/miaoski/pm25 | Github repository for "IoT 空污偵測 DIY" ]] * [[http://airpi.es/index.php | AirPi]] * [[http://airqualityegg.com | Air Quality Egg]] * [[http://www.ti.com/lit/ml/tidub68a/tidub68a.pdf | TI Designs - Air Quality Sensor]] * [[http://www.instructables.com/id/Programming-the-ATtiny85-from-Raspberry-Pi/ | Programming the ATtiny85 from Raspberry Pi ]] * [[http://www.muonhunter.com/blog/making-a-weather-station-using-the-raspberry-pi-i2c | Muonhunter MAKING A WEATHER STATION USING THE RASPBERRY PI I2C]] * [[https://github.com/rccursach/SAM_i2c_Dust_Sensor | ATTiny85 I2C Firmware for interfacing Sharp gp2y1010 Dust Sensor]] * [[http://arduinodev.woofex.net/2012/12/01/standalone-sharp-dust-sensor/ | Sharp dust sensor ]]