During my exchange to UPV (Polytechnic University of Valencia) I decided to learn how to implement a PID controller in C. I did this by making a simple temperature controller project using a PIC18f4520, simulated in Proteus ISIS 7 Professional.
The project shows two identical temperature controllers, both connected to a seven segment display to show the current temperature. The simulation starts at 20°C, with a desired temperature at 50°C. The temperature controllers consists of two heaters which can either be ON or OFF. The left one is turned ON when the temperature is < 50°C and turned OFF when the temperature is > 50°C. The right one is controlled by a PID with a PWM signal as output, running on 2 Hz.
The video will show that the left one reaches and exceeds the desired temperature, while the right, PID controlled heater will reach 50°C and stay put.
I started this project summer 2014 just for fun, and used pretty much what I had at home. The only thing i bought specifically for this was the XBee Series 2, ZigBee modules. The modules are configured as ZigBee Mesh, and can therefore forward messages between them if the transmitting node is out of range of the receiving node.
The “brain” of the system is a Raspberry Pi. Its purpose is to run a server for GUI, storing addresses and variables in a database and most importantly serve as a bridge between the WiFi and the ZigBee network. The Pi is connected directly to the router with an ethernet cable, and to an ATmega162 microcontroller via UART on the GPIO pins. The coordinator ZigBee module is then connected to the ATmega.
The end point nodes are connected to whatever microprocessors I had at home. To control the lights I broke apart some old 433 MHz radio receiver outlets and stuffed in an MSP430g2553 and the ZigBee module, along with some necessary electronics. The cabinet door is controlled by an ATmega48 connected to a servo along with the ZigBee module.
I built the helmet to wear on a costume party contest on Halloween 2013, and is because of this aesthetically damaged in the videos below. However, I won first prize and got myself a nice diploma, so it was totally worth it.
It was shortly after the party noticed on a major Swedish TV channel; TV4 (can be found here) in an interview with my good friend Sofie, about encouraging girls to apply for technical education. It can nowadays be found in a showcase at Linköping University.
The electronics consists of 256 LED soldered together to a 32×8 matrix, four 8-bit shift registers, an HC-05 Bluetooth module and an ATmega328 microcontroller. It was originally programmed with Arduino and later re-written in C.