IP core outputs for sensor motion over a IP core outputs for sensor motion over a Block diagram Flowchart of the project How IR sensor works How a DC motor works Basic FPGA architecture Block Diagram of Comparator LM339 4 pairs of IR sensors placed under

LIST OF FIGURES NO. OF FIGURE TITLE PAGE

2.1 Line follower block diagram

7 2.2 Sensors location method 8

2.3 Schematic of IR sensor

8 2.4 Driver and motor circuit 9

2.5 Front and rear wheels

10 2.6 The TCND5000 Reflective Optical Sensors on 12 the Gecko3 Robot 2.7 Sensor Infra-Red Emitter Receiver 13

2.8 The SoC solution for the robot line-following project 14

2.9 The Experimental Procedure – Sensor Motion over

14 a Grayscale

2.10 IP core outputs for sensor motion over a

15 quantized grayscale surface 10 bit resolution setting

2.11 IP core outputs for sensor motion over a

15 quantized grayscale surface 7 bit resolution setting

2.12 Block diagram

17 2.13 Simulation of white line follower and black line 17 follower using control

3.1 Flowchart of the project

20 3.2 Block diagram of the line following robot 21

3.3 How IR sensor works

22 3.4 IR Sensor Transmitter and Receiver 22

3.5 How a DC motor works

23 3.6 DC motor 24

3.7 Basic FPGA architecture

25 3.8 Spartan-6 Papilio Pro board 26

3.9 Block Diagram of Comparator LM339

27 3.10 Comparator LM339 27

4.1 4 pairs of IR sensors placed under the robot

30 4.2 IO ports at the FPGA connected to sensor and motor 31 4.3 IO ports Wing 1 A B are used 32

4.4 Spartan-6 Papilio Pro board embedded with the

33 line following robot

4.5 Two DC motor used in this robot

35 4.6 RTL Schematic diagram 36

4.7 IO ports location

36 4.8 InputOutput Simulation 37

4.9 Line Following Robot

38 4.10 Snapshot of working line following robot on track 39 4.11 Snapshot of line following robot on another track 39 ABBREVIATIONS FPGA – Field Programmable Gate Array IO – InputOutput IR – Infrared HDL – Hardware Description Language RISC – Reduce Instruction Set Computer ADC – Analog-to-Digital Converter CHAPTER I INTRODUCTION

1.1 Project overview

A line following robot usually utilize a microcontroller as the brain for it to function. There are many types of microcontroller available in the market. Each of it has its own characteristic and function. Nonetheless, there is a clear limitation when using a microcontroller as the input and output pins are preconfigured according to its packaging. This characteristic of a microcontroller will halt any changes or expansion for the design and function in future. This project is proposed with the aim of designing a line following robot controller in Verilog Hardware Description Language Verilog HDL and implement the hardware design in the Field Programmable Gate Array FPGA. This project will implement FPGA-based controller using 8-bit data bus utilizing four sensors and two servo motors. The controller modules are developed in FPGA environment and tested using Spartan 6 FPGA board. At the end of this project, a working line following robot is developed successfully using FPGA as its brain and has the capability of controlling the input sensors and output motors according to the algorithm. Line following robot is a robot that is used to detect black lines drawn on white surfaces, or vice versa. Line following robot has many usage and is applicable in the industries and daily life. Verilog HDL is a programming language that is used to describe a hardware to make it able to function according to the needs of the user. It is most commonly used in describing digital circuits at the register-transfer level RTL.

1.2 Objectives