In this work, we present an IMU-based rehabilitation system for upper and lower limbs. This system uses two wearable IMU sensors to detect rehabilitation motions of patients suffering from frozen shoulder, knee surgery, and hip surgery. The sensors are also connected to a smartphone via Bluetooth, and an Android APP is designed to show the correctness and the statistics of the rehabilitation exercises. The experimental results show that the average errors of knee angle, and elbow angle are both less than 5°. The average recognition rates of all the rehabilitation exercises are larger than 85%.