This paper presents a new technique to sense the direction of the magnetic field, enabling a new generation of contactless 360 degrees absolute angle encoders. The sensor consists of a microchip that contains a special ring-shaped Hall element. It is the first sensor that gives the angle value without the need of computing an arctan function. In addition, we demonstrate that this system is compatible with a self calibration method. Measurements were performed with the microchip operating inside a hollow permanent magnet and an accuracy of 0.1 degrees was obtained without calibration.