When current flows through a conductor it produces a magnetic field around it. This is called electromagnetism, a phenomenon which is utilised in many electrical devices such as transformers, motors, alternators and circuit breakers.
When looking at the theory of electromagnetism we first need to consider the direction that the magnetic field takes and how magnetic fields interact with one another.
On these pages you will see the notation used below. The circle with a dot shows the cross-section of a current carrying cable with the current flowing towards the viewer. The circle with the cross shows the cross-section of a current carrying cable with the current flowing away from the viewer.
Think of a dart: if you view it from behind as you throw it away from you, you will see a cross in the shape of the flights. If you are unfortunate enough to see the point of a dart coming towards you, you will briefly see a dot before you are blinded.
When current flows towards the viewer the magnetic field rotates anticlockwise. The circular lines represent the magnetic field.
If the direction of the current changes then the magnetic field will rotate clockwise.
Considering the "current flowing away from viewer" image. When screwing the screw into a piece of wood it rotates clockwise.
Two conductors next to each others will cause the magnetic fields to interact. This image shows two cables side by side with current flowing in the same direction. The cables will attract one another.
When two cables are next to each other with opposite current directions, the magnetic fields will cause the two cables to repel each other.
A solenoid consists of a length of wire wound on an iron core. If an electric current is passed through the wire, the solenoid develops a magnetic field around it. The polarity of the magnetic field is dependent upon the direction of the current flow through the wire.
To remember how the direction of current flow affects the polarity of the magnetic field this method can be used. The thread represents the wire wrapped around the core. If a screw is put into a piece of wood it is rotated clockwise and it moves leftwards.