I have sleeping problems too,
here is what I have discovered for myself that may work for you, its not always so cut and dry but these general guidelines have worked well for me.
low potassium, low calcium, low magnesium=insomnia
high sodium, high sulfur, high calcium =insomnia
not enough water=insomnia
too much protein=insomnia
not enough linoleic acid (fatty acids)=insomnia