An implementation of the system for determining drowsiness state of a driver to avoiding an accident is disclosed. In one aspect, a brainwave sensor may be attached at one or more touch points of a driver for sensing a brainwave emitted by neurons in a brain of the driver. Upon attaching the brainwave sensor, the system analyzes the brainwave in order to determine a category of the brainwave. In one aspect, the brainwave may be categorized into the category based upon a pre-defined frequency range associated with the brainwave. After analyzing the brainwave, the system identifies mental state of the driver based upon the category of the brainwave. Once the category of the brainwave is identified, the system generates an alarm for alerting the driver in order to avoid the accident based upon the mental state of the driver.