Fuzzy-Logic Temperature Control for a Digital Viscometer (Peltier power stage)

Electronics and control for a semi-automatic digital viscometer built for a university fluid mechanics laboratory. The instrument measures viscosity by the falling-ball method (Stokes law) while holding the fluid at a controlled temperature. MY CONTRIBUTION This was a team project. I was responsible for the wiring diagram, the fuzzy-logic temperature control and the power stage. TEMPERATURE CONTROL Fuzzy-logic controller running on an ATmega328P, driving Peltier cells through PWM. Temperature is read with a MAX31865 RTD front-end rather than a thermistor, because the measurement needed to be trustworthy enough to publish a viscosity curve against it. Reversing relays flip the Peltier polarity so the same stage can heat or cool. POWER STAGE - THREE ITERATIONS The first version used an H-bridge with 4 N-channel MOSFETs and one device overheated. The second, with 2 N-channel and 2 P-channel devices, burned current traces. The version in the images is the third: reversing relays for direction, plus an independent channel per Peltier cell, each with a 2N3904 driver and an IRF244N MOSFET for PWM regulation. Optocouplers isolate the control side from the power side. HMI Physical interface with an LCD and a matrix keypad to set the target temperature and start a test, plus SD logging. A second board handles the falling-ball detection. RESULT Five runs on cooking oil at controlled temperatures produced a coherent viscosity-temperature curve: 0.95 to 0.43 Pa.s between 25 and 50 C. Standards applied: ISO 17025, IEC 61010, ISO 13849-2. Note on the build: the boards were laid out in Proteus, but the working prototype was hand-assembled on perfboard rather than fabricated, which is why the images show the layouts and renders alongside the finished bench.
instrumentation 63125 64799 70781 71571 54175 60696 68120 fuzzy-logic mosfet atmega328