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!]

26 thoughts on “Temperature Controller Gets Open Source Firmware Upgrade

  1. 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.

    1. 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. 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.

        1. You typically use a voltage divider for thermistors, feed that to an A/D and calculate for temperature. You might be able to find one for the high temperature.

          A thermal couple such as a type K with a signal conditioner e.g. AD594/5 or discrete circuit would give you an analog voltage to an A/D (or use one with a digital interface.)

          http://www.linear.com/solutions/1432 Discrete Type K signal analog conditioning.

          1. Sure, but the glass ones are a pain, too easy to break vs the usual beaded ones. Availability isn’t the best either.

            Probably ok for an oven, though.

  3. 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…

    1. 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…

    1. 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.

  4. 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

  5. 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 to matsCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.