SlideShare a Scribd company logo
5
Table of Contents
1 Introduction .................................................................................. 9
1.1 The Arduino Project................................................................... 10
1.2 Book Structure and Target Audience ............................................ 10
2 Structure and Function of the Hardware ........................................ 11
2.1 Lots to Choose From: Arduino Versions........................................ 12
2.2 Available for all Purposes: Shields ............................................... 13
2.2.1 Proto Shield ................................................................... 13
2.2.2 Motor Shield .................................................................. 13
............................................................... 14
....................... 15
..................................... 15
2.5 The PC Connection: USB interface............................................... 16
3 Development Environment and Programming Basics ..................... 17
................................. 17
................................. 23
......................................... 24
3.4 General Structure of an Arduino Sketch ....................................... 24
........... 27
3.6 Program Structures................................................................... 29
......................................................... 29
......................................... 30
............................................... 30
3.10 The Art of Math: Operators ........................................................ 31
3.11 To Be Clear: Logical Operators.................................................... 32
3.12 Unchanging Parameters: Constants ............................................. 35
3.13 Dealing with Related Data of the Same Type: Arrays...................... 36
3.14 Program Control Structures........................................................ 36
3.15 Controlling Timing..................................................................... 39
3.16 Mathematical Functions ............................................................. 40
3.17 Random numbers ..................................................................... 40
....................................... 41
4 Electronic Components and Low-Cost ‘Freeduinos’ ........................ 43
..................... 43
4.2 Prototyping Boards: Durable Construction without Chemicals.......... 44
................................................................ 45
................... 46
4.4.1 USB Cable ..................................................................... 46
4.4.2 Resistors ....................................................................... 46
4.4.3 Capacitors ..................................................................... 47
4.4.4 Potentiometers............................................................... 47
............................................................................. 48
...................................................................... 48
Boek Arduino UK 131010.indd 5 10-12-13 11:33
6
4.4.7 Switches........................................................................ 49
4.4.8 Silicon Diodes................................................................. 49
4.4.9 Transistors..................................................................... 49
5 Hello World.................................................................................... 51
5.1 Cut to the Chaser ..................................................................... 51
...................................... 53
5.3 POVino: Persistence-of-Vision Display .......................................... 54
6 Displays and Display Techniques ................................................... 59
6.1 Bar Graph Display: The Classic for Measurement Applications ......... 59
6.2 Simple and Cheap: 7-Segment Displays....................................... 59
62
................ 67
6.5 Dot Matrix Display as a Two-Digit Digital Display ........................... 70
................................ 72
6.7 The LCD .................................................................................. 76
7 Measurement and Sensors ............................................................. 81
................................ 81
............. 83
......................................... 87
.. 89
........................... 91
..................................................... 93
7.7 A Simple NTC Thermometer ....................................................... 95
...... 98
7.9 Remote Thermometer................................................................ 99
...... 100
...................... 105
........ 107
............ 112
........................................................ 113
7.15 For Professional Photographers: A Digital Light Meter..................... 115
...... 117
8 Timers, Clocks and Interrupts........................................................ 123
8.1 Morning and Night Fun: Grand Prix Toothbrush Timer .................... 123
.................... 130
.................................................. 135
.................... 138
................................................ 141
8.6 Atomic Precision: The DCF77 Radio Clock..................................... 142
............................ 145
8.8 Stand-Alone DCF77 Clock with LCD Display .................................. 146
9 Interfaces .................................................................................... 149
...................................... 149
.................................... 152
. 155
........................................ 158
9.6 This Time, Fully Digital: The LM75 Thermometer ........................... 160
9.7 Power-Saving: Real-Time Clock with Date Display ......................... 163
Boek Arduino UK 131010.indd 6 10-12-13 11:33
7
167
........................................ 171
............................... 174
........................... 178
........................... 178
9.13 A Complete Microcomputer with LCD Monitor and Keyboard............ 181
10 Sounds and Synthesizer................................................................. 185
10.1 Simple Tones............................................................................ 185
......................................................... 187
........ 188
............................. 195
10.5 Audio Processing....................................................................... 197
.................................... 198
10.5.2 Digital Signal Processing.................................................. 200
10.6 Sound Cloud: A Digital Synthesizer .............................................. 203
11 Digital Control Techniques ............................................................. 207
11.1 Control Types ........................................................................... 208
11.1.1 P Controller.................................................................... 208
.................................................................... 209
.................................................................. 209
11.1.4 PD Controller ................................................................. 209
................................................................ 210
............. 210
11.3 A Classic of Control Theory: The Gravity Compensator ................... 214
12 Physical Computing ....................................................................... 221
........................................................... 221
....................................................... 225
..............................................
13 Processing .................................................................................... 231
13.1 Arduino and Processing: A Formidable Team................................. 232
........ 233
14 The ‘Living Room Box’: Our Modular Concluding Project ................ 241
14.1 Always Useful: A Clock ............................................................... 242
.............................................. 243
................. 243
................... 243
.............................................. 244
................................................... 244
............................................................................ 244
Bibliography......................................................................................... 249
Listings ................................................................................................ 251
List of Figures ...................................................................................... 253
List of Tables........................................................................................ 257
Index ................................................................................................... 259
Boek Arduino UK 131010.indd 7 10-12-13 11:33
9
1
Introduction
-
-
The second success factor is the associated programming interface, which is provided as
free-of-charge open source software. The second success factor is the associated pro-
-
tion, installation is quick and easy, so the environment is usable immediately. Simple in-
troductory examples encourage rapid progress. The selection of complicated parameters
Furthermore, the Arduino is backed up with a wealth of software libraries, and the num-
introduction of simple examples, the way forward is not clear. This is often due to the
lack of detailed descriptions and explanations. The number of projects on the internet,
which are explained to a greater or lesser extent, is more likely to cause confusion. Be-
cause these applications are designed by a number of different people, each with their
own goals in mind, there is no common thread connecting them.
-
ducing a different theme. A practical hands-on approach is employed alongside the
necessary theoretical foundations and, in a similar vein, important concepts such as A/D
conversion, timers and interrupts are presented using practical projects. There are run-
ning lights, fully-functional voltmeters, precise digital thermometers, clocks of all kinds,
reaction timers and a mouse-controlled robot crane. Along the way, the reader will gain
an understanding of the associated controller techniques and pick them up fully — in the
truest sense of the word.
The practical projects presented herein will not be relegated to the status of mere ‘lab-
will arise, which may be used for home, hobby and work. The projects are always imple-
modularly and may be adapted to individual requirements. The knowledge gleaned
throughout the book is used practically to produce a very useful, yet unusual, device.
Boek Arduino UK 131010.indd 9 10-12-13 11:33
1 INTRODUCTION
10
1.1 The Arduino Project
The Arduino
handy printed circuit board that contained all of the necessary electronic building blocks.
The main objective was the development of an inexpensive microcontroller board that
could be utilized quickly and simply by art and design students who had no previous
knowledge of programming or electronics.
-
gether easily, and it sold out quickly. Newer versions followed in rapid succession. De-
signers and artists from other regions took up the idea and the Arduino principle spread,
The concept of a simple and low-cost hardware platform with a freely available, easy-to-
learn programming language was quickly embraced by hobbyists. Finally, schools and
most successful of all time.
1.2 Book Structure and Target Audience
-
-
and teachers who come with some pre-existing technical knowledge will encounter new
challenges.
less technically challenging material at the beginning of the book. For this reason, be-
single project is constructed.
Boek Arduino UK 131010.indd 10 10-12-13 11:33
44
4.2 Prototyping Boards: Durable Construction without Chemicals
be built on prototyping board. There are different versions available. The most common
types are stripboard and perfboard. The former usually results in a circuit with fewer
solder connections, although many circuit traces are likely to require severing. On the
other hand, boards with individual solder pads require all electrical connections have to
be individually created, so no manual severing is required on the board itself, but many
more solder connections are required.
Figure 4.1:
Breadboard
Figure 4.2:
Stripboard
Figure 4.3:
A Perfboard has Individual Pads
Boek Arduino UK 131010.indd 44 10-12-13 11:33
60
scribed any further here. Another option for displaying alphabetical characters, the dot
matrix display, is covered in a later section.
Figure 6.1:
Typical Pin Layout on a Single 7-Segment Display
The wiring of a common-cathode 7-segment display is shown in Figure 6.2. Since a
numeric digit requires several segments to be lit simultaneously, one might expect an in-
Figure 6.2:
Control of a Single 7-Segment
Display.
Boek Arduino UK 131010.indd 60 10-12-13 11:33
161
The problems associated with NTCs, such as the nonlinear relationship between tem-
perature and resistance, as well as the requirement of a second resistor to make up a
voltage divider, which introduces additional inaccuracy, etc., all fall away.
alog transmission of temperature data takes place over a long cable, errors are eas-
electromagnetic radiation, such as from mobile phones and electric motors, may cause
unacceptable interference. Lastly, contact stresses at plugs and connections may lead to
for lines in excess of 1 m, problems start occurring in practice. Digital transmission via
and its corresponding pin. For larger applications, this can quickly lead to a pin short-
3
setup(), Wire and Lcd are initialized. Then follows the printing of a template for
the output of temperature values to the LCD. The main loop begins by setting the most
then read, one after the other. Conversion of the byte values takes place as per the
Figure 9.11:
LM75 for Local
Measurements
Boek Arduino UK 131010.indd 161 10-12-13 11:33
181
use re d() c r
click = Mouse.read();
mouseX = Mouse.read();
mouseY = Mouse.read();
// send data
Serial.print(“X=”);
Serial.print(mouseX, DEC);
Serial.print(“tY=”);
Serial.print(mouseY, DEC);
switch (click) {
case
Serial.print(“t left click”);
break;
case 10:
Serial.print(“t right click”);
break;
case 11:
Serial.print(“t both click”);
break;
}
Serial.println();
delay(20);
}
void mouseInit() {
Mouse.write(0xff); // reset
Mouse.read(); // con rm byte times
Mouse.read();
Mouse.read();
Mouse.write(0xf0); // remote mode
Mouse.read(); // con rm
delayMicroseconds(100);
}
-
vices are controlled using the mouse.
9.13 A Complete Microcomputer with LCD Monitor and Keyboard
Connect a keyboard and a mouse to the Arduino, and you have yourself a complete
microcomputer. Together with an LCD display, it forms a system with performance com-
Boek Arduino UK 131010.indd 181 10-12-13 11:33
188
stripboard may be used.
10.3 Fast PWM Makes It Happen: Not Just Tones, But Sound Waves
waves. A tone is able to be described fully by a single physical parameter: its frequency.
The tone()
Figure 10.3:
Construction Example
for the Audio Ampli er
Figure 10.4:
A Suitable DIY Speaker
Enclosure
Boek Arduino UK 131010.indd 188 10-12-13 11:33
205
The sounds generated by this synthesizer are based on a broadband noise spectrum,
which is repeated in rapid succession. Analog synthesizers produce similar sounds using
ed with its own additional decay rate.
Five potentiometers enable the adjustment of the following parameters:
Analog A0: Noise spectrum 1
Analog A1: Decay rate 1
Analog A2: Noise spectrum 2
Analog A3: Decay rate 2
Analog A4: Noise spectrum repeat frequency
reverb discussed above, as well as vibrato or various envelopes, may be created.
easily adjusted simultaneously. A construction example is shown in Figure 10.11.
Using Audacity, the raw sounds produced by the Arduino may be further processed,
creating very interesting sound sequences for use as background ambience in videos.
Tube video!
Figure 10.11:
Synthesizer Construction
Example
Boek Arduino UK 131010.indd 205 10-12-13 11:33
212
Figure 11.3: Brightness Control Circuit
-
nates the photodiode.
the voltage at the analog input increases with increased light intensity. Thus, the control
system is directly proportionally polarized. By calculating the error signal as
Boek Arduino UK 131010.indd 212 10-12-13 11:33
259
Index
2-D camera swivel...........................225
7-segment displays........................... 62
A
........................................185
Analog channels ..............................233
Arduino............................................. 9
Arithmetic operators ......................... 31
Arrays............................................. 36
ATMega168...................................... 16
ATMega328...................................... 16
Audio processing .............................197
B
................................200
Bar graph display ............................. 59
Bar graph voltmeter.......................... 81
Bar graph.......................................233
Batteries ........................................107
Blink............................................... 24
Breadboards .................................... 43
C
Calibration....................................... 86
Circular memory buffer ....................200
Constants........................................ 35
Control loop....................................207
Control...........................................215
Cranino..........................................228
Crystal...........................................123
D
Data loggers ...................................237
DCF77 module ................................145
DCF77 radio module ........................123
Digital clock....................................130
Diodes ............................................ 49
Displays .......................................... 59
Dot matrix displays........................... 67
E
.........................141
....................................... 94
....................... 89
.................................228
............................... 15
F
Fuse bits ........................................... 9
G
Geocaching.....................................113
Gravitation compensator ..................214
H
.....................155
.............................105
I
..........................................149
................................................. 17
..........................210
..............149
.....................................171
............................174
L
LC displays ...................................... 76
Levitation .......................................217
Libraries.......................................... 41
Light barriers ..................................112
Light meter.....................................115
Living room box ..............................241
Living room hygrometer ...................105
Logical operations............................. 32
M
Magnet ..........................................216
Microcontroller ................................. 15
Minimal Arduino ............................... 45
Mood lights...................................... 11
................................ 48
N
................................107
NTC................................................ 95
O
Optical sensors ...............................112
P
PC keyboards..................................178
PCF8583 ........................................164
PD controller...................................218
Photodiodes....................................112
Phototransistors ..............................112
Physical Computing..........................221
Potentiometers................................. 47
POV................................................ 54
............................... 53, 212
Boek Arduino UK 131010.indd 259 10-12-13 11:33
260
Power relay ....................................141
Power supply ................................... 15
Printed circuit boards ........................ 43
Processing......................................231
Program icons.................................231
Prototyping boards ........................... 44
PS/2 mice.......................................178
Pulse-width modulation ....................188
Pushbuttons..................................... 49
R
Random numbers ............................. 40
RC5 code........................................167
Reaction timer ................................135
Relative humidity.............................105
Resistors ......................................... 46
Reverberation springs, plates ............200
Reverberation .................................200
........................................171
RTC ...............................................163
Running light effects ......................... 51
S
Sensors........................................... 81
Seven segment displays .................... 62
Shields............................................ 13
Shift operators ................................. 33
Structures ....................................... 36
Switches ......................................... 49
Synthesizer ....................................185
T
Temperature sensor .......................... 98
Theremin .......................................195
Thermometer............................ 95, 100
Timer.............................................138
Toothbrush timer.............................123
Transistor parameters ....................... 93
Twilight switch ................................112
U
Ubuntu............................................ 23
Ultrasonic transducers......................117
Upload ............................................ 21
USB cable........................................ 20
V
Variables30
Variable types .................................. 31
VCO...............................................198
Verify.............................................. 21
Boek Arduino UK 131010.indd 260 10-12-13 11:33

More Related Content

What's hot

Artromick Ac Hostguide304 for Hospital Computing Solutions
Artromick Ac Hostguide304 for Hospital Computing SolutionsArtromick Ac Hostguide304 for Hospital Computing Solutions
Artromick Ac Hostguide304 for Hospital Computing Solutions
Artromick
 
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFD
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFDAERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFD
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFD
mouhamedakremmouffouk
 
60950106 basis-latest-till-interview-questions
60950106 basis-latest-till-interview-questions60950106 basis-latest-till-interview-questions
60950106 basis-latest-till-interview-questions
Ravic Kumar
 
Guia de usuario arena
Guia de usuario arenaGuia de usuario arena
Guia de usuario arena
Sadamii Rap
 
Bb8520
Bb8520Bb8520
Bb8520
mukesh
 
1 20
1   201   20
NX10 for Engineering Design
NX10 for Engineering DesignNX10 for Engineering Design
NX10 for Engineering Design
Nam Hoai
 
Sap basis r3 hand book
Sap basis r3 hand bookSap basis r3 hand book
Sap basis r3 hand book
nanda nanda
 
Tools Users Guide
Tools Users GuideTools Users Guide
Tools Users Guide
Andreas Peny
 
C2675m c
C2675m cC2675m c
C2675m c
hungvv616
 
Mazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners ManualMazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners Manual
Naples Mazda
 
Application of nanotechnologies: ICT
Application of nanotechnologies: ICTApplication of nanotechnologies: ICT
Application of nanotechnologies: ICT
NANOYOU
 
INVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CAR
INVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CARINVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CAR
INVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CAR
Daniel Baker
 
Bucher lift control guide
Bucher lift control guideBucher lift control guide
Bucher lift control guide
Júlio César Ramos
 
Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1
Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1
Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1
Andreas Peny
 
Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...
Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...
Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...
SANTIAGO PABLO ALBERTO
 
Fadal Parts Manual
Fadal Parts ManualFadal Parts Manual
Grundfos Wincaps Manual Guide
Grundfos Wincaps Manual GuideGrundfos Wincaps Manual Guide
Grundfos Wincaps Manual Guide
SERDAR BELBAĞ
 
G Streamer Apps Development Manual
G Streamer Apps Development   ManualG Streamer Apps Development   Manual
G Streamer Apps Development Manual
Caglar Dursun
 

What's hot (19)

Artromick Ac Hostguide304 for Hospital Computing Solutions
Artromick Ac Hostguide304 for Hospital Computing SolutionsArtromick Ac Hostguide304 for Hospital Computing Solutions
Artromick Ac Hostguide304 for Hospital Computing Solutions
 
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFD
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFDAERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFD
AERODYNAMIC DEVELOPMENT OF THE SEGURACING F1-R01 PROTOTYPE USING CFD
 
60950106 basis-latest-till-interview-questions
60950106 basis-latest-till-interview-questions60950106 basis-latest-till-interview-questions
60950106 basis-latest-till-interview-questions
 
Guia de usuario arena
Guia de usuario arenaGuia de usuario arena
Guia de usuario arena
 
Bb8520
Bb8520Bb8520
Bb8520
 
1 20
1   201   20
1 20
 
NX10 for Engineering Design
NX10 for Engineering DesignNX10 for Engineering Design
NX10 for Engineering Design
 
Sap basis r3 hand book
Sap basis r3 hand bookSap basis r3 hand book
Sap basis r3 hand book
 
Tools Users Guide
Tools Users GuideTools Users Guide
Tools Users Guide
 
C2675m c
C2675m cC2675m c
C2675m c
 
Mazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners ManualMazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners Manual
 
Application of nanotechnologies: ICT
Application of nanotechnologies: ICTApplication of nanotechnologies: ICT
Application of nanotechnologies: ICT
 
INVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CAR
INVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CARINVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CAR
INVESTIGATION INTO THE AERODYNAMIC DESIGN OF A FORMULA ONE CAR
 
Bucher lift control guide
Bucher lift control guideBucher lift control guide
Bucher lift control guide
 
Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1
Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1
Datacolor 650 600 400 Users Guide 4230 0395 M Rev 1
 
Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...
Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...
Arduino: Crea bots y gadgets Arduino aprendiendo mediante el descubrimiento d...
 
Fadal Parts Manual
Fadal Parts ManualFadal Parts Manual
Fadal Parts Manual
 
Grundfos Wincaps Manual Guide
Grundfos Wincaps Manual GuideGrundfos Wincaps Manual Guide
Grundfos Wincaps Manual Guide
 
G Streamer Apps Development Manual
G Streamer Apps Development   ManualG Streamer Apps Development   Manual
G Streamer Apps Development Manual
 

Similar to Preview arduino-projects-and-circuits-guide

Zwcad2011 tutorialbook+
Zwcad2011 tutorialbook+Zwcad2011 tutorialbook+
Zwcad2011 tutorialbook+
sebastian1232009
 
Blackberry v.6.0
Blackberry v.6.0Blackberry v.6.0
Blackberry v.6.0
Teddy Koornia
 
MFG/PRO QAD Reporting Framework Document Guide
MFG/PRO QAD Reporting Framework Document GuideMFG/PRO QAD Reporting Framework Document Guide
MFG/PRO QAD Reporting Framework Document Guide
Vinh Nguyen
 
The IT Manager's Guide to DevOps
The IT Manager's Guide to DevOpsThe IT Manager's Guide to DevOps
The IT Manager's Guide to DevOps
Massimo Talia
 
Solmanfocusedbuild
SolmanfocusedbuildSolmanfocusedbuild
Solmanfocusedbuild
Ghassen B
 
Peachpit mastering xcode 4 develop and design sep 2011
Peachpit mastering xcode 4 develop and design sep 2011Peachpit mastering xcode 4 develop and design sep 2011
Peachpit mastering xcode 4 develop and design sep 2011
Jose Erickson
 
Python_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdf
Python_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdfPython_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdf
Python_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdf
jankoabel2022
 
Openobject developer
Openobject developerOpenobject developer
Openobject developer
Ali Mashduqi
 
Copy_of_python-journeyman.pdf
Copy_of_python-journeyman.pdfCopy_of_python-journeyman.pdf
Copy_of_python-journeyman.pdf
NedyalkoKarabadzhako
 
architectureplaybook-readthedocs-io-en-latest.pdf
architectureplaybook-readthedocs-io-en-latest.pdfarchitectureplaybook-readthedocs-io-en-latest.pdf
architectureplaybook-readthedocs-io-en-latest.pdf
momirlan
 
orcad-tutorial.pdf
orcad-tutorial.pdforcad-tutorial.pdf
orcad-tutorial.pdf
PrathapBollineni1
 
Programming
ProgrammingProgramming
Programming
Aravindharamanan S
 
Dynamics AX/ X++
Dynamics AX/ X++Dynamics AX/ X++
Dynamics AX/ X++
Reham Maher El-Safarini
 
test6
test6test6
Zambak it excel2010
Zambak it excel2010Zambak it excel2010
Zambak it excel2010
Nazrin Afandiyeva
 
enterprise-angular-v5.pdf
enterprise-angular-v5.pdfenterprise-angular-v5.pdf
enterprise-angular-v5.pdf
SerhiiClevertempoLon
 
Threading
ThreadingThreading
Threading
j25ankur
 
Bwl red book
Bwl red bookBwl red book
Red book Blueworks Live
Red book Blueworks LiveRed book Blueworks Live
Red book Blueworks Live
Francesco Maria Rivera
 
E views 9 command ref
E views 9 command refE views 9 command ref
E views 9 command ref
Ibrahima Bakhoum
 

Similar to Preview arduino-projects-and-circuits-guide (20)

Zwcad2011 tutorialbook+
Zwcad2011 tutorialbook+Zwcad2011 tutorialbook+
Zwcad2011 tutorialbook+
 
Blackberry v.6.0
Blackberry v.6.0Blackberry v.6.0
Blackberry v.6.0
 
MFG/PRO QAD Reporting Framework Document Guide
MFG/PRO QAD Reporting Framework Document GuideMFG/PRO QAD Reporting Framework Document Guide
MFG/PRO QAD Reporting Framework Document Guide
 
The IT Manager's Guide to DevOps
The IT Manager's Guide to DevOpsThe IT Manager's Guide to DevOps
The IT Manager's Guide to DevOps
 
Solmanfocusedbuild
SolmanfocusedbuildSolmanfocusedbuild
Solmanfocusedbuild
 
Peachpit mastering xcode 4 develop and design sep 2011
Peachpit mastering xcode 4 develop and design sep 2011Peachpit mastering xcode 4 develop and design sep 2011
Peachpit mastering xcode 4 develop and design sep 2011
 
Python_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdf
Python_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdfPython_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdf
Python_Programming_and_Numerical_Methods_A_Guide_for_Engineers_and.pdf
 
Openobject developer
Openobject developerOpenobject developer
Openobject developer
 
Copy_of_python-journeyman.pdf
Copy_of_python-journeyman.pdfCopy_of_python-journeyman.pdf
Copy_of_python-journeyman.pdf
 
architectureplaybook-readthedocs-io-en-latest.pdf
architectureplaybook-readthedocs-io-en-latest.pdfarchitectureplaybook-readthedocs-io-en-latest.pdf
architectureplaybook-readthedocs-io-en-latest.pdf
 
orcad-tutorial.pdf
orcad-tutorial.pdforcad-tutorial.pdf
orcad-tutorial.pdf
 
Programming
ProgrammingProgramming
Programming
 
Dynamics AX/ X++
Dynamics AX/ X++Dynamics AX/ X++
Dynamics AX/ X++
 
test6
test6test6
test6
 
Zambak it excel2010
Zambak it excel2010Zambak it excel2010
Zambak it excel2010
 
enterprise-angular-v5.pdf
enterprise-angular-v5.pdfenterprise-angular-v5.pdf
enterprise-angular-v5.pdf
 
Threading
ThreadingThreading
Threading
 
Bwl red book
Bwl red bookBwl red book
Bwl red book
 
Red book Blueworks Live
Red book Blueworks LiveRed book Blueworks Live
Red book Blueworks Live
 
E views 9 command ref
E views 9 command refE views 9 command ref
E views 9 command ref
 

More from Domingo Arroyo

17309828
1730982817309828
17309828
Domingo Arroyo
 
Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...
Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...
Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...
Domingo Arroyo
 
Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...
Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...
Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...
Domingo Arroyo
 
93e23 msi ms-7101_rev_2b_sch
93e23 msi ms-7101_rev_2b_sch93e23 msi ms-7101_rev_2b_sch
93e23 msi ms-7101_rev_2b_sch
Domingo Arroyo
 
Candy washing machine_error_code_
Candy washing machine_error_code_Candy washing machine_error_code_
Candy washing machine_error_code_
Domingo Arroyo
 
Atx power supplytester
Atx power supplytesterAtx power supplytester
Atx power supplytester
Domingo Arroyo
 
Dir 300
Dir 300Dir 300

More from Domingo Arroyo (7)

17309828
1730982817309828
17309828
 
Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...
Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...
Manual diagnostico-dtc-tipos-obd-principios-codigos-emision-funcion-respaldo-...
 
Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...
Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...
Curso diagnostico-reparacion-fallas-sistema-inyeccion-electronica-combustible...
 
93e23 msi ms-7101_rev_2b_sch
93e23 msi ms-7101_rev_2b_sch93e23 msi ms-7101_rev_2b_sch
93e23 msi ms-7101_rev_2b_sch
 
Candy washing machine_error_code_
Candy washing machine_error_code_Candy washing machine_error_code_
Candy washing machine_error_code_
 
Atx power supplytester
Atx power supplytesterAtx power supplytester
Atx power supplytester
 
Dir 300
Dir 300Dir 300
Dir 300
 

Recently uploaded

按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
1jtj7yul
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
xuqdabu
 
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
yizxn4sx
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
lorraineandreiamcidl
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
peuce
 
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
yizxn4sx
 
按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理
按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理
按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理
yizxn4sx
 
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
terpt4iu
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
xuqdabu
 
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
eydeofo
 
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
zpc0z12
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
u0g33km
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
terpt4iu
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
8db3cz8x
 
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
6oo02s6l
 
Production.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd ddddddddddddddddddddddddddddddddddProduction.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd dddddddddddddddddddddddddddddddddd
DanielOliver74
 
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
snfdnzl7
 
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
terpt4iu
 
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
byfazef
 
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
xuqdabu
 

Recently uploaded (20)

按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
 
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
 
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
 
按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理
按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理
按照学校原版(Westminster文凭证书)威斯敏斯特大学毕业证快速办理
 
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
 
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
一比一原版(UOL文凭证书)利物浦大学毕业证如何办理
 
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
 
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
 
Production.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd ddddddddddddddddddddddddddddddddddProduction.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd dddddddddddddddddddddddddddddddddd
 
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
 
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
 
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
 
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
 

Preview arduino-projects-and-circuits-guide

  • 1.
  • 2. 5 Table of Contents 1 Introduction .................................................................................. 9 1.1 The Arduino Project................................................................... 10 1.2 Book Structure and Target Audience ............................................ 10 2 Structure and Function of the Hardware ........................................ 11 2.1 Lots to Choose From: Arduino Versions........................................ 12 2.2 Available for all Purposes: Shields ............................................... 13 2.2.1 Proto Shield ................................................................... 13 2.2.2 Motor Shield .................................................................. 13 ............................................................... 14 ....................... 15 ..................................... 15 2.5 The PC Connection: USB interface............................................... 16 3 Development Environment and Programming Basics ..................... 17 ................................. 17 ................................. 23 ......................................... 24 3.4 General Structure of an Arduino Sketch ....................................... 24 ........... 27 3.6 Program Structures................................................................... 29 ......................................................... 29 ......................................... 30 ............................................... 30 3.10 The Art of Math: Operators ........................................................ 31 3.11 To Be Clear: Logical Operators.................................................... 32 3.12 Unchanging Parameters: Constants ............................................. 35 3.13 Dealing with Related Data of the Same Type: Arrays...................... 36 3.14 Program Control Structures........................................................ 36 3.15 Controlling Timing..................................................................... 39 3.16 Mathematical Functions ............................................................. 40 3.17 Random numbers ..................................................................... 40 ....................................... 41 4 Electronic Components and Low-Cost ‘Freeduinos’ ........................ 43 ..................... 43 4.2 Prototyping Boards: Durable Construction without Chemicals.......... 44 ................................................................ 45 ................... 46 4.4.1 USB Cable ..................................................................... 46 4.4.2 Resistors ....................................................................... 46 4.4.3 Capacitors ..................................................................... 47 4.4.4 Potentiometers............................................................... 47 ............................................................................. 48 ...................................................................... 48 Boek Arduino UK 131010.indd 5 10-12-13 11:33
  • 3. 6 4.4.7 Switches........................................................................ 49 4.4.8 Silicon Diodes................................................................. 49 4.4.9 Transistors..................................................................... 49 5 Hello World.................................................................................... 51 5.1 Cut to the Chaser ..................................................................... 51 ...................................... 53 5.3 POVino: Persistence-of-Vision Display .......................................... 54 6 Displays and Display Techniques ................................................... 59 6.1 Bar Graph Display: The Classic for Measurement Applications ......... 59 6.2 Simple and Cheap: 7-Segment Displays....................................... 59 62 ................ 67 6.5 Dot Matrix Display as a Two-Digit Digital Display ........................... 70 ................................ 72 6.7 The LCD .................................................................................. 76 7 Measurement and Sensors ............................................................. 81 ................................ 81 ............. 83 ......................................... 87 .. 89 ........................... 91 ..................................................... 93 7.7 A Simple NTC Thermometer ....................................................... 95 ...... 98 7.9 Remote Thermometer................................................................ 99 ...... 100 ...................... 105 ........ 107 ............ 112 ........................................................ 113 7.15 For Professional Photographers: A Digital Light Meter..................... 115 ...... 117 8 Timers, Clocks and Interrupts........................................................ 123 8.1 Morning and Night Fun: Grand Prix Toothbrush Timer .................... 123 .................... 130 .................................................. 135 .................... 138 ................................................ 141 8.6 Atomic Precision: The DCF77 Radio Clock..................................... 142 ............................ 145 8.8 Stand-Alone DCF77 Clock with LCD Display .................................. 146 9 Interfaces .................................................................................... 149 ...................................... 149 .................................... 152 . 155 ........................................ 158 9.6 This Time, Fully Digital: The LM75 Thermometer ........................... 160 9.7 Power-Saving: Real-Time Clock with Date Display ......................... 163 Boek Arduino UK 131010.indd 6 10-12-13 11:33
  • 4. 7 167 ........................................ 171 ............................... 174 ........................... 178 ........................... 178 9.13 A Complete Microcomputer with LCD Monitor and Keyboard............ 181 10 Sounds and Synthesizer................................................................. 185 10.1 Simple Tones............................................................................ 185 ......................................................... 187 ........ 188 ............................. 195 10.5 Audio Processing....................................................................... 197 .................................... 198 10.5.2 Digital Signal Processing.................................................. 200 10.6 Sound Cloud: A Digital Synthesizer .............................................. 203 11 Digital Control Techniques ............................................................. 207 11.1 Control Types ........................................................................... 208 11.1.1 P Controller.................................................................... 208 .................................................................... 209 .................................................................. 209 11.1.4 PD Controller ................................................................. 209 ................................................................ 210 ............. 210 11.3 A Classic of Control Theory: The Gravity Compensator ................... 214 12 Physical Computing ....................................................................... 221 ........................................................... 221 ....................................................... 225 .............................................. 13 Processing .................................................................................... 231 13.1 Arduino and Processing: A Formidable Team................................. 232 ........ 233 14 The ‘Living Room Box’: Our Modular Concluding Project ................ 241 14.1 Always Useful: A Clock ............................................................... 242 .............................................. 243 ................. 243 ................... 243 .............................................. 244 ................................................... 244 ............................................................................ 244 Bibliography......................................................................................... 249 Listings ................................................................................................ 251 List of Figures ...................................................................................... 253 List of Tables........................................................................................ 257 Index ................................................................................................... 259 Boek Arduino UK 131010.indd 7 10-12-13 11:33
  • 5. 9 1 Introduction - - The second success factor is the associated programming interface, which is provided as free-of-charge open source software. The second success factor is the associated pro- - tion, installation is quick and easy, so the environment is usable immediately. Simple in- troductory examples encourage rapid progress. The selection of complicated parameters Furthermore, the Arduino is backed up with a wealth of software libraries, and the num- introduction of simple examples, the way forward is not clear. This is often due to the lack of detailed descriptions and explanations. The number of projects on the internet, which are explained to a greater or lesser extent, is more likely to cause confusion. Be- cause these applications are designed by a number of different people, each with their own goals in mind, there is no common thread connecting them. - ducing a different theme. A practical hands-on approach is employed alongside the necessary theoretical foundations and, in a similar vein, important concepts such as A/D conversion, timers and interrupts are presented using practical projects. There are run- ning lights, fully-functional voltmeters, precise digital thermometers, clocks of all kinds, reaction timers and a mouse-controlled robot crane. Along the way, the reader will gain an understanding of the associated controller techniques and pick them up fully — in the truest sense of the word. The practical projects presented herein will not be relegated to the status of mere ‘lab- will arise, which may be used for home, hobby and work. The projects are always imple- modularly and may be adapted to individual requirements. The knowledge gleaned throughout the book is used practically to produce a very useful, yet unusual, device. Boek Arduino UK 131010.indd 9 10-12-13 11:33
  • 6. 1 INTRODUCTION 10 1.1 The Arduino Project The Arduino handy printed circuit board that contained all of the necessary electronic building blocks. The main objective was the development of an inexpensive microcontroller board that could be utilized quickly and simply by art and design students who had no previous knowledge of programming or electronics. - gether easily, and it sold out quickly. Newer versions followed in rapid succession. De- signers and artists from other regions took up the idea and the Arduino principle spread, The concept of a simple and low-cost hardware platform with a freely available, easy-to- learn programming language was quickly embraced by hobbyists. Finally, schools and most successful of all time. 1.2 Book Structure and Target Audience - - and teachers who come with some pre-existing technical knowledge will encounter new challenges. less technically challenging material at the beginning of the book. For this reason, be- single project is constructed. Boek Arduino UK 131010.indd 10 10-12-13 11:33
  • 7. 44 4.2 Prototyping Boards: Durable Construction without Chemicals be built on prototyping board. There are different versions available. The most common types are stripboard and perfboard. The former usually results in a circuit with fewer solder connections, although many circuit traces are likely to require severing. On the other hand, boards with individual solder pads require all electrical connections have to be individually created, so no manual severing is required on the board itself, but many more solder connections are required. Figure 4.1: Breadboard Figure 4.2: Stripboard Figure 4.3: A Perfboard has Individual Pads Boek Arduino UK 131010.indd 44 10-12-13 11:33
  • 8. 60 scribed any further here. Another option for displaying alphabetical characters, the dot matrix display, is covered in a later section. Figure 6.1: Typical Pin Layout on a Single 7-Segment Display The wiring of a common-cathode 7-segment display is shown in Figure 6.2. Since a numeric digit requires several segments to be lit simultaneously, one might expect an in- Figure 6.2: Control of a Single 7-Segment Display. Boek Arduino UK 131010.indd 60 10-12-13 11:33
  • 9. 161 The problems associated with NTCs, such as the nonlinear relationship between tem- perature and resistance, as well as the requirement of a second resistor to make up a voltage divider, which introduces additional inaccuracy, etc., all fall away. alog transmission of temperature data takes place over a long cable, errors are eas- electromagnetic radiation, such as from mobile phones and electric motors, may cause unacceptable interference. Lastly, contact stresses at plugs and connections may lead to for lines in excess of 1 m, problems start occurring in practice. Digital transmission via and its corresponding pin. For larger applications, this can quickly lead to a pin short- 3 setup(), Wire and Lcd are initialized. Then follows the printing of a template for the output of temperature values to the LCD. The main loop begins by setting the most then read, one after the other. Conversion of the byte values takes place as per the Figure 9.11: LM75 for Local Measurements Boek Arduino UK 131010.indd 161 10-12-13 11:33
  • 10. 181 use re d() c r click = Mouse.read(); mouseX = Mouse.read(); mouseY = Mouse.read(); // send data Serial.print(“X=”); Serial.print(mouseX, DEC); Serial.print(“tY=”); Serial.print(mouseY, DEC); switch (click) { case Serial.print(“t left click”); break; case 10: Serial.print(“t right click”); break; case 11: Serial.print(“t both click”); break; } Serial.println(); delay(20); } void mouseInit() { Mouse.write(0xff); // reset Mouse.read(); // con rm byte times Mouse.read(); Mouse.read(); Mouse.write(0xf0); // remote mode Mouse.read(); // con rm delayMicroseconds(100); } - vices are controlled using the mouse. 9.13 A Complete Microcomputer with LCD Monitor and Keyboard Connect a keyboard and a mouse to the Arduino, and you have yourself a complete microcomputer. Together with an LCD display, it forms a system with performance com- Boek Arduino UK 131010.indd 181 10-12-13 11:33
  • 11. 188 stripboard may be used. 10.3 Fast PWM Makes It Happen: Not Just Tones, But Sound Waves waves. A tone is able to be described fully by a single physical parameter: its frequency. The tone() Figure 10.3: Construction Example for the Audio Ampli er Figure 10.4: A Suitable DIY Speaker Enclosure Boek Arduino UK 131010.indd 188 10-12-13 11:33
  • 12. 205 The sounds generated by this synthesizer are based on a broadband noise spectrum, which is repeated in rapid succession. Analog synthesizers produce similar sounds using ed with its own additional decay rate. Five potentiometers enable the adjustment of the following parameters: Analog A0: Noise spectrum 1 Analog A1: Decay rate 1 Analog A2: Noise spectrum 2 Analog A3: Decay rate 2 Analog A4: Noise spectrum repeat frequency reverb discussed above, as well as vibrato or various envelopes, may be created. easily adjusted simultaneously. A construction example is shown in Figure 10.11. Using Audacity, the raw sounds produced by the Arduino may be further processed, creating very interesting sound sequences for use as background ambience in videos. Tube video! Figure 10.11: Synthesizer Construction Example Boek Arduino UK 131010.indd 205 10-12-13 11:33
  • 13. 212 Figure 11.3: Brightness Control Circuit - nates the photodiode. the voltage at the analog input increases with increased light intensity. Thus, the control system is directly proportionally polarized. By calculating the error signal as Boek Arduino UK 131010.indd 212 10-12-13 11:33
  • 14. 259 Index 2-D camera swivel...........................225 7-segment displays........................... 62 A ........................................185 Analog channels ..............................233 Arduino............................................. 9 Arithmetic operators ......................... 31 Arrays............................................. 36 ATMega168...................................... 16 ATMega328...................................... 16 Audio processing .............................197 B ................................200 Bar graph display ............................. 59 Bar graph voltmeter.......................... 81 Bar graph.......................................233 Batteries ........................................107 Blink............................................... 24 Breadboards .................................... 43 C Calibration....................................... 86 Circular memory buffer ....................200 Constants........................................ 35 Control loop....................................207 Control...........................................215 Cranino..........................................228 Crystal...........................................123 D Data loggers ...................................237 DCF77 module ................................145 DCF77 radio module ........................123 Digital clock....................................130 Diodes ............................................ 49 Displays .......................................... 59 Dot matrix displays........................... 67 E .........................141 ....................................... 94 ....................... 89 .................................228 ............................... 15 F Fuse bits ........................................... 9 G Geocaching.....................................113 Gravitation compensator ..................214 H .....................155 .............................105 I ..........................................149 ................................................. 17 ..........................210 ..............149 .....................................171 ............................174 L LC displays ...................................... 76 Levitation .......................................217 Libraries.......................................... 41 Light barriers ..................................112 Light meter.....................................115 Living room box ..............................241 Living room hygrometer ...................105 Logical operations............................. 32 M Magnet ..........................................216 Microcontroller ................................. 15 Minimal Arduino ............................... 45 Mood lights...................................... 11 ................................ 48 N ................................107 NTC................................................ 95 O Optical sensors ...............................112 P PC keyboards..................................178 PCF8583 ........................................164 PD controller...................................218 Photodiodes....................................112 Phototransistors ..............................112 Physical Computing..........................221 Potentiometers................................. 47 POV................................................ 54 ............................... 53, 212 Boek Arduino UK 131010.indd 259 10-12-13 11:33
  • 15. 260 Power relay ....................................141 Power supply ................................... 15 Printed circuit boards ........................ 43 Processing......................................231 Program icons.................................231 Prototyping boards ........................... 44 PS/2 mice.......................................178 Pulse-width modulation ....................188 Pushbuttons..................................... 49 R Random numbers ............................. 40 RC5 code........................................167 Reaction timer ................................135 Relative humidity.............................105 Resistors ......................................... 46 Reverberation springs, plates ............200 Reverberation .................................200 ........................................171 RTC ...............................................163 Running light effects ......................... 51 S Sensors........................................... 81 Seven segment displays .................... 62 Shields............................................ 13 Shift operators ................................. 33 Structures ....................................... 36 Switches ......................................... 49 Synthesizer ....................................185 T Temperature sensor .......................... 98 Theremin .......................................195 Thermometer............................ 95, 100 Timer.............................................138 Toothbrush timer.............................123 Transistor parameters ....................... 93 Twilight switch ................................112 U Ubuntu............................................ 23 Ultrasonic transducers......................117 Upload ............................................ 21 USB cable........................................ 20 V Variables30 Variable types .................................. 31 VCO...............................................198 Verify.............................................. 21 Boek Arduino UK 131010.indd 260 10-12-13 11:33