Im sorry to hear about your symptoms. Now there are a number of conditions which can cause this problem. The first one which comes to mind is that you could be having an abnormal heart rhythm. This is known as heart arrhythmia. This is a condition in which the heart beats rapidly and irregularly and can lead to symptoms like headaches, palpitations, dizziness, lightheadedness, chest pain, shortness of breath, sweating etc. Not all symptoms need to be present in order to have an aryhthmia. This would need to be diagnosed with the help of an EKG, echocardiography and a 24 hour holter monitor. A 24 hour holter monitor is necessary as it can monitor your heart for a whole day instead of the EKG which ONLY detects problems in the heart when it being done. Even if your last EKGs and echos were normal, they should be repeated nonetheless.
Secondly, its good that you took some potassium and magnesium as that can lead to irregular heart rhythms but i wouldnt recommend taking it anymore without getting your levels tested. Get serum electrolyte levels tested by visiting your doctor and then use supplements. Too high levels of either of these electrolytes can also cause heart rhythm problems.
Lastly, i think this can be due to anxiety (only if the palpitations started after you woke up) because of the headache. If this is the case then behavioural therapy and relaxation techniques can be helpful as well.
Now for now i would suggest that you do some breathing exercises and try to relax, take some OTC motrin or aleve for the headache but if the palpitations and raised heart rate is persistent, then you need to go to urgent care to have this evaluated.
Do you have any more questions?
Please leave a POSITIVE (3 – 5 stars, preferably 5) rating by clicking on the stars above, until you do i am not compensated for my time. You can continue to ask follow-up questions even after the POSITIVE rating. You can also ask questions from me directly by going on the link below,