For this recitation, we were tasked with making a higher-voltage drawing machine using a stepper motor and a potentiometer. In order to create the circuit, we needed to use an H-bridge, a component that sends current in two directions, enabling the stepper motor to turn both clockwise and counter-clockwise. Another notable piece of this circuit was the use of a 12 VDC power supply, which greatly increased the voltage of the circuit, making it vulnerable to catching fire. This level of power was necessary to power the machine since the stepper motor requires more than the 5 volts that the Arduino can supply.
We first set up the H-bridge and stepper motor, connecting every port to the Arduino. In order, the H-bridge’s legs were connected as such:
1 to 5V
2 to D8
3 to the stepper motor’s port A
4 and 5 to ground
6 to the stepper motor’s port C
7 to D9
8 to the 5-volt battery’s power
9 to 5V
10 to D10
11 to the stepper motor’s port B
12 and 13 to ground
14 to the stepper motor’s port D
15 to D11
16 to 5V
After connecting each piece, we got this:
Using the following code, the stepper motor would rotate in one direction and then the other direction:
#include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); void setup() { // set the speed at 60 rpm: myStepper.setSpeed(60); // initialize the serial port: Serial.begin(9600); } void loop() { // step one revolution in one direction: Serial.println("clockwise"); myStepper.step(stepsPerRevolution); delay(500); // step one revolution in the other direction: Serial.println("counterclockwise"); myStepper.step(-stepsPerRevolution); delay(500);
After the motor was set up, we added a potentiometer to the circuit to control the motor’s movement. In order to do this we connected two of the potentiometer’s prongs to power and ground, and the third one to A0. This looked like this:
After mapping the potentiometer to the stepper motor, we could control the stepper motor using the potentiometer like so:
The code used:
/* * MotorKnob * * A stepper motor follows the turns of a potentiometer * (or other sensor) on analog input 0. * * http://www.arduino.cc/en/Reference/Stepper * This example code is in the public domain. */ #include <Stepper.h> // change this to the number of steps on your motor #define STEPS 200 // create an instance of the stepper class, specifying // the number of steps of the motor and the pins it's // attached to Stepper stepper(STEPS, 8, 9, 10, 11); // the previous reading from the analog input int previous = 0; void setup() { // set the speed of the motor to 30 RPMs stepper.setSpeed(30); } void loop() { // get the sensor value int val = map(analogRead(0), 0, 1023, 0, 200); // move a number of steps equal to the change in the // sensor reading stepper.step(val - previous); // remember the previous value of the sensor previous = val; }
Finally, we combined two circuits together and added 3D-printed parts to create a drawing machine where each of us would use our potentiometer to move the stepper motors to control a pen on paper.
Question 1:
I would be interested in building machines that help me with things that I struggle with. An example that I came up with was a machine that gives me a little electric shock to wake me up since I’m always tired. While actuators may not be useful in that machine, I can imagine an infinite amount of possibilities when it comes to their use. You could use them to spin the wheels on a wheelchair to help someone move around easier, or maybe use them as robotic arms to reach things that are normally out of reach.
I think that more generally, the digital manipulation of art is something that is good. Giving people more tools to do things is a good thing especially in the art world. If people have a more wide variety of options when it comes to creativity, it will stimulate more people’s creative process and we can see more new, unique, never-before-seen products.
Question 2:
I was drawn to Gil Weinberg’s Haile because I’m a musician. I enjoy creating music, much like Weinberg, and think that his robot is interesting. This one especially stood out to me because it improvises with the band, something that is extremely difficult for humans to do. Compared with the drawing machine, this project is extremely different, although the basis of interaction is still there. My hand moves the potentiometer which moves the drawing machine, while the humans in Haile play music and the robot responds. I think that the two are similar in the way that that they both use human input to move actuators and create some sort of art, whether the art is auditory or visual. The actuators for Haile seem like ones that could move at different speeds to create different velocities of drum sounds.