Here are some fun projects that I did. They don't really have anything to do with anything besides hacking stuff and just having fun.
This project came out of my interest in the HID Proximity RFID cards. They are used for entry into different different types of buildings and rooms. They work at a frequency of 125KHz. This project just uses a commercially avaliable reader and a MC9S08GB60 microcontroller and XBee wireless modules for the communication. No exact code will be posted but I will outline the steps taken to make the project.
Before I begin here is some reading that may be of use:
How is a card read
Some Wiegand
More Wiegand
Some parts of the above files may not be important but skim all of them
Assuming that you have read through the above files and have an idea what Wiegand is I will start with how the microcontroller plays a part in the card reading. So the card reader is powered via a 5V source. In this case it is a 5V regulator which also powers the microcontroller. The reader itself for this project does all the processing of the actual raw data on the card and spits out the binary data. The binary data comes out in the Wiegand format. Since there at two data lines the KBI on Port A is used to be the data inputs. They are setup on falling edge interrupt trigger and then it polls the two to see which data line is low. Then the microcontroller sends either a 0 or 1 back to the computer via the SCI device and the XBee module. The microcontroller is “dumb” and doesn't know how many bits are on the card so it just sends the data while it is avaliable. The computer takes care of the rest
The computer has XBee to serial adapter which it uses to capture the data. This data is read by a Visual Basic program. It reads in the serial data and then decodes the data into the FAC or facility code and the card number. This is done through string parsing and base conversion, the parity bits are ignored. This can be automatically done by the computer if the card length is of a known bit length or else the user has to select a custom format.
The overall result is the ability to easily walk around and get the id number off of someone's RFID card. This will not work with all cards and it is not recommended that you try this as in some situations this maybe illegal and may land you in a lot of trouble.
I obtained an old Epson touch screen cash register that the university was throwing out. It came complete with a external disply, touch screen, thermal printer, and Windows XP embbedded. I made some modifications to it and some programs to run on it, here is some of that information. It is not necessarily only true for this cash register and may provide some insight or ideas into how other work.
The printer on this specific cash register is TM-T88II(R) which is a thermal serial printer. It is located inside the unit itself and runs off of 24VDC. To install the printer I used a printer utility on the computer that was provided by epson. It installed both the printer and a special version of the printer that prints a reduced size of the output. However, they didn't work and the trick was to get the port correct. After doing some research and finding a program called OPOS I found that the printer and external display shared port COM3. So after switching the printer to COM3 I could print to the printer without any problem. Also, if the printer in the control panel was set to a port other than COM3 you could printer via hyperterm. What you do is connect to COM3 9600 baud, hardware controlled, 8 bit, no parity and you can print directly. However, if the printer is set in windows to this port there is a software conflict. To easily fix this problem the following VBscript was written to quickly switch printer ports.
'Switches the printer port for the specified printers-in this case the reciept printers
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
'This is for the first printer
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where DeviceID='EPSON TM-T88II(R) Receipt'")
For Each objPrinter in colPrinters
objPrinter.PortName = "COM3:"
objPrinter.Put_
Next
'This is fror the second printer
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where DeviceID='EPSON TM-T88II(R) Reduce35'")
For Each objPrinter in colPrinters
objPrinter.PortName = "COM3:"
objPrinter.Put_
Next
Mybox = MsgBox("COM3 set as printer port", 4096, t)
This version turns on COM3 as the printer port but you can also switch the COM3 to another valid port so you can use hyperterm.
When I started to control the printer via COM3 I also noticed that the screen displayed what was on the printer. There was no way however to display on the screen without printing to the printer. So I went about making a converter to switch between COM3 and another external serial port for the communication. The following picture is of the finished adapter installed.
So I took a DB-9 serial port plug and added an ethernet jack on top and a RJ-45 coming out the back. The top port is to plug the display into. The RJ-45 goes to the normal COM3 plug that the dislpay goes to. It provides the 24VDC also needed to power the display and also some control flow pins. However, the switch on the side is a DPDT which would switch the data line and DSR/CTS lines. Then I was able to switch whether the display was tied to the printer or controlled independently. Here is the schematic used for the pinout.
Though i only got the register itself and not the drawers I did get some interesting documentation with it. One document describeds the connectors includeing the DKD port which is for controlling the cash drawers. It is a 6 pin modular connector like a phone line. This is just for informing and not to be used for criminal activity. In order to help with that I am going to list the pins in no specific order:
Frame ground, Drawer kick out control (LOW:Open), Drawer Status symbol, 24 VDC supply, Drawer 2 kick out control (LOW:open), and Signal ground.
An idea was mentioned about the use of a machine like this for a music jukebox. So a program was made in Visual Basic which will play a list of songs. As the songs are played the current song will be displayed on the external display and may also be printed on the printer if wanted to give a playlist for the night. An additional feature is the ability to restrict who can add songs to the playlist. Using the magnetic card reader on the side the program will validate that the person has a valid UD#1 card and then allows them to add a song. If the ID isn't valid then the person cannot add the song.