Nest Thermostat Data Logging

I have a Nest thermostat here at the house, which we really like a lot. It’s great for keeping track of energy usage on heating, as well as being able to remotely control the settings, in addition to the insanely awesome scheduling it can take care of.

However, I had wished that it offered some way to log or plot the data available from the onboard sensors for temperature and humidity inside the house. Unfortunately, it’s not *really* available. However, some some helpful dude made an PHP class that makes use of the interface the nest itself uses to talk, so I’ve taken advantage and am now making fancy graphs of the data. Woo!

Screen Shot 2014-07-07 at 12.58.50 PM

Posted in Electronics, Life, Random, Technology, Weather | 1 Comment

Secure Data Destruction

In light of my recent work with making things more secure with a truly random number generator for use in feeding the kernel entropy pool, I also thought it would be a good time to visit secure data destruction, and share a few photos from a recent outing.

IMG_0770

IMG_0774

IMG_0778

IMG_0782Most of the damage and holes were done with the 9mm, but the .22 played a good role, and the 12 gauge with trap shot was around to pretty up the top plate with a number of small dents.

Posted in Electronics, Firearms, Technology | Leave a comment

Random Number Generator

I’ve always been interested in the idea of truly random phenomenon, and in particular, the quantum effects like avalanche noise that one can take advantage of to generate truly random data. Note that I say truly random, as compared to the pseudo-random data one would get from /dev/random or /dev/urandom.

Most computers get their entropy from timing physical parameters available to them. Timings of ethernet device drivers, intervals between keyboard key presses, or mouse movements are a few options there. These are all based on inputs of some kind available to a computer, which if known, can potentially cause predictable “random” numbers, or be externally influenced, to again, potentially cause predictable “random” numbers.

Now, take the above with a grain of salt. A lot of very smart people have spent a lot of time working on making the pseudo-random number generators that most computers rely on, for example, when you visit a HTTPS enabled web site, very secure. However, they are inherently based on an algorithm fed by given inputs, and will never be TRULY random.

Recently, I burned through enough of the personal project backlog, and had been thinking about it enough, that I decided to make a device, say a USB key, that would generate truly random numbers, that one could use to feed a computer’s entropy pool and, in theory, increase the security of any cryptographic functions on that computer.

So I did.

IMG_0653 IMG_0657

As a side note, this is the first device I’ve made to directly support USB. It’s really cool to see a USB device show up in the info list with my details!

Screen Shot 2014-06-21 at 1.46.35 PM

This device, relies on quantum tunneling to create a truly random noise source, which is sampled by a microcontroller, delivered to the computer, whitened, and passed into the kernel’s entropy pool.

Specifically, a transistor’s P-N junction is reverse biased (the voltage is hooked up the wrong way), and normally, this means no current will flow. However, quantum tunneling will occasionally allow electrons to jump across the barrier, which creates a voltage on the other side. As the electrons are randomly jumping across the barrier, the voltage on the other side also randomly fluctuates. If you sample that voltage every so often, you can use that to generate random data.

However, random doesn’t mean that the data isn’t biased. In the case of my device, data is biased towards 1’s. But imagine a geiger counter. Most of the time, it’s not reading anything, and will be heavily biased towards 0’s, until a particle of radiation comes in, and you get a 1. It’s still very random data, but it’s biased. Unfortunately, computers want the data to be BOTH random and unbiased, so we need to do a little bit of processing on the random data to remove the bias.

Now, as if John von Neumann wasn’t smart enough, he came up with a very simple way to remove bias from an input stream. If the bits are the same (1 & 1 or 0 & 0), throw them out. If the bits are different, use the first bit as the output. So in my case, the preponderance of 1’s gets thrown away, and we start caring about where the 1’s and 0’s meet.

After you take care of that, you now have an unbiased AND random stream of binary data, which can be fed into the kernel entropy pool. BUT!!!!! Before you do so, you should make sure that the data really is random. The whole project is for nothing if it isn’t!

Let’s use a helpful little tool called “ent” to test the entropy of our output data! (There are other tools like dieharder that are excellent at testing data, but their output is less blog post friendly, needless to say the data sees good results with these as well).

 

Entropy = 1.000000 bits per bit.

Optimum compression would reduce the size
of this 2215723008 bit file by 0 percent.

Arithmetic mean value of data bits is 0.5000 (0.5 = random).

Monte Carlo value for Pi is 3.129546186 (error 0.38 percent).

Serial correlation coefficient is 0.017544 (totally uncorrelated = 0.0).

So, we can see through a number of tests here, that the data looks to be pretty random, and the program estimates that there is one bit of entropy for every bit in the data stream! Very random!

Also, here is an (enormous) plot a buddy of mine threw together with the random data. It *also* looks pretty random!

140708-nigelvh-random-03

EDIT: Additionally, check out the post regarding the new revision here: New RNG Revision

Posted in Electronics, Life, Projects, Random, Technology | 1 Comment

Meyer Lemon Take Two

A while back I posted about getting a pretty small Meyer Lemon tree, in the hopes of not failing utterly at growing things, like I normally do. Unfortunately, I’m not sure I succeeded there… I’m not sure it was entirely healthy to begin with, but a scale infestation pretty much did it in.

So, for take two, I’ve gotten another tree, a little bit older one this time, and so far things are going pretty well.

IMG_0807

It’s even got a few blooms happening (there are actually more than there were in this picture taken a few days ago).

IMG_0809 IMG_0811

In addition to at least one lemon starting!

IMG_0813

So, we’ll see if I’m drinking lemonade later on!

Posted in Life, Random | Leave a comment

IRIS Transmitter V1.2

I’ve been working on creating a new version of my IRIS Transmitter boards, which I use for high altitude balloon trackers. This was somewhat more of a re-architechture from the 1.0 and 1.1 revisions.

Revision 1.2 brings a number of changes:

  • A new radio chip, the SI4464, replaces the ADF7012. The SI4464 provides more stable output power than the ADF7012 which had significant variations, and has a number of built in digital packet processing capabilities.
  • The microcontroller is now run on 3.3V instead of 5V which allows the boost regulator to operate more efficiently when operating from two AA batteries.
  • A uBlox MAX-6 GPS chip and antenna have been put on the board to remove the need for an external GPS device.
  • Output power is reduced from ~250mW to 100mW. The lower power level is still plenty to serve the needs with the perfect line of sight of the high altitude flights, and reduces board complexity by removing the external RF FET amplifiers featured on previous revisions.
  • Overall board size was again reduced.
Posted in Electronics, Ham Radio, Projects, Technology | Leave a comment