Yes, a stepper motor can turn both ways. The direction of rotation for a stepper motor is controlled by the sequence of electrical pulses applied to its coils.
### How It Works:
1. **Stepper Motor Basics**: A stepper motor is an electromagnetic device that divides a full rotation into a series of discrete steps. It has multiple coils (windings) that are energized in a specific sequence to create magnetic fields that pull the rotor (the part that rotates) from one step to the next.
2. **Direction Control**: The direction in which the stepper motor turns is determined by the sequence in which the coils are energized:
- **Forward Rotation**: Energizing the coils in a specific order causes the rotor to turn in one direction (e.g., clockwise).
- **Reverse Rotation**: Energizing the coils in the reverse order will make the rotor turn in the opposite direction (e.g., counterclockwise).
3. **Pulse Sequence**: To achieve the desired direction, you need to send pulses to the coils in a particular sequence. For example, if you are using a stepper motor driver, you would send pulses to the driver, which then energizes the coils in the correct sequence to move the rotor forward or backward.
4. **Types of Stepper Motors**:
- **Unipolar Stepper Motors**: These have a center tap on each coil and can be driven with simpler circuitry. The direction of rotation is controlled by changing the sequence of the coil activations.
- **Bipolar Stepper Motors**: These have no center tap and require more complex circuitry to reverse the current through the coils. However, they generally offer more torque compared to unipolar motors. Direction control is achieved by reversing the current through the coils.
### Summary:
By changing the pulse sequence sent to a stepper motor, you can control its direction of rotation, allowing it to turn both ways. This flexibility is one of the reasons stepper motors are commonly used in applications requiring precise position control, such as in CNC machines, 3D printers, and robotic systems.