A Low-Cost and Energy-Effcient Wearable Device For Posture Monitoring