
Content
About the Raspberry Pi............................................................................................10
Raspberry Pi Pin Numbering Introduction ..................................................................11
Raspberry Pi GPIO Library Introduction.....................................................................13
How to Use wiringPi and RPi.GPIO ............................................................................15
Lesson 1 Blinking LED.............................................................................................19
Lesson 2 Controlling an LED by Button ......................................................................22
Lesson 3 Controlling an RGB LED by PWM..................................................................25
Lesson 4 Active Buzzer............................................................................................28
Lesson 5 Passive Buzzer ..........................................................................................31
Lesson 6 Controlling an LED by Hall Sensor ................................................................34
Lesson 7 Controlling an LED by Reed .........................................................................37
Lesson 8 How to Use a Relay ....................................................................................40
Lesson 9 Laser Transmitter......................................................................................43
Lesson 10 Laser Receiver.........................................................................................46
Lesson 11 How to Control a DC Motor........................................................................49
Lesson 12 Controlling an LED by Limit Switch.............................................................52
Lesson 13 Controlling an LED by Vibration Switch .......................................................55
Lesson 14 Rotary Encoder .......................................................................................59
Lesson 15 Controlling an LED by Touch Button ...........................................................63
Lesson 16 Movement Detection Based on PIR .............................................................67
Lesson 17 Flame Sensor ..........................................................................................71
Lesson 18 Line Finder .............................................................................................74
Lesson 19 Measuring the Temperature via DS18B20....................................................77
Lesson 20 Temperature & Humidity Sensor - DHT-11 ..................................................82
Lesson 21 Measuring the Distance.............................................................................85
Lesson 22 Acceleration Sensor - ADXL345 ..................................................................88
Lesson 23 Barometric Pressure Sensor - BMP180 ........................................................91
Lesson 24 Dot-matrix Display...................................................................................94
Lesson 25 LED Bar Graph.........................................................................................97
Lesson 26 How to Drive the Segment Display ............................................................ 100
Lesson 27 Potentiometer ....................................................................................... 103
Lesson 28 Photoresistor ........................................................................................ 108
Lesson 29 Thermistor ........................................................................................... 111
Lesson 30 Water Level Detection ............................................................................ 115