da Vinci

etchasketch.dwg_.zip (69073Bytes)
Code_Name__EAS_v2.pde.zip (2415Bytes)

 

da Vinci is an etch-a-sketch robot. He is capable of etching low resolution images in grey-scale. Let’s get to the build process.

 

I first went searching for an etch-a-sketch. You would think I would have one already, but nope. I think every one should have a Rubik's Cube, an etch-a-sketch, and a slinky. I looked online at Walmart and supposively they are not sold in stores. No one buys these things anymore? I don't know why. Playing with the x and y movement is awesome!

DSC01482.jpg

Come on kids, "as seen on TV"

DSC01484.jpg

 

Well the knobs easily popped off. I measured the diameter of the shaft. I will need this later. Some how I have to spin that.

DSC01495.jpg

 

Well I think it is obvious that I went with stepper motors. I decided I would use stepper motors and gears to spin the etch-a-sketch's shafts. I got these 5v stepper motors and controllers at yourduino.com. I saw the ad for them on the front page of LMR. Actually that ad inspired me to make this whole project. So much for disliking ads...

One of the controllers did have a bad soldering joint I had to fix. 

DSC01519.jpg

 

I hooked them up to an Arduino and gave them a test using the Arduino stepper motor library. They worked (slowly). I was pleased. That's all I have to say about that.

DSC01541.jpg

 

So next I had to tackle the issue of getting gears on the shafts of the etch-a-sketch. Whatever I did, I did not want it to be permanently on. So that elminates gluing. I could try and press fit a gear to the shaft, but I do not know how likely that is to work. I remembered I used a "collet" on one of my RC airplanes that did exactly what I needed. Would you know I found a 5mm collet online (they were not as cheap as I was expecting). The shafts of the etch-a-sketch are 4.8mm. Sounds like it was meant to be.

I have ordered many packages, but few have came in packing peanuts.

DSC01549.jpg

DSC01550.jpg

DSC01569.jpg

 

I put some washers and a little cardboard in the collet and tightened it onto the shaft. Eventually a gear goes where I put the filler (the washers and cardboard). It has a very good grip.

DSC01557.jpg

 

So next I needed to design the parts that would become "da Vinci." First I had to decide what they would be made of. Acrylic? Wood? Gold? Ok the last one is joke. I went with wood because it is strong and easy to glue. The local hardware store does not have nice plywood. So I ordered some hobby grade stuff online. This is the good stuff. So good in fact that I only had the money for 3 6"x12" sheets. That set my first design contraint. 

DSC01682.jpg

 

It was time to start CADing. For the first time, I cut out the design in foam board to see how it would fit together. This was crucial because with only 3 sheets of plywood, I had little room to mess up. 

DSC01592.jpg

 

This was my initial design. The whole thing is angled back a little like a picture frame.

DSC01611.jpg

DSC01609.jpg

DSC01629.jpg

 

There were a few things that were obviously missing in this design that I knew I would eventually add. The first is a front panel that would house a LCD, potentiometer, and a button. The second was a way of mounting the motors. 

I went ahead and edited the design to include motors mounts. This is what I came up with:

DSC01636.jpg

DSC01634.jpg

 

As you may have guessed, there were issues with this first design. So onto design #2. I added the front panel and tweaked what needed to be tweaked. 

DSC01657.jpg

DSC01659.jpg

DSC01666.jpg

 

The last things to design were the gears. In fact, I did not design them at all. I found a website with CAD files of different gears. I found ones that would worked, scaled them, and ended up with this:

DSC01679.jpg

 

I present to you the final design:

The wooden pieces:

sheet1_0.jpg

sheet2.jpg

sheet3.jpg

 

The acrylic pieces:

acrylic1.jpg

acrylic2.jpg

 

 

With the design finalized, I went to school to cut it out on a laser cutter. It took 2 passes of the laser cutter to cut all the way through the wood. The gears came out better than I thought they would. Below are the parts freshly cut out and temporarily assembled.

 

DSC01692.jpg

DSC01696.jpg

DSC01697.jpg

DSC01698.jpg

DSC01702.jpg

DSC01707.jpg

DSC01709.jpg

DSC01711.jpg

 

 

Next I glued all the wood pieces together. The acrylic pieces are not glued in. They are simply sandwiched into the design. Now all the hardware is complete.

 

DSC01759_0.jpg

DSC01760.jpg

DSC01765.jpg

DSC01768.jpg

DSC01774.jpg

DSC01741.jpg

DSC01742.jpg

 

With the electronics partially complete, I did a quick scribble test. This program simply was etching away a section of the screen to reveal the inner workings of the etch-a-sketch.

DSC01785.jpg

 

 

Well the scribble test was a success, but I wanted to try something more. At this time I was still waiting on the rest of the electronics (SD card shield, SD card, potentiometer, and a button). I decided I could still generate an image and save it in an array in the micro-controller’s program memory. So I started working on da Vinci’s code (not the book :P). Here is a photo I took while I was writing and tweaking the program:

DSC01814.jpg

 

 

Once I finished testing and tweaking the code, I finally was able to etch a low resolution Apple logo. Success!

apple_sketch_0.jpg


 

 

DSC01891.jpg

DSC01837.jpg

DSC01855.jpg

DSC01800.jpg

 

 

It took some courage, but I erased the etch-a-sketch and tried to etch another image. This time I did the Adafruit logo, which is a flower.

adafruit_sketch.jpg

DSC01913.jpg

DSC01923.jpg

DSC01937.jpg

 

The mail finally arrived with the rest of my electronics. I received an Arduino microSD card Shield, potentiometer, knob, push button, and some cables.

DSC01962.jpg

DSC01966.jpg

DSC01968.jpg

DSC01973.jpg

 

I also ordered a 4GB microSD card ($6 at Walmart). This card will store a bunch of data files for etching images.

 

DSC02083.jpg

 

The prototyping area on the microSD card shield was the selling point to me. It allowed me to easily wire up all of the required connections. This included 8 digital outputs for the stepper motor controllers, serial communication connection to the ezLCDuino, 1 digital input for the button, 1 analog input for the potentiometer, and of course necessary power distribution. 

DSC02140.jpg

DSC02143.jpg

 

 

That concludes the build process. They grow up so fast! Here are some final pictures:


DSC01992.jpg

DSC02003.jpg

DSC02059.jpg


 

 

 

 

 


 

 

Time to Talk Software

First let me talk about the computer software I wrote. Below are some images you should have already seen:

 

 

apple_sketch_0.jpg

adafruit_sketch.jpg

 

 

Above are two different screen shots of the piece of software I wrote using the Processing language (I love this language and use it for just about everything). This program takes an image, averages the pixels, displays a preview, and then generates a file. Ok that was a lot of stuff. Let me break it down:

Step 1 (“takes an image”): As you can see in the screen shot, there are quite a few different controls in the bottom left of the program. The upper most box is labeled “file name.” This is where the user simply types in the name of the image file they would like to load into the software. The image files must be in the Processing Sketch’s (sketch is just what they call a Processing program) folder to be loaded in, else there will be an error. The image will automatically be scaled to fit within the window, but there are user controls for scaling as well. The “scale factor” control allows the user to alter the scale of the image. There are numerator and denominator slide control bars. This is how the user sets the scale factor, which is in the form of a fraction. The program will not react to a set scale that is too big to display the image properly within the window. 

Step 2 (“averages the pixels”): In order to etch the image on the etch-a-sketch it needs a resolution adjustment. Obviously an image with tons of pixels is simply impossible to display on an etch-a-sketch. This is not an HD T.V. we are talking about. So what the program does to lower the resolution is what I call “averaging the pixels.” There are two more controls I will bring your attention to, the “pixel size” and “average pixels” controls. These control the image averaging. The pixel size slide control bar is what sets the size of the averaging grid. You can see this red grid in the screen shots above. It is overlaid on the loaded image. The length of each side of the squares in the grid is equal to the  pixels size set by the user. The smaller the pixel size, the tighter the grid, and the higher resolution the image is when averaged. The larger the pixel size... well you get the idea. Simply setting the grid size does not average the image. The “average pixels” check box must be checked for the image to be averaged. When this is checked, the program takes all of the pixels in each square of the grid and averages their grey-scale value (i.e. all images are converted to shades of grey). It then display a square over the picture that represents this average grey-scale value, and you are presented with a lower resolution image. 

Step 3 (“displays a preview”): The last control is the “Etch” button. When this is enabled, the program will virtually etch the image. There is a “virtual” etch-a-sketch on the right side of the software window. This virtual etch-a-sketch’s screen is almost exactly the same size of real one. The program takes the data from the averaged image and displays it as lines on the virtual etch-a-sketch. Different grey-scale values are created by varying the distance between each line. This generated preview and the actual etched image on da Vinci look very similar, so that is good. You wouldn’t want to etch an image, which takes hours, and not know what it is going to look like in the end would you? So the feature is very handy, but I actually put that feature in way before I built da Vinci simply to see how well the software worked. It is very common for me to write software for a project I have yet to start.

Step 4 (“generates a file”): Finally the last step is to generate a file. This is the whole reason the program was created, to extract useful data from an image that I could then read into da Vinci and etch. This file is saved in the Processing Sketch’s folder. The name of the file is the same name as the loaded image and the extension is .txt. The contents of the file includes the width of each column in pixels, the number of rows, the number of columns, and the etch width for each averaged grey-scale value. The etch width is the number of pixels between each line in preview image. This file can then be put onto a microSD card, which is then inserted into da Vinci.


 

 

Now that we have data on a microSD card da Vinci’s Arduino program is ready to take over.

The Arduino program is pretty simple, but I will break it down into steps again.

 

Step 1: The user selects which file to etch. The user can navigate through the different file names using the potentiometer. The potentiometer’s analog value gets mapped to the number of files on the SD card. The file that corresponds with that number is displayed on the ezLCDuino (the ezLCDuino is a LCD with an Arduino backpack I made). The communication between the main Arduino micro-controller and the ezLCDuino is done over serial using Bill Porter’s EasyTransfer Library. When the user has selected the file they want etched they can hit the button to begin etching. 

Step 2: This is the second and last step. The data of the chosen file on the microSD card is read in. The width of each column, the number of rows, and the number of columns first get put into variables. The width of each column is used to fit the image within the etch-a-sketch’s screen. The number of rows and columns are simply used to terminate for loops. One by one, the etch width data for each index of the image is read in and etched. This etch width is originally in pixels, but is then scaled to stepper motor steps. After each row is etched the program returns the etch-a-sketch’s stylus to the left hand side before etching the next row.

General Comments: There were a lot of little things to figure out and add in the code. Most of it was compensation for backlash and slop. It would be hard to completely explain all of the nuances in the code. So I have simplified the concept a little in my explanation. 

 

https://www.youtube.com/watch?v=q2LIMYKQLXE

Collets!Nice work PM,

Collets!

Nice work PM, looking forward to seeing a few more vids of da Vinci in action with the newer software =)

Awesome idea and

Awesome idea and implementation!

Say, do you think you could have an erase button that activates a vibration motor(s) for a set time to shake and erase the etch a sketch?

Collets indeed! The apple

Collets indeed! The apple etching you see was made with the “new” software. I just do not have a walk through video yet of that new processing software I wrote with the preview area. I did show a screen shot of it. 

There will definetly be more videos of it in action. I had a limit to the resolution of the image using an array, but now that I think about I could use program memory to store the array… I might etch a more detailed image before the SD card shield arrives after all.

Wow.

This is an incredible way of adding new life to an old toy.  Your build is beautiful.

I’m not too sure a vibration

I’m not too sure a vibration motor would cut it. It probably needs a couple of good tilts before it is fully earsed. The image is one that slowly developes over a period of hours, which makes it a cool art installation I suppose. While I guess it is not optimal to manually erase and reset it, it takes very little time to do compared to the actual drawing time. 

As always you amaze me with

As always you amaze me with your skill and your design of your creations!

I saw this a while ago but yours is way cooler http://www.youtube.com/watch?v=NBbNn8Tkb6I

Good job Patrick, I like

Good job Patrick, I like your project. 5 stars. BTW are these step motors from YourDuino?  Thanks for sharing.

Nice job

Very nice documentation, VERY nice project.  Way to be creative.  Keep up the GREAT work!

This is cool :slight_smile:

This is cool :slight_smile:

Again, cool and very well

Again, cool and very well done! Keep it up!

Cheers!

Thanks for the compliment.

Thanks for the compliment. Yes they are from YourDuino.

Thanks for all the nice

Thanks for all the nice comments. They come from such an awesome group of people.

Cool project.

I was watching this project since you started it and it looks great.  You built it very neat and clean like all your other projects. 

Good job.

This is so awesome!! I

This is so awesome!! I really like the look of all your projects. The burning of the wood on the edges is really cool. Keep up the great work.

Great project, Patrick.Do

Great project, Patrick.

Do you have any concerns about the wooden teeth on your gears being resilient? Especially where the grain of the wood is cross-wise to the tooth?

I saw a tip from Jamie Mantzel (the Giant Robot Project guy) about using super glue around the edges of wooden gears. The glue permeates the wood and makes it stronger.

Anyway, a really wonderful project.

They have held up well.

They have held up well. There were some chips that came off right after they were laser cut. I guess I will find out how their life span is. I thought about doing something similar like your super glue suggestion.

Hey great job, just letting

Hey great job, just letting you know that you were metioned on hack a day.com 

http://hackaday.com/2012/02/06/robotic-etch-a-sketch-draws-grayscale-images/

The ply, is cross laminated,

The ply, is cross laminated, so each laminate layer is laid down in a different direction. They shoudl stand up pretty well i reckon.

This project is amazing. Good work.