Design and Implementation of a Microcontroller Based Home Automation System