Will it print?

Part 1

For a friend of mine I've developed a "point of sale"-system a couple of years ago which helped him to run over the counter sales in his small gym and also to offer membership contracts etc to his clients.
With the intention as a hobby of mine but also for him to save money I've realized the whole application in linux text mode to make it usable even on the slowest and oldest linux system either directly on a terminal or also in a remote putty session.

So the planned next step was to implement a receipt printer (so far they can get their receipt only by email) and an RFID reader to support loyalty cards for his clients. For that I have a few  RFID reader building kits at home for quite some time, which I bought a couple of years ago, waiting to get used some day.

But only after I saw these small thermal printers in a webshop, this project got back into my mind so I've decided to finally build this ideally as all-in-one device.

This is a thermal printer running already at 5 volts and has a serial interface at 19200 baud on TTL level, just perfect to connect directly to one of my favorite microcontrollers.
:-)

Both, printer and RFID reader should go into the same enclosure and have a joint network connection.

The RFID reader kit reads 125kHz tags and send their code as hex data on a serial port as well with 9600 baud. Unfortunately this kit is sold out meanwhile and replaced by a more expensive one with functions I would not really need.
But: the vendor is still offering the layout and parts list and even the firmwarefor download for the AT-tiny 2313 microcontroller they are using.
For those of you who are interested, here are the links:
Layout & description RFID building kit (pollin.de)
Firmware for AT Tiny controller for RFID reader (pollin.de)

I have to add that I've used this RFID reader kit already in the past for an automated door lock - for some reason two capacitors needed to be replaced with a different type, otherwise this thing simply didn't work. If someone wants to build this reader according to the layout mentioned above  - I can let you know the necessary changes, just drop me a message here.

The next component necessary is a microcontroller, connecting to the printer and the RFID reader and making both available via network. In fact there are a lot of options possible for that. For instance an arduino with a network shield. In the end I've decided for something out of the things I still had at home. It's a ready to use PCB with a layout for using an ATMEL processor together with the ethernet controller ENC28J60 for network connectivity. It's even still available :-) and supports a power supply circuit on board as well as a level converter (MAX232) for RS232 signals to TTL and back.

ATMEGA1284p together with ENC28J60 above
On the board I've only put the components I really need. First to save the rest for other projects but also not to waste energy as I do expect the printer to be switched on non-stop more or less.
The diodes, 7805, MAX232 and capacitors coming along with that I didn't solder onto the board.
Further I replaced the ATMEGA32 with an ATMEGA 1284p, as I would like to have a bootloader, which enables later updates via ethernet instead of using an ISP programmer all the time.
On the picture you already see the connection to the RFID reader board (the blue, yellow and grey cable) for serial connection and 5V power.

Further I need a case and a 5V power supply. Of the latter one I still have a few, coming out of a bunch of 10 or so I bought years ago. There are a lot of quite cheap 5V 1A power supplies - it turned out that these standard ones are not working for a thermal printer combined with a microcontroller. The power consumption of the printer is quite high when printing, which caused the microcontroller to restart after each line. (and also caused some debugging at the wrong end... ;-)
So I've made use of an 5V 2.2A open frame AC/DC adapter, which is small enough to fit into the same enclosure together with printer, rfid reader and the microcontroller board.

The enclosure will be a plain plastic box, hopefully big enough to contain all the components. I was first thinking to probably leave the power supply outside and take one which is integrated into a plug enclosure. But in the end it is probably nice to have everything integrated in one box plus there is more freedom around the electricity socket. :-)

As I want to make the network cable directly plugable into the board I needed to make sure that the enclosure has an right sized opening where the network socket of the board sits.

Cutting openings into plastic enclosures is always difficult in my experience. The bigger opening for the printer worked quite well with a dremel. The issue is that at high rotation speed the plastic tend to melt and destroying the edges of the opening to a certain extent. Whereas with smaller openings it's difficult to cut into it at all without making it to big. Hence the small one for network connection socket I drilled and widened with a file afterwards.

Due to the size of the microcontroller board and kind of reinforced corners in the enclosure the network socket is pointing to the site, not ideal but better than having the socket somewhere deeper inside the enclosure, more difficult to reach from outside.

On the left you see the enclosure with the microcontroller and power supply. Mounting the power supply turned out be tricky: the board is full with components and there are no mounting holes and also no space for it. On the other hand I also didn't want screws to stick out of the enclosure which are inside near to high voltage. So I had to clamp the power adapter with an isolated metal bracket inside of the case. For some reason these mechanical issue taking often most of the time of such projects, but maybe it's also only me... ;-))




Inner side of lid of the enclosure
getting full...

On the lid side of the enclosure you see the backside of the printer, the coil of the RFID reader and I also put 3 LED illuminated button for future use into it.
Together with the board for the RFID reader between microcontroller and power supply, the enclosure is getting busy.





The whole box is now having the printer in the back part, then three buttons, which are planned maybe for a time tracking system later on, plus the rfid reader in the front part. I will probably create a sticker which is making clear where to put an RFID card for reading.

In part 2 I will explain more about how the printer and the rfid reader are connected to the microcontroller, what kind of framework I'm using to program it and how it looks when doing test print out and reading rfid cards.

Thanks for reading and feel free to make comments or ask questions you may have.

:-)

Comments