Raspberry Pi A+

One of the great things about the Raspberry Pi Foundation is you never know what they are going to do next. In November 2014, they released a + version of the Model A. It has the extended GPIO pins (40) of its big sister the B+. It is also smaller than any other Pi at 65mm in length.

In order to shrink the footprint, the A+ has no Ethernet port, a single USB port, and 256MB of SDRAM. This not only reduces the physical size of the device, but also the amount of power it consumes. I recently purchased an A+ with the very cool Pibow Royale enclosure. What a beautiful combination of high tech and art.

Raspberry Pi A+

Raspberry Pi A+ with Pibow Royale enclosure (Photo courtesy Adafruit Industries on Flickr)

I am sure many folks are wondering why bother with a a Pi that is so… ‘legacy.’ For me, this is exactly what I was looking for. Small, simple, lightweight, and capable. Trying to jam the original Pi’s into security camera enclosures has been a headache for me. Not anymore.

Also, the low power requirements of the A+ make it much easier to power the device for long periods of time using batteries or solar power.

The folks at the Raspberry Pi Foundation are not only mad scientists – but geniuses as well. Tip of the hat to you all.

Stay tuned for some of the great projects I plan for this fantastic Pi.

Sopwith

Tracking Airplanes on a Raspberry PI

One of the great things about living in London is the fact glossy Linux magazines are so cheap. These magazines are published in the UK and sell in stores for about 6 Quid. The same magazine in the US is $15+ due to the exchange rate and shipping costs. I buy one every chance I get.

I came across a very interesting article in the December 2014 issue of Linux Magazine titled, “Plane Spotting.” Written by Charly Kuhnast, the one-page article describes how to use a USB DVB-T device to capture airplane traffic and plot it on a Google map. What a cool idea! Ol’ Sopwith decided to purchase a DVB-T and see if it would work on the Raspberry Pi.

Continue reading

Python3 vs Python2 – Playing nice

Like many of my fellow smoke-makers, ol’ Sopwith has been very reluctant to adopt Python3. In my view, Python2.7 is the most stable and flexible version of Python ever released. It is hard to believe the first version of Python3 was released in 2008. Folks – that was six years ago! The time has come to move to Python3.

In my recent work with the AM2315 humidity sensor, I was forced to use Python3 because the quick2wire library I use only runs in the Python3 environment. So, I wrote a Python3 class that wraps the capabilities of the AM2315 sensor.

A couple of important points about Python3. First, installing Python3 on your computer does nothing to your existing Python2.x installation. Python3 is installed in a completely separate location and runs in a separate environment. This means it is very easy to have both version on your system. If you install Python3 on Windows, it will become the default Python version. You can still use Python2.x but you will have to ensure its PATH is set correctly. On Linux you run your Python3 scripts using python3 from the command prompt.

Second, there are a few things in Python3 that you must understand up front. The biggest gotcha for most people is that the print statement is now a function (print()). This is a very good thing although it may take you some time to internalize this change. Also, all ambiguities about Unicode are gone in Python3. This is a big change. You must now think of strings as ‘text’ and all other data as ‘bytes.’ This is truly ‘elegant’ as they say. Once you understand how this works it makes much more sense.

Sopwith recommends that you write all new Python code in Python3. Whether you want to port your old code to Python3 is up to you.

Continue reading

Revisiting the AM2315 Humidity Sensor

NOTE: This content of this page is no longer relevant. Please go here for the latest AM2315 implementation “How-To.”

——————————————————————————————————————–

I was quite surprised by the number of comments and emails I received about the AM2315 humidity sensor. This confirms two things. First, it appears this sensor is quite popular. Based on my experimentation with the device, it is also quite accurate. Secondly, there are a lot of folks hacking this sensor but struggling with the am2315-python-api code.

It was really great of Joehrg Ehrsam to publish the code and make it available to all of us. Unfortunately, the code is poorly formatted and not commented. Also, the code has some timing issues that can result in bogus data. If you look at the below screenshot you can see the sensor is sending garbage.

image001

The AM2315 datasheet warns about this:

“Send read/write command, the host must wait at least 1.5ms, and then send a read sequence, to read back the data…” (pg15).

Failure to get this timing right means you can get inaccurate data from the sensor. I have written Joehrg twice and did not receive a response. So, I decided to write a new Python class to read the sensor data accurately. You can download the code here:

 

Be sure to read the README.txt file and I suggest you run the test_aosong_am2315.py script to be sure the sensor is wired correctly.

Sopwith

 

Hacking the AM2315 Humidity Sensor

NOTE: This content of this page is no longer relevant. Please go here for the latest AM2315 implementation “How-To.”

——————————————————————————————————————–

I recently discovered the AOSONG AM2315 humidity/temperature sensor and was quite intrigued. This is a very accurate and affordable device that is a nice addition to a current project. Supposedly, this device is i2c compliant, so I figured it would be easy to talk to. Little did I know….

After hacking around for a couple of long days I was able to get the device working on my breadboard with a Pi Cobbler. Google and forum searches determined there are a lot of people struggling to get the device to work.

So, Sopwith decided to write-up his adventure with the AM2315 and provide a very detailed step-by-step guide with screenshots.

I hope this helps save my fellow smoke-breathers some time and frustration.

Sopwith