Thursday, October 3, 2013

Arduino Drawing Bot


 Drawing Bot


I built a drawing robot. Here is a rough little video of it in action.


 

The design, shown below, is certainly not original with me but I had all the parts laying around and I thought it would produce a nice profile picture.

The stepper motors wind and unwind the thread in order to position the Sharpie. Not shown in the above drawing is a solenoid mechanism that raises and lowers the Sharpie so that as it moves along it can either draw or not.

More Detail

I wrote a quick program in Processing on my pc that captures a photo and then rescales it and converts it to binary, that is, no color or gray-scale, just black or white pixels. The program then creates a file that is essentially just a list of every pixel in the picture with a "1" if the pixel is black or "0" if the pixel is white. My plan was to transmit the 1s and 0s to an Arduino over the serial connection but the current version of Processing doesn't support Serial on 64-bit Windows. So, I just copied the file to an SD card, and sneaker-netted it to an Arduino Uno with an SD shield on top.

The program on the Uno just moves back and forth across the drawing area, raster style, reading the file and putting the Sharpie down if the next point is a "1" or up if the next point is a "0". The program uses the Pythagorean theorem to to calculate how long the threads should be at each point, and based on how long they were for the last point it either winds or unwinds thread from the shafts of the two stepper motors.

What I would do next

The Drawing Bot is slow. Depending on the resolution of the picture it can take hours to complete a drawing. The Arduino program could certainly be made more efficient. For instance, right now it just draws from left to right, then returns to the left end of the next line down. If it drew in both directions it would probably be 30% faster. It could also be made to skip more directly over areas where nothing is to be drawn.

Further, I built it to draw using 8 1/2" x 11" paper. If desired, though, without any changes in the design (just longer thread) it could easily draw pictures ten times as large. Of course without improving the efficiency of the program you'd be a lot older by the time it got done.

WAK

No comments:

Post a Comment