Co2 Data Logging

Recently I was convinced by a friend to get a CO2 sensor to check on the levels in my apartment, citing the correlation to CO2 and cognitive function. The sensor I picked up immediately showed that the levels in my apartment were around 1800ppm above the recommended amount. I wanted to be able to log the CO2 levels over time so I threw together this quick project to read the data out of the sensor. Now I can see how opening different windows or doing things like turning on the bathroom fan affect the CO2 levels and how fast.

If you’re curious about logging CO2 levels and building a dashboard to show them this guide below should let you replicate my setup.


C02 sensor AZ Instrument RH7722
This is device that will do the actual measurement.
Particle photon
This will connect to the CO2 sensor and send the data to
Barrel Connector
This lets us connect the Particle to the CO2 sensor
Prototyping kit
If you don’t have a breadboard, a 1k resistor, or hookup wire this looks like an acceptable little kit


Hook up the Photon like this, using a 1k resistor as a pull up for the UART communication.

Setup Adafruit IO

Setup an account on Adafruit IO

From there you will want to set up 3 new feeds named, temperature, humidity, and co2

Click the yellow AIO key link in the upper right to get your key and save it for the next step.

Programing the Photon

Now follow the instructions to get your Particle Photon connected to your wifi
One that is complete load up the code for this project here:
On line 4 put your AIO key from earlier into the quotes replacing the key_here text.
You can now flash this code to the Photon.

Once that is done, go back to the Adafruit IO page and you should see data in your feeds. You can now make a new dashboard that uses these feeds to show information. Have fun!


Fix for Windows 8 hanging with 100% Hard Drive Usage

If Windows is suddenly tasked with a lot of HDD I/O it will lock up for 20 seconds or more. I’ve noticed mostly this when launching games or installing apps. This fix has worked for me in the past:

bcdedit /set disabledynamictick yes


Removing advertisements from the new Kindle Fire HD

Removing the ads from the new Kindle Fire HD is a fairly simple process.

First make sure to root your device, the method here should be quick and painless:

Now just open up a terminal and do the following:

adb shell
cd /data/data/                        
rm -r ./adunits
touch adunits

Now the lockscreen should just show the stock photos.


Modifying Amazon’s Kindle app to hide soft keys on Ice Cream Sandwich

Ice Cream Sandwich introduced soft buttons to Android phones, and Google had forethought  enough to allow applications to dim these buttons so that they don’t distract from content like text and video. Sadly Amazon has yet to update their Kindle application to support this feature. Luckily we can take advantage of APK Multi-tool to de-compile, modify, and re-compile and resign applications. Below is a screen shot of how the app should look before and after the modifications.

First we need to create a temporary application so that we can get the Dalvik code that we want to inject into the Kindle application.

Create a test project in eclipse to get the dalvik code and put this into the onCreate method after setting the content.


We can use baksmali that comes with APK Multi-tool to de-compile this new app and find code similar to this:

invoke-virtual {p0}, Lcom/amazon/kcp/reader/ReaderActivity;->getWindow()Landroid/view/Window;
move-result-object v2
invoke-virtual {v2}, Landroid/view/Window;->getDecorView()Landroid/view/View;
move-result-object v2
const/4 v1, 0x1
invoke-virtual {v2, v1}, Landroid/view/View;->setSystemUiVisibility(I)V

Next we need to de-compile the Kindle app.

We want to change the code located in:


Now the code that was generated earlier can be inserted into the Reader activity after line 2027 which should look like this

invoke-virtual {p0, v0}, Lcom/amazon/kcp/reader/ReaderActivity;->setContentView(I)V

Once that is complete smali include with APK Multi-tool can be use to re-compile the modified app. The output can be pushed to an android device with adb and the soft buttons should now auto hide.


On Wall Disc Storage

At the office we have an unreasonable amount of discs that we use frequently. At one point they were kept on thumb tacks on a bulletin board, but they always seems to manage to jump off and end up in the same place where lost socks go.  Luckily I stumbled upon an excellent article on Make, Peel ‘n’ Stick Disc Storage.

It turns out that the CD hubs, that are often found in books, are the perfect solution and cost very little.  I went ahead and ordered some clear ones from Amazon and set them up in the office. So far they get the job done wonderfully, the discs are easy to access and they don’t try to run away anymore.