This is a little project I have been working on. It is a power thermostat. Essentially it reads the ambient temperature and switches a relay on or off according to that temperature. The brief is fairly simple but I hope to use it in practice initially to control the temperature in a cupboard where I am brewing my own beer.
The project is based around an Atmel ATTiny85 micocontroller. I chose this because it is small and more than capable. Additionally I had a few spare lying around. The ATTiny reads the temperature from a onewire Dallas DS18B20 temperature sensor. (See my earlier post on interfacing one of these with an arduino.)
There are two switches for updating the temperature set level. One to adjust the temparature up and the other to adjust the temperature down. These will be in 1 degree steps but there is no reason why these steps cannot be programmed into the ATTiny at greater or smaller intervals.
A small OLED screen has been added. This will provide user feedback and display the set temperature and the current temperature.
For my requirements, when the ambient temperature reaches the set temperature it will switch off the relay thus providing no more heat. As the ambient temperature then cools down once it drops below the set temperature the relay will switch back on again. To avoid continual switching on and off I will have a 1 degree margin either side of my set temperature.
For troubleshooting I have also included an icsp header. This will allow me to program and re-program the ATTiny85 without the need to keep removing it from the board.
I intend to package all up in one small unit that includes the power supply, low level circuitry, relay and screen. With a simple in and out mains power connector so that it can be plugged in line to a domestic heater.
The schematic can be seen below.
I am by no means an expert in board layout. I am sure I have broken many rules in my layout below. Please do not take a leaf out of my book on this one. As you can see, the transformer is on the left. The recitfication and smoothing circuits are in the middle. The headers and connectors are at the top right and the ATTiny is bottom right. The pull up resistors are filling up spaces. I have added super thick traces for the mains 220v connection to the transformer. All low level voltage is over to the right of the board. There are a few surface mount components. I have never soldered surface mount before, but figured now is the time to have a go. I think I’ll be ok for the three components, i.e. 2 large caps and the bridge rectifier. Any suggestions on board layout improvements are more than welcome.
The next thing to do was to find a board manufacturer. I looked for a long time to find a good priced one for hobbyists, and the best deal I could find was seeedstudio.com They are in China but are so well know that they even have there own export function in Eagle schematic, which is the program that I used to design the circuit. They are also very competitively priced. I could not find anywhhere outside China that comes close to competing with them. The ordering porcess was simple and it cost £10 for 10 boards including delivery. I chose red ones and added some additional screen printing. The ordering process was very straightforward as Eagle exported the required gerber files. These were then attached to the seeed order and payment was made. Within a week I recieved confirmation that the boards were completed, along with a photo. I am now awaiting for them to arrive.
The boards arrived within 4 weeks. Which was also delayed by a week as the whole of China had literally shutdown at the start of the covid-19 outbreak. The quality is exactly what you should expect from a board manufacturer.