When Oersted discovered in 1820 that an electric current deflected a magnetic needle, many of the details of the direction of the magnetic effect were left to be worked out. Oersted's needle was under the influence of a combination of the Earth's magnetic field and the current's magnetic field. In his experiments, given the magnitude of the current that he used, he observed a maximum deflection of around 45o when the compass was kept close to the wire.
In the interactive simulation below, you can see the angle of deflection for different currents and distances. You will find that even with a large current (10 A), the angle of deflection is still less than 90o.
It was Andre-Marie Ampere who devised a way to eliminate the influence of the Earth's magnetic field and reveal the true action of the current on the needle. He found direct evidence that the magnetic field due to a current-carrying wire was at right angles to the wire.
To understand what Ampere did, we need to recall that the direction of the Earth's magnetic field at any place is not exactly horizontal. In most places, it points at an angle into or out of the ground (angle of dip). Nor does it point exactly north (declination), but we can ignore this for now.
Rotate the compass in this simulation to a vertical position using the slider to get a sense of the angle of dip. The compass shows an angle of dip of 15o (roughly the angle of dip in Bangalore, India).
Ampere realised that the action of the Earth's magnetic field can be totally eliminated if the needle's axis was placed parallel to the direction of the Earth's magnetic field. To achieve this, he created an elaborate apparatus where he could rotate a magnetic compass along different axes (see figure). He called it 'astatic needle'.
Using the astatic needle, Ampere was able to study the magnetic effect of an electric current on a compass needle in isolation. He showed that the angle of deflection was 90o every single time, even with small currents.
Now you can play with a virtual replica of Ampere's astatic needle to retrace his discovery. Make sure to try different values of angle and current. By detault, the compass is rotated by 75o to keep its axis parallel to the Earth's magnetic field (at Bangalore).
You will see that for this angle of rotation (75o), the needle is deflected by 90o even for small currents. Another thing to notice is that the needle doesn't return to pointing northwards when the current is switched off (can you explain why?). Rotate the compass using the slider to reset the needle's position. At other angles, the Earth's magnetic field has an influence and even large currents do not deflect the needle by 90o.