Hardware and Schematic

2.1 ATMega16 microprocessor

The AT mega 16 microprocessor is a 40 pins dual - inline microprocessor. We make use of the 8 pins of portB(PB) and 3 pins of portD(PD) for the LCD; 3 other pins in portD are connected to the LED light. 2 pins in PortA(PA) are reserved for the photo transistor, and there is no connection for PortC, however, 4 pins in PortC are reserved for the JTag.

2.2 Sharp dot matrix LCD display

The Sharp dot matrix LCD display is a 14-pin LCD display, with 8-bit data bus and 3 control signals (Register set instruction/data, Read/Write, Enable). The 8-bit data busses (DB0-DB7) are connected to PB0-PB7. The three control signals are connected to PD0-PD2: Register select is connected to PD0, Read/write is connected to PD1 and enable pin is connected to PD2.

2.3 LED light

The LED has 4 ends: the blue end, green end, red end and the longest pin which is to be connected to ground. The LED light that produces the three colours is connected to PD4 - PD6 of the microprocessor. The blue end is connected to PD4, green end to PD5, red end to PD6, and the other pin, is connected to ground (pin number 11 on the microprocessor). Note: this LED light is a common anode LED, not a common cathode LED as shown in the device label.

2.4 BPY 62-2 Phototransistor

The BPY 62-2 phototransistor is a high linearity bi-polar junction transistor. The collector of the phototransistor is connected to PA0 and the emitter is connected to PA1, since there is a built - in analogue to digital converter in portA. The base is not connected as it is used to receive the reflection light.

2.5 Various Resistors

One 100 Ohm resistor is connected between each end (except the end connected to the ground) of the LED and the microprocessor to prevent the strong current from destroying the LED.