openSerial: A Graphical Serial Interface Suited for Microcontroller Applications

For a university group project involving IoT sensors I had the requirement of creating a graphical interface that helps send various commands via a serial port, and receive data on the same serial port from the same IoT sensors as a reply. Obviously this can be done fairly easily with command line programs such as screen and miniterm and there are almost certainly suitable programs out there, but as it was a requirement for the group project I decided to give my own a go.  Thus, openSerial was born.

Command line serial programs can at times be a pain, and take more time then they should to get up and running. So I tried to make openSerial as useful as possible for a wide range of situations, although the application is more targeted towards talking to microcontrollers. It was coded using Qt, and utilises Qt’s QtSerialPort library. It scans the available serial ports once a second and updates the port name combo box list. The user can define different serial settings such as baud rate, data bits setting, parity bit setting, stop bit settings, and flow control settings. It also automatically updates the connection status label based on what serial port is connected.

A quick tutorial of openSerial.

The user can read the full serial output in the console window, and send single line commands using the command lineEdit window. A history of sent commands is displayed in the Send Commands Window.

I have tested it out and it seems to work well! Sometimes if you disconnect from a serial connection, you have to unplug and plug the device in again before reconnecting. But this is more likely due to the behavior of the end device I used to test the software with. When in doubt, turn it off and on again!

You can find the source code, and a .zip file containing a binary and required Qt libraries on my github page at The program has been tested on a machine running Ubuntu 18.04. It’s a little messy in the naming department, but should be quite easy for anyone to get their head around. I highly recommend using Qt Creator when working with Qt projects!


PollutionPi: Project Proposal for an Indicative Air Quality Index Compatible Raspberry Pi Powered Air Quality Station

As a part of my volunteer position working on air pollution issues at CPI Fondacija located in Sarajevo, Bosnia and Herzegovina, I put together a project proposal for the design and prototyping of an inexpensive air quality station. This prototype would have provided the basis for building a network of air quality sensors that can provide indicative air pollution sensing in Sarajevo and other areas of Bosnia and Herzegovina. The aim was two fold. To advocate for action that curbs the severe air quality issues Bosnia and Herzegovina faces, and to provide awareness on how acute the air quality issue is in the region.

Unfortunately the project never went ahead, but I have decided to publish the project proposal here as I believe the project had merit and I did extensive research that I included in the proposal. I also think it is good to use in the sense portfolio as it shows some of my research and project design capabilities.

PollutionPi: An Indicative Air Quality Index Compatible Raspberry Pi Powered Air Quality Station

24 Hour Air Pollution Data in Federation of Bosnia and Herzegovina

In an attempt to make air pollution data in the Federation of Bosnia and Herzegovina more accessable to citizens, the Federal Hydrometeorological Institute of Bosnia and Herzegovina (FHMZBIH) has kindly given access to validated 24 hour air pollution data from the years of 2015, 2016, and 2017. The following interactive chart allows citizens to view this data.

24 hour data better shows the cycles of pollution across the Federation of Bosnia and Herzegovina, with a particular emphisis of poor air quality within the winter months.

Mobile Data

PMSA003 Low Cost Air Pollution Sensor Accuracy; An Attempt At Calibration in Sarajevo

In the last five or so years, affordable low cost air pollution sensors have become available on the market resulting in an explosion of open source online projects that measure the ambient quality of air. Much discussion and research has taken place within academic and government environmental organisations as to how accurate such sensors are and whether they have a place in the enforcing of environmental regulation, or even providing an indication of air quality trends to citizens.

As a part of project I am currently involved in with a NGO located in Sarajevo, I constructed multiple boxes that house low cost sensors which measure PM10 pollution. These boxes followed a design created by a locally based start up called CityOS. CityOS have resources available on their website including parts lists, a step-by-step guide to assembling an affordable air quality sensor that measures PM10, PM2.5, and PM1 particulate matters, a code base for the project, and an interface to view and download measured data. In order to gain a greater insight in to how accurate designs using these kinds of sensors are, I decided to attempt to get some comparison data on these sensors by using sensor collocation. The CityOS designed sensors will be placed in the immediate vicinity to professionally calibrated devices maintained by the Federal Hydrometeorological Institute of Bosnia and Herzegovina (FHMZBIH). With this data, I intend to attempt to calibrate these sensors as to increase their accuracy.

The PMSA003 Particulate Matter Sensor

The Plantower PA003

The Plantower PMSA003 is used in this particular CityOS sensor design. This sensor is available from a variety of online websites and generally costs between $15AUD and $20AUD a peice. No english datasheet exists for the device as far as I could find, however a datasheet written in Mandarin is available here.

The datasheet specifies a PM2.5 accuracy of +-10ug/ms when PM2.5 concentrations are below 100ug/m3, and a +-10% accuracy when PM2.5 concentrations are between 100ug/m3 and 500ug/m3. Already this is a little worrying, as according to EU and BiH regulations healthy PM2.5 concentrations exist below an annualised average of 25ug/m3, and healthy concentrations of PM10 exist bellow an hourly average of 50ug/m3. Having such a large inaccuracy at lower concentrations would likely result in unacceptable measuring accuracy for the majority of time. No PM10 accuracy information was included in the datasheet, which is problematic as this is the precise particulate matter that will be measured during the test.

The PMSA003 uses the method of laser diffraction to detect how much particulate matter is in the air. Laser diffraction typically requires calibration with a sensor using an alternative detection method such as Beta Attenuation due to the way different pollution diffracts light, and the highly sensitive nature of the technique to meteorological factors such as humidity.

The CityOS “Boxy” Sensor

The CityOS “Boxy” design includes a protective enclosure that houses various electronic components such as the ESP8266, as well as a DHT22 digital temperature and humidity sensor, and the PMSA003. The bottom of the enclosure is open so air can freely flow to the PMSA003, and so the electronics can be somewhat ventilated. The Boxy unit sends the data via a wifi connection, where the data can then be accessed on the CityOS or by utilising the CityOS API. Particulate matter measurements are taken every 60 seconds. When accessing the data via the CityOs API, the measurements are averaged to an hourly value.

The DHT22 sensor datasheet specifies a temperature reading accuracy of +-0.5 degrees Celsius, and a +-2% relative humidity accuracy.

The Reference PM10 Station and Test Setup

Verewa F-701 PM10 reference station

The Sarajevo based FHMZBIH kindly allowed us to place six CityOS Boxy units in the vicinity of their professionally calibrated Verewa F-701 PM10 measuring station so we could use it’s results as a calibration reference. This measuring station is located at the FHMZBIH offices in Bjelave, Sarajevo. The station completes a measurement once an hour and the result is accessible to the public on the FHMZBIH website.

The housing for the CityOS Boxy sensors.

The six units were placed approximately four metres away from the reference station within a basket in a small housing that contained vents that allowed air flow and sheltered from the elements such as rain.

Six Boxy units inside basket.

In addition to reference PM10 data,  reference temperature and humidity data were also to be recorded in order to correlate the CityOS Boxy PM10 measurement accuracy with various weather conditions. The accuracy of the DHT22 temperature and humidity measurements were also to be compared to this data. The temperature and humidity data could potentially be used to calibrate the PMSA003 sensor regardless of the weather conditions.

The Results

Mobile Data

The above interactive chart shows data collected over a ten day period from sources including data sourced from six CityOS Box units, FHMBIH PM10 reference station, and FHMBIH temperature/humidity reference station.


The PM10 measurement accuracy of the PMSA003 particulate matter sensor housed in the CityOS Boxy enclosure was poor in almost all conditions presented while the testing was conducted.  By navigating the above interactive chart, the following conclusions can be made:

  •  Over the ten day test period the average error of the PMSA003 sensor in a CityOS Boxy enclosure was approximately +- 60% when compared to the reference PM10 measurements.
  • PM10 measurement error is significantly higher at lower PM10 concentrations, thus confirming the datasheet specification of significant errors at particulate matter concentrations below 100ug/m3.
  • There is a trend of higher PM10 measurement error as humidity increases, however there is no significant statistical correlation that can be utilised for calibration.
  • There is no significant statistical correlation between PM10 measurement error and temperature.
  • PMSA003 and DHT22 measurements were broadly uniform across all units.
  • The DHT22 temperature measurements had an average accuracy of approximately +-15%. The discrepancy of this accuracy and that reported on the DHT22 datasheet is likely to be due to the sensor placement in the CityOS boxy enclosure.
  • The DHT22 humidity measurements had an average accuracy of approximately -+50%. The discrepancy of this accuracy and that reported on the DHT22 datasheet is likely to be due to the sensor placement in the CityOS boxy enclosure.

From these conclusions, it is apparent that calibration for measurements under 100ug/mg may not be possible. While there are some correlations between PM10 measurement accuracy and PM10 concentration and humidity, the correlations are not represented in a uniform in a way that may be useful for the calibration of the sensors.


Due to the high measurement errors at lower particulate matter concentrations that do not correspond to bias errors, it is not possible to calibrate PMSA003 sensor to provide more accurate data at concentrations below 100ug/m3.  This calls in to question the usefulness of the PMSA003 sensor in providing accurate particulate matter measurements.

However, it may still be possible to use the PMSA003 in a useful way to inform individuals about dangerous levels of particulate matter concentrations in the air when hourly averaged values indicate concentrations above 30ug/m3. The United States Environmental Protection Agency (EPA), in partnership with the Village Green Project, conducted research in to the usability of low cost sensor in informing the public of poor air quality within communities. By analyzing the data measured by low cost sensors they came up with a scaling system that provides useful information to the public for PM2.5 measurements, while taking in to account the inaccuracies of low cost sensors.

The Village Green Project PM2.5 scaling system.

For PMSA003 measurements to be useful a similar scaling system should be utilised, and individual measurements should be treated with skepticism. The data analysed from this test seems to corroborate with this scaling system in terms of the accuracy of the measurements at different concentration levels. More qualitative analysis of the test data is required in order to make an similar scaling system catered towards the  PMSA003, however at first analysis the Village Green Project scaling system appears to be a good solution to the issue of poor measurement accuracy.

Controlling Ultrasonic Piezo Transducer Output with PWM Duty Cycle

For my capstone project at university I am working with a bunch of ultrasonic piezo transducers that require a variable sound pressure level (SPL) output. One way of achieving this is by driving the transducer with a pulse width modulated (PWM) signal and varying the duty cycle. My application actually requires a way of changing the output SPL in a linear manner, so I decided to conduct an experiment to see what the SPL output is with different duty cycles of the piezo transducer I have on hand, the Murata MA40S4S.

The Experiment

To do this, I taped together two Murata MA40S4S transducers together directly. As both of these transducers are specified as transmitting transducers, this was not ideal, but for the purpose of this experiment it will do the job for both transmitting the pulses with varying duty cycle, and measuring the resulting output.

The two MA40S4S piezo transducers taped together.

I connected a Picoscope 2204A’s arbitrary wave generator (AWG) directly to one of the transducers, and the channel A input of the Picoscope 2204A to the remaining transducer. This formed the transmitter/receiver setup.

The transmitter/receiver setup

From there, I found the resonant frequency that resulted in the greatest voltage output from the receiving piezo transducer. To do this, I setup a 2Vpp square wave with a duty cycle of 50% with picoscope’s software, and then slowly sweeped different frequencies around 40kHz. I found that the highest receiver voltage peaked with a driving frequency of 43.9kHz.

The picoscope software setup for creating square waves with different duty cycles and measuring the response

Then everything was simple. I just changed the duty cycle of the square wave and recorded the peak to peak voltage of the receiving transducer.

The Results

The following charts show the measured receiver output when the transmitting transducer was driven with a 43.9kHz square wave signal with differing duty cycles.

Output measured from receiving transducer at different transmitting duty cycles

From these measurements we can see that the greatest output occurs with a duty cycle of 50%. We can also see that as duty cycle is decreased, the voltage output does not decrease in a linear manner. In order to get an idea of how non-linear the transducer is at different driving duty cycles, I made the following chart which displays the ideal and measured response in decibels relative to a duty cycle of 50%.

Transducer response relative a 50% duty cycle

We can see from this chart that the error is significant. If linearity is required in the reduction of SPL output from these transducers when using PWM with a varying duty cycle, some kind of calibration would have to take place. This is especially the case as piezo transducers of this kind often have large tolerances.

The Conclusion

Driving piezo transducers with PWM signals that vary in duty cycle is a great way to reduce SPL output in an easy manner. However changes in duty cycle do not result in a proportional change in SPL output. If linearity is required in this sense, some form of calibration should be performed.

It should be noted that the poor linearity of the results could be influenced by the receiving transducers own non-linearities. Frustratingly this kind of thing is not defined in the Murata MA40S4S or MA40S4R datasheet, but I have no way to know for sure other than by purchasing a decent ultrasonic microphone and performing the same measurements.


Sarajevo Historic Air Pollution and Air Pollution Sources Data

For the next few months I will be living in Sarajevo and working on a project to do with air pollution in the region. This project will involve the building of some sensors to measure some concentrations of air pollution, as well as helping out with the development of a live map that people will be able to monitor Bosnian air pollution in real time. To get a better understanding of the topic, I did some quite extensive research and developed some interactive charts to convey this research.

Air pollution in Sarajevo has been a hot button topic within Bosnia and Herzegovina for a number of years. Restrictions on driving cars within the city have been enforced in the past, and World Health Organisation statistics have identified Bosnia and Herzegovina as one of the most polluted countries in Europe . The causes, trends, and solutions of this air pollution issue in Sarajevo are often not fully understood by the wider public and media within the region. Historic air pollution data exists, although it is not widely published beyond non-publicised government reports and is formatted in a hard-to-read fashion. I hope that by compiling various data sources relating to air pollution in Sarajevo, it will be useful for someone down the track.

Historic Causes of Air Pollution in Sarajevo

In the 1970’s, the Yugoslavian government in partnership with The World Bank funded the Sarajevo Air Pollution Control Project in an attempt to reduce pollution levels before the 1984 Winter Olympics. They identified several natural and man made factors that contributed to air pollution at the time. The air flow impeding valley like topography of Sarajevo combined with the typical climate of the region promotes a climatic phenomenon called temperature inversion. Temperature inversions have a tendency to trap air pollution at ground level for extended periods of time. The heating systems utilised in Sarajevo at the time used fuels known for causing heavy pollution such as wood, lignite coal (brown coal), coke, and fuel oil. This caused significant air pollution in the winter months. This air pollution in the atmosphere would be exacerbated by instances of temperature inversion, ensuring the pollution would linger within the city for extended periods of time. Finally, significant industry existed within the city which added to the already existing pollution. At the conclusion of the project, natural gas was widely adopted as a heating fuel among city and pollution levels dropped significantly.

In the post war period, The World Bank funded the Emergency District Heating Reconstruction Project in order to repair damaged district heating infrastructure within the Sarajevo region. This project provided “fuel-switch” capability to much of the district heating infrastructure in Sarajevo, allowing the usage of both natural gas and fuel oils as heating fuels. This was done in order to increase post-war energy security within Sarajevo.

Current Causes of Air Pollution in Sarajevo

The current causes of air pollution in Sarajevo have not changed significantly from the past, although according to government air pollution reports, air pollution within Sarajevo has decreased significantly in the post-war period. Industrial output is widely acknowledged to have not returned to pre-war levels, and therefore is less of an issue in regards to air pollution as it was in the past. Car ownership has significantly increased since the 1990’s, adding a new problematic source of pollution within the city.

Historic Air Pollution Data in Sarajevo Kanton

Mobile Data

The above interactive chart contains all air pollution data that is currently available from online and published government sources. Data can be highlighted based on the pollution station it was measured from by clicking on drop pins via the map, as well as by clicking on the station names listed in the adjacent table. Different pollution sources can be selected by clicking one of the 5 red buttons located above the first chart. Statistical data can be displayed separately on the second chart to clicking one of the 3 blue buttons located bellow the chart. By analysing this data, statistical conclusions can be drawn about air pollution in the Sarajevo region over the last ten years.

Statistical conclusions

The annual average concentration of particulate pollution with a particle diameter between 2.5 and 10μm, otherwise known as PM10, has not significantly decreased within the Sarajevo region. This annual average concentration of PM10 is routinely above the maximum 40µg/m3 concentration allowed by Bosnian and EU regulations. Depending on the station, PM10 exceedances of 50µg/m3 over a 24 hour period continue to occur between 40 to 100 days on an annual basis in contravention of Bosnian and EU regulations.

Annual Sulfur Dioxide (SO2) emissions appear to be decreasing over the long term, with levels recorded being significantly less than that of the measurements taken in the pre-war period. Despite this, a small number of exeedances of 125µg/m3 over a 24 hour period still occur at a number of stations throughout Sarajevo on an annual basis.

Like SO2 emissions, annual Nitrogen Dioxide (NO2) emissions over the long term appear to be decreasing, however annual peak values are increasing. The pollution station located in Otoka is consistently recording an annual average concentration exceeding of 40µg/m3 in contravention of Bosnian and EU regulations. Exeedances of 200µg/m3 over a 1 hour period still occur at a number of stations in the region on an annual basis.

Ozone (O3) pollution has been rising in recent years throughout Sarajevo. A large number of exeedances of 120µg/m3 over an 8 hour period occur at a number of pollution stations located throughout Sarajevo.

Carbon Monoxide (CO) pollution over the long term appears to be decreasing within the Sarajevo region, however not enough data exists in order to make a statistical conclusion. In the past the pollution station located in Otoka has recorded over 10 exeedances of 10mg/m3 over an 8 hour period.

Data Sources

Bosnian historic air pollution data sources are scattered across multiple online departments, sites, and portals. Due to this, I concentrated on available data from the Federation of Bosnia and Herzegovina entity.

Government reports generated by the Federal Hydrometeorological Institute of Bosnia and Herzegovina (FHMZBIH), have been published from the period of 2003-2008 as well as for 2009, 2010, and 2011. However, the reports written during this period were often lacking tabular and statistical results making the contained data difficult to use. The online location of these reports also appears to be on a non-publicised section of the FHMZBIH website, making them hard to locate. The data used to generate these FHMZBIH reports from the period of 2003-2012 is also published on the EEAs Eionet Centreal Data Repository under the since terminated EoI data reporting obligations that Bosnia and Herzegovina participated in. However this data is only available in convoluted and non-documented database formats which are difficult and time consuming to navigate. Fortunately, formatted statistical data derived from these 2003-2012 databases has been published along with other European air pollution data through the so called “Airbase”, a now superseded European air quality database. It is the statistical data contained in these releases that was used for the years of 2003-2012 in the above interactive chart.

No government report was generated for 2012 and 2013, and no data from 2013 appears to be available at all. However FHMZBIH government reports exist for 2014, 2015, 2016, and 2017. The format of FHMZBIH government reports since 2014 have improved significantly, with tabulated monthly and annual statistical data available, albeit in difficult to extract PDF format. Data from these reports was used in the above interactive chart for the years following 2014.

The formatted data used to generate this chart can be downloaded using the Data link located underneath the interactive chart. The chart can be embedded in other websites using the Mobile link located in the same position.

Improving Air Pollution Data Availability

In order to improve the availability of air pollution data in Bosnia and Herzegovina, in addition to the publication of government reports all available historic daily, monthly, and annual air pollution data should be published in an easy to use format such as CSV in a central repository. Ideally this would include air pollution data obtained during the pre-war and post-war periods. The availability of this data would make it easier for institutions and individuals from Bosnia and Herzegovina and abroad to access and study this air pollution data, enabling them to contribute to the discussion around the issues that Bosnia and Herzegovina faces with air pollution. The online availability of FHMZBIH generated government reports should also be located in a centreralised location.

Other Notes on Available Data

While the data that can be currently found online is useful for analysing the trends of air pollution in Sarajevo, some inconsistencies can be observed. For annual air pollution statistics to be valid, The Federal Hydrometeorological Institute of Bosnia and Herzegovina (FHMZBIH) has informed me that according to Bosnian and EU regulations at least 90% of hourly measurements should be valid on an annual basis, or at least 75% of hourly measurements should be valid if the gaps in valid data are evenly distributed during the year. This annualised data does not take this in to account, and therefore not all the data may be valid in a regulatory sense.

Historic Data on Causes of Air Pollution

In order to gain a greater understanding around some of the trends in air pollution within Sarajevo, data was gathered and interactive charts were developed to further analyse trends in some of the causes of air pollution in the region. This data pertains to the types of fuels used in district heating systems within Bosnia and Herzegovina, and traffic data from Sarajevo Kanton.

District Heating Fuel Usage in Bosnia and Herzegovina

Mobile Data
The above interactive chart contains all district heating fuel usage data that is currently available from online and published government sources. The data can be viewed as a percentage of the heat produced, and as a quantity of the fuel used by clicking on 1 of the 2 red buttons. By analysing this data, broad conclusions can be drawn about the effect the heating fuel usage mix has had on air pollution in Bosnia and Herzegovina. Unfortunately no data is currently available online in regards to district heating fuel usage in the Sarajevo Kanton alone, therefore one must keep this in mind when trying to draw conclusions on the affect this data might have on air pollution data within the Sarajevo region.

Statistical conclusions

In the last decade, the heating fuel mix used in district heating system within Bosnia and Herzegovina has dramatically changed. Distillate fuel oil usage over the decade has declined by over 85%. This dramatic change was largely offset by a 500% increase wood and wood waste fuels, as well as a slight increase in the usage of residual fuel oils. Natural gas usage has also slightly declined over the last decade.

Wood and wood waste fuels generally produce larger amounts of particulate pollution such as PM10 than other heating fuels such as natural gas. Residual fuel oils have higher a sulfur content than distillate fuel oils, and therefore generally produce more air pollution. Natural gas is generally considered one of the cleaner fuels when used for heating purposes.

Data Sources

Government reports generated by the Agency for Statistics of the Bosnia and Herzegovina (BHAS) that contain information regarding district heating fuel usage have been published for 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, and 2016. In order to convert fuel quantities to a heat produced percentage I used the EPA’s published Miscellaneous Data and Conversion Factors document, and caculated total percentages based on those results.

The formatted data used to generate this chart can be downloaded using the Data link located underneath the interactive chart. The chart can be embedded in other websites using the Mobile link located in the same position.

Improving District Heating Fuel Usage Data Availability and Usefulness

In order to improve the usefulness of district heating fuel usage data in Bosnia and Herzegovina in regards to its correlation with air pollution, data on fuel usage should be available on a Kanton by Kanton level. The data should also be published in an easy to use format such as CSV in a single document. The online availability of BHAS generated government reports should also be located in a centreralised and easy to find location.

Historic Vehicle Usage Data in Sarajevo Kanton

Mobile Data

The above interactive chart contains vehicle usage data within Sarajevo Kanton that is currently available from online and published government sources. The data can be viewed as of total number of kilometres traveled by vehicles in Sarajevo Kanton on a quarterly basis, or as the total number of vehicle registrations in Sarajevo Kanton on an annual basis by clicking on 1 of the 2 red buttons. The data is simply the number of kilometers driven by passenger and commercial vehicles with Sarajevo Kanton on a quarterly basis. By analysing this data, board conclusions can be drawn about the effect traffic may have had on air pollution in Sarajevo Kanton.

Statistical conclusions

The kilometres traveled within Sarajevo Kanton over the past decade have gradually been increasing by around 1% on an annual basis. Vehicle transportation is a known emitter of CO and particulate matter, therefore this increase in the kilometres traveled within Sarajevo Kanton is likely to be partly responsible for the persisting levels of PM10 and CO within metropolitan Sarajevo. Registrations of vehicles have increased by around 20% in a linear fashion over the last 8 years, indicating that it is unlikely that the number of kilometres traveled by vehicles in Sarajevo Kanton will decrease in the near future.

Data Sources

Quarterly vehicle statistics as well as annual registration statistics are available from Sarajevo Kanton’s Department of Informatics and Statistics

The formatted data used to generate this chart can be downloaded using the Data link located underneath the interactive chart. The chart can be embedded in other websites using the Mobile link located in the same position.

Improving Vehicle Usage Data Availability and Usefulness

In order to improve the usefulness of vehicle usage data in Bosnia and Herzegovina in regards to its correlation with air pollution, all historic and current data on vehicle usage should be published in an easy to use format such as CSV in a single document.


Air pollution within the Sarajevo region is a pressing issue that should not be ignored. During the winter months, concentrations of various pollutants such as PM10, SO2, NO2, and O3 often exceed Bosnian and EU regulations, confirming that air pollution is a public health concern that is impacting the lives of residents of Sarajevo. By viewing the data available in these interactive charts, worrying trends in district heating fuel and vehicle usage within Sarajevo Kanton can be observed. Positive steps are being taken regarding the usage of fuel oils and coal with heavy sulfur contents, however as significant contributors to air pollution within Sarajevo, further action should be taken to reverse these trends.

How Cold Can a Raspberry Pi Get?

The other day I was discussing with a colleague how cold the CPU of a Raspberry Pi would get if it were left out in the harsh Sarajevian winter. With Sarajevo being the capital of Bosnia and Herzegovina, and my current whereabouts.

He assured me the thing would not get very cold and me being my stubborn self I had to test this out. “If only we had a temperature chamber”, I mused. “A temperature chamber? We are in Bosnia! Our temperature chamber is our kitchen freezer and oven! Let’s just put the damn thing in the freezer”, he retorted. So that is what we did.

The Experiment

This Raspberry Pi had a Tiny Core distribution installed, which is a very cool minimalist distribution particularly well suited for embedded applications that I would recommend to anyone who has the time to learn its quirks. Being only a Raspberry Pi version 2, we had to add WiFi connectivity via a USB dongle, and we powered the Pi with a mobile charger battery. In the end this shenanigan looked a bit like this:

Setup of the great Raspberry Pi in freezer experiment.

After setting up the WiFi dongle driver and getting the Pi to automatically connect to the offices WiFi network at boot up (no easy feat using Tiny Core as a beginner), I SSH’d in to the Pi and used the following very simple Bash command to print out the temperature in Terminal every 3 seconds, and also save it to a CSV file.

while true
    echo "$(date),$(cat/sys/class/thermal/thermal_zone0/temp)"
    echo "$(date),$(cat/sys/class/thermal/thermal_zone0/temp)" >>temp_freezer.csv
    sleep 3



The Results

Keeping in mind that there is not much that is scientific about this test, The Raspberry Pi was kept at around 22 degrees before the test started (measured by a DHT22 sensor from a different project and the room air conditioner read out. After putting the Pi in the freezer, we got the following results.

Results from the experiment.

The Conclusion

After getting these results, we used a mercury thermometer to measure the temperature inside the freezer, which returned around -14 degrees. So, what can we gather from this experiment? A Raspberry Pi will cool in a linear fashion when placed in the cold. The Raspberry Pi CPU resting temperature is not linear when it comes to different ambient temperatures (42c-22c = 20c, 14c-(-14c) = 28c. The Raspberry Pi CPU thermometer has a pretty low resolution, which can be seen by the quantising like spikes in the results.

I am hoping that one day I can repeat this experiment in a controlled environment with a temperature chamber, as well as with the inclusion of other variables such as CPU load. But in the near future I will try and do similar experiments with Raspberry Pi CPU temperature vs CPU frequency. Hope this helps someone who needs to put their Pi in the freezer!

Hello world!

I have had the idea milling around for a while to write up about some of the various projects I do at university and in my own time, as well find a home for some of the travel related stuff I have written in the past. I suppose the time has come to actually do it. So consider it done.