Table of Contents Table of Contents... vi Part 1: Introduction to Robotics... 1 1.1 Robotics... 3 1.1.1 House Robots... 4 1.1.2 Industrial Robots... 4 1.1.3 Medical Robots... 6 1.1.4 Space Robots... 7 1.1.5 Military Robots... 8 1.1.6 Entertainment Robots... 9 Part 2: Basic Electronics... 10 2.1 LED... 10 2.2 Resistor... 14 Series and Parallel Resistors... 16 2.2.1 Potentiometer (Variable Resistor)... 19 2.2.2 Ohm s Law... 21 2.2.3 Triangle Law... 23 2.2.4 Resistor Color Coding... 24 2.3 Capacitor... 25 2.3.1 Decoding Capacitance Value... 26 2.4 Diode... 26 2.5 Transistors... 28 2.5.1 Transistor Operation... 29 2.5.2 Transistor Applications... 30 2.5.3 Transistor Gain... 31
2.6 Bread Board... 32 2.7 Motors... 35 2.7.1 Fleming s Left Hand Rule... 36 2.7.2 Brushed DC Motor (Permanent magnet DC motor)... 37 2.7.3 PMDC Geared motor... 38 2.7.4 Brushless DC Motor... 40 2.7.5 Stepper DC Motor... 42 2.7.6 Servo Motor... 43 2.8 DPDT Switches (Manual Robotics)... 44 2.9 Power Supply... 47 2.10 Rainbow Wire... 48 2.11 Remote Controlled Robotic Car... 50 2.12 Integrated Circuits (IC s)... 65 2.12.1 Pin numbers... 65 2.12.2 IC holders (DIL sockets)... 66 2.12.3 Removing an IC from its holder... 66 2.12.4 Static precautions... 67 2.12.5 Datasheets... 67 2.12.6 The 555 and 556 Timers... 68 2.12.7 Motor Driver IC L-293D... 69 2.12.8 LM-358... 71 2.12.9 LM-324... 71 2.13 Microcontroller... 78 2.13.1 Microcontroller v/s Microprocessor... 78 2.14 Seven Segment Display... 79 2.15 Liquid Crystal Display (LCD)... 80 2.16 Sensors... 81 ix
2.16.1 Infrared Sensor... 82 2.16.2 Passive Infrared Sensor (PIR)... 83 2.16.3 TSOP... 84 2.16.4 Light Dependent Resistor (LDR)... 85 2.16.5 Ultrasonic Sensor... 86 2.16.6 Temperature Sensor (LM-35)... 87 2.17 Projects... 88 2.17.1 LDR based LED control... 88 2.17.2 Led blink using 555 IC... 89 2.17.3 Buzzer Beep... 92 2.17.4 Projects on Transistors... 93 Part 3: Getting Started with Arduino... 98 Introduction:... 98 3.1 Roboduino Hardware... 104 3.2 Arduino Software... 106 3.2.1 Installing Arduino on Your Computer... 107 3.2.2 Connect the Board... 108 3.3 Your first Program Blinking an LED... 115 Part 4: Programming... 120 4.1 Programming in Arduino... 120 4.2 Basic Structure of Program... 120 4.2.1 setup()... 121 4.2.2 loop()... 121 4.2.3 pinmode(pin, mode)... 122 4.2.4 digitalread(pin)... 123 4.2.5 digitalwrite(pin, value)... 123 4.2.6 high/low... 124 ix
4.2.7 input/output... 124 4.3 PWM... 124 4.3.1 analogwrite(pin, value)... 126 4.3.2 analogread(pin)... 126 4.4 functions... 128 4.4.1 {} curly braces... 129 4.4.2 ; semicolon... 129 4.4.3 /* */ block comments... 130 4.5 variables... 130 4.5.1 variable declaration... 131 4.5.2 variable scope... 132 4.5.3 byte... 133 4.5.4 int... 133 4.5.5 long... 133 4.5.6 float... 134 4.5.7 arrays... 134 4.6 Arithmetic... 135 4.6.1 Compound assignments... 136 4.6.2 Comparison operators... 136 4.7 Logical operators... 137 4.8 Constants... 137 4.8.1 True/False... 137 4.8.2 if... 138 4.8.3 if else... 138 4.8.4 for... 139 4.8.5 while... 140 4.8.6 do while... 141 xi
4.9 delay(ms)... 141 4.9.1 millis()... 142 4.9.2 min(x, y)... 142 4.9.3 max(x, y)... 142 4.9.4 randomseed(seed)... 142 4.10 random(max), random(min, max)... 143 4.11 Serial.begin(rate)... 143 4.12 Serial.println(data)... 144 4.13 Input/Output... 144 4.13.1 digital output... 144 4.13.2 digital input... 145 4.13.3 pwm output... 146 4.13.4 potentiometer input... 147 4.13.5 variable resistor input... 148 Part 5: Arduino Projects... 149 Project 1: Blinking an LED... 149 Project 1.1... 150 Project 1.2... 151 Project 1.3... 153 Project 2: Push button and LED... 156 Project 2.1 Led Blink using Push button... 157 Project 3: Fading LED... 161 Project 3.1: LED fading using PWM... 161 Project 3.2 - Led Fire Effect... 164 Project 3.3- Mood changing Lamp... 167 Project 4: Analog I/O (PWM)... 174 Project 4.1 LED fading using Potentiometer... 174 xi
Project 4.2 Darkness activation light system... 178 Project 4.3 Light activation system... 181 Project 4.4 Morning alarm... 184 Project 5: Sensors and Arduino... 187 Project 5.1 Arduino, IR sensor and Basic shield... 189 Project 5.2: DC motor control using push button... 192 Project 5.3 Line Follower Robot... 198 Project 5.4 Edge avoider robot... 205 Project 5.5 Obstacle Avoider Robot... 210 Project 5.6 Motor Speed control using PWM... 217 Project 6: DTMF and Arduino... 222 History of DTMF... 222 Project 6.1: Arduino, Basic shield and DTMF... 226 Project 7: Arduino and LCD Display... 231 Project 7.1: Hello World!... 232 Project 8: Seven Segment Display (SSD)... 236 Project 8.1 Arduino and SSD... 238 Project 9: Arduino and Accelerometer... 247 Project 10: Arduino and Touch screen... 250 Project 11: Arduino and Ultrasonic sensor... 261 Project 12: Arduino and PIR sensor... 265 Part 6: Introduction on MATLAB... 270 6.1 DESKTOP BASICS... 272 6.1.1 First Session... 273 6.2 Getting Started... 275 6.2.1 Creating MATLAB variables... 275 6.2.2 Matrix and Array Operations... 277 xiii
6.2.3 Matrix indexing... 279 6.2.4 Colon operator... 279 6.2.5 Linear spacing... 280 6.2.6 Colon operator in a matrix... 281 6.2.7 Error messages... 282 6.2.8 Creating a sub-matrix... 282 6.2.9 Deleting row or column... 285 6.2.10 Dimension... 286 6.2.11 Transposing a matrix... 286 6.2.12 Matrix generators... 287 6.2.13 Special matrices... 289 6.2.14 Making corrections... 289 6.2.15 Controlling the hierarchy of operations or precedence... 290 6.3 Array Concatenation... 291 6.3.1 Complex Numbers... 292 6.3.2 Array Indexing... 293 6.4 Managing the workspace Variables... 295 6.5 Calling Functions... 299 6.6 Miscellaneous commands... 300 6.7 Getting help... 300 6.8 2-D and 3-D Plots... 301 6.8.1 Creating simple plots... 301 6.8.2 Multiple data sets in one plot... 305 6.8.3 3-D Plots... 305 6.8.4 Subplots... 306 6.8.5 Specifying Line Styles and Colors... 308 6.8.6 Adding Plots to an Existing Graph... 309 xiii
6.8.7 Setting Axis Visibility... 310 6.8.8 Setting Grid Lines... 311 6.9 Control Flow... 311 6.10 Loop Control for, while... 313 6.10.1 for loop... 314 6.10.2 While loop... 314 7. Image Processing... 316 7.1 Images... 316 7.2 Colors... 320 7.2.1 RGB... 320 7.2.2 CMYK... 321 7.3 Overview of Image Types... 322 7.4 Image Properties... 326 7.4.1 Pixel Indices... 326 7.4.2 Color Bit Depth... 328 7.5 Introduction to the basic programming of image processing... 329 7.6 Spatial Transformations... 333 7.6.1 Resizing an image... 333 7.6.2 Rotating an Image... 334 7.7 Image Acquisition with MATLAB... 335 7.8 Filters... 336 7.8.1 Performing Linear Filtering of Images Using imfilter... 337 7.8.2 Low Pass Filters... 337 7.8.3 Median Filters... 337 7.9 Morphology Fundamentals... 339 7.10 BLURRING/DE BLURRING an image... 340 xiii
7.11 Edge Detection in an image... 342 7.12 Color detection... 343 7.13 General Commands... 344 7.14 Webcam Capture... 346 7.15 Interfacing of Roboduino with MATLAB... 347 7.15.1 Serial communication... 347 Part 8: Hobby Projects... 353 1. Color conversion using Image Processing... 353 2. Graphical conversion of images using MATLAB... 354 3. Sub-plotting of two images in a single window... 355 4. Use filter to remove noise in a black and white image... 356 5. Counting total number of objects in an image... 357 6. Adding noise to an image... 360 7. Color Indicator... 361 8. Edge detector... 362 9. Color detector... 364 10. Advance color detection... 367 11. Video player through MATLAB... 368 12. Conversion of color format through webcam... 369 13. Cam Shots... 371 14. Algorithm of line follower using Black and White projection... 371 15. Live color detection... 373 16. Count the number of red pixels... 375 17. Centroid of detected color... 376 18. Designing of new image through MATLAB... 378 19. Play music through MATLAB... 379 xv
20. LED flasher using MATLAB... 380 21. To make a pattern of LEDs using MATLAB and ROBODUINO... 382 22. Keyboard controlled BOT... 384 23. Gesture controlled BOT... 388 24. Color Detector BOT... 391 25. AUTOMATED GESTURE CONTROL ROBOT USING IMAGE PROCCESSING TOOLBOX... 395 26. Ball Tracking BOT... 401 27. Number plate reader... 404 28. Live data projection... 406 29. MATLAB GUI Controlled BOT-... 408 30. Music player using color detection... 414 Part 9: What is PCB Designing?... 418 WHAT IS EAGLE CAD?... 419 STRUCTURE OF EAGLE CAD... 420 Starting the EAGLE CAD... 421 SCHEMATIC... 424 Layout PCB... 428 After autorouting... 431 PHYSICAL DESIGNING OF PCB... 432 Required Material for PCB:... 432 Printing the layout... 432 Transferring Toner from Paper to Board... 433 Etching Process:... 436 Drilling... 437 Products... 439 xv