TeensyPi Networked Temperature Controller

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I didn't look at the library for that chip, but I'm sure that the setup would be similar.

Yes, it seems to be similar, MAX31855 is a newer version of MAX6675 (but not a drop in replacement) and they both communicate over SPI. http://playground.arduino.cc/Main/MAX6675Library here is the lib if you are interested to look at it. It's very simple, and includes examples for single and multiple chips. They say that MAX6675 is discontinued, but there's a whole bunch of them on ebay, and they are less expensive than MAX31855.
 
Here are the I2C RGB LCD boards that I designed:
LCD_Cards.png


The upper board is the current iteration.

They are compatible with the Adafruit I2C RGB LCD boards, but can also be expanded to include up to eight of the LCDs on the I2C bus.

The software I've written will support either the RGB LCDs or the standard HD44780 LCD.

More info at my web site.

:ban:



What are the power selector and switch jumpers called. Looked for them at Radio Shack and Mouser.com but no luck so I suspect I just don't know what to ask for.
 
What are the power selector and switch jumpers called. Looked for them at Radio Shack and Mouser.com but no luck so I suspect I just don't know what to ask for.

I've seen them called jumpers or shorting blocks.

If you have no plans to change the address or power selection you can also just solder in a jumper instead of using the posts.
 
I've seen them called jumpers or shorting blocks.

If you have no plans to change the address or power selection you can also just solder in a jumper instead of using the posts.


So are the posts just header pins, like the header pin strip at the top of the board/picture? I'm assuming, if I am using the TeensyPi software as is, that I would need to change the address if I wanted to use more than one LCD at a time, correct?

BTW, my switchboards are in/populate and seem to be working great! LCD boards are in and the Adafruit LCD/chip should be here Friday. I'll have extras of the LCD boards if anyone is interested.
 
So are the posts just header pins, like the header pin strip at the top of the board/picture? I'm assuming, if I am using the TeensyPi software as is, that I would need to change the address if I wanted to use more than one LCD at a time, correct?

BTW, my switchboards are in/populate and seem to be working great! LCD boards are in and the Adafruit LCD/chip should be here Friday. I'll have extras of the LCD boards if anyone is interested.

The group marked "switches" are inputs to the MCP23017 that the Adafruit Python library can use. My C code program does not interrogate them.

The address pins are used to set the I2C address for the board. The default address is 0x27 if no pins are jumpered. You can set the address from 0x20 to 0x27 by jumpering the appropriate pins. For instance, if you jumper just A0 the address would be 0x26, if you jumper A0 and A1 the address would be 0x24, etc.
 
Great work here, and at your TeensiPi website! Most of your boards have been labeled with the components, bu do you have a list of components for the Adafruit Pi plate replacement board you created? Thanks.
 
Great work here, and at your TeensiPi website! Most of your boards have been labeled with the components, bu do you have a list of components for the Adafruit Pi plate replacement board you created? Thanks.

Are you talking about this one?

The resistors are all 4k7 1/8watt, the caps are 10uf, and the regulator is a LM117-3v3.

That board was about 3 iterations back. The newest one I just got uses 3v3 to 5v level-shifter circuits that remove the need for the 3v3 regulator. I haven't populated and tested it yet, but when I do, I'll post it here and at my site.
 
Yes, That's the one. What is the advantage of using 3v3 to 5v level-shifter circuits rather than the 3v3 regulator? I am waiting for that board to arrive to start playing, rather than soldering wires on to the Adafruit Pi Plate board.
 
Yes, That's the one. What is the advantage of using 3v3 to 5v level-shifter circuits rather than the 3v3 regulator? I am waiting for that board to arrive to start playing, rather than soldering wires on to the Adafruit Pi Plate board.

The 3v3 signal lines work just fine if the mini-lan is relatively short and configured properly.

I've tested the mini-lan in non-ideal configurations such as extremely long lines (> 100 meters), and mixed topologies (instead of a daisy-chain, I've tested a star configuration and a hybid of daisy-chain and star, with varying line lengths on the stubs of both the daisy-chain and star), and found that as the "weight" of the mini-lan increases, reflections on the 3v3 line can cause problems. This is mediated somewhat by using the level-shifter and driving the mini-lan at 5v.

It's also one less wire in the cabling.
 
Another noobie questions Jimmayhugh:

Does the LCD board connect to the IC2 of the Teensy or the RPI? I expected they would be the same but my TeensyPi board has terminal blocks for both. I'm guessing RPI as I think you mentioned previously that the RPI is managing the data communications while the Teensy is controlling the actions. I haven't found the specific code that tells the LCD what to display; where should I look?
 
Another noobie questions Jimmayhugh:

Does the LCD board connect to the IC2 of the Teensy or the RPI? I expected they would be the same but my TeensyPi board has terminal blocks for both. I'm guessing RPI as I think you mentioned previously that the RPI is managing the data communications while the Teensy is controlling the actions. I haven't found the specific code that tells the LCD what to display; where should I look?

The LCD board(s) are connected to the RPi I2C terminals. The program that controls the LCD board(s) is the compiled program i2c_lcd located at /var/www/htdocs in the latest RPi image (Version 0.0.19 - 04/07/2013), while the c code and compiler script are at /home/teensypi/i2c_lcd/. It uses the WiringPi library, which is also installed.

The i2c_lcd program is in turn started and stopped when an action set is enabled with a LCD selection.

You can also test for the board(s) using i2cdetect.
 
jimmayhugh said:
The LCD board(s) are connected to the RPi I2C terminals. The program that controls the LCD board(s) is the compiled program i2c_lcd located at /var/www/htdocs in the latest RPi image (Version 0.0.19 - 04/07/2013), while the c code and compiler script are at /home/teensypi/i2c_lcd/. It uses the WiringPi library, which is also installed.

The i2c_lcd program is in turn started and stopped when an action set is enabled with a LCD selection.

You can also test for the board(s) using i2cdetect.

That helped. I updated the image and then downloaded the WiringPi Library and it lit right up and displayed action status. I populated all the resistors but wondering now if I need the two you omitted given I'm using your TeensyPi board. It works with them...
 
That helped. I updated the image and then downloaded the WiringPi Library and it lit right up and displayed action status. I populated all the resistors but wondering now if I need the two you omitted given I'm using your TeensyPi board. It works with them...

The missing resistors are the pullups for the I2C lines, and only one set is required. If you plan on using more than one LCD board on your system, leave the resistors off of any future boards.
 
So one and only one of the LCD boards attached the Teensypi at any given time should have the two resistors installed; got it! The LCD is reporting action status fine. Doesn't appear that the software is capable of reporting PID status, correct? I don't see an option to tie PID status to an LCD and setting up a parallel Action will report the temp probe but not the PID switch actions or the setpoint.
 
This is my latest version of the TeensyPi main board. This version does away with the need for a separate 3V3 regulator and 3V3 cable:

TeensyPi-V5.png


The 1-Wire mini-lan and both I2C channels are now buffered with level shifters that convert the 3V3 signals from the Teensy 3.0 and RPi to 5V signals to the outside world and vice-versa. The level shifters are comprised of BS170 N-Channel MOSFETS and 10K resistors. Each signal channel is designed per this diagram:

LevelShifter.png


There are 10 - BS170 and 10 - 10k resistors on the board. I went with this design to eliminate the separate 3V3 regulator and additional cable line required in my previous design. The added feature is that it provides better resistance to noise and reflections on a heavily-loaded or non-optimal 1-Wire mini-lan.

This board is compatible with all of the other 1-Wire and I2C boards by simply jumpering the 5V and 3V3 terminal block on the boards.

The Eagle and Gerber files are available on my github account.
 
Doesn't appear that the software is capable of reporting PID status, correct? I don't see an option to tie PID status to an LCD and setting up a parallel Action will report the temp probe but not the PID switch actions or the setpoint.

That's correct. It's doable, I just need to add a few tables and rows to the MySQL database, modify the PID setup and display pages, and re-write the LCD daemon. Right now I'm futzing with the thermocouple hardware/software. The next board will not be a shield, that is it won't sit on top of the RPi. I needed more room to add 4 thermocouples, so I have to spring for a Hobbyist version of EAGLE. I'm also trying to decide if it's more cost-effective to put the SMD parts directly on the board, or use a breakout board similar to the Adafruit board.
 
Jim,

Ive been following your project and really love what you have accomplished so far...

only features missing for me is a way to send a email if the parameters are above or below the set threshold so it can be dealt with if im not at home to keep a eye on the webpage.

other one is a way to deal with a power outage at my house. i have a APC UPS that will drive the rpi and assorted sensors... and to have it send a email to my phone so im aware of the power outage.

whats the chance of adding these options to the webpage? and to the underlying OS.

of note. Ive been around Unix OS's for long time. ever since the days of SunOS 4.0.x and Solaris 2.1 and FreeBSD 2.x and Linux 0.x... i have VERY little experience with embedded.
 
Jim,

Ive been following your project and really love what you have accomplished so far...

only features missing for me is a way to send a email if the parameters are above or below the set threshold so it can be dealt with if im not at home to keep a eye on the webpage.

other one is a way to deal with a power outage at my house. i have a APC UPS that will drive the rpi and assorted sensors... and to have it send a email to my phone so im aware of the power outage.

whats the chance of adding these options to the webpage? and to the underlying OS.

of note. Ive been around Unix OS's for long time. ever since the days of SunOS 4.0.x and Solaris 2.1 and FreeBSD 2.x and Linux 0.x... i have VERY little experience with embedded.

The OS on the RPi is basically Debian Linux that's been optimized and compiled for the RPi CPU. Otherwise it's a standard linux, with most of the linux packages available from the appropriate repository.

It should be a relatively trivial operation to add a mail handler, and the code in /var/www/htdocs/updateActionStatusWithMySQL.php or
/var/www/htdocs/updateStatus.php should provide some ideas about where to set the trip points for the e-mail.

Hope this helps.
 
I've been playing with thermocouples and how to use them with the TeensyPi.

So far I have two approaches:

1) The first approach uses the Maxim MAX31855K thermocouple chip. Right now I'm using an Adafruit MAX31855 breakout board and a modified version of their library for this test, but a board with up to 4 devices is designed. This is a fairly easy chip to interface, since you simply interrogate the chip and it gives you the temperature. The drawbacks include:
A: It uses SPI to communicate, so there are many additional chip select ouputs to connect if you want to use more than one.

B: SPI communications are limited to fairly short ( < 2M) lengths.

C: It's designed specifically for K-type thermocouples, so if you are using a different thermocouple, you're out of luck.

D: Read times can take up to 32ms to complete, and requires the Teensy 3.0's compete attention while reading. This can result in loss of serial communication between the Teensy 3.0 and RPi during that time, which can cause the status display to hiccup.​

2) The other approach uses a Maxim DS2762 to read the Seebeck Voltage at the thermocouple junction. The DS2762 also has an integral thermoneter that can be used as the cold junction reference.

The advantages of this approach are:
A: Since this is a 1-Wire device, it can be placed on the same 1-wire mini-lan as the rest of the TeensyPi devices.

B: It can be used at much greater distances.

C: Multiple devices can be placed on the mini-lan.

D: With the proper table (more about this in a minute) any thermocouple can be used.

Disadvantages:
A: In order to get reasonably accurate readings, especially at temperatures approaching 0 degrees C, the calculations must be done via forward and reverse lookups of a table of Seebeck Voltages vs Temperature.

This table would vary based on the thermocouple used, and, depending on the range needed, take up a LARGE amount of code space, on the order of kilobytes per table.​

The main advantage to using thermocouples is the much wider temperature range available of thermocouple vs the DS18B20.

The other disadvantage to both devices is that the devices are only available as surface mount devices (SMD), so building or adding the devices yourself would be problematic without better than average soldering tools and abilities.

So, with all that said, the question becomes: Is there sufficient interest in this endeavor for me to continue investigating the possibilty of using either of these devices?
 
Jimmy, have you looked at the Linear LTC2495 ?, it offers the same capabilities with 16 channels and I2C IO. It includes an on board temp sensor for cold junction, programmable gains, and addressing for multiple units. It looks like a bit of math is needed to convert thermocouple raw values to a real world temperature values.
 
kladue said:
Jimmy, have you looked at the Linear LTC2495 ?, it offers the same capabilities with 16 channels and I2C IO. It includes an on board temp sensor for cold junction, programmable gains, and addressing for multiple units. It looks like a bit of math is needed to convert thermocouple raw values to a real world temperature values.

The biggest problem I see with that part is that the 38-pin QFN package is definitely not DIY-friendly.
 
Try the 4 channel LTC2487 with a 14 pin DFN package, and a board from these folks http://www.epboard.com/eproducts/protoadapter.htm#DFNtoDIPAdapter, the 14 pin DFN to DIP with .5mm pitch. If soldering is a challenge you can send the IC to them and get a finished board back. The DIP layout will let you use a breadboard to attach wiring for testing or direct wire to DIP connections.
 
...The main advantage to using thermocouples is the much wider temperature range available of thermocouple vs the DS18B20...

I don't really understand how in the application this would be applied to on here (temps generally from 0-100°C) a thermocouples range would be an advantage over the DS18B20?
 
I don't really understand how in the application this would be applied to on here (temps generally from 0-100°C) a thermocouples range would be an advantage over the DS18B20?

According to maxim, the standard sensor has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C. I think the advantage of adding a thermocouple would be accuracy for brewing applications where it gets above 85c. Ie brew day.

Jimmy's system could handle a brew from grain to glass.
 
I don't really understand how in the application this would be applied to on here (temps generally from 0-100°C) a thermocouples range would be an advantage over the DS18B20?

Others have expressed an interest in using the TeensyPi for other than brewing applications, like smoking meats, which requires a wider temperature range.
 
According to maxim, the standard sensor has an operating temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C. I think the advantage of adding a thermocouple would be accuracy for brewing applications where it gets above 85c. Ie brew day.

Jimmy's system could handle a brew from grain to glass.

I looked up some specs, it looks like K-type TC have an accuracy of +/- 1.1°C, the DS1820 is +/- 2°C over 85°C but do we need accuracy above this since this region really only occurs getting up to boil / cooling back down. Most of the temperature control is needed under 85°C

Others have expressed an interest in using the TeensyPi for other than brewing applications, like smoking meats, which requires a wider temperature range.

Thought that might be it (sorry I don't know if it was mentioned before but at close to 400 posts it would take some time to find out :)), seemed like a whole lot of hassle with extra conversion chips to deal with the TC if it was just for brewing.
But of course if electronics is another hobby it really isn't a hassle.
 
So, with all that said, the question becomes: Is there sufficient interest in this endeavor for me to continue investigating the possibilty of using either of these devices?

I'm interested in the 1-wire option/application but have to admit that the smoker application is a lower priority for me until I finish a brew controller (which at my current rate means at least another 4-6 months). The ability to use the Teensypi for fermentation/keezer/brewing/smoking as an all-in-one device is intriguing though!
 
Jimmayhugh, I also have to say that finishing the teensypi for brewing purposes is what I have been working on for a few months now. I have taken alot of ideas from the various DIY forums here, most notably forums on weldless builds, building detachable ss probes, the electric brewery site, and of course this forum and the teensypi website. I have the stand built from superstrut, the gas manifold is attached, and have the teensypi built. I would like to do smoking also, but I hope to continue following your excellent work to make this dream of mine a reality.
 
I've received the boards for the thermocouple sensor / switch combo board, and have put together three units for testing.

So far, it seems that the DS2762 may be suitable as a thermocouple sensor on a 1-wire mini-lan with a few caveats:

  1. The choice of a thermocouple seems to make a difference. I've got 3 thermocouples from different sources, and the locally sourced thermocouples seem to be more reliable. One "stainless" model that I sourced from china on eBay has already developed a fine reddish patina after a day in my local water.
  2. Since we are dealing with measuring microvolt levels, induced noise is a problem. My first generation boards seem to fluctuate more than I like, so I'm doing a second generation thermocouple-only board that will include a substantial ground plane for shielding. More on that in a later post.
  3. My current software only measures down to 0 degrees C (32 degrees F). This may change in a later iteration. The values are also displayed in full degrees to conserve space.
  4. The DS2762 is only available as an SOIC-16 Surface Mount Device (SMD), so more care and better soldering equipment is necessary if assembling the board yourself. There are numerous excellent videos and webpages that outline the techniques and skills required, so I'll not repeat that here.

When I'm satisfied with the design, I'll release the Eagle files and updated software.

More as things develop.
 
Maxim just announced the MAX31850 1-wire thermocouple converter. More on this after I get some samples.

UPDATE: There's currently a 17-week lead time on purchases from distributors, so it may be a while before this becomes a valid option.
 
Maxim just announced the MAX31850 1-wire thermocouple converter. More on this after I get some samples.

UPDATE: There's currently a 17-week lead time on purchases from distributors, so it may be a while before this becomes a valid option.

Just what the doctor ordered; sounds like it will be worth the wait!
 
Jim great work! I just got mine up and running and was wondering if there is a easy way to change the temp to be displayed in Celsius?
 
Jim great work! I just got mine up and running and was wondering if there is a easy way to change the temp to be displayed in Celsius?

There's a boolean value "showCelcius" ( yeah, I know, spelling :p ) that can be set to "TRUE" , and then re-compile the Teensy 3.0 code, and the temp values should be set to Celsius.

I can also add code that would allow the values to be changed by the GUI, but that would be in a later release.
 
Hey Jim...been following this since day 1 and really like what's been going on so please don't take this next statement the wrong way....I'm a bit lost as to why or what you're looking for in the pursuit of new boards, hardware, and or ways to get to the end of this project if there is one....so please bring me up to date as I'm curious as to where it's going....will follow you to the end if my time and resources can hold out....again just an awesome project and one that I hope to finish...sincere regards
 
Thanks Jim it worked, a possibility to change it via the GUI would be nice to have even though changing the Teensy 3.0 code, recompiling and uploading took less than a minute :)

Any plans for RTD (PT100) sensor support in the near future?
 
Back
Top