52
Name: Ankan Naskar College : Future Institute Of Engineering & Management Traning Id: TECHLW16422 Robotics With Embedded Systems Introduction: Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller ) and a piece of software , or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package

Robotics and Embedded Systems

Embed Size (px)

Citation preview

Page 1: Robotics and Embedded Systems

Name: Ankan Naskar

College : Future Institute Of Engineering & Management

Traning Id: TECHLW16422 Robotics With Embedded Systems

Introduction: Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board.The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package

Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike.

Page 2: Robotics and Embedded Systems

Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed at students without a background in electronics and programming. As soon as it reached a wider community, the Arduino board started changing to adapt to new needs and challenges, differentiating its offer from simple 8-bit boards to products for IoT applications, wearable, 3D printing, and embedded environments. All Arduino boards are completely open-source, empowering users to build them independently and eventually adapt them to their particular needs. The software, too, is open-source, and it is growing through the contributions of users worldwide.

What's on the board?

There are many varieties of Arduino boards (explained on the next page) that can be used for different purposes. Some boards look a bit different from the one below, but most Arduinos have the majority of these components in common:

Power (USB / Barrel Jack) :Every Arduino board needs a way to be connected to a power source. The Arduino UNO can be powered from a USB cable coming from your computer or a wall power supply (like this) that is terminated in a barrel jack. In the picture above the USB connection is labeled (1) and the barrel jack is labeled (2).The USB connection is also how you will load code onto your Arduino board. More on how to program with Arduino can be found in our Installing and Programming Arduino tutorial.

Page 3: Robotics and Embedded Systems

NOTE : Do NOT use a power supply greater than 20 Volts as you will overpower (and thereby destroy) your Arduino. The recommended voltage for most Arduino models is between 6 and 12 Volts.

Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF):The pins on your Arduino are the places where you connect wires to construct a circuit (probably in conjuction with a breadboard and some wire. They usually have black plastic ‘headers’ that allow you to just plug a wire right into the board. The Arduino has several different kinds of pins, each of which is labeled on the board and used for different functions.

GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can be used to ground your circuit.

5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin supplies 3.3 volts of power. Most of the simple components used with the Arduino run happily off of 5 or 3.3 volts.

Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are Analog In pins. These pins can read the signal from an analog sensor (like a temperature sensor) and convert it into a digital value that we can read.

Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO). These pins can be used for both digital input (like telling if a button is pushed) and digital output (like powering an LED).

PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also be used for something called Pulse-Width Modulation (PWM). We have a tutorial on PWM, but for now, think of these pins as being able to simulate analog output (like fading an LED in and out).

AREF (9): Stands for Analog Reference. Most of the time you can leave this pin alone. It is sometimes used to set an external reference voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.

Reset Button :Just like the original Nintendo, the Arduino has a reset button (10). Pushing it will temporarily connect the reset pin to ground and restart any code that is loaded on the Arduino. This can be very useful if your code doesn’t repeat, but you want to test it multiple times. Unlike the original Nintendo however, blowing on the Arduino doesn’t usually fix any problems.

Power LED Indicator :Just beneath and to the right of the word “UNO” on your circuit board, there’s a tiny LED next to the word ‘ON’ (11). This LED should light up whenever you plug your Arduino into a power source. If this light doesn’t turn on, there’s a good chance something is wrong. Time to re-check your circuit!

Page 4: Robotics and Embedded Systems

TX RX LEDs :TX is short for transmit, RX is short for receive. These markings appear quite a bit in electronics to indicate the pins responsible for serial communication. In our case, there are two places on the Arduino UNO where TX and RX appear – once by digital pins 0 and 1, and a second time next to the TX and RX indicator LEDs (12). These LEDs will give us some nice visual indications whenever our Arduino is receiving or transmitting data (like when we’re loading a new program onto the board).

Main IC :The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think of it as the brains of our Arduino. The main IC on the Arduino is slightly different from board type to board type, but is usually from the ATmega line of IC’s from the ATMEL company. This can be important, as you may need to know the IC type (along with your board type) before loading up a new program from the Arduino software. This information can usually be found in writing on the top side of the IC. If you want to know more about the difference between various IC’s, reading the datasheets is often a good idea.

Voltage Regulator :The voltage regulator (14) is not actually something you can (or should) interact with on the Arduino. But it is potentially useful to know that it is there and what it’s for. The voltage regulator does exactly what it says – it controls the amount of voltage that is let into the Arduino board. Think of it as a kind of gatekeeper; it will turn away an extra voltage that might harm the circuit. Of course, it has its limits, so don’t hook up your Arduino to anything greater than 20 volts.Commonly Used Components In Ardrino System :In Ardrino there few components are mainly used to build any kind of project.Resistor: A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines, among other uses. High-power resistors that can dissipate many watts of electrical power as heat may be used as part of motor controls, in power distribution systems, or as test loads for generators. Fixed resistors have resistances that only change slightly with temperature, time or operating voltage. Variable resistors can be used to adjust circuit elements (such as a volume control or a lamp dimmer), or as sensing devices for heat, light, humidity, force, or chemical activity.Capacitor : A capacitor is a passive two-terminal electrical component that stores electrical energy in an electric field.[1] The effect of a capacitor is known as capacitance. While capacitance exists between any two electrical conductors of a circuit in sufficiently close proximity, a capacitor is specifically designed to provide

Page 5: Robotics and Embedded Systems

and enhance this effect for a variety of practical applications by consideration of size, shape, and positioning of closely spaced conductors, and the intervening dielectric material. A capacitor was therefore historically first known as an electric condenser.[2]

The physical form and construction of practical capacitors vary widely and many capacitor types are in common use. Most capacitors contain at least two electrical conductors often in the form of metallic plates or surfaces separated by a dielectric medium. A conductor may be a foil, thin film, sintered bead of metal, or an electrolyte. The nonconducting dielectric acts to increase the capacitor's charge capacity. Materials commonly used as dielectrics include glass, ceramic, plastic film, paper, mica, and oxide layers. Capacitors are widely used as parts of electrical circuits in many common electrical devices. Unlike a resistor, an ideal capacitor does not dissipate energy.When two conductors experience a potential difference, for example, when a capacitor is attached across a battery, an electric field develops across the dielectric, causing a net positive charge to collect on one plate and net negative charge to collect on the other plate. No current actually flows through the dielectric, instead, the effect is a displacement of charges through the source circuit. If the condition is maintained sufficiently long, this displacement current through the battery ceases. However, if a time-varying voltage is applied across the leads of the capacitor, the source experiences an ongoing current due to the charging and discharging cycles of the capacitor.Capacitance is defined as the ratio of the electric charge on each conductor to the potential difference between them. The unit of capacitance in the International System of Units (SI) is the farad (F), defined as one coulomb per volt (1 C/V). Capacitance values of typical capacitors for use in general electronics range from about 1 pF (10−12 F) to about 1 mF (10−3 F).Diode : A diode is a device which only allows unidirectional flow of current if operated within a rated specified voltage level. A diode only blocks current in the reverse direction while the reverse voltage is within a limited range otherwise reverse barrier breaks and the voltage at which this breakdown occurs is called reverse breakdown voltage. The diode acts as a valve in the electronic and electrical circuit. A P-N junction is the simplest form of the diode which behaves as ideally short circuit when it is in forward biased and behaves as ideally open

Page 6: Robotics and Embedded Systems

circuit when it is in the reverse biased. Beside simple PN junction diodes, there are different types of diodes although the fundamental principles are more or less same. So a particular arrangement of diodes can convert AC to pulsating DC, and hence, it is sometimes also called as a rectifier. The name diode is derived from "di-ode" which means a device having two electrodes.LED : LEDs are semiconductor diodes, electronic devices that permit current to flow in only one direction. The diode is formed by bringing two slightly different materials together to form a PN junction (Figure 2). In a PN junction, the P side contains excess positive charge ("holes," indicating the absence of electrons) while the N side contains excess negative charge (electrons).When a forward voltage is applied to the semiconducting element forming the PN junction (heretofore referred to as the junction), electrons move from the N area toward the P area and holes move toward the N area. Near the junction, the electrons and holes combine. As this occurs, energy is released in the form of light that is emitted by the LED.Relay : A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is necessary to control a circuit by a separate low-power signal, or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit and re-transmitted it on another circuit. Relays were used extensively in telephone exchanges and early computers to perform logical operations.A type of relay that can handle the high power required to directly control an electric motor or other loads is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays".Buzzer : A buzzer or beeper is an audio signalling device,[1] which may be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers and beepers

Page 7: Robotics and Embedded Systems

include alarm devices, timers, and confirmation of user input such as a mouse click or keystroke.

Infrared Sensor : An infrared sensor is an electronic device, that emits in order to sense some aspects of the surroundings. An IR sensor can measure the heat of an object as well as detects the motion.These types of sensors measures only infrared radiation, rather than emitting it that is called as a passive IR sensor. Usually in the infrared spectrum, all the objects radiate some form of thermal radiations. These types of radiations are  invisible to our eyes, that can be detected by an infrared sensor.The emitter is simply an IR LED (Light Emitting Diode) and the detector is simply an IR photodiode which is sensitive to IR light of the same wavelength as that emitted by the IR LED. When IR light falls on the photodiode, The resistances and these output voltages, change in proportion to the magnitude of the IR light received.Push Button : A push-button (also spelled pushbutton) or simply button is a simple switch mechanism for controlling some aspect of a machine or a process. Buttons are typically made out of hard material, usually plastic or metal.[1] The surface is usually flat or shaped to accommodate the human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased switches, although many un-biased buttons (due to their physical nature) still require a spring to return to their un-pushed state. Different people use different terms for the "pushing" of the button, such as press, depress, mash, hit, and punch.

LDR : A photoresistor (or light-dependent,resistor, LDR, or photocell) is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity;

Page 8: Robotics and Embedded Systems

inotherwords,itexhibits photoconductivity. A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits.A photoresistor is made of a high resistance semiconductor. In the dark, a photoresistor can have a resistance as high as several megohms (MΩ), while in the light, a photoresistor can have a resistance as low as a few hundred ohms. If incident light on a photoresistor exceeds a certain frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electrons (and their hole partners) conduct electricity, thereby lowering resistance. The resistance range and sensitivity of a photoresistor can substantially differ among dissimilar devices. Moreover, unique photoresistors may react substantially differently to photons within certain wavelength bands.A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has its own charge carriers and is not an efficient semiconductor, for example, silicon. In intrinsic devices the only available electrons are in the valence band, and hence the photon must have enough energy to excite the electron across the entire bandgap. Extrinsic devices have impurities, also called dopants, added whose ground state energy is closer to the conduction band; since the electrons do not have as far to jump, lower energy photons (that is, longer wavelengths and lower frequencies) are sufficient to trigger the device. If a sample of silicon has some of its atoms replaced by phosphorus atoms (impurities), there will be extra electrons available for conduction. This is an example of an extrinsic semiconductor.

ATMEGA 328P-PU : The Atmel 8-bit AVR RISC-based microcontroller combines 32 kB ISP flash memory with read-while-write capabilities, 1 kB EEPROM, 2 kB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels

in TQFP and QFN/MLF packages),programmable watchdogtimer with internal oscillator, and five software selectable power saving modes. The device

operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS per MHz.

Page 9: Robotics and Embedded Systems

7-segment Display : An LED or Light

Emitting Diode, is a solid state optical

PN-junction diode which emits light

energy in the form of “photons” when it

is forward biased by a voltage allowing

current to flow across its junction, and in

Electronics we call this process

electroluminescence.

The actual colour of the visible light emitted by an LED, ranging from blue to red to orange, is decided by the spectral wavelength of the emitted light which itself is dependent upon the mixture of the various impurities added to the semiconductor materials used to produce it.

7-segment Display

Light emitting diodes have many advantages over traditional bulbs and lamps, with the main ones being their small size, long life, various colours, cheapness and are readily available, as well as being easy to interface with various other electronic components and digital circuits.But the main advantage of light emitting diodes is that because of their small die size, several of them can be connected together within one small and compact package producing what is generally called a 7-segment Display.The 7-segment display, also written as “seven segment display”, consists of seven LEDs (hence its name) arranged in a rectangular fashion as shown. Each of the seven LEDs is called a segment because when illuminated the segment forms part of a numerical digit (both Decimal and Hex) to be displayed. An additional 8th LED is sometimes used within the same package thus allowing the indication of a

Page 10: Robotics and Embedded Systems

decimal point, (DP) when two or more 7-segment displays are connected together to display numbers greater than ten.Related Products: DisplaysEach one of the seven LEDs in the display is given a positional segment with one of its connection pins being brought straight out of the rectangular plastic package. These individually LED pins are labelled from a through to g representing each individual LED. The other LED pins are connected together and wired to form a common pin.So by forward biasing the appropriate pins of the LED segments in a particular order, some segments will be light and others will be dark allowing the desired character pattern of the number to be generated on the display. This then allows us to display each of the ten decimal digits 0 through to 9 on the same 7-segment display.The displays common pin is generally used to identify which type of 7-segment display it is. As each LED has two connecting pins, one called the “Anode” and the other called the “Cathode”, there are therefore two types of LED 7-segment display called: Common Cathode (CC) and Common Anode (CA).The difference between the two displays, as their name suggests, is that the common cathode has all the cathodes of the 7-segments connected directly together and the common anode has all the anodes of the 7-segments connected together and is illuminated as follows.

1. The Common Cathode (CC) – In the common cathode display, all the cathode connections of the LED segments are joined together to logic “0” or ground. The individual segments are illuminated by application of a “HIGH”, or logic “1” signal via a current limiting resistor to forward bias the individual Anode terminals (a-g).

2. The Common Anode (CA) – In the common anode display, all the anode connections of the LED segments are joined together to logic “1”. The individual segments are illuminated by applying a ground, logic “0” or “LOW” signal via a suitable current limiting resistor to the Cathode of the particular segment (a-g).

Page 11: Robotics and Embedded Systems

Common Anode 7-segment Display :

In general, common anode displays are more popular as many logic circuits can sink more current than they can source. Also note that a common cathode display is not a direct replacement in a circuit for a common anode display and vice versa, as it is the same as connecting the LEDs in reverse, and hence light emission will not take place.Depending upon the decimal digit to be displayed, the particular set of LEDs is forward biased. For instance, to display the numerical digit 0, we will need to light up six of the LED segments corresponding to a, b, c, d, e and f. Then the various digits from 0 through 9 can be displayed using a 7-segment display as shown.

7-Segment Display Segments for all Numbers:

Then for a 7-segment display, we can produce a truth table giving the individual segments that need to be illuminated in order to produce the required decimal digit from 0 through 9 as shown below.

Page 12: Robotics and Embedded Systems

7-segment Display Truth Table :

Driving a 7-segment Display : Although a 7-segment display can be thought of as a single display, it is still seven individual LEDs within a single package and as such these LEDs need protection from over current. LEDs produce light only when it is forward biased with the amount of light emitted being proportional to the forward current.This means then that an LEDs light intensity increases in an approximately linear manner with an increasing current. So this forward current must be controlled and limited to a safe value by an external resistor to prevent damage to the LED segments.The forward voltage drop across a red LED segment is very low at about 2-to-2.2 volts, (blue and white LEDs can be as high as 3.6 volts) so to illuminate correctly, the LED segments should be connected to a voltage source in excess of this forward voltage value with a series resistance used to limit the forward current to a desirable value.Typically for a standard red coloured 7-segment display, each LED segment can draw about 15 mA to illuminated correctly, so on a 5 volt digital logic circuit, the value of the current limiting resistor would be about 200Ω (5v – 2v)/15mA, or 220Ω to the nearest higher preferred value.

Page 13: Robotics and Embedded Systems

So to understand how the segments of the display are connected to a 220Ω current limiting resistor consider the circuit below.

Driving a 7-segment Display

In this example, the segments of a common anode display are illuminated using the switches. If switch a is closed, current will flow through the “a” segment of the LED to the current limiting resistor connected to pin a and to 0 volts, making the circuit. Then only segment a will be illuminated. So a LOW condition (switch to ground) is required to activate the LED segments on this common anode display.But suppose we want the decimal number “4” to illuminate on the display. Then switches b, c, f and g would be closed to light the corresponding LED segments. Likewise for a decimal number “7”, switches a, b, c would be closed. But illuminating 7-segment displays using individual switches is not very practical.7-segment Displays are usually driven by a special type of integrated circuit (IC) commonly known as a 7-segment decoder/driver, such as the CMOS 4511. This 7-segment display driver which is known as a Binary Coded Decimal or BCD to 7-segment display decoder and driver, is able to illuminate both common anode or common cathode displays. But there are many other single and dual display drivers available such as the very popular TTL 7447.This BCD-to-7 segment decoder/driver takes a four-bit BCD input labelled A, B, C and D for the digits of the binary weighting of 1, 2, 4 and 8 respectively, has seven outputs that will pass current through the appropriate segments to display the decimal digit of the numeric LED display.The digital outputs of the CD4511 are different from the usual CMOS outputs because they can provide up to 25mA of current each to drive the LED segments directly allowing different coloured LED displays to be used and driven.16x2-lcd-module :LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are

Page 14: Robotics and Embedded Systems

economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data.The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD. Click to learn more about internal structure of a LCD.

Pin Description :

VSS, VDD   and VEE Pin 1 (VSS) is a ground pin and it is certainly needed that this pin  should be grounded for LCD to work properly. VEE and VDD are given +5 vlots normally. However VEE may have a potentiometer voltage divider network to get the contrast adjusted. But VDD is always at +5V.

RS, R/W and E These three pins are numbered 4, 5 and 6 as shown above. RS is used to make the selection between data and command register. For RS=0, command register is selected and for RS=1 data register is selected.

R/W gives you the choice between writing and reading. If set (R/W=1) reading is enabled. R/W=0 when writing.

Enable pins is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high to low pulse must be applied to this pin in-order

Page 15: Robotics and Embedded Systems

for the LCD to latch in the data present at the data pins. It maybe noted here that the pulse must be of minimum 450ns wide. 

D0-D7 The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of LCD's internal register.

The following paragraph is taken and included from "Muhammad Ali Mazidi", 

"To display letters and numbers, we send ASCII code for the letters A-Z, a-z and numbers 0-9 while making RS=1. We also use RS=0 to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D-7 and can be read when R/W=1 and RS=0, as follows: if R/W=1, RS=0. When D7=1 (busy flag=1), the LCD is busy taking care of internal operations and will not accept any new information. When D7=0, the LCD is ready to receive new information. It is recommended to check the busy flag before writing any data to LCD".

Projects :

1.Blinking an Led :

The LED blinking sketch is the first program that you should run to test whether your Arduino board is working and is configured correctly. It is also usually the very first programming exercise someone does when learning to program a microcontroller. A light-emitting diode (LED) is a small elec-tronic component that’s a bit like a light bulb, but is more efficient and requires lower voltages to operate.K indicates the cathode (negative), or shorter lead; A indicates the anode (positive), or longer lead.

Component List : Component Quantity1.Ardrino (barebone) 12.Ardrino Software 13.Jamper 2 4.USB Plug 1

Page 16: Robotics and Embedded Systems

2. Fade an LED :To create this circuit, you will need to combine the circuit you just built with the pushbutton circuit shown in Figure 4-6. If you’d like, you can simply build both circuits on different parts of the breadboard; you have plenty of room. However, one of the advantages of the breadboard (see Appendix A) is that there is a pair of rails running horizontally across the bottom and top. One is marked red (for positive) and the other blue or black (for ground).

Component Quantity

1.Ardrino (barebone) 12.Ardrino Software 13.Jamper 2 4.USB Plug 1Program Code :

Page 17: Robotics and Embedded Systems

3. LED CHASER :

This example makes use of 6 LEDs connected to the pins 2 - 7 on the board using 220 Ohm resistors. The first code example will make the LEDs blink in a sequence, one by one using only digitalWrite(pinNum,HIGH/LOW) and delay(time). The second example shows how to use a for(;;) construction to perform the very same thing, but in fewer lines. The third and last example concentrates in the visual effect of turning the LEDs on/off in a more softer way.

Component Quantity

1.Ardrino (barebone) 12.Ardrino Software 13.Jamper 74.USB Plug 15.LED 66.Resistor 7

Page 18: Robotics and Embedded Systems

Programing Code :

Play Melody using buzzer :

This example makes use of a Piezo Speaker in order to play melodies. We are taking advantage of the processors capability to produde PWM signals in order to play music.

A Piezo is nothing but an electronic device that can both be used to play tones and to detect tones. In our example we are plugging the Piezo on the pin number D5, that supports the functionality of writing a PWM signal to it, and not just a plain HIGH or LOW value.

The other thing to remember is that Piezos have polarity, commercial devices are usually having a red and a black wires indicating how to plug it to the board. We connect the black one to ground and the red one to the output. Sometimes it is possible to acquire Piezo elements without a plastic housing, then they will just look like a metallic disc.

Component Quantity1.Ardrino (barebone) 14.Card board 15. Piezo Speaker 1

Page 19: Robotics and Embedded Systems

Program Code :

Working Of LDR using ardrino : A Light Dependent Resistor (LDR) or a photo resistor is a device whose resistivity is a function of the incident electromagnetic radiation. Hence, they are light sensitive devices. They are also called as photo conductors, photo conductive cells or simply photocells. They are made up of semiconductor materials having high resistance. There are many different symbols used to indicate a LDR, one of the most commonly used symbol is shown in the figure below. The arrow indicates light falling on it.To get get the value from ldr we connect the analog pin A5.

Component Quantity1.Ardrino (barebone) 14.Input Card 15. Jamper 3Program Code :

Page 20: Robotics and Embedded Systems

ARDUINO TEMPERATURE SENSOR LM35 :

LM35 is a precision IC temperature sensor with its output proportional to the temperature (in oC). The sensor circuitry is sealed and therefore it is not subjected to oxidation and other processes. With LM35, temperature can be measured more accurately than with a thermistor. It also possess low self heating and does not cause more than 0.1 oC temperature rise in still air. The operating temperature range is from -55°C to 150°C. The output voltage varies by 10mV in response to every oC rise/fall in ambient temperature, i.e., its scale factor is 0.01V/ oC.To measuring temparature we connect analog pin A0 of barebone board to the input card pin LM35 and give 5v and ground from barebone to input card.

Pin Description:Pin No Function Name

1 Supply voltage; 5V (+35V to -2V) Vcc

2 Output voltage (+6V to -1V) Output

3 Ground (0V) GroundProgram code :

Page 21: Robotics and Embedded Systems

Bootloader :Microcontrollers are usually programmed through a programmer unless you have a piece of firmware in your microcontroller that allows installing new firmware without the need of an external programmer. This is called a bootloader.

Instructions :To use your Arduino board to burn a bootloader onto an AVR, you need to follow a few simple steps.

1. Open the ArduinoISP firmware (in Examples) to your Arduino board.

Page 22: Robotics and Embedded Systems

2. Note for Arduino 1.0: you need to make one small change to the ArduinoISP code. Find the line in the heartbeat() function that says "delay(40);" and change it to "delay(20);".

3. Select the items in the Tools > Board and Serial Port menus that correspond to the board you are using as the programmer (not the board being programmed).

4. Upload the ArduinoISP sketch.5. Wire your Arduino board to the target as shown in the diagram below. (Note for the

Arduino Uno: you'll need to add a 10 uF capacitor between reset and ground.)6. Select the item in the Tools > Board menu that corresponds to the board on which

you want to burn the bootloader(not the board that you're using as the programmer). See the board descriptions on the environment page for details.

7. Select the Arduino as ISP in the Tools>Programmer menu.8. Use the Burn Bootloader command.

Note :This procedure works with the boards that have the SPI signals on the indicated pins. For boards for which this isn't valid (32u4 boards like Leonardo) the SPI signals have to be connected to the ISP connector whose pinout is reported below.

Circuit (targeting Arduino Uno, Duemilanove, or Diecimila) :

Page 23: Robotics and Embedded Systems

An Arduino board serving as an ISP to program the ATmega on another Arduino board. On the Arduino Uno, you'll need to connect a 10 uF capacitor between reset and ground (after uploading the ArduinoISP sketch). Note that you need access to the reset pin on the target board, which isn't available on NG or older boards.

Circuit (targeting Arduino NG or older)

On NG or older boards, connect the reset wire to pin 1 of the Atmega chip on the board, as shown above.

See the Arduino to Breadboard tutorial for details.

Using an Arduino board to program an ATmega. Because no external clock source is connected, the ATmega must be configured to use its internal clock.

Using an Arduino board to program an ATmega, with external crystal and associated capacitors (18 or 22 picofarads).

Uploading Code - Hard Way :

Page 24: Robotics and Embedded Systems

The hard way is for those people who want to use the command line. This method may be more preferable if you are modifying and recompiling and don’t want to have to keep updating the IDE, but otherwise its pretty unnecessary. Again you will need to get the programmer, and hook everything up. In this example we are using avrdude on Windows.There are two steps to this process. The first step involves setting the fusebits. Fusebits are the part of the AVR chip that determine things like whether you are using an external crystal or whether you want brown out detection. The commands listed below are for the Arduino Uno using an ATMega328, they will probably work on some other similar boards such as the Duemilanove, but make sure you know what you are doing before playing with fusebits (NOTE: these fusebits will not work on a 3.3V/8MHz board). All the required fuse bits are listed in the boards.txt file for different boards, but again, if you have a boards.txt file installed then just use the Easy Way.Arduino as ISP: avrdude -P comport -b 19200 -c avrisp -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:mAVR Pocket Programmer:avrdude -b 19200 -c usbtiny -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:mThe second step is actually uploading the program.Arduino as ISP: avrdude -P comport -b 19200 -c avrisp -p m328p -v -e -U flash:w:hexfilename.hex -U lock:w:0x0F:m AVR Pocket Programmer: avrdude -b19200 -c usbtiny -p m328p -v -e -U flash:w:hexfilename.hex -U lock:w:0x0F:mOne last bit of info. As we stated earlier, a bootloader is essintially a .hex file. Thus, you can use this method to upload and code you wish to your ICs.16x2 Lcd program("Hello World!") :The LiquidCrystal library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.This example sketch prints "Hello World!" to the LCD and shows the time in seconds since the Arduino was reset.

The LCDs have a parallel interface, meaning that the microcontroller has to manipulate several interface pins at once to control the display. The interface consists of the following pins:

A register select (RS) pin that controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next.

A Read/Write (R/W) pin that selects reading mode or writing mode

An Enable pin that enables writing to the registers

8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read.

Page 25: Robotics and Embedded Systems

There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.

The process of controlling the display involves putting the data that form the image of what you want to display into the data registers, then putting instructions in the instruction register. The LiquidCrystal Library simplifies this for you so you don't need to know the low-level instructions.

The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying text on the screen, you can do most everything in 4-bit mode, so example shows how to control a 2x16 LCD in 4-bit mode.

Hardware Required

Arduino or Genuino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k ohm potentiometer 220 ohm resistor hook-up wires breadboard

CircuitBefore wiring the LCD screen to your Arduino or Genuino board we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above.To wire your LCD screen to your board, connect the following pins:

LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2

Additionally, wire a 10k pot to +5V and GND, with it's wiper (output) to LCD screens VO pin (pin3). A 220 ohm resistor is used to power the backlight of the display, usually on pin 15 and 16 of the LCD connector

Page 27: Robotics and Embedded Systems

Program Code :

Page 28: Robotics and Embedded Systems

Robotics  is the interdisciplinary branch of engineering and science that includes mechanical engineering, electrical engineering, computer science, and others. Robotics deals with the design, construction,operation,anduseof robots,[1] as well as computer systems for theircontrol, sensoryfeedback, and information processing.These technologies are used to develop machines that can substitute for humans. Robots can be used in any situation and for any purpose, but today many are used in dangerous environments (including bomb detection and de-activation), manufacturing processes, or where humans cannot survive. Robots can take on any form but some are made to resemble humans in appearance. This is said to help in the acceptance of a robot in certain replicative behaviors usually performed by people. Such robots attempt to replicate walking, lifting, speech, cognition, and basically anything a human can do. Many of today's robots are inspired by nature, contributing to the field of bio-inspired robotics.The concept of creating machines that can operate autonomously dates back to classical times, but research into the functionality and potential uses of robots did not grow substantially until the 20th century.[2] Throughout history, it has been frequently assumed that robots will one day be able to mimic human behavior and manage tasks in a human-like fashion. Today, robotics is a rapidly growing field, as technological advances continue; researching, designing, and building new robots serve various practical purposes, whether domestically, commercially, or militarily. Many robots are built to do jobs that are hazardous to people such as defusing bombs, finding survivors in unstable ruins, and exploring mines and shipwrecks. Robotics is also used in STEM (Science, Technology, Engineering, and Mathematics) as a teaching aid.

Types of robots by application :Nowadays, robots do a lot of different tasks in many fields and the number of jobs entrusted to robots is growing steadily. That's why in my opinion one of the best ways how to divide robots into types is a division by their application.

There are: 

*Industrial robots - Industrial robots are robots used in an industrial manufacturing environment. Usually these are articulated arms specifically developed for such applications as welding, material handling, painting and others.

Page 29: Robotics and Embedded Systems

If we judge purely by application this type could also include some automated guided vehicles and other robots. 

*Domestic or household robots - Robots used at home. This type of robots includes many quite different devices such as robotic vacuum cleaners, robotic pool cleaners, sweepers, gutter cleaners and other robots that can do different chores. Also, some surveillance and telepresence robots could be regarded as household robots if used in that environment. 

*Medical robots - Robots used in medicine and medical institutions. First and foremost - surgery robots. Also, some automated guided vehicles and maybe lifting aides. 

*Service robots - Robots that don’t fall into other types by usage. These could be different data gathering robots, robots made to show off technologies, robots used for research, etc. 

*Military robots - Robots used in military. This type of robots includes bomb disposal robots, different transportation robots, reconnaissance drones. Often robots initially created for military purposes can be used in law enforcement, search and rescue and other related fields. 

*Entertainment robots - These are robots used for entertainment. This is a very broad category. It starts with toy robots such as robosapien or the running alarm clock and ends with real heavyweights such as articulated robot arms used as motion simulators. 

*Space robots - I’d like to single out robots used in space as a separate type. This type would include robots used on the International Space Station, Canadarm that was used in Shuttles, as well as Mars rovers and other robots used in space. 

*Hobby and competition robots - Robots that you create. Line followers, sumo-bots, robots made just for fun and robots made for competition.

Now, as you can see there are examples that fit into more than one of these types. For example, there can be a deep sea exploration robot that can gather some valuable information that can be used for military purposes.

Also, I have seen that a division into two types is used, accordingly - industrial and service robots. However, I can not see how a Mars exploration rover fits into one of these general types. Therefore I have used "service robots" in a narrower manner. In my version a term "service robots" serves as "others". This is basically a type where robots that don't fit into other types should fall in.

Components :Power sourceAt present, mostly (lead–acid) batteries are used as a power source. Many different types of batteries can be used as a power source for robots. They range from lead–acid

Page 30: Robotics and Embedded Systems

batteries, which are safe and have relatively long shelf lives but are rather heavy compared to silver–cadmium batteries that are much smaller in volume and are currently much more expensive. Designing a battery-powered robot needs to take into account factors such as safety, cycle lifetime and weight. Generators, often some type of internal combustion engine, can also be used. However, such designs are often mechanically complex and need a fuel, require heat dissipation and are relatively heavy. A tether connecting the robot to a power supply would remove the power supply from the robot entirely. This has the advantage of saving weight and space by moving all power generation and storage components elsewhere. However, this design does come with the drawback of constantly having a cable connected to the robot, which can be difficult to manage.[27] Potential power sources could be:

pneumatic  (compressed gases) Solar power  (using the sun's energy and converting it into electrical power) hydraulics  (liquids) flywheel energy storage organic garbage (through anaerobic digestion) nuclear Actuation :

A robotic leg powered by air muscles

Actuators are the "muscles" of a robot, the parts which convert stored energy into movement. By far the most popular actuators are electric motors that rotate a wheel or gear, and linear actuators that control industrial robots in factories. There are some recent advances in alternative types of actuators, powered by electricity, chemicals, or compressed air.Electric motors:Main article: Electric motor

The vast majority of robots use electric motors, often brushed and brushless DC motors in portable robots or AC motors in industrial robots and CNC machines. These motors are often preferred in systems with lighter loads, and where the predominant form of motion is rotational.Linear actuators:Main article: Linear actuator

Various types of linear actuators move in and out instead of by spinning, and often have quicker direction changes, particularly when very large forces are needed such as with industrial robotics. They are typically powered by compressed air (pneumatic actuator) or an oil (hydraulic actuator).Series elastic actuators:

A flexure is designed as part of the motor actuator, to improve safety and provide robust force control, energy efficiency, shock absorption (mechanical filtering) while

Page 31: Robotics and Embedded Systems

reducing excessive wear on the transmission and other mechanical components. The resultant lower reflected inertia can improve safety when a robot is interacting with humans or during collisions. It has been used in various robots, particularly advanced manufacturing robots and[28] walking humanoid robots.[29]

Air muscles:Main article: Pneumatic artificial muscles

Pneumatic artificial muscles, also known as air muscles, are special tubes that expand(typically up to 40%) when air is forced inside them. They are used in some robot applications.[30][31][32]

Muscle wire:Main article: Shape memory alloy

Muscle wire, also known as shape memory alloy, Nitinol® or Flexinol® wire, is a material which contracts (under 5%) when electricity is applied. They have been used for some small robot applications.[33][34]

Electroactive polymers:Main article: Electroactive polymers

EAPs or EPAMs are a new[when?] plastic material that can contract substantially (up to 380% activation strain) from electricity, and have been used in facial muscles and arms of humanoid robots,[35] and to enable new robots to float,[36] fly, swim or walk.[37]

Piezo motors:Main article: Piezoelectric motor

Recent alternatives to DC motors are piezo motors or ultrasonic motors. These work on a fundamentally different principle, whereby tiny piezoceramic elements, vibrating many thousands of times per second, cause linear or rotary motion. There are different mechanisms of operation; one type uses the vibration of the piezo elements to step the motor in a circle or a straight line.Another type uses the piezo elements to cause a nut to vibrate or to drive a screw. The advantages of these motors are nanometer resolution, speed, and available force for their size. These motors are already available commercially, and being used on some robots.Sensing:Main article: Robotic sensing

Sensors allow robots to receive information about a certain measurement of the environment, or internal components. This is essential for robots to perform their tasks, and act upon any changes in the environment to calculate the appropriate response. They are used for various forms of measurements, to give the robots warnings about safety or malfunctions, and to provide real-time information of the task it is performing.Touch:Main article: Tactile sensor

Current robotic and prosthetic hands receive far less tactile information than the human hand. Recent research has developed a tactile sensor array that mimics the mechanical properties and touch receptors of human fingertips.[43][44] The sensor array is constructed as a rigid core surrounded by conductive fluid contained by an elastomeric skin.

Page 32: Robotics and Embedded Systems

Electrodes are mounted on the surface of the rigid core and are connected to an impedance-measuring device within the core. When the artificial skin touches an object the fluid path around the electrodes is deformed, producing impedance changes that map the forces received from the object. The researchers expect that an important function of such artificial fingertips will be adjusting robotic grip on held objects.Scientists from several European countries and Israel developed a prosthetic hand in 2009, called SmartHand, which functions like a real one—allowing patients to write with it, type on a keyboard, play piano and perform other fine movements. The prosthesis has sensors which enable the patient to sense real feeling in its fingertips.[45]

Vision:]Main article: Computer vision

See also: Vision processing unit

Computer vision is the science and technology of machines that see. As a scientific discipline, computer vision is concerned with the theory behind artificial systems that extract information from images. The image data can take many forms, such as video sequences and views from cameras.In most practical computer vision applications, the computers are pre-programmed to solve a particular task, but methods based on learning are now becoming increasingly common.Computer vision systems rely on image sensors which detect electromagnetic radiation which is typically in the form of either visible light or infra-red light. The sensors are designed using solid-state physics. The process by which light propagates and reflects off surfaces is explained using optics. Sophisticated image sensors even require quantum mechanics to provide a complete understanding of the image formation process. Robots can also be equipped with multiple vision sensors to be better able to compute the sense of depth in the environment. Like human eyes, robots' "eyes" must also be able to focus on a particular area of interest, and also adjust to variations in light intensities.There is a subfield within computer vision where artificial systems are designed to mimic the processing and behavior of biological system, at different levels of complexity. Also, some of the learning-based methods developed within computer vision have their background in biology.Locomotion:Main articles: Robot locomotion and Mobile robot

Rolling robots :

Segway in the Robot museum in Nagoya

For simplicity, most mobile robots have four wheels or a number of continuous tracks. Some researchers have tried to create more complex wheeled robots with only one or two wheels. These can have certain advantages such as greater

Page 33: Robotics and Embedded Systems

efficiency and reduced parts, as well as allowing a robot to navigate in confined places that a four-wheeled robot would not be able to.Two-wheeled balancing robotsBalancing robots generally use a gyroscope to detect how much a robot is falling and then drive the wheels proportionally in the same direction, to counterbalance the fall at hundreds of times per second, based on the dynamics of an inverted pendulum.[58] Many different balancing robots have been designed.[59] While the Segway is not commonly thought of as a robot, it can be thought of as a component of a robot, when used as such Segway refer to them as RMP (Robotic Mobility Platform). An example of this use has been as NASA's Robonaut that has been mounted on a Segway.[60]

One-wheeled balancing robotsMain article: Self-balancing unicycle

A one-wheeled balancing robot is an extension of a two-wheeled balancing robot so that it can move in any 2D direction using a round ball as its only wheel. Several one-wheeled balancing robots have been designed recently, such as Carnegie Mellon University's "Ballbot" that is the approximate height and width of a person, and Tohoku Gakuin University's "BallIP".[61] Because of the long, thin shape and ability to maneuver in tight spaces, they have the potential to function better than other robots in environments with people.[62]

Spherical orb robots :Main article: Spherical robot

Several attempts have been made in robots that are completely inside a spherical ball, either by spinning a weight inside the ball,[63][64] or by rotating the outer shells of the sphere.[65][66] These have also been referred to as an orb bot [67]  or a ball bot.[68][69]

Six-wheeled robots :Using six wheels instead of four wheels can give better traction or grip in outdoor terrain such as on rocky dirt or grass.Tracked robots :

TALON military robots used by the United States Army

Tank tracks provide even more traction than a six-wheeled robot. Tracked wheels behave as if they were made of hundreds of wheels, therefore are very common for outdoor and military robots, where the robot must drive on very rough terrain. However, they are difficult to use indoors such as on carpets and smooth floors. Examples include NASA's Urban Robot "Urbie".[70]

Page 34: Robotics and Embedded Systems

Walking applied to robots :

Walking is a difficult and dynamic problem to solve. Several robots have been made which can walk reliably on two legs, however, none have yet been made which are as robust as a human. There has been much study on human inspired walking, such as AMBER lab which was established in 2008 by the Mechanical Engineering Department at Texas A&M University.[71] Many other robots have been built that walk on more than two legs, due to these robots being significantly easier to construct.[72][73] Walking robots can be used for uneven terrains, which would provide better mobility and energy efficiency than other locomotion methods. Hybrids too have been proposed in movies such as I, Robot, where they walk on two legs and switch to four (arms+legs) when going to a sprint. Typically, robots on two legs can walk well on flat floors and can occasionally walk up stairs. None can walk over rocky, uneven terrain. Some of the methods which have been tried are:ZMP technique :Main article: Zero moment point

The zero moment point (ZMP) is the algorithm used by robots such as Honda's ASIMO. The robot's onboard computer tries to keep the total inertial forces (the combination of Earth's gravity and the acceleration and deceleration of walking), exactly opposed by the floor reaction force (the force of the floor pushing back on the robot's foot). In this way, the two forces cancel out, leaving no moment (force causing the robot to rotate and fall over).[74] However, this is not exactly how a human walks, and the difference is obvious to human observers, some of whom have pointed out that ASIMO walks as if it needs the lavatory.[75][76][77] ASIMO's walking algorithm is not static, and some dynamic balancing is used (see below). However, it still requires a smooth surface to walk on.Hopping :Several robots, built in the 1980s by Marc Raibert at the MIT Leg Laboratory, successfully demonstrated very dynamic walking. Initially, a robot with only one leg, and a very small foot could stay upright simply by hopping. The movement is the same as that of a person on a pogo stick. As the robot falls to one side, it would jump slightly in that direction, in order to catch itself.[78] Soon, the algorithm was generalised to two and four legs. A bipedal robot was demonstrated running and even performing somersaults.[79] A quadruped was also demonstrated which could trot, run, pace, and bound.[80] For a full list of these robots, see the MIT Leg Lab Robots page.[81]

Dynamic balancing (controlled falling) :A more advanced way for a robot to walk is by using a dynamic balancing algorithm, which is potentially more robust than the Zero Moment Point technique, as it constantly monitors the robot's motion, and places the feet in order to maintain stability.[82] This technique was recently demonstrated by Anybots' Dexter Robot,[83] which is so stable, it can even jump.[84] Another example is the TU Delft Flame.Passive dynamics :Main article: Passive dynamics

Perhaps the most promising approach utilizes passive dynamics where the momentum of swinging limbs is used for greater efficiency. It has been shown that totally unpowered humanoid mechanisms can walk down a gentle slope, using only gravity to propel themselves. Using this technique, a robot need only supply a

Page 35: Robotics and Embedded Systems

small amount of motor power to walk along a flat surface or a little more to walk up a hill. This technique promises to make walking robots at least ten times more efficient than ZMP walkers, like ASIMO.[85][86]

Line follower Robot is a machine which follows a line, either a black line or white line. Basically there are two types of line follower robots: one is black line follower which follows black line and second is white line follower which follows white line. Line follower actually senses the line and run over it. 

Concepts of Line Follower

Concept of working of line follower is related to light. We use here the behavior of light at black and white surface. When light fall on a white surface it is almost full reflected and in case of black surface light is completely absorbed. This behavior of light is used in building a line follower robot.

Page 36: Robotics and Embedded Systems

In this arduino based line follower robot we have used IR Transmitters and IR receivers also called photo diodes. They are used for sending and receiving light. IR transmits infrared lights. When infrared rays falls on white surface, it’s reflected back and catched by photodiodes which generates some voltage changes. When IR light falls on a black surface, light is absorb by the black surface and no rays are reflected back, thus photo diode does not receive any light or rays.Here in this line follower robot when sensor senses white surface then arduino gets 1 as input and when senses black line arduino gets 0 as input. 

Circuit ExplanationThe whole line follower robot can be divided into 3 sections: sensor section, control section and driver section. Sensor section:This section contains IR diodes, potentiometer, Comparator (Op-Amp) and LED’s. Potentiometer is used for setting reference voltage at comparator’s one terminal and IR sensors are used to sense the line and provide a change in voltage at comparator’s second terminal. Then comparator compares both voltages and generates a digital signal at output. Here in this line follower circuit we have used two comparator for two sensors. LM 358 is used as comparator. LM358 has inbuilt two low noise Op-amps. Control Section:Arduino Pro Mini is used for controlling whole the process of line follower robot. The outputs of comparators are connected to digital pin number 2 and 3 of

Page 37: Robotics and Embedded Systems

arduino. Arduino read these signals and send commands to driver circuit to drive line follower.  Driver section:Driver section consists motor driver and two DC motors. Motor driver is used for driving motors because arduino does not supply enough voltage and current to motor. So we add a motor driver circuit to get enough voltage and current for motor. Arduino sends commands to this motor driver and then it drive motors. 

Working of Line Follower Robot using ArduinoWorking of line follower is very interesting. Line follower robot senses black line by using sensor and then sends the signal to arduino. Then arduino drives the motor according to sensors' output.

Here in this project we are using two IR sensor modules namely left sensor and right sensor. When both left and right sensor senses white then robot move forward.

Page 38: Robotics and Embedded Systems

If left sensor comes on black line then robot turn left side.

If right sensor sense black line then robot turn right side until both sensor comes at white surface. When white surface comes robot starts moving on forward again.

Page 39: Robotics and Embedded Systems

If both sensors comes on black line, robot stops.

Required ComponentsArduino

In our Project we have used a microcontroller to control whole the process of system that is ARDUINO. Arduino is an open source hardware and very useful for project developments. There are many types of arduino like Arduino UNO, arduino mega, arduino pro mini, Lilypad etc. available in the market. Here we have used arduino pro mini in this project as arduino pro mini is small and so breadboard compatible. To burn program we have used FTDI burner.

Page 40: Robotics and Embedded Systems

 L293D Motor DriverL293D is a motor driver IC which has two channels for driving two motors. L293D has two inbuilt Transistor Darlington pair for current amplification and a separate power supply pin for giving external supply to motors.

 IR Module:IR Module is sensor circuit which consists IR LED/photodiode pair, potentiometer, LM358, resistors and LED. IR sensor transmits Infrared light and photo diode receives the infrared light.

Page 41: Robotics and Embedded Systems

 Power Supply  I have added a voltage regulator to get 5 volt for arduino, comparator and motor driver. And a 9 volt battery is used to power the circuit.

Required Component Quentity

1.Ardrino(Barebone) 1

2.Motor Driver 1

3.IR Module 2

4.Motor 2

5.Jamper Wire 7

Program Code :

Page 42: Robotics and Embedded Systems

Conclusion :Today we find most robots working for people in industries, factories, warehouses, and laboratories. Robots are useful in many ways. For instance, it boosts economy because businesses need to be efficient to keep up with the industry competition. Therefore, having robots helps business owners to be competitive, because robots can do jobs better and faster than humans can, e.g. robot can built, assemble a car. Yet robots cannot perform every job; today robots roles include assisting research and industry. Finally, as the technology improves, there will be new ways to use robots which will bring new hopes and new potentials.

Page 43: Robotics and Embedded Systems
Page 44: Robotics and Embedded Systems