A Digital Compass for the Original Tablet (2)

compass-adafruitBContinued from page one of compass article …

A while ago, I put a barometric pressure and temperature sensor into the Pi2 powered “homemade” tablet, and now I’ve decided that the original (Ordoid C1 powered tablet) should have one too.  As the only open space remaining  inside the enclosure was on the “ceiling” and walls of same, I mounted the BMP-180 board on one of the walls.  Because I was using female-ended header wires to connect the sensors to the 40 pin GPIO header on the C1, and had already used i2c bus #1 for the compass, I used the second i2c bus on the original tablet for the barometric pressure board (the Odroid C1 has multiple i2c busses).  The pin-to-pin connections are made a little differently in order to access the second i2c bus on the OdroidC1:

Odroid/C1 –  BMP 180 Barometric
  • Pin 27 —-  SDA — may need ~1.8k – 4.7k ohm pull-up to Vin (see text)
  • Pin 28 —-  SCL — may need ~1.8k – 4.7k ohm pull-up to Vin (see text)
  • Pin 1  —- Vin
  • Pin25 —- Gnd

Note: Odroid pins are on the left, pressure/temp sensor pins on the right. Also note that SDA and SCL may need pullups (something like 1.8k – 4.7 kohms) to Vin/Vcc

The Odroid documentation that I’ve managed to find is not clear (at least to me) about what value the internal pull-up resistors may be for  SCL and SDA, or it they exist.  So, I’ve tried the BMP-180 with and without pull-ups from SCL to Vin, and from SDA to Vin, and it works equally well either way (seemingly).  This seems to say that there are internal pull-ups, but it would be wise to check on this (somehow). A look at the Odroid schematic at hardkernel didn’t reveal the answer to me.

For a discussion of values for pull-ups on an I2C bus, see:


(Note that it’s just the previous page of this article)

For pins 1 and 25 on the Odroid (3.3 VDC and GND) – I put a series of pins, pulled from a male header strip, into a small PCB and strung the respective connections together, and tied them to the appropriate pins (1 or 25) on the Odroid’s 40 pin GPIO connector, so to make a nice power bus with multiple Vcc and GND pins for connection to all of the sensors with female-ended headers.  These could be soldered, of course, and in a permanent project they probably would be.  But, the conductive gel/glue holds them pretty tightly for my purposes, and I can switch things around easily, if I need to do that.

I could have used the first i2c bus for both sensors, implementing a male pin terminal for the multiple i2c sda/sclk connections on the same PCB that I used for the power connections, but I chose the easy plug’n’play header wire route.  Probably being a little lazy there.

Here’s a link to the Pi2 powered tablet’s barometric pressure installation:


The software on the Odroid is exactly the same as on the Pi2 for the barometric pressure sensor, if using Python, with one small change when using the second bus instead of the first i2c bus.  The software defaults to the first i2c bus in the sample program for the BMP 180, so this line in simpletest.py is replaced:

sensor = BMP085.BMP085()

by this line:

sensor = BMP085.BMP085(busnum=2)

Note that the BMP 180 works with the code that references the slightly older 085 model of the barometric pressure board. The Python library and the associated simpletest.py example program code is at:


The temperature/pressure sensors have a legitimate use for some day, but in the meantime, they are valuable for monitoring the heat inside of the various enclosures I’m using for “homemade” tablets.  I like to keep tabs on the temperature because of the sensitivity of LCD monitors to heat. LCD crystals can lose orientation (resulting in a type of “screen burn,” pun intended).  Most manufacturers recommend a top limit of around 100 degrees, while some specify a lower and some recommend a higher upper temperature limit.  In my own case, I put a fan into an enclosure if the temperature might exceed about 95 degress Fahrenheit, and run it often enough to suppress further increases.

How this might affect an LCD operated in direct sunlight I don’t know.  I suspect that there is some margin in the specs, and I’ve never seen obvious damage to LCD monitors exposed to filtered sunlight, for not-so-enormous periods of time.

The problem with the temperature sensor is that, when it’s located inside the enclosure, it will only register the ambient temperature outside of the box for a few minutes, then it will register a higher temperature. This depends upon how quickly the internal circuitry generated heat builds up past the ambient.  I’m not sure how to fix that problem, other than using some type of external “probe”.  It occured to me that I could disguise an old, longish WiFi antenna as the probe!

If anyone knows of a good source of low-current, high cfpm fans, let me know. The ones I currently have access to are 80 mA, and that’s a catch twenty two situation because the additional draw adds to the heat dissipation that the device is trying to accomplish.

To be continued …

Note: the author does not have a recent, applicable background in circuit building, or battery related issues, so this is presented as the work of a hobbyist, and is not meant for duplication by others. Readers should look elsewhere for design advice and info.

Note: The Odroid site is http://www.hardkernel.com and is not affiliated with this site in any way.  The Adafruit product #1120 Compass is available at adafruit.com.  Imedion (PowerEx)  NiMH batteries are made by Maha, and are available from various online retailers. None of the mentioned companies has any relationship to this author or website. 

The Raspberry Pi2 is a product of the Raspberry Pi Foundation. “Raspberry Pi” is a trademark of the Raspberry Pi Foundation. All trademarks and copyrights are owned by the respective companies.

Imedion and PowerEx are trademarks of Maha Energy Corp.  This author and site has no affiliation with them.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s