Thermostat controlling a valve by means of a stepper motor, based on the LPC1114FN28 ARM Cortex-M0 chip in DIP package

I have reused the board developed previously for a wireless lock with a stepper motor for a thermostat construction which turns a valve using the stepper motor. The whole project is open hardware and open source, you can download all necessary files here. The schematics in PDF is here and the KiCad design and gerber files are here. The temperature measurement is made here using the I2C sensor MCP9808 which is reasonably accurate for this purpose and on the board I had already an I2C extension connector, while other pins of the relatively few GPIOs available in the LPC1114FN28 package are saved for the rotational coder. Display is connected via I2C expander MCP23078. The thermostat can bi-directionally communicate with a server at 433.92MHz ASK, using rolling code encryption to prevent misuse. The source code is termostat.c in the following arm_lpc111x.tar.gz file, which contains all necessary files. Customization constants and encryption passwords are to be set in generic_keys.h and in termostat.c. Surprisingly large portion of the code is portable C copied verbatim from my previous Atmel AVR based thermostat code. Notice that the firmware uses EEPROM to store settings, which is an external component here (in contrast to AVR where it inside the MCU) and is thus not programmed during the flashing procedure. After flashing you have to communicate with the device using UART 115200 baud and issue the command "Defaults", which will initialize the EEPROM. Also note in the code that I am using reset-persistent RAM (cf. section .persistent in the ld script) to store some settings and the device thus needs a power cycle for cold reset.

Here are some photos showing the mechanical design - not nicest but perfectly functional




The motor is from www.microcon.cz type SX24-2341D (4Nm) with dual axis (on outter side is a knob for backup manual operation), on inner side it has a coupling (www.huco.com) from 8mm axis to 15mm, where a 3D-printed adapter to the square profile of the valve shaft is inserted.









Introduction to LPC1114


Another project which uses LPC1114 to control a stepper motor


A thermostat based on AVR ATmega chip


My Electronics page


My hobby page


My main page with e-mail contact


TOP of my family pages