🎄⛄❄️🎁 It's beginning to look a lot like ADABOX-mas! The next ADABOX from Adafruit ships soon! Get yours now, or give as a gift! 🎄⛄❄️🎁
0

Connecting a printer to an Arduino?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Connecting a printer to an Arduino?

by uberhund on Sat Dec 06, 2008 1:49 pm

Has anyone ever done this before?

I'm desperate, so I'd be interested in examples connecting a Diecimila or Duemilanova directly (not through a PC) to a hard copy device through any interface - Serial, USB, TTL, ethernet -I'll take any example the forum might have up its sleeve.

Thanks to all
Hacking is an addiction. Arduino is the gateway drug.

uberhund
 
Posts: 142
Joined: Tue Dec 02, 2008 4:06 pm

Re: Connecting a printer to an Arduino?

by sparr on Sat Dec 06, 2008 3:04 pm

I have not done it, but I might start here
sparr
 
Posts: 196
Joined: Tue Nov 04, 2008 5:21 pm

Re: Connecting a printer to an Arduino?

by eil on Sun Dec 07, 2008 7:30 pm

Do you have a plan of action so far? How much are you looking print, how often, and how much physical space are you talking? Those answers will determine the kind of printer you need.

If you're using an Arduino, I would assume the answers would be "not much," "not very," and "little." A serial thermal printer (like the ones that print grocery receipts) would fit the bill and finding a cheap used one in an auction shouldn't be terribly hard. Since the Arduino speaks serial easily, I believe all you'd need (hardware-wise) is something to convert TTL to RS-232, like a MAX232. Depending on the printer, I shouldn't think you'd need to do any extremely crafty coding to talk to it. It ought to be just a serial device.

But I've never done anything like this so someone correct me if I'm wrong. :)
eil
 
Posts: 440
Joined: Sun Aug 31, 2008 11:09 pm

Re: Connecting a printer to an Arduino?

by Entropy on Fri Dec 12, 2008 1:36 pm

Depends on the printer. Older parallel printers had a mode where you could pretty much feed them raw ASCII and they would print it. Not sure about modern printers, esp. not modern USB printers.

It will be nearly impossible to interface with a USB printer - AVRs can act as USB devices but not as USB hosts.

Network printer + Ethernet shield might work
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Re: Connecting a printer to an Arduino?

by uberhund on Sat Dec 13, 2008 11:01 am

Thanks to sparr, entropy, and eil for your inputs.

I really liked the link,http://www.beyondlogic.org/spp/parallel.htm, sparr. Good find.

These comments have helped me draw a circle around some of the issues - here's the net as I see it so far:

1) USB is electrically practical, but the barrier appears to be the rich, packet-based, USB protocol. Maybe too rich even for the relatively verdant code space budget of a '328. Check it out here: http://www2.rad.com/networks/2000/usb/maintxt.htm

2) TTL has a simpler protocol, but the barrier appears in the number of pins required by the Centronics parallel interface standard. More, by half, than Arduino has available.

3) Ethernet - Appealing, but the barrier is the requirement of an ethernet friendly printer who's IP address would be fixed and known to the Arduino.
Last edited by uberhund on Thu Feb 25, 2010 9:20 am, edited 1 time in total.
Hacking is an addiction. Arduino is the gateway drug.

uberhund
 
Posts: 142
Joined: Tue Dec 02, 2008 4:06 pm

Re: Connecting a printer to an Arduino?

by rufruf on Mon Feb 15, 2010 9:27 pm

If anyone needs to print with Arduino using an Epson printer or an ESC POS compatible printer then goto my blog site:

you can ask me questions from there.

http://printarduino.blogspot.com/
rufruf
 
Posts: 1
Joined: Mon Feb 15, 2010 9:25 pm

Re: Connecting a printer to an Arduino?

by Rotzog on Mon Feb 15, 2010 11:08 pm

You could also try one of the serial point of sale (pos) printers. The docs are pretty easy to get.
Rotzog
 
Posts: 106
Joined: Mon Nov 23, 2009 10:10 pm

Re: Connecting a printer to an Arduino?

by TheFallen on Wed Feb 24, 2010 7:41 pm

Seeing as the FT232 chips on Arduino boards are simply TTL serial to USB as a VCOM you may find the trask of pretending to be a print server a little hard, impossible even.

You could attempt to make use of the VUSB library http://www.obdev.at/products/vusb/index.html but this does not work directly with Arduino as far as I know, however Rancid Bacon has a few pages on it:
http://code.rancidbacon.com/LearningAboutArduinoAVRUSB
http://code.rancidbacon.com/ProjectLogArduinoUSB

Assuming you want a "proper" printer aka A4/Letter size, you're best finding a cheap 2nd hand parallel port one, and bit banging that. Or at least that's how I'd go about it.
TheFallen
 
Posts: 94
Joined: Mon Feb 08, 2010 1:28 pm
Location: UK

Re: Connecting a printer to an Arduino?

by uberhund on Thu Feb 25, 2010 9:21 am

You are correct, Fallen. It was impossible. My current solution now is to implement the interface described in the link by rufruf, with fingers crossed.
Hacking is an addiction. Arduino is the gateway drug.

uberhund
 
Posts: 142
Joined: Tue Dec 02, 2008 4:06 pm

Re: Connecting a printer to an Arduino?

by raykholo on Mon Apr 26, 2010 4:16 pm

Guys, I have seen the PIC 32 bit microcotrollers used as USB hosts. Perhaps look into the Basic Stamp, which uses the pic chip. Personally, I use arduino and i could also appreciate if it could work as a usb host - for example to interface with a usb bluetooth dongle. The ~$60 bluetooth modules are pretty annoying to have to buy... Xbee is good, but bluetooth would also be nice.
raykholo
 
Posts: 26
Joined: Fri Feb 19, 2010 6:54 pm

Re: Connecting a printer to an Arduino?

by adafruit on Mon Apr 26, 2010 9:21 pm

the basic stamp doesnt use pic 32bit controllers and not sure what bluetooth has to do with either since this thread is about printers.

there is a 'usb host' shield for arduino http://www.circuitsathome.com/category/ ... usb-shield
but youd have to figure out the printing protocol which isnt necessarily simple

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Connecting a printer to an Arduino?

by raykholo on Fri May 07, 2010 9:40 pm

adafruit wrote:the basic stamp doesnt use pic 32bit controllers and not sure what bluetooth has to do with either since this thread is about printers.

there is a 'usb host' shield for arduino http://www.circuitsathome.com/category/ ... usb-shield
but youd have to figure out the printing protocol which isnt necessarily simple


ok, my bad... The basic stamp uses a pic microcontroller so I figured that that would be the best bet for someone that does arduino (without having to learn to program a pic microcontroller (Basic + assembly vs. C)

The bluetooth part of the comment was a bit off topic; I was saying that having arduino as a host would allow me to use a ~$2 usb dongle instead of a ~$60 breakout board for a bluetooth module. Thanks for pointing me in the direction of the usb host shield. I will be sure to take a look.
raykholo
 
Posts: 26
Joined: Fri Feb 19, 2010 6:54 pm

Re: Connecting a printer to an Arduino?

by charliex on Fri May 07, 2010 11:16 pm

some printers are bluetooth enabled.
http://032.la - Null Space Labs.
charliex
 
Posts: 179
Joined: Sat Nov 28, 2009 5:54 pm
Location: Las Vegas

Re: Connecting a printer to an Arduino?

by pstemari on Mon May 10, 2010 10:15 am

If you're trying to print to a Centronics-style parallel interface, then a shift register plus 3 or 4 pins ought to do it. Clock the bits into the shift register, strobe the port, and repeat as needed.
--Paul

A wholly owned subsidiary of:
Persephone: DL R+W+B C 7 X L W C++ I++ T+ A E H++ S+ V-- F+ Q P B PA+ PL
Aldebaran: DM Rt H 5 Y L- W+ C+ I++ T++ A+++ E H++ S+ V+ F++ Q+ P B++ PA- PL--
User avatar
pstemari
 
Posts: 310
Joined: Sun Mar 21, 2010 6:10 pm
Location: Seattle, WA

Re: Connecting a printer to an Arduino?

by JohnDowdell on Tue May 11, 2010 10:19 am

Here's another option:
http://www.vinculum.com/documents/appnotes/AN_106_Interfacing_USB_Printer_using_Vinculum_Host_Controller_FT_000064.pdf

FTDI have a spinoff product/company called Vinculum. At the heart of it is the VN1CL IC that is a USB host controller that can be accessed by serial or SPI with a "simple" ascii text command/reply protocol (there's a binary protocol option too). Vinculum provide a few different firmwares that can be loaded into it for supporting such things as usb flash drives (which i have used it for before) and in the above app note, printers.

I was looking around for my VDIP module that is the VN1CL IC on a small breakout board to see if i could prove if it works for printers but i havn't found it yet. The doc's may take a little reading and FTDI don't seem to write manuals/datasheets the way you'd want to read them :)

John Dowdell
JohnDowdell
 
Posts: 27
Joined: Sun May 02, 2010 1:59 am

Please be positive and constructive with your questions and comments.