Hardware Reference
In-Depth Information
rpm parameter is a long . The i nal function is used to instruct the motor to
move by a specii c amount of steps:
Stepper.step(steps);
This function does not return any data and requires one parameter: steps .
The steps parameter is an int and indicates the number of steps to perform.
Depending on the wiring, positive values will cause the motor to turn in one
direction, and negative values will make the motor turn the opposite direc-
tion. This function does not return until the task is complete, and depending
on the amount of steps to perform, this can take a long time. During this
time, the sketch cannot continue to perform other actions.
Example Project
In this project, you create another thermometer, one that varies slightly from
the servo motor example in the previous example. An LM35 temperature
sensor will connect to A0. The stepper motor will connect to digital pins 8,
9, 10, and 11 through a double H-bridge. This project is different from the
previous because it will not show the exact temperature, but a variation.
A stepper motor can maintain its position and provide force to keep the
angle correctly positioned. A stepper motor cannot know its exact position;
an order is given to move a certain number of steps in one direction or
another, but it cannot know if the motor shaft has turned correctly. Maybe
there was too much force involved, and the motor couldn't overpower the
force. The advantage to this is that stepper motors can be repositioned; you
can force the hand into a certain position and then let the motor reposition
itself as required. This thermometer will not show the exact temperature,
but a variation. The user can reposition the hand into a central position at
any time, and by looking at the thermometer moments later, he will know
if it is getting colder or warmer.
Hardware
This project uses an Arduino Uno for the control part of the project and an LM35
temperature sensor like in the servo example. It also uses an H-bridge control-
ler and a 5-V stepper motor. Most H-bridges can use higher power motors, but
with a less powerful motor the user can change the position of the motor by
hand. An illustration of the circuit is shown in Figure 15-2.
 
Search WWH ::




Custom Search