Dot Matrix Printer From a CDDVD Reader With Arduin

August 6, 2017 | Author: Lord_Darth_Vader | Category: Printer (Computing), Arduino, Pixel, Electronics, Electronic Engineering
Share Embed Donate


Short Description

Dot Matrix Printer From a CDDVD Reader With Arduin...

Description

Food

Living

Outside

Play

Technology

Workshop

Dot Matrix Printer from a CD/DVD Reader with Arduino by Robson Couto on August 21, 2014

Table of Contents Dot Matrix Printer from a CD/DVD Reader with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Intro: Dot Matrix Printer from a CD/DVD Reader with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

Step 1: The motivation and my ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

Step 2: Enough talk, lets get the recicled parts! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

Step 3: Parts List (Arduino and electronics). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

Step 4: Starting the hard work. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

Step 5: A long and careful journey, disassembling the laser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

Step 6: The acrilic pieces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Step 7: The paper pulling gear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Step 8: The pen mechanism. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Step 9: All your base are belong to us . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Step 10: Finishing the mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Step 11: The Circuit Schematic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Step 12: Mounting the controller board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Step 13: About the PC side. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Step 14: Understanding the processing Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Step 15: Programming the Arduino. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Step 16: Done! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Step 17: Show your art! Sharing it with your friends! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Author:Robson Couto

Dragão sem Chama I'm 19, a eletrical engeneering student. Starting my journey through the world of electronics. Microcontrollers?! I love them!

Intro: Dot Matrix Printer from a CD/DVD Reader with Arduino Hey! Some time ago while going through the pages here in Instructables, something catch my attention, a printer made of a CD reader, and i was amazed. I thought: "This is incredible, I have to make one!" I know that these kind of projects don't always receive a "I made it", because of its degree of difficulty, so i tried to make mine easier. This project was started more than a year ago, because of the lack of time i could only work in it while on college recess, but this is great because I finish it during the remix contest, that's fit perfectly in this case. If you think that I deserve your votes in the contests don't be shy and hit the button, I really like your support.;) I also wanted to make this a motivation, i don't even dream of putting my hands in a laser cutter or 3D printer for making my projects, so i made this printer only using my dremel to cut the plastic pieces and gluing them together with super glue. What can I say? It worked.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 1: The motivation and my ideas Lets give a look in the Brunoip's version and compare with mine: -It uses a Stepper motor to pull the paper, it makes the circuit and programming more complex, but the precision it's very reliable, I used instead a DC motor, making the circuit and programming easier, but losing a bit of the precision offered by the stepper. -The pen makes a circular(that's the word?!) movement, like a pointer in a clock, I opted for a vertical movement, and instead of using a H bridge chip to moving the motor in both directions, i used only a transistor to lower the pen, making a mechanism with a spring to lift it. -Brunoip used a pic microcontroller as a brain for its printer, I opted for Arduino because it is easy to code, to program , to buy and is very popular here. Brunoip, thank you for posting this creative instructable, without it I would never think of making mine ;)

Step 2: Enough talk, lets get the recicled parts! You will need a CD or a DVD Reader/Writer, you can ask for one in the computer repairs workshop next to your house. You need the 'sled' from the DVD/CD reader with the stepper motor and laser module, it will be used to movement the pen mechanism. The gears for opening the tray I used to make the pen mechanism. Here in my house I have boxes with parts that I toke from these drives for the years, so i not used pieces from only one drive. You can find many precious things in old electronics, think twice before putting them in the trash. I used a piece of acrylic to make the base, but you can use wood or something like that, it only needs to be flat, that piece was from a friend that kindly gave me(acrylic is costly where I live). You can find a nice acrylic sheet in some LCD monitors, be careful opening them, you may hurt you fingers in some sharp parts. The wheel used to pull the paper is from a old inkjet printer, You will see that I really like to reuse junk in my projects ;).

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 3: Parts List (Arduino and electronics). Ok, let's see what we will need to control the printer. To receive the data from computer and control the motors: 1 x Arduino Board (Uno, Nano, Mega.... whatever). To controlling the DC motors: 2 x Diodes 1N4001 or similar. 2 x TIP120 Transistors (Can be the TIP122 too). 2 x 2.2k ohm Resistors (Red,Red,Red) ; To control the stepper motor: 1 x L293D Dual bridge IC. You will need too: A breadboard, I used two halfs (yeah, i know, is what i had in hands). Jumper cables. A 7V power source( you can't power the motors through USB). You can see my converter in the images, I'm using a adjustable module to get 7V from my 12V source.

Image Notes

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

1. I'm using this regulator to get 7V from my 12V wall adapter.

Step 4: Starting the hard work. *You can put your protection glasses now, i'm serious your eyes are too precious, be careful.* You will need the laser sled from a CD or DVD reader, if you don't know how to disassemble one don't worry, I have a instructable teaching how to disassemble these drives, you can get some tips there. Disassembling a CD/DVD reader and reusing its parts. Hey! don't disassemble the entire driver, check the first picture in this step, this piece we will use to carrying the pen. First, loose the screws that fix the brushless motor (the one that makes the CD spin), after that, with care, retire the laser module from the structure.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 5: A long and careful journey, disassembling the laser. We will need to retire many parts from the laser module, leaving only its structure. It will be use to attach the pen mechanism. My advice is that you get a these made of plastic, like mine, because you will need to make a whole in it, there are the modules with a metal structure, like the one I disassembled in my other instructable, I think they are hard to drill but not impossible, remember to use protection glasses. You will have to take all the electronics and glass, be careful here, you can cut yourself or hurt your eyes, see the pictures to know how to proceed, after having only the plastic structure make a hole like in the pictures, where the pen will pass.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 6: The acrilic pieces. I made the white acrylic pieces with my dremel and a bench vise, but if you have a 3D printer or a laser cutter it can be easier, I think. I'm putting here the measures of my pieces just to give you a idea,i think that you will have to make some changes, the holes have to be made according with your gears, motors and other parts. A 2mm acrylic sheet was used, it was easy to cut and drill with the dremel, to glue the pieces together superglue was used. I tried to make the models on sketchup, they aren't perfect, but you can see and understand them better.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

File Downloads

paper.skp (1 MB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'paper.skp']

pen base.skp (1 MB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'pen base.skp']

Pen.skp (1 MB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'Pen.skp']

Step 7: The paper pulling gear Just gather some gears, they don't need to be exactly from a CD/DVD reader, there are gears in old VHS players, DVD/CD players, electric toys, printers.... The wheel used to pull the paper is from a old inkjet printer, but if you don't have one you can use another thing, let me think............I know! A wheel from a broken RC car or a toy, or another thing, just be creative! It just has to offer friction enough to don't let the paper escape. Sorry, as I said, i started this project some time ago, because this you can see that the piece already was done, I don't even had a camera when i started this project, so I disassembled it to show the most I could.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 8: The pen mechanism. This piece makes me proud, it's such a piece of engineering made only with my handy dremel and a bench vise. The gears I took from DVD players and CD readers and the motor from a CD reader. With the dremel i cut the white pieces of acrylic, using super glue to fix them. When we apply a voltage in the motor, it makes the pen go down, making a dot in the paper, a spring is used to make pen lift and come back to it's position, this way is possible to control the motor with only a transistor instead of a H bridge.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 9: All your base are belong to us The base can be made of acrylic, like mine, but you can use wood too. Before putting the sled on the base, desolder the cable and put a female header to make easy connect it with jumper cables, if you don't have the female header you can solder wire. In the image you can see that i out some pieces of plastic to make the paper stay in the right place while printing, i made them with rulers. I used screws to fix the sled structure on the base, this makes easy regulating its height .

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 10: Finishing the mechanics Ok, let's finish mounting the mechanics. Put the mechanism for pulling the paper on the base, see how much it is close of it, the wheel must make enough pressure on the paper to don't let it escape, but it can't be too strong, to allowing the paper to slide through the base. Now you have the mechanics, let's go to electronics and after that to software!

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 11: The Circuit Schematic. You can see in the images the circuit, be careful with the polarity of the components. A TIP 120 transistor is used to drive each DC motor, the L293D is used to controlling the Stepper motor from the CD drive.To power the motors I used a 7V source, using more than that can damage your motors, be careful ;). Any Arduino board can be used, Mega, UNO, Nano... You can download the schematics(Fritzing and Eagle) below, it can help if you want to see them better.

File Downloads

Arduino Dot Matrix Printer.fzz (32 KB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'Arduino Dot Matrix Printer.fzz']

Printer.sch (305 KB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'Printer.sch']

Step 12: Mounting the controller board. Follow the schematics on the previous step to connecting the components, be careful with their polarity. A warning: The L239D can overheat, damaging your breadboard, this was my first time playing with it so i didn't knew. My breadboard melted a little, but maybe because i left it on for a long time. You can make the circuit on a perfboard(a copper board available in electronics stores with a lot of holes) to be sure not damaging your precious breadboard.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 13: About the PC side. I'm using processing for processing( hehe) the images and sending them to Arduino. Processing is a great and easy language and tool, I only discovered how good it is a month or two ago. With processing was very easy read the pixels from the image, and use the serial port too, if you still don't know it and is a maker I really recommend trying it. Processing is derived from java and also is available to Windows, Linux and Mac. So what you're waiting to download it?! Download Processing.

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

Step 14: Understanding the processing Sketch The Processing sketch is small, this is possible because of the good work made by the folks at Processing, making easy to play with images and read its pixels. What the sketch does is to check every pixels in an image and then sends bytes though the serial port to say if the Arduino board must make a dot or not, or start a new line. //Written by Robson Couto //http://dragaosemchama.com.br/ //August 2014. import processing.serial.*; Serial myPort; // Create object from Serial class PImage IMG; //create a PImage named IMG void setup() { size(60, 118);//Put here the size of your image String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600);//opens the Serial Port IMG = loadImage("link2.jpg");//Open your image, put here the name of your image, including the extension. image(IMG, 0, 0); } void draw() { IMG.loadPixels(); for (int y = 0; y < height; y++) {//check the lines for (int x = 0; x < width; x++) { //check each pixel in the line int loc = x + y*width; //the pixels are loaded as in a aray, so its position is only a number. if (IMG.pixels[loc]>color(128)) { myPort.write(0);//if a pixel is not black, send a '0'. delay(50); } else { myPort.write(1);//if a pixel is black, send a '1'. delay(50); } } delay(10000);//Wait for some time, time enough to the printer finish this line. myPort.write('L');//send a "L" to indicate a new line. } noLoop(); }

File Downloads

http://www.instructables.com/id/Dot-Matrix-Printer-from-a-CDDVD-Reader-with-Arduin/

pixels.zip (205 KB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'pixels.zip']

Step 15: Programming the Arduino. It's necessary burn the Arduino only once, because we'll use the serial port through USB to send the images to the Arduino printing them. The Arduino receives the bytes from the computer and checks if it has to make a dot or not. At each dot the pen advances, until it receive a order to start a new line, when the paper moves a little. Isn't necessary to download any additional library, just the code itself. //Written by Robson Couto //http://dragaosemchama.com.br/ //August 2014. #define time 4 // time in miliseconds between each motor's step #define pentime 200 //time of the pulse in the pen motor #define pulltime 6200 //time(in microseconds to allow a alrge range) of the pulse on the motor to pull the paper. #define penPin 4 //pen motor pin #define paperPin 5 //paper motor pin #define #define #define #define

StepperA1 StepperA2 StepperB1 StepperB2

9 10 11 12

//stepper motor pins // // //

byte data;//byte to receive and check data from computer void setup() { Serial.begin(9600);//Start the Serial port. pinMode(StepperA1, pinMode(StepperA2, pinMode(StepperB1, pinMode(StepperB2,

OUTPUT);//Stepper motor pins as output OUTPUT); OUTPUT); OUTPUT);

pinMode(penPin,OUTPUT);//Pen motor pin as a output pinMode(paperPin,OUTPUT);//Paper motor pin as a output back(80);//makes the car return, to be sure it will start at the begin of the line } void loop() { if(Serial.available()){//if there is data on the Serial buffer while(Serial.available()>0){//continues reading the values on the buffer. data=Serial.read(); if(data==1){ dot();//if a one was received, makes a dot. forward(1);//avances one time (four steps) } if(data==0){ forward(1);// if a zero was received just avances. } if(data=='L'){//if a "L" was received, pull the paper to begin a new line. pullPaper();//call the pulling paper function. back(80);//return the car. } } } } void forward(int number){//forward function, you can choose the number of steps when calling the function int i=0;//to control the number of steps while(i
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF