Introduction: How to Make a Drawing Arm With Arduino
This Instructables will show you how to create your very own drawing arm. The drawing arm draws by using the hole in the up most piece of wood as a writing utensil holder. This drawing arm works by taking input from the potentiometers and making them a servo reading. The Drawing arm has 2 DOF and each DOF is controlled by a potentiometer.
Step 1: Gather Materials
You will need the following to make a drawing arm:
Electronics:
1 - Arduino Uno
2 - Mini Servos
1 - Bread Board (Any Size will do)
A couple jumper cables
For the Non- Electronics:
1 - Piece of wood to screw the Arduino on and hot glue a servo on (you could use acrylic, I didn't)
1 - Popsicle Stick / Craft Stick to hot glue a Servo horn onto
1 - Small piece of wood to hot glue a Servo horn and make a hole to put a writing utensil in
Step 2: The Circuit
Step 3: The Code
The code uses a map function that ties each potentiometer to its servo it controls.
#include <Servo.h>
Servo myservo1; // "Calls" a Servo
Servo myservo2;
int potpin1 = 0; // analog pin used to connect the potentiometer
int potpin2 = 1; int value; // variable to read the value from the analog pin
void setup() {
myservo1.attach(3); // attaches the servo on pin3
myservo2.attach(4); // attaches the servo on pin 4
}
void loop() {
value = analogRead(potpin1); // reads the value of the potentiometer
value = map(value, 0, 1023, 0, 179); // scale it between 0 and 180
myservo1.write(value); // sets servo according to the scaled value
value = analogRead(potpin2); // reads the value of the pot
value = map(value, 0, 1023, 0, 179); // scale it between 0 and 180
myservo2.write(value); // sets servo according to the scaled value
delay(15); // waits for the servo to get there
}
Step 4: The Non-Electronics
Using the largest piece of wood (or acrylic) screw the Arduino to the board. Hot glue one servo to the top left corner of the board. Hot glue the breadboard wherever you have room.
Hot glue one servo horn to a Popsicle stick. When laying the Popsicle horizontally the servo horn should be on the left side. On the complete opposite side of the servo horn should be the place in which you hot glue another servo.
On the small piece of wood drill a hole big enough to place a writing utensil in. Hot glue the last servo horn on the opposite side. You should be able to place the servo horn on the Popsicle stick in the servo on the base, and place the servo horn on the small piece of wood on the servo that is on the Popsicle stick. Enjoy ! Please comment questions, or things you would like for me to make Instructables on.
Participated in the
Glue Contest
Participated in the
Sensors Contest