A connector assembly includes a first connector and a second connector. The first connector is coupled to a first electronic device, and the second connector is coupled to a second electronic device and detachably mated with the first connector. The first connector includes a first housing and a magnetic member. The magnetic member is installed inside the first housing and for generating magnetic field. The second connector includes a second housing and a magnetic sensor disposed in the second housing. The magnetic sensor senses the magnetic field generated by the magnetic member when the second connector is mated with the first connector, so as to drive the second electronic device to power the first electronic device.