Temperature Controller Gets Open Source Firmware Upgrade

stc1000

Beer lovers rejoice! [Mats] has reverse engineered a temperature controller and written new open source firmware for it. This effectively gives all us homebrewers a low cost, open source software driven controller. The STC-1000 is a cheap (under $20 USD) temperature controller mass-produced in the far east. The controllers do work, but have several limitations. The programming options are somewhat limited to basic set points for heat and cool. The controller also is only programmed for temperature display in Celsius, which is a bit of an annoyance for those of us who think in Fahrenheit. Under the hood, the STC-1000 utilizes a Microchip PIC16F1828 microcontroller. Unfortunately the PIC’s protection bits were set, so the original code would have been extremely difficult to extract. Not a problem, as [Mats] reverse engineered the hardware and wrote his own firmware. A 10k NTC thermister acts as the temperature probe. The probe is read by the PIC’s ADC. These probes are not very linear, so a look up table is used to convert from volts to degrees Celsius or Fahrenheit.

[Mats] new firmware allows for up to 6 profiles. Each profile has up to 10 set points and a time duration to hold each of the set points. Hysteresis and temperature offset values are also programmable via the front panel. PIC software is often written in C using Microchip’s MPLAB tool chain, and programmed with the PICkit 3 In Circuit Serial Programming (ICSP) tool. [Mats] decided to buck the system and wrote his C code using Small Device C Compiler. To keep things simple for homebrewers who may not have Microchip tools, [Mats] used an Arduino Uno for flashing duties. Thankfully the unholy matrimony of a PIC and an AVR has not yet caused a rift in time and space. The firmware is still very much in the beta stage, so if you want to help out, join the discussion on the homebrew talk forum. If you see [Mats] tell him we owe him a Haduino which he can use to almost open his beer.

[Thanks for the tip Parker!]

Comments

  1. Avel says:

    http://www.amazon.com/Docooler-Temperature-Controller-Thermocouple-Fahrenheit/dp/B00F05UI8O/

    Already displays in Fahrenheit, has an adjustable range for temperature spread, also has a timer for refrigerator compressor thingies. Oh and a calibration feature. Will work off a 7.4v (2S) battery if you bypass the transformer and power directly after the rectifier. BUT only has one relay. I should of bought more than two. Using for activating a heat pad and another for activating a fan in an RC vehicle.

    • Avel says:

      Oops,I meant to just leave a link, not have this picture show up and stuff. Delete if needed, sorry.

    • mats says:

      Since I’m swedish, the reason I’m doing this is to have profiles, as we use Celsius scale. Fahrenheit I added just because I can and it seems to be a feature quite a few ppl want.
      So, yeah, that controller is a single stage, single setpoint termostat, that does do Fahrenheit… That is further from what I want, not closer.

  2. Rainer Presssaft says:

    Only three of almost 200 countries in the world left which didn’t adopt the superior SI unit system, still causing troubles for all the others … :-/

  3. Json says:

    Now that’s an awesome hack, +1

  4. mats says:

    Awesome!!! I made hackaday :) that is way cool!

  5. bitshuffler says:

    This would also allow the controller hardware to be used for tasks more complicated than maintaining a fixed temperature eg. a reflow oven’s profile with soak times etc.

  6. Colin Bennett says:

    Way to go for using SDCC instead of taking the easy but proprietary route of using the Microchip Dev tools!

    If PIC was better supported by open source tools I would probably actually use it again. As it stands I may never use anything other than ARM again…

    • Mats says:

      Thanks! Yeah, I really wanted to use free tools if possible.
      I never coded for PIC’s before and I got to say that it has been a somewhat frustrating experience. SDCC and GPUTILS are ok in my book, but the PIC itself is weird to me…

  7. Septillion says:

    What kind of feedback loop is used to maintain a constant temperature? Can you set, or even better, calculate system parameters?

    • Mats says:

      Simple thermostat control only. This should be good enough for fermenting beer, as the thermal mass is large, and some temperature swing is tolerable. You can set the hysteresis, heating and cooling delay (minimum off time).
      More advanced control schemes could be implemented, but the hardware imposes serious limitations. As it is, my firmware pretty much use up most resources, so for this project, thermostat control it is.

  8. PH says:

    A firmware that implements a PID controller (for a HERMS system, maybe) would be very cool!

  9. Mats says:

    Version 1.00 is now released.

  10. John says:

    Mats,

    Thanks so much for the firmware hack! I have a question: can the firmware be modified to handle temperatures higher than 99.9 ^ C? This will be very useful for using a temperature probe that can measure higher temperatures, so that this PID controller can be used not only for brewing applications, but also other applications that requires controlling temperatures higher than 99.9 ^C.

    Again, thank you so much for the great work!

    John

  11. Andy says:

    In the Github Manual it is stated

    “You will need the following equipment:
    ● An STC1000 (with the correct hardware revision, A400_P)”

    How to know when ordering an STC1000 that it is the right one?

    I am after 4 units in Romania and need them fast but cannot fund any locally, anyone know a source in EU.
    Cheers

    Andy

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

Follow

Get every new post delivered to your Inbox.

Join 94,054 other followers