The location of the sun in the sky as a function of time and location on the earth has been well known for a very long time. Instead of "searching" for the sun Google the equations for location of the sun and apply those to your system.
To do this accurately you will need to know the location of the system, a GPS is more than adequate for that and you will have to go through some trigonometry to do the translation. Keep in mind all trig functions I have ever seen on a computer use radians as the unit for input and output, you will need to convert degrees to radians and back. Once again use Google if you do not know the conversions.
Hope this helps.