Step 1: Parts in the box

Start with getting everything you need.

Step 2: Putting Sensly All Together

Let’s put it all together

Step 3: Extra Parts

Getting everything for your raspberry pi

Step 4: Setting Up the Raspberry Pi

The guide to setup a raspberry pi if you need from the raspberry pi foundation

https://www.raspberrypi.org/learning/hardware-guid...

Latest version of Raspbian Jessie can be found on the link below.

https://www.raspberrypi.org/downloads/

Step 5: Download the Software

Setting up the Raspberry Pi to connect to the Sensly HAT.

There are a few ways to do this, first you can download the Raspbian image here . This will be preconfigured to work. Secondly, you can download the install script from https://github.com/Altitude-Tech/Sensly_Install.

Firstly we need to download the install scripts using the command. Make sure you are in your home directory

Then we change directory to the Sensly_Install folder

Next, we need to make the install script executable.

Finally we run the script. There will be some prompts that you will need to type in Y to confirm you want to continue

Once completed it your pi will restart. To confirm that everything is working we can run the following command.

You should be able to see positions 05 and 76 on the screen

Step 6: Calibrate the Gas Sensors

Now we need to calibrate the Gas Sensors to be able to calculate the PPM. To do this we need to put the Sensly HAT in a clean air environment. This could be outside or if you have the facilities, in synthetic air. While the air you put it in will affect the accuracy of the sensors it will not affect precision so if you are looking to track changes in your air quality Sensly will be suitable. The Sensly HAT comes pre-loaded with the calibration firmware, so we can simply run the calibration script to find the R0 values for each Gas sensor. To be able to put Sensly in the calibration environment we need to be able to run the calibration script when the Pi boots up. For this, we can use the command crontab.

Type into the terminal the following commands

If you have never run crontab before then you will need to choose which editor that you want to use to edit it with, I normally use nano so I pick option 2. Next, we need to put the following command into the file

Then we close the file using Ctrl+x then Y. This will mean every time you start up your Pi it will run the calibration script.

You can now take it to you clean air environment and leave it for between half an hour, to an hour. The longer the better.

Once this is finished you should have a file named Sensly_Calibration_"date"_"time".csv where "date" will be replaced with the current date stored on the Raspberry pi and "time" is replaced with the current time. This file will contain the R0 values calculated during the calibration phase averaged every 5 minutes. Since the script logs a running average, you take the last entry in the file as the R0 values for the MQ2, MQ7 and MQ135. This will then be put into the Sensly.py file. to enable us to calculate the PPM values for each gas detected

Step 7: Running the Sensly HAT

To be able to run Sensly in full operation mode we need to update the firmware to get it out of Calibration mode. This is done by running the update.sh script

Once completed we can now run our main python script. But first, we need to download it from the GitHub repo.

Finally, to enable you to run the script automatically we then run the crontab command again.

Then add this to the end of the file while removing our earlier entry

Now every time you boot your pi the Sensly HAT should be logging data to a csv file. The final step is to take the R0 values you obtained during the calibration step and put them in the highlighted the last screen shot.

The next instructable we will be releasing will show you how to link this up with plotly.

Step 8: Final Steps

Please share your data as it will help us build better updates for Sensly.

If you think you have the skills to write a great Instructable using Sensly then purchase one from our store and if we like it we will refund your money and even send you more goodies!