Re: Connecting a printer to an Arduino?

by raykholo on Tue May 11, 2010 10:07 pm

Also, AVR 32 bit micros are capable of usb "hosting" Typically, the chip has enough memory to handle a library for printing, should anyone write one. I'm sure that since this is an Arduino related forum, most of us prefer AVR (myself included).
raykholo
 
Posts: 26
Joined: Fri Feb 19, 2010 5:54 pm

Re: Connecting a printer to an Arduino?

by mojo on Fri Jun 04, 2010 4:59 pm

Just a thought but if you wanted to use USB printers then one of the USB AVRs might do. The ones that have host/on-the-go support should be able to interface with printers that support Pict-Bridge (printing directly from a camera). Those AVRs can also act as mass storage devices which are supported by many printers. You would then have what you want to print as a bitmap that is read by the printer. The only major issue I can see is that printers may require images in JPEG format, but maybe they support other formats too. TIFF would be the most obvious choice or perhaps uncompressed BMP.

I have seen microcontrollers interfaced to Nintendo Gameboy printers before. They are not hard to work with.
mojo
 
Posts: 136
Joined: Mon Jan 21, 2008 4:04 pm

Re: Connecting a printer to an Arduino?

by uberhund on Fri Jul 23, 2010 4:31 pm

I was finally able to build a shield to successfully communicate with a Serial printer. My original design was based on a Maxim232, of course, but subsequently, I discovered a vendor selling an adequate RS232 shield (also based on a Maxim232) that, with some minor modifications, would enable it to work compatibly with an Arduino. Compatibility, in this case, means that outputs 0 and 1 are reserved for communication with the IDE and debugging output, while all other pins are available for RS232 TX and RX.

If LadyAda had designed this shield, I know none of the modifications would have been necessary. She would never have approved the original design. :shock:

Anyway, if anyone's still interested, I'll post what I believe is the simplest solution to adding printer support to a stand-alone Arduino, based on modifications to the commercially available shield.
Hacking is an addiction. Arduino is the gateway drug.
User avatar
uberhund
 
Posts: 120
Joined: Tue Dec 02, 2008 3:06 pm

Re: Connecting a printer to an Arduino?

by jer291113 on Sat Aug 07, 2010 3:55 pm

Hi Uberhund

I would be very interested in knowing more about your printer project. I'm going to order a small thermal printer off of eBay that has a serial port.
jer291113
 
Posts: 9
Joined: Fri Jul 23, 2010 8:56 am

Re: Connecting a printer to an Arduino?

by richms on Sat Aug 07, 2010 6:37 pm

If you are looking at a POS type recipet printer, then all that I have looked at have exactly emulated the epson TM-88 protocol, which at its most basic you can just serial write stuff and have it print, Once you have that working you can start to play with the codes to do bigger and bolder writing.

just be aware if you get one that is serial, and you later want to use it on a PC, it will be _SO_ slow to print things even at 57600bps (the fastest they do) because everything that windows sends is a bitmap.

You might want to look at getting a parallel one and using it instead, since that will be so much more usable on a PC if your needs change. I saw this come up a while ago on some list or RSS I was on - http://www.gotbadger.org.uk/2010/06/20/arduino-controlled-epson-tm-t88p-printer-part1/

Even with that inefficiant code to set each pin I think it would be faster than serial, and you could look into using a shift register on the data lines to minimize pincount if you are short of them.
richms
 
Posts: 558
Joined: Tue Jan 20, 2009 2:05 am
Location: New Zealand

Re: Connecting a printer to an Arduino?

by uberhund on Sun Aug 29, 2010 12:44 pm

The parallel to serial conversions and Arduino pin-count issues renders the parallel approach a non-starter. As someone who has actually made a working printer solution for the Arduino (one of the very few, from what I can tell), it's still my opinion the solution below is optimum, as of this writing.

1) Acquire an RS232 serial shield. If from http://www.cutedigi.com, then these three Mods will be required:
    MOD1: Bend shield pins 0 and 1 so they do not plug into the Arduino serial dedicated digital IO pins. This allows the Arduino serial com to remain available to sketch uploading and USB debugging.
    MOD2: Add jumpers between whatever two ports you wish to use as printer IO pins and the RS232 shield pins 0 and 1 (remember - we bent the shield pins so they are no longer talking to the Arduino, but the RS232 shield is still expecting TTL-level serial data on its pins 0 and 1 anyway. The jumpers will "fool" the shield into believing data is from Arduino pins 0 and 1, when actually the signals are coming from whatever Arduino pins you jumper them to.)
    MOD3: Add a reset button to the RESET and GND pins. Grrr. The shield completely covers the Arduino reset button. Who designs things this way?
2) Plug in your receipt printer to the DB9 socket of the shield and start churning out paper.

Believe it or not, it's that simple. Why someone hasn't make a decent printer shield is beyond me. It took me a year to find this one. I spoke with the support person for the RS232 shield suggesting they improve their board to address its these mods. For some reason, I might as well have been speaking Martian.
Last edited by uberhund on Fri Sep 02, 2011 11:42 am, edited 3 times in total.
Hacking is an addiction. Arduino is the gateway drug.
User avatar
uberhund
 
Posts: 120
Joined: Tue Dec 02, 2008 3:06 pm

Re: Connecting a printer to an Arduino?

by westfw on Mon Aug 30, 2010 12:45 pm

I don't quite get it. It's always been "obviously trivial" to connect a serial-interface intelligent ascii printer to an Arduino. The problem is that that kind of printer is increasingly difficult to find (and expensive when you do find it.) Newer low-end printers with USB interfaces are often much dumber, so that in addition to needing to implement a usb host interface to talk to them (not really possible with an Arduino), you also need to send them data in weird proprietary formats at high rates (also difficult on an Ardunio.)

Did you find a good source for serial printers?
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Connecting a printer to an Arduino?

by westfw on Mon Aug 30, 2010 1:04 pm

Add a reset button to the RESET and GND pins. Grrr. The shield completely covers the Arduino reset button. Who designs things this way?

People who designed shields before there WAS a "reset" signal on the shield connectors :-)
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Connecting a printer to an Arduino?

by jer291113 on Mon Aug 30, 2010 2:12 pm

Thanks for your response Uberhund

The interface isn't the problem, it's the printer. I'm using the Sipix Pocket Printer which was inexpensive but doesn't use regular ASCII characters to print. It uses some kind of graphics scheme to generate the characters, etc. I've been trying to get info but have not had much luck, a regular ASCII receipt printer would be okay but too expensive.
jer291113
 
Posts: 9
Joined: Fri Jul 23, 2010 8:56 am

Re: Connecting a printer to an Arduino?

by uberhund on Mon Aug 30, 2010 3:13 pm

Well, the interface was a problem for *me*! But, in any case, I wish I could help Jer and Westfw.

I'm using a $250 Epson receipt printer given to me by a friend. I wish I had more friends - I'd be happy to share.
Last edited by uberhund on Tue Aug 31, 2010 7:03 am, edited 1 time in total.
Hacking is an addiction. Arduino is the gateway drug.
User avatar
uberhund
 
Posts: 120
Joined: Tue Dec 02, 2008 3:06 pm

Re: Connecting a printer to an Arduino?

by richms on Tue Aug 31, 2010 2:27 am

Check out your local physical auction houses, when food service places go broke they normally physically auction things because most are large etc, and the point of sale equipment normally goes for quire cheap IME. I got barcode scanners and epson printers for stuff all to setup dispatch stations for a friends online store.
richms
 
Posts: 558
Joined: Tue Jan 20, 2009 2:05 am
Location: New Zealand

Re: Connecting a printer to an Arduino?

by copiertalk on Tue Aug 31, 2010 7:31 pm

I have made network printers print via port 9100.

It is not all that grand or glorious a solution but does work.
copiertalk
 
Posts: 6
Joined: Sat Aug 21, 2010 12:58 pm
Location: Texas

Re: Connecting a printer to an Arduino?

by uberhund on Wed Sep 01, 2010 6:06 am

So you used an ethernet shield on the Arduino to address the printer through a URI of some sort?
Hacking is an addiction. Arduino is the gateway drug.
User avatar
uberhund
 
Posts: 120
Joined: Tue Dec 02, 2008 3:06 pm

Re: Connecting a printer to an Arduino?

by copiertalk on Sat Sep 04, 2010 7:32 pm

uberhund wrote:So you used an ethernet shield on the Arduino to address the printer through a URI of some sort?


port 9100 is a simple protocol. The device will print anything it gets on that port. You can simply send your data and it will print.

Yes, with an ethernet sheild. I
copiertalk
 
Posts: 6
Joined: Sat Aug 21, 2010 12:58 pm
Location: Texas

Re: Connecting a printer to an Arduino?

by uberhund on Sat Sep 04, 2010 7:51 pm

I'm intrigued by this. Could you post a sketch that you actually know works?
Hacking is an addiction. Arduino is the gateway drug.
User avatar
uberhund
 
Posts: 120
Joined: Tue Dec 02, 2008 3:06 pm