Close
0%
0%

OpenHAP

An opensource DIY tool to help combat "household air pollution"-which kills more people globally than HIV/AIDS and malaria combined.

Similar projects worth following
An opensource DIY household air pollution monitor that bridges the technology gap for researchers, citizen scientists and enthusiasts in developing countries in order to help advance solutions to household air pollution that affects close to a third of the world's population and kills approximately 4 million people annually. Banner image is permitted for use by International Lifeline Fund( https://lifelinefund.org/ ) with thanks.

The problem

For nearly 3 billion people of the world's poorest, the simple act of cooking a meal is an uncomfortable and deadly daily experience that accounts for approximately 5% of the global burden of disease and close to 4 million deaths globally each year, which is greater than the mortality rate due to HIV/AIDS(1.6 million) and malaria(627,000) combined. 

Of these deaths:

  • 27%-Pneumonia
  • 27%-Ischemic heart disease
  • 20%-Chronic obstructive pulmonary disease (COPD)
  • 18%-Stroke
  • 8%-Lung cancer.

But why is cooking so dangerous?
 Simply put-Unclean fuels. These fuels include wood, crop wastes, charcoal, coal, unpressurised kerosene among others. Charcoal in Africa -for example- is a $24.5 billion market that causes 2 million hectares of deforestation annually – more than 200 times the size of Manhattan – and also causes deaths from household air pollution.

While bold steps have been made so far in having some populations in Asia, Africa and Latin America move from unclean fuels to relatively cleaner fuels, progress is relatively slow due to a knowledge and technology gap in developing countries on how to generate data quickly on the causes of household air pollution within their own contexts( Is it human behaviour/stove technologies used/ Types of fuels used or a complex combination of the three that is the cause ) and at minimal cost in order to create effective counter-measures. We believe that open source DIY is the way by which this gap will be filled.

About OpenHAP

OpenHAP is an open source device used to monitor exposure to pollutants within the indoor household space. It is also very useful for non invasive monitoring of human habit and actions that may have contributions to pollution, without the need to ask direct questions that may offend or go against culture thus difficult to obtain answers to.

Documentation log (In order)

OpenHAP block diagram

OpenHAP design goals

... Read more »

BOM.csv

Bill of materials

Comma-Separated Values - 7.32 kB - 09/01/2019 at 13:59

Download

  • Real world test - Urban low income - A family of four

    aloismbutura09/01/2019 at 18:27 0 comments

    A second test was carried out within an urban single-unit household in Kibera informal settlement. Actual names have been altered in order to keep identities private. We thank them for offering us the opportunity and permission to collect and analyse their data and make it public for the sake of public awareness. Asante!

    Meet the family :)

    John Doe* has lived within Kibera for the past 16 years, he met his wife Jane Doe* within Kibera. They are married with 2 children: A girl aged 15 years in a local day high school and a 6 month bundle of Joy. They live in a single room  made of aged iron sheets roughly measuring 2 meters(~12 feet) by 3 meters(~36 feet) that they share with their 2 children. They also cook within this single room. Amenities such as bathroom are shared. There is electricity but illegal connections causing fires in the neighborhood have made them afraid of connecting their home to the grid! They thus use candle for lighting. The household energy mix includes charcoal briquettes and kerosene. Kerosene is mainly used during the day while briquettes are used in the evening.

    A sample kerosene stove 

    Image result for briquette stoveA sample briquette stove

    Data analysis

    Data was captured in  a CSV file as below using an OpenHAP unit and analysed.

    The above image shows raw data collected.

    Plotting MLX90640 max temperatures, PM2.5 values against time

    Tp obtain the plots above of stove temperature and PM2.5 against time, the unix time recorded in column 1 is converted into ISO 8601 format, the day , hour, minute, second is extracted and plotted on a continuous line. The corresponding values of PM2.5  and Max temperature(Obtained by pre-processing the MLX90640 pixel data before saving to the CSV file on the SD card) are plotted against this.

    Overlaying activity information on presence information

    We obtain 

    The above plots are a superposition of two datasets:

    • Presence information - Derived from "<BLE_MAC>_count" column in the CSV file. This column stores the total number of messages received in that specific data acquisition cycle from a wristband identified by its MAC address. A zero value represents absence while anything greater than zero shows presence.
    • Activity information - Inferred from "<BLE_MAC>_mean_dBm" column in the CSV file. This column stores the average signal strength of the total number of messages(RSSI monitoring) received in that specific data acquisition cycle. This is because a wristband typically sends messages every 1-3 seconds whereas a typical data acquisition cycle lasts 20-40 seconds depending on settings.

    The Y axis can take a universe of two values with regard to presence/absence:

    • Y value > 0 -> present - In order not to have the same single level for various monitored persons, we settle for unique integer values per person with regard to presence. In the graph above:
      • Value 2 represents primary participant presence.
      • Value 1  represents secondary participant presence.
    • Y value = 0 -> Absent

    As we can only measure the activity when the participant is present, we superpose activity information on the presence information. To do this we scale the dBm information and overlay in on the presence plots above.

    The more variation there is, the more active the person. This can be used to infer when one may be asleep or awake.

    Analysing presence/activity information

    The primary participant here represents an actual mother with a six month old child. She takes care of her...

    Read more »

  • Testing activity sensing via BLE RSSI monitoring

    aloismbutura09/01/2019 at 13:49 0 comments

    A bluetooth tag that supports Eddystone / Ibeacon BLE protocols is used. This would allow the ESP32 to monitor human behavior that may have influences on pollution.

    With each Eddystone TLM(Telemetry) frame we would extract the beacon count and its associated RSSI.

    Tp ensure that the beacons are not received outside of the kitchen, we reduce the output power of the radio using the manufacturer's android application till the beacons RSSI outside the area monitored are below the receiver threshold.

    Configuring beacon interval and output power via manufacturer android application

  • Webserver stack

    aloismbutura09/01/2019 at 13:33 0 comments

    Choice of selection

    For the webserver we chose the libesphttpd project, originally created by Spritetm, originally for the ESP-8266 but modified for the ESP32 by Chris Morgan.

    Purpose

    The purpose of the webserver is to stream data to a mobile handset or computer using the onboard Wifi ability of the ESP32. The use of the webserver was designed to be primarily used to set up the system and ensure the system is okay prior to leaving it in the field over a 24-72 hour period. 

    The data within the web server includes:

    • Real time sensor information
    • System status such as current time
    • Status of storage media such as SD card.
    • Real time visualisation of the thermal array sensor data. This is to ensure that the camera is facing the source of heat.
    • Bluetooth tag information including RSSI - This is used to test the limits of the hand worn bluetooth tag with regard to distance,

    Information is listed in project video.

  • Power consumption measurement

    aloismbutura09/01/2019 at 13:20 0 comments

    Defining the data acquisition cycle

    • Wakeup
    • Scan for bluetooth beacons for 10 seconds.
    • At the same time, set the PM sensor into active mode and switch the fan on to allow fresh sream of air to flow into the sensor for 15 seconds.
    • Take the PM 2.5 and PM 10 readings, 2D thermal snapshot and extract the min, max and average, standard deviation of temperature pixel values and write this  data to the SD card as a CSV file.
    • Deep sleep for 30 seconds.

    Sample recordings of this data within a  CSV file is as below:

    The power consumption of a data acquisition cycle can be seen below.

    Power consumption profile(Single data acquisition cycle)

    To power profile I used the current ranger with the ground lead replaced with a low noise prong. The data was recorded on an oscilloscope and exported as a CSV for further analysis. 

    Average power consumption: 61.46mA

    Suggested power consumption improvements - Next iteration

    It is noted that the deep sleep phase of the data acquisition phase is around 40 mA. The reason for this may be due to the following factors.

    • The Particulate matter sensor power mode is software controlled - The datasheet gives a < 10mA idle current.
    • The load distribution within the system - There are multiple loads on the 3v3 rail that are always active even when the ESP32 is in deep sleep such as: 
      • 15-25mA - thermal sensor(20mA)
      • ~10 mA - SD card, RTC, temperature humidity sensor, GPIO expander.

    Power profiling setup

  • Testing the thermal image sensor

    aloismbutura09/01/2019 at 12:57 0 comments

    Testing the MLX90640 firmware support stack

    Melexis, creator of the MLX90640 provide a firmware stack that is available directly on github. The stack was written to be run off a Teensy running mbed os. I thus ported the stack over to the ESP-IDF development environment including the test cases with raw data provided with an excel file by the repository maintainer.

    The goal is to pass the raw camera parameters through the stack running on the embedded development platform and check that the results are equal to the reference results given by the manufacturer. My forays into doing this is detailed in the project's github issues

    I checked and confirmed the results by comparing the SHA-256 hashes of the reference results against mine, some tests failed and on further inspection, which I suspect to be due to floating point representation and rounding error! I considered this as non impactful!

    Testing the MLX90640 - Displaying frames

    To test that the sensor worked, I printed the raw data of my own thermal representation sent by the thermal camera to the ESP32 processor, to my computer and formatted the data using python as a 2D numpy array(24x32) for plotting. The code is as seen below:

    Bilinear interpolated test image of me using the plasma color palette in matplotlib.

    A 3D temperature surface plot of a typical thermal image with 24x32 pixels

    import matplotlib
    #matplotlib.use('GTKAgg') 
    import numpy as np
    from mpl_toolkits.mplot3d import Axes3D
    import matplotlib.pyplot as plt
    
    frame = np.array([30.825253,30.455252,30.720179,30.544859,30.427420,30.370266,29.946110,29.928658,29.878696,30.046879,30.317205,31.169159,33.990673,35.194588,35.997345,36.098236,36.031712,35.897179,36.039021,35.784195,35.328114,35.644867,35.863697,35.174343,31.032515,31.371862,30.977913,30.588465,30.133257,
    30.008118,30.236732,
    30.231815,30.976789,30.689404,30.787285,30.362507,30.149279,30.146961,30.035376,30.241760,30.489824,30.103189,30.620626,31.206104,35.185364,35.667862,36.217941,35.894447,35.881859,35.292969,35.147324,35.744308,35.361080,35.174133,35.637871,35.915424,32.157627,31.172319,30.133978,30.620142,30.077423,
    29.957914,30.049553,30.963652,30.955786,30.545006,32.262329,30.053732,30.133377,30.106586,31.323080,29.745535,30.029339,30.132275,31.237171,33.113396,35.322514,35.405560,35.708084,35.426910,33.949474,34.209705,34.342945,34.208508,34.998226,35.118893,36.396896,35.762486,33.242210,32.095470,30.882133,
    30.798094,30.593410,30.201653,30.372244,30.420557,30.871033,30.348743,30.257111,30.570904,30.083139,30.148439,29.986992,29.818211,29.564634,29.975609,31.276020,33.663185,35.581955,35.840919,35.192551,34.320091,32.080173,32.254898,32.203354,32.421917,33.327965,33.865158,34.779900,34.088661,33.353344,
    32.041279,31.380322,30.768456,30.482023,31.081444,29.956898,30.223719,30.339663,30.205742,30.265926,30.145273,30.305040,30.179245,30.155495,29.484919,29.640444,30.064463,32.542854,34.320049,35.053146,35.165974,33.747772,33.833889,31.328650,31.578316,31.994202,32.109375,33.064148,32.973824,33.972363,
    33.738358,32.720371,32.628704,31.945860,30.206486,30.670797,30.118706,29.981321,28.589109,30.237324,30.031094,30.333559,30.369200,29.809341,29.831825,29.624437,29.970108,29.929329,30.226299,32.220379,34.503220,34.974258,33.980598,34.773674,34.643135,32.091923,31.376667,32.039097,32.077644,32.826157,
    34.001637,34.346165,34.727680,33.437244,32.627235,32.021400,31.101357,29.732843,29.929398,30.093491,29.902218,30.573723,29.981726,30.058355,29.946224,29.900709,29.617571,29.825027,29.898470,29.462370,30.350552,32.004219,34.320049,34.948685,34.968773,35.805622,35.928032,32.918358,32.612209,32.546959,
    32.588249,34.324471,34.577042,35.043011...
    Read more »

  • Assembly

    aloismbutura09/01/2019 at 11:36 0 comments

    Assembling the Thermal array sensor add on board


    Errata 1: Footprint pinswap - Within the MLX90640 datasheet, the following pins are shown from bottom view. I ported the pins to footprint(Top view) without swapping the view of the pins within the datasheet. The end effect of this is that for the board to work, the top layer had to become the bottom when mounting- Luckily this change still worked well within the entire mechanical assembly without conflicts. Though this would mean the IDC connector would not work as expected as noted in Errata 2.

    MLX90640 datasheet pin out

    Top layer(Meant to face the Item in view of the MLX90640)Corrected board.

    Corrected board. 

    Errata 2: Due to the above errata 1, the 6 pin connector was swapped left-right/right-left due. The problem was remedied by using Female-Female jumpers instead of the desired 6 pin IDC cable. The design flaw can be seen below.


    Footprint on add on board(bottom layer in layout). 

    Footprint on the top layer on the main board

    Assembling the main board

    Cellular module

    In order to have the ability to swap in and swap out various communication modules based on the Mikrobus footprint standard, the pins were staggered to allow a solderless connection. Each pin was moved off center alternating at 8 mils distance.

    The above was ideal because the module chosen followed the Mikrobus open standard, it could easily be swapped out with another. Mikoelektronika has a whole list of Mikrobus modules. This allows one to choose between the following modules:

    Note: as at a version 1 on the hardware level, only cellular is possible as I only implemented the UART(TX/RX) and power portion of the Mikrobus standard.

    Particulate matter sensor

    For the particulate matter sensor I used the ZH03B from Winsen electronics. Though the calibration for these sensors are not traceable, the thought is that low cost sensors can be used to show a decrease in pollutant exposure over time as opposed to being used for absolute point measurements.

    The ZH03B part did not have a 3D model, I thus created the 3D model in onshape for all variants of the part which include the ZH03, ZH03A and ZH03B. The 3D STEP models can be downloaded from grabcad

    The connector to be placed on the PCB that integrates this sensor is the Boom Precision Elec 1.25T-8P with part number C53040. The Molex picoblade series part number 0533980871can also be substituted for the Boom precision part. Do note the connector is shrouded,thus polarised, therefore you cannot rotate it 180 degrees in case the electrical connections are swapped during design unless by physical removal of one of the shroud walls after PCB placement.

    Errata 3: wrong particulate matter sensor placement-rotated 180 degrees-As can be seen below the footprint pinout was swapped in footprint design. Meaning that Pin 8 on the sensor would be connected to Pin 1 on the main board connector and so on. The remedy was to remove the shroud on the connector, meaning I could invert the cable 180 degrees.

    ZH03B pinout

    Main board top layer view

    Corrected

    Buzzer

    Errata 4: Wrong buzzer selection: The wrong buzzer was selected. Within my schematic, I designed for a self excited buzzer(Constant frequency - usually 2 kHz) but when doing the ordering I chose an externally excited buzzer that required an external oscillator circuit to drive it!(Varying audible frequency as a result)

    ... Read more »

  • 3D printing the enclosure

    aloismbutura09/01/2019 at 08:25 0 comments

    As we needed to test the enclosure fitting prior to choosing extruded aluminum, we settled for 3D printing as we could get our prints with a 2 day lead time. We chose Cubic 3D as our printing partner. They offer affordable printing services in Kenya and have very good customer service. Quite impressive considering that the printing service is lead by 2 undergraduate students.

    On login, we uploaded our 3D prints.

    Total cost for a single unit(all parts combined) came to 11 USD.

  • Household air pollution in action

    aloismbutura08/27/2019 at 16:42 0 comments

    Is state of household air pollution really that bad?- This is the question I doubtfully asked myself in March 2019 while doing research on the problem above as I was designing an household air pollution monitor for a study being carried out by EED Advisory for SNV, the Dutch development agency on the cooking the sector in Kenya.

    Nothing could have prepared me for the truth as my first openHAP field test did in rural Kenya.

    The rural area in Kiambu county, Kenya. In the background are Ngong hills and its wind farm. The air looks so clean doesn't it?

    The home that we were welcomed to visit take sample measurements. The lady who welcomed us so nicely can be seen in the distance with my colleague.

    The home uses a Three stone open fire(TSOF) stove which is one of the most widely available stoves globally due to the ease of building materials and the minimal skills needed. Details are well documented here.

    An illustration of a Three Stone Open fire(TSOF) stove taken from the Improved cookstoves training manual, hosted within the Humanity Development Library 2.0 by the Humanities Library Project.

    Stove temperatures as seen on a FliR Thermal camera

    The mock cooking exercise started as soon as I began setting up the openHAP prototype unit. Though the camera does not capture the smoke levels well, the build up  much faster than anticipated as it took less than just 30 seconds by my approximation for it to reach the point I couldn't see. At that moment the closest thing I could compare it to was industrial flue gas
    Industrial flue gas emissions
    "Help me, I cant see!" By this time everybody except us had vacated the kitchen due to the smoke, even the lady who invited us could only just watch our brave efforts from outside,"Help me, I cant see!" By this time everybody except us had vacated the kitchen due to the smoke, even the lady who invited us could only just watch our brave efforts from outside,
    The prototype OpenHAP unit already setup. One can see the thick layer of soot coating formed on the corrugated iron sheets over time. It is still unbelievable how the lungs and eyes can take such a beating for so long given that people cook three times a day and this kitchen has been here for years!
    After 48 hours, we downloaded the data from the OpenHAP prototype unit and analysed it. Apparently the readings were so high that it exceeded the upper detection threshold of our particulate sensor! From the calculations, the lady who invited us(primary participant in the graph) was taking in the equivalent of 8 cigarettes a day and approximately 8 times above WHO's 24 hour exposure limit just based on our curtailed particulate matter sensor readings.

    After testing the unit in rural Kenya and seeing the data, we decided to open source the openHAP design and methodology and give support to its development through our subsidiary, Kaiote as a public domain project allowing others to make copies and derivatives.

  • Household air pollution in action

    aloismbutura08/27/2019 at 16:42 0 comments

    Is household air pollution really that bad?- This is the question I doubtfully asked myself 3 months ago while doing research on the problem above as I was designing an household air pollution monitor for a study being carried out by EED Advisory for SNV, the Dutch development agency on the cooking the sector in Kenya.

    Nothing could have prepared me for the truth as my first openHAP field test did in rural Kenya.

    The rural area in Kiambu county, Kenya. In the background are Ngong hills and its wind farm. The air looks so clean doesn't it?

    The home that we were welcomed to visit take sample measurements. The lady who welcomed us so nicely can be seen in the distance with my colleague.

    The home uses a Three stone open fire(TSOF) stove which is one of the most widely available stoves globally due to the ease of building materials and the minimal skills needed. Details are well documented here.

    An illustration of a Three Stone Open fire(TSOF) stove taken from the Improved cookstoves training manual, hosted within the Humanity Development Library 2.0 by the Humanities Library Project.

    Stove temperatures as seen on a FliR Thermal camera

    The mock cooking exercise started as soon as I began setting up the openHAP prototype unit. Though the camera does not capture the smoke levels well, the build up  much faster than anticipated as it took less than just 30 seconds by my approximation for it to reach the point I couldn't see. At that moment the closest thing I could compare it to was industrial flue gas
    Industrial flue gas emissions
    "Help me, I cant see!" By this time everybody except us had vacated the kitchen due to the smoke, even the lady who invited us could only just watch our brave efforts from outside,"Help me, I cant see!" By this time everybody except us had vacated the kitchen due to the smoke, even the lady who invited us could only just watch our brave efforts from outside,
    The prototype OpenHAP unit already setup. One can see the thick layer of soot coating formed on the corrugated iron sheets over time. It is still unbelievable how the lungs and eyes can take such a beating for so long given that people cook three times a day and this kitchen has been here for years!
    After 48 hours, we downloaded the data from the OpenHAP prototype unit and analysed it. Apparently the readings were so high that it exceeded the upper detection threshold of our particulate sensor! From the calculations, the lady who invited us(primary participant in the graph) was taking in the equivalent of 8 cigarettes a day and approximately 8 times above WHO's 24 hour exposure limit just based on our curtailed particulate matter sensor readings.

    After testing the unit in rural Kenya and seeing the data, we decided to open source the openHAP design and methodology and give support to its development through our subsidiary, Kaiote as a public domain project allowing others to make copies and derivatives.

  • PCB Layout

    aloismbutura08/25/2019 at 13:46 0 comments

    We obtained the following aluminum profile(Code REH8253) from a chinese manufacturer www.robustcasing.com:

    Due to the sliding action and play within the enclosure, the copper was  pulled back from the board edge to accommodate this movement.

    PCB with copper pulled back

    Front side

    Back side

    PCB layout on 4 layer board.

    Board specifications: 4 layer FR4 1.6mm thickness, ROHS, 1/1oz, ENIG surface finish, Green Solder Mask, White silkscreen legend color.

    Top layer

    Inner layer 2

    Inner layer 3

    Bottom layer

    3D rendered PCB views right from Kicad

    With regard to the 2D thermal array sensor add on:

    Board specifications: 2 layer FR4 1.6mm , ROHS, 1/1oz, HASL surface finish, Green Solder Mask, White silkscreen legend color.

    Top layer

    Bottom layer

    3D rendered PCB views right from Kicad

View all 11 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates