IR based Computer Scroll Device

Introduction

In the computer world “Scrolling” express the sliding text, images, videos or whatever the displayed in display/ monitor in vertically or horizontally. To do this job there are many devices using various technologies. In the very first the people used key board to work computers and also scroll the display. After it is make mouse to handle it easily than key board. Then introduced touch screens to handle it more and more easily. But in this mini project it has been created IR Based Computer Scroll Device by using Infrared Emitting Diodes, Photo Sensing Diodes and an AVR microcontroller (ATmega328p) to scroll computer display. And it is more advance technology than above noticed devices and it is very easy to scroll the display than others.

Material and Methods

This project contained three main circuits in two parts of the device named Sensor module and Scroll Box. In the Sensor had been include the sensor circuit. The motherboard and the mouse circuit are included in the Scroll Box.

The IR transmitted Diodes transmit IR beams forward and the photo transistor sense to IR rays and it change switch on/off moods according to receive IR beams. Those two components are included in the Sensor module and it sends a signal to the Scroll Box and then it sends a signal to the computer to scroll the display toward the direction which is the user want.

Repairing and maintaining are very easy the device even if the user does not have more knowledge about electronics.  All circuits are attach or coupled with plugin wires with each circuits. The sensor and Scroll Box are coupled with a 10 wire extension code and hence it can be easy to set the sensor where the user wants.

Microcontroller

Microcontroller is the main part of this project and it is work as heart of the device. This project designed as an AVR programming project and hence it had been use ATmega328p microcontroller.

ATmega 328p is 8-Bit processor microcontroller IC and it is included 28 pins (most of the pins can use as interrupts). the progarmming memory space (Flash memory) is 32K Bytes.

Figure1 show the pin diagram and the physical view of the ATmega328p.

Atmega328pFigure1:ATmega 328p pin diagram

Infrared Transmitted LED

An IR (Infrared) LED (Light Emitting Diode) also known as IR transmitter, is a special purpose LED that transmits infrared rays in very small wavelength (nm range). IR LEDs are also same as common LEDs. But no one can see whether the IR LED working or not. Because of human eye can’t see the infrared radiations.

Operating voltage and current of the IR LED are 1.2V and 20mA respectively.

IR LED

Figure 2: IR transmit LED

Photo-transistor

Photo-transistor is a special kind of transistor which sense to infrared beams. When project reflected infrared beam directly in to photo-transistor it became ON switch mood and the connect circuit in between collector and emitter.

Normally photo-transistor LED appears as a black cover LED, since it is easy to introduce the component.

SONY DSC

Figure 3 : Photo-transistor LED

Methods

How work Sensor Module

There are three types of components in the sensor module. Those are IR transmits LED, Phototransistor LED and resistors. In the module have been connect 8 sets of IR transmit LED, Phototransistor LED and two resistors. Each set connected as follows.

sens

Figure 3 :how to set IR LED and Phototransistor

Here IR LED connects with the Vcc through 1K resistor in forward bias mood. Use of that resistor is protecting IR LED form high voltage and also it controlled the intensity of the IR beam. When decrease the R1 value intensity of the IR rays is increase. The phototransistor is connected with the 10K resistor in between ground and Vcc parallel to the IR transmit LED with small distance (nearly 1cm). Actually this transistor look likes as a Black LED and it attach to the circuits as reverse bias mood.

The method of work sensor is IR transmit LED transmit IR beam with having wide area (this area is define by the manufacture and user can’t change it as his wish). The phototransistor LED placed nearly the transmit LED but should not detect any IR beam directly. If someone close his finger, hand or any object to these transmitter and receiver, the projected IR beam are reflected by that object and those reflected IR beams are captured by the phototransistor. Then it automatically switches to ON mood and current passing through the resistor which is connect with the phototransistor in series. Therefore it feels voltage difference between this resistor (R2-10K see Figure 3) and it caused to change the pin digital high logic level which is connect In between phototransistor and the resistor with the microcontroller.

If the user close his finger or any object to each one of receive and transmit IR led sets, above progress will continue and each pin feels high voltage relevant to the activated sensing parts. Figure 4 shows the IR rays do that job

How sensor module work

Figure 4 : How sensor module work

How Handle a I/O PORT of microcontroller

ATmega 328p microcontrollers have 23 I/O (input/ output) Pins in relevant to three PORTs and each pin contain pull-up resistors inbuilt. These pins can be used as output pin (send a signal from microcontroller) as well as input pin (send a signal to microcontroller). Before use the pins as input or output the programmer must be set the valid registry activation according to ports.

Each port pin consists of three register bits: DDxn, PORTxn, and PINxn. the DDxn bits are accessed at the DDRx I/O address, the PORTxn bits at the PORTx I/O address, and the PINxn bits at the PINx   I/O address. The DDxn bit in the DDRx Register selects the direction of this pin. If DDxn is written logic one, Pxn is configured as an output pin. If DDxn is written logic zero, Pxn is configured as an input pin.

If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin. The port pins are tri-stated when reset condition becomes active, even if no clocks are running.

If PORTxn is written logic one when the pin is configured as an output pin, the port pin is driven high (one). If PORTxn is written logic zero when the pin is configured as an output pin, the port pin is driven low (zero).

Reading the Pin Value

Independent of the setting of Data Direction bit DDxn, the port pin can be read through the PINxn Register bit. The PINxn Register bit and the preceding latch constitute a synchronizer. This is needed to avoid metastability if the physical pin changes value near the edge of the internal clock, but it also introduces a delay. However if activate PINxn register it gave the value of the pins relevant to the port.

In this project it has been set the PORTD as an input port and it always connect with the Sensor module. As well as PORTC0 and PORTC1 have been set as outputs and coupled with the mouse circuit. if sensor module send a signal to the PORTD it is captured by the microcontroller and run the procedure which is programmed by the programmer and then send a signal througt the PORTCx pins to the mouse module. That is the method which has been used for IR based computer scroll device.

Design and Constructions

Figure 5 shown simple hardware block diagram of this device.

block Diagram

Figure 5: Hardware Block Diagram

Motherboard

The motherboard of this project has contained an ATmega 328p programmable IC as the main chip and also 3 wire connectors. Figure 6 shown the PCB layout (bottom view) of the motherboard and Figure 7 shown the appearance of the motherboard after set the all components. Appendix B contain all components list of motherboard. All PCB layouts and PCB designs are created by using OrCad 16.5 software version and all components can find from normal electronic market easily.

motherboard

Figure 6: Motherboard layout Bottom view

Motherboard

Figure 7 : Finalized Motherboard

Sensor Module

In this board have include IR transmit LEDs, phototransistor LEDs and some resisters. Sensor and the motherboard will connect with a 10 core wire and sensor has a 10 pin wire connecter to set that wire. Figure 8 displayed the PCB layout of the sensor and figure 9 shown finalized sensor circuit. All components which are required to sensor are note down in Appendix B.

sensor PCB

Figure 8: Sensor module PCB layout Bottom view

se

Figure 9: Finalized Sensor module PCB

Other Circuits

Except the motherboard and sensor circuits there are two connector circuits in this project. Those are 10 pin sensor module connector and 9 pin LED module connector. These 9 pin LED module does not exist in this project but it has already reserved for future development.

10 pin connector

Figure 10: 10 pin wire connector PCB

9pin connector

Figure 11 : LED module connector PCB

Optical mouse circuit

In this project an optical mouse circuit had coupled with the motherboard and it send signals to the computer according to received bit pattern from the motherboard.

optical mouse

Figure 12: Optical mouse circuit

Software Design

The software of the device is very simple. Sensor module wire pins are connected to the Vcc, Ground and PD0-PD7 of microcontroller respectively. Then read the Port D values from the software and active the port C pins to send a signal to the mouse circuit. It’s all done from the software. here used C language as programming language and used WinAVR software to compile the code to microcontroller all over the project.

Results

  • The device was able to emulate the scroll up and down with a good response time. User can scroll the computer display contain for the needed direction by moving on the sensor module or drawing on the module sense surface easily. Although the device can introduce as plug and play device with the computer and it connect through an USB port. Thus the user can handle that device very easily.
  • The device support with USB 2.0 or higher version
  • When the user plug the device (Scroll Box) to the computer it started automatically and it is indicated by lighting a LED. And then user can plug Sensor module to the Scroll Box and can work device normally.
  • If user stops moving hand in one position on the sensor module, the device pause scrolling the display position. And then look after the device is the user hand move or not to do its job.
  • User can set the Sensor module in any place because of it separate from the device and it is a good opportunity to user.
  • Sensor module has an orange bright light as a help to identify the sensor in dark environment.
  •  The device doesn’t want to connect any external power supply and user doesn’t need to care about supply voltages or current.

cover

Figure 13: final device

device 3d

Figure 14: Final Device in graphic

Analysis

  • The intensity of the Infrared LED depends on the resistor which is used in series with the IR LED. When increase the value of the resistor the intensity of the IR rays are decrease and otherwise increase.
  • The sensitivity of the phototransistor depends on the surfaces which are reflected the IR rays. And also it depends on the colour and material type of the barrier surface. The black colour is most absorbs the IR rays and the white colour is most reflects IR rays. In general thin glass surfaces also able to reflect IR rays but in this project it has been adjust the sensitivity of the phototransistor to avoid capture reflected IR rays which are reflect from the glass surface.
  • The device will work properly when the user hand moving in between 2cm above the sensor module.
  • When analysis about the scrolling job of the mouse it has included a mechanical decoder and it generate bit pattern like 20, 21 20,21,0 each and every single motion of the scroll ball of the mouse according to the direction.

Main Findings

  • To work the device properly user must be move the hand toward the up or down clearly not in very fast.
  • The device can be attached with any object what can plug USB mouse externally.
  • The device toggle or doesn’t work when the reflecting area of IR rays is quite small.

Improvements, Future Enhancements for the Device

  • If consider about the Scroll Box, someone can see one pin connector base instead of the sensor module connector base. Actually it is reserved for the LED panel. When design this project very firstly there was an idea to display activated sensor sections from lighting LEDs. But did not construct that module with the device because nothing enough time period. Thus it is also reserved for future developments.
  • The device can be improved to work within 10m or high far from sensor module.
  • This device plug with a USB cable to the computer but in the future world it can be modify as wireless IR based computer scroll.
  • This device has use an optical mouse circuit inside the scroll box. But ATmega ICs can be used as mouse IC. Thus it can be reduce the size of the product.

References

http://www.atmel.com/images/doc8161.pdf

http://www.instructables.com/answers/how-the-usb-optical-mouse-works-exactly-in-detail/

http://www.digikey.com/catalog/en/partgroup/5mm-infrared-led-emitters/11636

http://www.sparkfun.com/products/246

http://www.engineersgarage.com/electronic-components/ir-infrared-led

Appendix A

Schematic diagram-Motherboard

motherbord shematic

Figure 15 : Motherboard schematic diagram

Sensor module

Sensor module schematic

Figure 16: Sensor module schematic diagram

Connector socket schematics

sockets

Figure 17: connector sockets schematics

Appendix B

Component lists

  • Motherboard
 
Component name Quantity
ATmega328p microcontroller 01
28 pin IC base 01
10 wire pin socket 01
4 wire pin socket 01
9 wire pin socket 01

Table 1: motherboard components

  • Sensor Module
 
Component Name Quantity
IR Transmit LED 08
Phototransistor LED 08
10 wire pin socket 01
1KΩ resistor 08
10KΩ resistor 08

Table 2: sensor module components

  • Other components
 
COMPONENT name QUANTITY
10 Pin Socket (dual line/ 5by 5) 01
10 wire pin socket 01
10 wire pin socket 02
10 ribbon wire 01

Table 3: other electronic components

Appendix C

code listing

IR based computer scroll device CODE (Source code)