• No results found

Dot Matrix Printer From a CDDVD Reader With Arduin

N/A
N/A
Protected

Academic year: 2021

Share "Dot Matrix Printer From a CDDVD Reader With Arduin"

Copied!
36
0
0

Loading.... (view fulltext now)

Full text

(1)

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

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

(2)

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.

(3)

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.

(4)
(5)

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.

(6)

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.

(7)
(8)

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.

(9)
(10)
(11)

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.

(12)
(13)

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.

(14)
(15)
(16)

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.

(17)
(18)
(19)
(20)
(21)

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 .

(22)
(23)

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.

(24)
(25)

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.

(26)
(27)

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.

(28)

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(); }

(29)

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 StepperA1 9 //stepper motor pins #define StepperA2 10 //

#define StepperB1 11 // #define StepperB2 12 //

byte data;//byte to receive and check data from computer void setup() {

Serial.begin(9600);//Start the Serial port.

pinMode(StepperA1, OUTPUT);//Stepper motor pins as output pinMode(StepperA2, OUTPUT);

pinMode(StepperB1, OUTPUT); pinMode(StepperB2, 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<number){

digitalWrite(StepperA1, HIGH); //this sequence is part of the basic algoritm to control a bipolar stepper motor. digitalWrite(StepperA2, LOW);

digitalWrite(StepperB1, HIGH); digitalWrite(StepperB2, LOW);

delay(time);//wait the time defined. digitalWrite(StepperA1, HIGH); digitalWrite(StepperA2, LOW); digitalWrite(StepperB1, LOW); digitalWrite(StepperB2, HIGH); delay(time); digitalWrite(StepperA1, LOW); digitalWrite(StepperA2, HIGH); digitalWrite(StepperB1, LOW); digitalWrite(StepperB2, HIGH); delay(time); digitalWrite(StepperA1, LOW); digitalWrite(StepperA2, HIGH); digitalWrite(StepperB1, HIGH); digitalWrite(StepperB2, LOW); delay(time); i++; } digitalWrite(StepperA1, LOW); digitalWrite(StepperA2, LOW); digitalWrite(StepperB1, LOW); digitalWrite(StepperB2, LOW); }

void back(int number){//As the forward function, but makes the reverse sequence. int i=0;

(30)

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

while(i<number){ digitalWrite(StepperA1, LOW); digitalWrite(StepperA2, HIGH); digitalWrite(StepperB1, HIGH); digitalWrite(StepperB2, LOW); delay(time); digitalWrite(StepperA1, LOW); digitalWrite(StepperA2, HIGH); digitalWrite(StepperB1, LOW); digitalWrite(StepperB2, HIGH); delay(time); digitalWrite(StepperA1, HIGH); digitalWrite(StepperA2, LOW); digitalWrite(StepperB1, LOW); digitalWrite(StepperB2, HIGH); delay(time); digitalWrite(StepperA1, HIGH); digitalWrite(StepperA2, LOW); digitalWrite(StepperB1, HIGH); digitalWrite(StepperB2, LOW); delay(time); i++; } digitalWrite(StepperA1, LOW); digitalWrite(StepperA2, LOW); digitalWrite(StepperB1, LOW); digitalWrite(StepperB2, LOW); }

void dot(void){//actives the pen motor for some time digitalWrite(penPin,HIGH);

delay(pentime);

digitalWrite(penPin,LOW); }

void pen(void){ //this functions can be used if you want to make lines instead of dots, digitalWrite(penPin,HIGH); // I think that the dots are cool.

} // void nopen(void){ // digitalWrite(penPin,LOW); // } //

void pullPaper(void){ //function to pull the paper digitalWrite(paperPin,HIGH); delayMicroseconds(pulltime); digitalWrite(paperPin,LOW); }

File Downloads

printer.ino (4 KB)

[NOTE: When saving, if you see .tmp as the file ext, rename it to 'printer.ino']

Step 16:

Done!

It was a nice and rewarding journey, I learned many things making this printer, it is a powerful didactic device, let's see what i played with:

The mechanical part is full of physics, the reduction gear is used to offer enough torque to pull the paper and do it slower than the the motor rotation.The spring makes the pen return to its original position, potential energy being nice here.

The electronic part has the Arduino and the components needed to make the motors spin, I learned how to use these stepper motors from old CD drivers using the L293D chip, they are really nice if you want precision.

About programming we have:

First contact with Processing, a really nice language.

Image processing and matrices(easy thanks to Processing), used to know if a pixel in a image is black or not. Serial communication used to transport the bits from the PC to the Arduino.

(31)

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

And recycling! I love to take apart old electronics and learn about them. You can imagine what kind of cool things that are inside these scraps.

Step 17:

Show your art! Sharing it with your friends!

It actually is yours printer's art, but if you don't say it i won't say it too.

My friends and girlfriend seems to like these printings, they even ask for an character ,pokémon, or something they like.

What about you? Make some these and give to someone you like, your friends, girlfriend or boyfriend, crush, little brother, grandpa.... I 'm sure they will love. Well, thanks for reading! And don't forget to vote for me in the contests if you liked my instructable, your support is really nice, these amazing prizes can help me to make new instructables that you may like.

(32)
(33)
(34)
(35)

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

Related Instructables

DIY delta 3D printer using low cost recycled parts by hesamh The Arduino Internet Gizmo by talk2bruce Buzz Wire Alarm Clock by hertzgamma Making a typewriter with an old keyboard and a dot matrix printer (Photos) by furri Beginner tutorial: Controlling LED matrix with 2 595 shift registers and potmeter by rscharff Tangible Music Player: RFID card controlled iPodTouch by XenonJohn Advertisements

Comments

10 comments

Add Comment

MrAskWhy says: Sep 16, 2014. 9:30 PM REPLY

looks like it's time to buy a silver pen and fab some circuits!

Robson Couto says: Sep 16, 2014. 9:34 PM REPLY

Hey!

It's an good idea.

rocketman221 says: Sep 16, 2014. 9:08 PM REPLY

Cool project, I'm tempted to build it even though I don't have a use for one right now.

I would suggest using an L298 h-bridge though if the L293 is getting hot enough to melt your breadboard.

Robson Couto says: Sep 16, 2014. 9:31 PM REPLY

Thank you! The fun is in building it, but printing and giving the images is cool too. The L298 don't get hot easy? Good to know, thanks.

suvinks

says: Sep 16, 2014. 8:22 PM REPLY

Good work. Loved the instructable. Going to hunt for from DVD readers :)

Robson Couto says: Sep 16, 2014. 8:48 PM REPLY

Thank you ;) Good hunting!

kenbob says: Sep 16, 2014. 7:16 PM REPLY

A+, I love this. It covers so much ground, and makes it all approachable and understandable. One of my favorite instructables ever.

Robson Couto says: Sep 16, 2014. 7:55 PM REPLY

Thank you for kind words.

This comment makes me want to go too much far.

And thanks for the A+, it is my first. Were i live the notes goes from 0 to 10.

k9oic says: Sep 16, 2014. 6:07 PM REPLY

(36)

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

Robson Couto says: Sep 16, 2014. 6:28 PM REPLY

You're welcome!

References

Related documents

We identified six affordances of eWOM that enhance customer engagement in tourism domain from interpretive multiple case studies: interactive affordance,

process. The audio signal is detected by the piezoelectric sensor and amplified by the amplifier, preferably at least 1000 times. The amplified signal is filtered by low pass filter

A triage test after HPV-DNA detection using the HPV16/18-E6 test exhibited a significantly higher specificity compared with a triage test of ASCH+ to CIN2+ (91.8% vs. 84.0%, p =

Then, DIY- banking models allow retailers the ability to exercise a total control on the management of the financial services, primarily using the retailer

Following recent calls for a better understanding of public views of human enhancement (e.g., [ 8 ]), we exam- ined the role of the Dark Triad of personality (DT), trait

The optimization shows that DebtRank can be reduced on average by a factor of 3.5, under constraints that guarantee that the banks’ interbank assets and liabilities, as well as

Scholars of death and grief online have often noted the frequency with which participants refer to heaven, angels and the afterlife (e.g. Walter et al. 2012), but very

Journal of Service Theory and Practice to others; how acceptance of cyborg FLE actors may be explored; issues of privacy and security raised by the embodied nature of the