Wandering is a common behavioral disorder in the community-dwelling elderly. More than two-thirds of caregivers believe that wandering would cause falls. While physical restraint is a common measure to address wandering, it could trigger challenging behavior in approximately 80% of the elderly with dementia. This study aims to develop a virtual restraint using a night monitoring system (eNightLog) to provide a safe environment for the elderly and mitigate the caregiver burden. The eNightLog system consisted of remote sensors, including a near infra-red 3D time-of-flight sensor and ultrawideband sensors. An alarm system was controlled by customized software and algorithm based on the respiration rate and body posture of the elderly. The performance of the eNightLog system was evaluated in both single and double bed settings by comparing to that of a pressure mat and an infrared fence system, under simulated bed-exiting scenarios. The accuracy and precision for the three systems were 99.0%, 98.8%, 85.9% and 99.2%, 97.8%, 78.6%, respectively. With higher accuracy, precision, and a lower false alarm rate, eNightLog demonstrated its potential as an alternative to physical restraint to remedy the workload of the caregivers and the psychological impact of the elderly.