Interacting with the MAX31855 Thermocouple Amplifier via Python

446 views
Skip to first unread message

raym...@gmail.com

unread,
Aug 1, 2013, 9:55:42 AM8/1/13
to beagl...@googlegroups.com
So after some frustration interacting with the MAX31855 Thermocouple on my BBB, I ended up repackaging the Adafruit Arduino MAX31855 library concepts into a simple python library for the BeagleBone Black.  The code and example can be found here -

https://github.com/onetinov/bbb_max31855

Note that this requires you to install the Adafruit provided GPIO library - https://github.com/adafruit/adafruit-beaglebone-io-python.  Also note that you need to run GPIO code as root to be able to read GPIO pins.  I am still working on how to get around this but it is hampered by the GPIO.setup() routine that creates new devices with new permissions at awkward times!

Apologies for the rather simplistic code, but I am curious for any feedback you may have.  There is an example file provided in the repository, but the basic gist is this -

~~~
import math
from max31855 import MAX31855

therm = MAX31855("GPIO1_15","GPIO1_14","GPIO0_27")
tempextF = therm.readFarenheit()
if math.isnan(tempextF):
   print "Error reading Thermocouple - %s" % therm.readError()
else:
   print "Current thermocouple temp = %.3f F" % tempextF

~~~

Nice and easy!  My WiFi enabled BBQ smoker termperature monitor is one step closer to completion :-)

Reply all
Reply to author
Forward
0 new messages