__________________________________
\ ____________________________ /
\ \ / /
) ) THE ASCII ART SCANNER ( (
/ /__________________________\ \
/________________________________\
Introduction:
-------------
You always deal carefully with your computer, you always do what the
manufacturer recommends ...
That is very good and if you will take good advice, if you have good sense
you should NOT read the following text under any circumstances! It is about
the merciless abuse of hardware for senseless purposes. In other words:
The following guidance describes the use of an old printer as a "scanner".
It addresses amateur craftsmen with the courage to do crazy things. It
should be clear to everyone that the result of this experiment doesn't
have much to do with a normal scanner. One version of this "scanner"
provides, in the optimal case, pictures which are (solid line or gray
scale) ASCII-art.
I did not have the idea to build an ASCII scanner actually at first. I was
young, poor, and really wanted to have a scanner. Unfortunately my budget
did not permit that, and then I had the idea that I could build a scanner
by myself ... then I tried my idea and suddenly I had an ASCII scanner...,
before I ever heard of ASCII-art. :)
_____________
_____________________________/ \______________________________
\____________________________-W-A-R-N-I-N-G-_____________________________/
(( )) \_____________/ (( ))
\\// IF YOU WILL NEVERTHELESS CONTINUE READING OR ACTUALLY TRY \\//
\/ TO BUILD ONE, AT LEAST BE CAREFUL. DO _NOT_ WORK ON THE \/
() HARDWARE OF YOUR PRINTER WHILE IT IS PLUGGED IN! WARNING! ()
() ELECTRICAL HAZARD! AUTHOR IS NOT RESPONSIBLE FOR INJURY OR ()
/\ ANY KIND OF DAMAGES ! USE AT YOUR OWN RISK !!! /\
(__)________________________________________________________________(__)
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
/_/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\_\
PART I: HARDWARE
================
Components:
-----------
+ cable, flexible, 2-4x (depends from the sensor)
+ Joystick plug
+ if need be a Component Board and a Variable Resistor Pot for the regulator
+ light sensitive resistor (alternative: barcode reader, additional: LED)
+ old printer cartridge
Cost [without computer and printer ;-) ]: ~ $6
(1.) (2.) (3.) (4.) (5.)
Sensor
+----+ +---------------+\________
| C | | +-+--________\____O
| o | | | | / \_\
| m | | | | |
| p | Joystick +------------+ | | | | ___
| u +-( )----------| Regulator |-----------|-------| | \__/__/
| t +-( )----------|(controller)|-----------|---------| ___/
| e | Port +------------+ | /
| r | +---------------+
| |
+----+ Printer cartridge
1.) A Computer : Isn't important which one. From a C64 to a high end
PC everything works. You likewise need a old
(9 pin) printer with one way cartridges.
2.) Joystick port : Connected are only two pins: Fire button and GND.
(Fire1 or Fire2). If you have a analog input you
could use this one alternative (-> gray scale).
[Of cause you can use the serial port too, but it
isn't needed because of the low data transfer rate.
Normally it's more easy to program the joystick
port]
3.) Regulator : Especially if you use a digital joystick input
(Amiga, Atari). A normal PC port has a analog input
and you can regulate the input per software.
Otherwise one Resistor Pot is enough. The value depends
from the sensor (means: you must try). If the Ohm
value of the sensor is to high, it might be helpful
to integrate an signal amplifier (two transistors,
'Darlington' circuit or something similar, see bottom)
4.) Printer cartridge: You should only use a old or empty one. First
remove the color band (open) and make sure that you
didn't damage the mechanic. Cut a little opening
(left side) in the plastic, where the sensor should
be later. On the left side make a small hole for
the cable.
5.) Sensor: : I would suppose to put the sensor at the top of a
small plastic tube. You can use a light sensitive
resistor , a transistor or a barcode reader (<-
works good). I couldn't say anything to the exact
values of them. You must try to find the best
'break value' with help of the regulator. The
plastic tube is now inserted in the small opening
(4.). It should be moveable because you must set
the distance to the paper later. The cable should
be flexible and long enough (don't forget to
calculate the distance which the printer head
moves). [I have had better results with a barcode
reader as with a light resistor. They need normally
external power. A LED which guarantees a constant
brightness, helps too.]
Other:
- The mechanism of the printer cartridge must work. Otherwise the printer
head will not move.
- The sensor should be built in at the left side.
- The sensor should be moveable to set the best distance
- IMPORTANT: This description contains nothing that tells you to change
anything internal at your computer and printer !
- My Hardware (only as information, not necessary):
Amiga500, Star LC10 9 Pin Printer
WARNING: [AGAIN]
THIS MANUAL IS FOR PERSONS WITH SOME KNOW-HOW ABOUT ELECTRONICS. THE PLUGS
OF YOUR COMPUTER AND PRINTER ARE HOT. IF YOU MAKE A MISTAKE YOUR HARDWARE
MIGHT BE DAMAGED. THERE IS NO RESPONSIBILITY OF THE AUTHOR. THERE IS NO
GUARANTEE FOR THE CORRECTNESS AND COMPLETENESS OF THIS DOCUMENT !!!!!!!!!!
UNPLUG EVERYTHING BEFORE STARTING. USE AT YOUR OWN RISK!
This all may take more effort than it what might appear at first. You should
use old hardware. A second hand C-64 with printer cost around 30$ at the
moment.
PART II: SOFTWARE
=================
This is the more difficult part of this manual:
I think that you wouldn't find any software for this self construction
and therefore you need some programming know-how. The language isn't
important, but you should know a bit about controlling the hardware ports.
The program has the following parts:
1.) Reading the sensor inputs (port control)
2.) Controlling the printer
3.) Analyzing and optimizing the data (+ output)
The structure of the program is simple and you can realize it in BASIC
fast. If you want to change the program with some more functions later,
other program languages have more potential (some free components are
available for Delphi and C++). Following routines should be included in
the program.
A.) Reading the ports:
Possibility 1: Reading the fire-buttons (Black/white Scanner, digital)
If the sensor value (Ohm) is high, set a '1'/TRUE (apply power)
Otherwise set a '0'/FALSE. If you want to display the graphic on
screen you can use something like 1:="#" and 0:=" " later. If there
isn't enough difference between the dark and light areas to switch the
port control you must adjust the regulator or amplifier. A LED might
help if the sensor works in a high Ohm area.
Possibility 2: Reading Resistor Pots (gray scale scanner, analog)
Depending on the brightness of the graphic, the resistance changes.
You could use different intervals to set the characters.
Example (in KOhm):
0-25=" ", 25-50=".", 50-75="o" , 75-100="#" (whatever you like ...)
You can download complete software unit which controls the ports from
the www.
INFORMATION:
If you use a sensor with only two states (barcode reader) there is no
reason to use an analog input.
B.) Controlling the printer.
First you need the printer control codes (see manual) . The controlling
works with the ESC sequences of your printer. After you have opened the
printer port (Open COM or LPT1 ...), you need a routine, which will let
the printer scroll about the paper (character after character, with a
short stop for slow sensors = light sensitive resistor).
Possible motions of the printer head:
1.) Line by line (left to right) 2.) Bi-directional
---------------------> (line wrap) -----------------------.
---------------------> (line wrap) .----------------------'
---------------------> (line wrap) '----------------------.
Although the second one looks more elegant, the first has a great
advantage: The printer is adjusted left after every line. If the
sensor isn't very exact it might be helpful the check the position
more than one time.
C.) Analyzing and optimizing the data
Here you need your imagination. You should integrate an auto-save
function and a routine which tries to reduce errors (<- could be
very complex). The standard output is a text graphic ( a self defined
symbol font with a OCR routine is nice), but you can make a pixel
graphic too. The reason why this is a ASCII scanner are the following:
A standard printer move has the width of one character. Therefore
ASCII art is the optimal medium. A pixel graphic must be stretched to
the correct aspect ratio and becomes very small (see bottom and
links).
PART III: Expansion possibilities
=================================
Other Sensors:
A lot of possible variations: IR sensor, barcode ready, extern light
source, ...
Pixel width moving of the printer:
Most printers could be moved pixel by pixel. You can try to scan with this
setting, but I wouldn't suggest it. My results have been really poor and I
have needed ~36h(!) to scan a picture (my printer could move about pixels,
but it couldn't do it with 'stop and go' => needs to be adjusted after
every move). There are a lot of other problems: Paper isn't inserted
correctly, light changes, computer crash, ... If you nevertheless try it,
don't complain: You have been WARNED! (See sample pictures)
Making the Printer a "PLOTTER" instead of a scanner:
If the preceding was too insane for you, now it becomes really bizarre.
You can realize with a similar construction a 'Plotter'. I know that it
is off topic, therefore only a short description:
+--------+------+\____ ....... Elastic band
| .....|=|Magnet| ___ \
|.O |______|/ \_\
| ..../ |
| / | ___
-------| o Joint \__/__/
------ | / O O ___/
| /HHHHHHHHHHHHHHHHHHHHHHHHH>- (Moveable pen)
+-----O--------O+ Pen
The basic principle : The computer controls the electric magnet, which
pulls the band tight. Above the joint the pen is pressed on the pager. If
the magnet isn't under power the elastic (!) band moves the pen back. The
magnet should be controlled with the serial port (Printer with ESC
Sequences). You should make three runs because you need to change the pens
to produce all three colors (Red, Green, Blue).
If you want to modify the plotter some more, it is possible to misuse it
as a one-pin printer .... hmm, I should stop know ...
PART IV: Tech. Reference
========================
Game Ports (PC):
~~~~~~~~~~~~~~~~
Pin | Function
----+---------------------------------------------
1 | POWER +5V (*)
4 | GND
2 | FIRE 1 -> digital
7 | FIRE 2 -> "
3 | INPUT 0 Pot 100K (Pot is in your Joystick) -> analog
6 | INPUT 1 Pot 100K (Pot is in your Joystick) -> "
(*) To protect your hardware you should use an external power source
if you need one.
More info's: 'Hardware Book'
( http://studenten.freepage.de/meph/info/2links.htm
page is German, but the first link lets you download the Eng. Book)
'Darlington' circuit : (Theoretical construction)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__+---+_________________________________
| +---+ | | T1,T2: Transistors,
| R1 +-+ | (+) NPN (*)
| | |R3 -----
| | | === R1-3 : Resistors
| +-+ | (-)
| | |
o o | .... : Possible
In (Sensor) Out | modification
o o | (regular)
| ________________| |
|__+---+_T1_|/ C | | R4 : Variable
: +---+ B |\___ | | Resistor
: R2 E | | | Pot
: | ___| |
: _ |____T2_|/ C |
: /` R |\___ |
:..+--/+....................E.|__________|
+-/-+
/R4
(*) A (European ?) standard type is BC547.
Plastic tube with sensor (Samples):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Partial view (~ 1:1)
___________
~~~~~~~~~~~\
............\______________________
__\
Plastic tube ===|___) IR LED
===|___) IR Sensor
.........................__________/
~~~~~~~~~~~~~~~~~~_~_~ ~ \
~~~~~~~~~~~~~~~~/ \ ~ \
~~~~~~~~~~~~~~~/ \_~_\
___________
~~~~~~~~~~~\
............\______________________
__\_
Plastic tube ===| (| Barcode reader
---|___(| or Phototransistor
.........................__________/
~~~~~~~~~~~~~~~~~~_~_~ ~ \
~~~~~~~~~~~~~~~~/ \ ~ \
~~~~~~~~~~~~~~~/ \_~_\
___________
~~~~~~~~~~~\
............\________________________
===|__ _) LED
Plastic tube |\
======| ) Light sensitive resistor
.........................__________|/
~~~~~~~~~~~~~~~~~~_~_~ ~ \
~~~~~~~~~~~~~~~~/ \ ~ \
~~~~~~~~~~~~~~~/ \_~_\
I have had the best results with a simple barcode reader (~3$). All of
this components shouldn't cost more than 2-3$. Of cause you could use more
effective (=expensive) sensors, but I don't believe that they are suitable
in this low tech production. ;)
PART V: Credits
================
Joe Fischer: Thank you for translating my barbaric English to readable text.
____________________
/ \
/) (\ /\ /\ /) (\ (HELLOJOETHANKX4THEHELP)
((___)) //\\ //\\ ((___)) )WITHTHETRANSLATIONNO(
/_\___/_\ (( \\______// )) /_\___/_\ (WYOUHAVETREEWISHFREE(*)
\ /___\ / \\ \______/ // \ /___\ / \___ ____________/
(( )) ))___ ___(( (( )) _) /
\) (/ //-<##) (##>-\\ \) (/ ____/ ___/
(( )) ___/ ____/
____\\ /\ //____ __/ ___/
__/ \\ (/\) // \_/___/
_/ \\ ____ // _/__/\_
/ \\/VVVV\//____/_/ \
( \\____// )
\ \ \\__// / /
) ) \__/ ( (
/ / \ \
<O>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<O>
(( __ __ _____ ____ __ __ ))
)) \ \ / / / ___/ | _ \ ( \ / ) ((
(( () \/ () ( (__ | |_) ) \ (__) / ))
)) / _ _ \ ) __) | __/ ) __ ( ((
(( / / \/ \ \ ( (___ | | / ( ) \ ))
)) /_/ \_\ \____\ |__\ (__/ \__) ((
__(( . . . . . . . . ))__
\/_))|\|\|\|\ -(C)-1999- /|/|/|/|((_\/
<O>| ) ) ) )=-=-=-=-=-=-=-=-=-=-=-( ( ( ( |<O>
(_)_)_)_) (_(_(_(_)
( )
\ ))(( /
\_______//__\\_______/
/_______\\__//_______\
( \ / )
\__ \/ \_
\__ \__
\___ \__
\___ \_
\___ \_
\____ \
____) )
_______/ ____/
_____/ _________/
/ ____________/
( (__
\___ \
\_\
___
[ ]
) (
( )
__/ \__
|_________|
|#Jonny###|
|##Walker#|
|#########|
|#Black###|
|##Label##|
|#########|
|_________|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(*) Except from the translating of the original
A. Einstein scripts to English. ;)