The National Agency for New Technologies, Energy and Sustainable Economic Development (ENEA) is an Italian Government sponsored research and development agency. In 2017 Sara Bollanti and her team at ENEA in Frascati developed a solar compass that "is 100 times more precise than magnetic compasses..." with applications for surveying, civil engineering, and for us, sundial alignment. The heart of the device is a combination of GPS receiver for determining both time and geographic position and a solar collector consisting of a narrow slit and a CMOS image detector. Essentially this is an electronic solar azimuth compass. A smallArduino computer uses the UTC time plus geographic coordinates to compute the local sun azimuth and then compares it to the position of the sun's projection of a slit on a CMOS detector. According to ENEA, the "...electronic solar compass is compact, completely automatic, cheap, and reaches an accuracy better than 1 arcmin. The latter is one of the best currently available values, comparable to those achievable by means of much more expensive and sophisticated devices, like coupled GPS systems (see for example U.S. patent 5,617,317A, 1997) or gyrocompasses. Furthermore, the ENEA compass provides the orientation in a few seconds, a time extremely shorter than that necessary for gyrocompasses."
By 2018 this was tested in Antarctica and now the mathematics has been reduced to fit into your smart phone. In April 2020 the ENEA team announced the developed the smartphone app i called "SunPass". It is currently in beta testing and will soon be available at the Play Store. In basic form, the app allows you to acquire the sun azimuth by pointing toward the shadow of a vertical object such as a building ("shadow method") or the shadow of a vertical pole ("gnomon method"). A more accurate appraoch is to construct a box with a slit on the front and hole on top such that the smartphone can observe the illuminated sun line on the floor of the box ("Slit method"). For the advanced, one can construct a precision holder from a kit that mounts on a tripod.
ENEA's goal of a low cost, simple method of precision alignment is now accessible to all. This new technology implements the mathematics of determining the sun's azimuth in elegant ways. But of course it only works on sunny days.