Hardware Notes 1
Hardware Notes 1
INPUT DEVICES
Barcode Scanners
A barcode is a series of dark and light parallel lines of varying thickness. The numbers 0 to 9
are each represented by a unique series of lines. Various barcode methods for representing
these digits exist.
Barcode scanner is a hand-held or stationary input device used to capture and read information
contained in barcode.
» the barcode is first of all read by a red laser or red LED (light emitting diode)
» light is reflected back off the barcode; the dark areas reflect little or no light, which allows
the bars to be read
» as the laser or LED light is scanned across the barcode, a pattern is generated, which is
converted into digital data – this allows the computer to understand the barcode
» the barcode number is looked up in the stock database (the barcode is known as the key field
in the stock item record); this key field uniquely identifies each stock item
» when the barcode number is found, the stock item record is looked up
» the price and other stock item details are sent back to the checkout (or point of sale terminal
(POS))
» the number of stock items in the record is reduced by 1 each time the barcode is read
» this new value for number of stock is written back to the stock item record
» the number of stock items is compared to the re-order level; if it is less than or equal to this
value, more stock items are automatically ordered
» once an order for more stock items is generated, a flag is added to the record to stop re-
ordering every time the stock item barcode is read
» when new stock items arrive, the stock levels are updated in the database.
» no need to price every stock item on the shelves (this reduces time and cost to the
management)
» possible to check customer buying habits more easily by linking barcodes to, for
example, customer loyalty cards
The barcode system is used in many other areas. For example, barcodes can be utilised in
libraries where they are used in books and on the borrower’s library card. Every time a book is
taken out, the borrower is linked to the book automatically. This allows automatic checking of
when the book is due to be returned.
Quick Response (QR) Codes
QR code is another type of barcode; it is made up of a matrix of filled-in dark squares on a light
background. QR codes can hold considerably more information than the more conventional
barcodes.
QR code description
A QR code consists of a block of small squares (light and dark) known as pixels. It can
presently hold up to 4296 characters (or up to 7089 digits) and also allows internet addresses
to be encoded within the QR code.
This compares to the 30 digits that is the maximum for a barcode. However, as more and more
data is added, the structure of the QR code becomes more complex.
The three large squares at the corners of the code function as a form of alignment; the remaining
small corner square is used to ensure the correct size and correct angle of the camera shot when
the QR code is read.
Because of modern smartphones and tablets, which allow internet access on the move, QR
codes can be scanned anywhere. This gives rise to a number of uses:
» advertising products
How it works?
By using the built-in camera on a mobile smartphone or tablet and by downloading a QR app
(application), it is possible to read QR codes on the move using the following method:
» the app will now process the image taken by the camera, converting the squares into
readable data
» the browser software on the mobile phone or tablet automatically reads the data
generated by the app; it will also decode any web addresses contained within the QR code
» the user will then be sent to a website automatically (or if a telephone number was
embedded in the code, the user will be sent to the phone app )
» if the QR code contained a boarding pass, this will be automatically sent to the
phone/tablet.
» There will be fewer errors; the higher capacity of the QR code allows the use of built-
in error-checking systems – normal barcodes contain almost no data redundancy (data which
is duplicated) therefore it isn’t possible to guard against badly printed or damaged barcodes
» QR codes are easier to read; they don’t need expensive laser or LED (light emitting
diode) scanners like barcodes – they can be read by the cameras on smartphones or tablets
» It is also possible to encrypt QR codes which gives them greater protection than
traditional barcodes.
» QR codes can be used to transmit malicious codes – known as attagging. Since there
are a large number of free apps available to a user for generating QR codes, that means anyone
can do this. It is relatively easy to write malicious code and embed this within the QR code.
When the code is scanned, it is possible the creator of the malicious code could gain access to
everything on the user’s phone (for example, photographs, address book, stored passwords).
The user could also be sent to a fake website or it is even possible for a virus to be downloaded.
New developments
Newer QR codes (called frame QR codes) are now being used because of the increased ability
to add advertising logos. Frame QR codes come with a ‘canvas area’ where it is possible to
include graphics or images inside the code itself. Unlike normal QR codes, software to do this
isn’t usually free.
Digital cameras
Digital cameras have essentially replaced the more traditional camera that used film to capture
the images. The film required developing and then printing before the photographer could see
the result of their work.
This made these cameras expensive to operate since it wasn’t possible to delete unwanted
photographs.
Modern digital cameras simply link to a computer system via a USB port or by using Bluetooth
(which enables wireless transfer of photographic files).
These cameras are controlled by an embedded system which can automatically carry out the
following tasks:
» remove ‘red eye’ when the flash gun has been used
» the image is captured when light passes through the lens onto a light-sensitive cell; this
cell is made up of millions of tiny sensors which are acting as photodiodes (i.e. charge couple
devices (CCD) which convert light into electricity)
» each of the sensors are often referred to as pixels (picture elements) since they are tiny
components that make up the image
» the image is converted into tiny electric charges which are then passed through an
analogue to digital converter (ADC) to form a digital image array
» the ADC converts the electric charges from each pixel into levels of brightness
(now in a digital format); for example, an 8-bit ADC gives 28 (256) possible brightness levels
per pixel (for example, brightness level 01110011)
» apart from brightness, the sensors also measure colour which produces another binary
pattern; most cameras use a 24-bit RGB system (each pixel has 8 bits representing each of the
3 primary colours), which means each pixel has a red value (0 to 255 in denary), a green value
(0 to 255) and a blue value (0 to 255); for example, a shade of orange could be 215 (red), 165
(green) and 40 (blue) giving a binary pattern of 1101 0111 1010 0101 0010 1000 (or D7A528
written in hex)
» the number of pixels determines the size of the file used to store the photograph
» the quality of the image depends on the recording device (how good the camera lens is
and how good the sensor array is), the number of pixels used (the more pixels used, the better
the image), the levels of light and how the image is stored (JPEG, raw file, and so on).
Mobile phones have caught up with digital cameras as regards number of pixels. The drawback
is often inferior lens quality and limited memory for the storage of photos. But this is fast
changing and, at the time of writing, many smartphones now have very sophisticated optics
and photography software as standard.
Keyboards
Keyboards are by far the most common method used for data entry. They are used as the input
devices on computers, tablets, mobile phones and many other electronic items.
The keyboard is connected to the computer either by using a USB connection or by wireless
connection. In the case of tablets and mobile phones, the keyboard is often virtual or a type of
touch screen technology.
Each character on a keyboard has an ASCII value. Each character pressed is converted into a
digital signal, which the computer interprets.
They are a relatively slow method of data entry and are also prone to errors, however keyboards
are probably still the easiest way to enter text into a computer.
Unfortunately, frequent use of these devices can lead to injuries, such as repetitive strain injury
(RSI) in the hands and wrists.
Ergonomic keyboards can help to overcome this problem – these have the keys arranged
differently and they are also designed to give more support to the wrists and hands when doing
a lot of typing.
How it works
» In Figure 3.25, the ‘H’ key is pressed and this completes a circuit as shown
» The CPU in the computer can then determine which key has been pressed
» The CPU refers to an index file to identify which character the key press represents
Microphone
Microphones are either built into the computer or are external devices connected through the
USB port or using Bluetooth connectivity.
The current produced is converted to a digital format so that a computer can process it or store
it (on, for example, a CD).
» When a diaphragm in the microphone picks up the air vibrations, the diaphragm also
begins to vibrate.
» A copper coil is wrapped around the cone which is connected to the diaphragm. As the
diaphragm vibrates, the cone moves in and out causing the copper coil to move backwards and
forwards.
» This forwards and backwards motion causes the coil to cut through the magnetic field
around the permanent magnet, inducing an electric current.
» The electric current that is analogue in nature, is amplified or sent to a recording device.
The electric current output from the microphone can also be sent to a computer where a sound
card converts the current into a digital signal which can then be stored in the computer.
The following diagram shows what happens when the word ‘hut’ is picked up by a microphone
and is converted into digital values: