It is the device part of the code which runs on At89s52 micro-controller which on receiving certain characters via serial port turns on or off relays which in turn on or off electrical appliances.