Embodiments of the invention provide methods for detection and treatment of atrial fibrillation (AF) and related conditions. One embodiment provides a method comprising measuring electrical activity of the heart using electrodes arranged on the heart surface to define an area for detecting aberrant electrical activity (AEA) and then using the measured electrical activity (MEA) to detect foci of AEA causing AF. A pacing signal may then be sent to the foci to prevent AF onset. Atrial wall motion characteristics (WMC) may be sensed using an accelerometer placed on the heart and used with MEA to detect AF. The WMC may be used to monitor effectiveness of the pacing signal in preventing AF and/or returning the heart to normal sinus rhythm (NSR). Also, upon AF detection, a cardioversion signal may be sent to the atria using the electrodes to depolarize an atrial area causing AF and return the heart to NSR.