How to make a device that keeps water in sink and bath at desired temperature?
You are most likely looking for a so called "PID controller". You can either build one yourself (with a PIC (AN964 Implementing a PID Controller on PIC16F684) or AVR (AVR221: Discrete PID controller), or get one like osPID.

A PID controller uses a control loop to feed back its output to its input (aka closed loop system). This way it checks constantly for any deviation in the (output) state/variable and tries to correct it. The output characteristic can be Proportional, an Integral, a Derivative of the input, or any (scaled) combination of the three.