Index

Numbers

3.3V port, 142

5V power and GND

versus 3.3V port, 142

attaching to breadboard, 121, 125

8 ohm speaker

adding, 220221

adding to circuit, 278282

arguments, 226227

circuit, 32

code, 221222

delay() function, 226227

digitalWrite() function, 226227

illustration, 8

loop() code, 223224

note chart, 225

playing notes, 239

setup(), 222223

tone() and notone(), 224227

9-12-volt power supply, 5, 22

9V battery. See also batteries

attaching cap, 53

ground terminal, 52

illustration, 5

multimeter, 62

plus (+) and minus (-) terminals, 52

power terminal, 52

top and side, 53

9-volt battery cap or holder, 56

10K potentiometer, 5

330-ohm resistor, 4849, 58. See also resistors

Symbols

-- operator, 312

//, using with comments, 100101

/* and */, using with comments, 100101

/= operator, 312

++ operator, 312

+= operator, 312

−= operator, 312

*= operator, 312

{} (curly braces)

for loop, 305

using, 115

using with setup(), 104

> (greater than) operator, 310

>= (greater than or equal to) operator, 310

= = (is equal to) operator, 310

!= (is not equal to) operator, 310, 324325

< (less than) operator, 310

<= (less than or equal to) operator, 310

&& (logical and) operator, 329

|| (logical or) operator, 329

− (minus) sign, 43

! (not) operator, 329

() (parentheses) in functions, 226, 305

+ (plus) sign, 44

; (semicolon) in code, 105106

(tab), 277

A

AC adapter, output ratings, 162

AC and DC current, 146147

actuators and motors, 340342

Adafruit Industries, 1213

addition operators, 311

amperage

explained, 159160

warning, 166

analog data, 291292

analog input

adjusting values, 262263

analogRead(), 261262

analogWrite() function, 264265

map(), 262263

potentiometer values, 259261

scaling values for ranges, 263

voltage-to-analog conversion, 262

analog input pins

analogWrite(), 264265

features, 244246

using, 244245

writing values, 264265

analog pins, 16, 1819

analog values. See also PWM (pulse width modulation)

as output, 266268

overview, 241242

potentiometer, 245

potentiometer circuit, 243

analog versus digital information, 242

analogRead() function, 265

analog-to-digital conversion, 260

analogWrite() function, 264265, 268

anode and cathode

illustration, 9

symbols, 39, 4142

Arduino. See also Uno version

app, 79

boards, 347348

computer connection, 8283

features, 12

flowchart, 76

forums, 336

functions and boards, 2

hardware version, 85

license agreement, 81

logo, 1

parts, 16

plugging into computer, 2026

powering up, 2226

programming language, 99

schematic, 115117

setup() and loop(), 99

shields, 348

unplugging during changes, 23

USB port, 2021

versions, 2, 4, 11

Arduino 101, 345

Arduino IDE. See IDE (integrated development environment)

Arduino team, kits, 13

Arduino YÚN, 346

arguments, 226227. See also functions

art projects, 344

ATmega328P, black chip, 1819

B

batteries. See also 9V battery

current, 147

LED bulb flashlight, 5254

positive and negative sides, 55

symbol, 39, 4042

voltage, current, resistance, 176

battery cap, 56, 48, 52

begin() function, LEA7_AnalogInOutSerial sketch, 258

Blink sketch. See also LEA4_Blink sketch

debugging, 9698

opening, 9192, 95

blinking LEDs. See LEDs

boards, 347348

Boolean operators, 329331. See also operators

breadboard

5V power and GND, 121

benefits, 47

circuits attached, 74

connecting components, 7

connecting to, 119121

connections, 4647

labeling, 119

LED bulb flashlight, 4247

pins, 120

power and ground buses, 4445

power and ground connection, 57

power and ground pins, 120

versus soldering iron, 1011

tie points, 44, 46

trench, 46

using, 4243

warning, 44

“x-ray” view, 44

brightness value, translating, 251254

built-in LEDs, Uno version, 18

button circuit, building, 200. See also circuits

button keyboard, three-tone, 194

Button sketch, uploading, 204205

buttons. See also digital input; three-button “Instrument” loop() function; two-button circuit

adding, 201202, 233234

adding to breadboard, 202

adding to pin, 204

diagrams, 201202

functionality, 237238

ground connection, 203

identifying, 90

LED circuit, 198

LED on and off, 205206

parts, 197198

power connection, 203

pushing, 238

resistor connection, 203

schematic, 198199

switches, 202, 206

uploading sketch, 204

C

calling functions, 106

cardboard robot circuit, 32

cathode and anode, 9

Christmas lights, series arrangement, 190

circuit loops, debugging, 5859

circuits. See also button circuit; electricity; potentiometer circuit; short circuit

3.3V, 142

Arduino connected to breadboard, 119121

attached to breadboard, 74

building, 4952, 121122, 140142

component arrangement, 180

components, 3536

computer attachment, 123124

conductive lines, 34

continuity, 5859

continuity testing, 6970, 144

current, 161162

debugging, 5760, 143144

diagramming, 3940

examples, 32

features, 34

flow, 33

LED bulb flashlight, 4852

LED connection, 122123

LEDs in parallel, 182183

Ohm’s law, 178

parts and tools, 48, 119, 140

PCBs (printed circuit boards), 3435

pin and resistor, 121122

pin connected to resistor, 121122

power and ground pins, 141142

powering, 140141

schematic, 116118, 141

tracks, 33

voltage measurement, 157

warning, 118, 120

code. See also comments

in circuit, 74

explained, 7677

instructions, 105

uploading, 75

code window, 8890

comments. See also code

LEA4_Blink sketch, 99

using, 99101, 108

comparison operators, 309310

components. See also parts

actuators and motors, 340342

arranging in circuits, 180

getting information, 26

parallel, 180186

pressing into place, 49

schematic symbols, 40

sensors, 338340

series, 180181, 186192

components in parallel. See parallel

components in series. See series

compound operators, 310311

computer, connecting Arduino, 8283

conditional statements

best practices, 331

else statement, 218220

explained, 216218

if, 217

LEA6_Button sketch, 215

loop() code, 215218

nesting, 220

reviewing, 237

conductive lines, 34, 36

conductors and insulators, 145146

const, variables, 212

continuity testing, 5859, 6570, 144

curly braces ({})

for loop, 305

using, 115

using with setup(), 104

current. See also high current; Ohm’s law

AC and DC, 146147

in circuits, 161162

circuits, 161162

electrical model, 161

explained, 159160, 175

flow, 159161

impact on batteries, 176

impact on LEDs, 176

impact on resistors, 176

input, 163

limit, 162163

limit for Arduino, 162163

measuring, 160, 163164, 167

multimeter adjustment, 164167

review, 173177

series and parallel, 192

symbol, 174175, 177

voltage and resistance, 148149, 167, 173180

current flow, 159161, 167

custom functions. See also functions

calling, 327328

creating, 325327

using, 331

D

data sheets, 2829

DC current, symbol, 159

DC motors, 340

DC voltage

measuring, 154

symbols, 175

debugging

Blink sketch, 9698

circuits, 5760, 143145

explained, 96

LED bulb flashlight, 6970

projects, 335336

unblinking LED, 9698

delay() function, 111112, 114, 226227

Digi-Key Electronics, 12

digital input. See also buttons

adding button, 201202

button attachment, 204

button circuit, 200

button connection, 203

Button sketch, 204205

HIGH and LOW states, 213214, 241

LED off and on, 205206

parts, 197198

review, 213214

schematics, 198199

states, 213214

digital inputs and outputs, overview, 195197

digital I/O pins, 16, 1819

digital pins, treating like output, 107

digital versus analog information, 242

digitalRead() function, 265

digitalWrite() function, 110112, 115, 226227, 265

distance and motion, sensing, 338

division operator, 311

E

electrical connection, testing, 6566

electrical ground, 152

electrical model

current, 161

resistors, 169

schematic, 150151

electrical properties

impact of changes, 176177

series and parallel, 192

symbols, 174

electrical properties, testing, 139140

electricity. See also circuits

AC and DC current, 146147

behavior, 145146

conductive lines, 36

flow, 150

flow through circuit, 138, 251254

impact on components, 174176

LED bulb flashlight, 5556

measuring with multimeter, 139140

overview, 144145

properties, 138

resources, 148

warnings, 147, 154

water tank analogy, 148149, 174

zero point, 152

electromotive force, 150

else if statement, 220, 230232

else statement, 218220

end = ground symbol, 39

errors, checking in code, 77, 8889

F

flags

turning, 314316

waving, 291292, 300301, 320322, 331

flow

and current, 159160

restricting, 167173

flowchart, 76

for loop. See alsoloop() function

condition testing, 307308

ending, 308

flowchart, 306

flowchart with code, 309

initialization, 307

overview, 304309

in sketch, 312313

FSRs (force-sensing resistors), 339

functions. See also arguments; custom functions

calling, 106

declaring, 326

defined, 102, 115, 257, 325

naming, 327

void, 327

G

GND and 5V power, attaching to breadboard, 121. See also power and ground pins

greater than (>) operator, 310

greater than or equal to (>=) operator, 310

ground terminal, 56

H

hardware

open source, 3

version, 85

HIGH and LOW states, digital input, 213214, 241

high current, 167. See also current

home automation projects, 343

I

IDE (integrated development environment)

Applications folder, 79

buttons, 8990

closing sketch windows, 84

code window, 8890

components, 77

configuring, 8488

contents, 76

downloading, 76, 7882

errors and information window, 89

explained, 75

interface, 8384

message areas, 89

if in conditional statements, 217

indicator LED, On Uno version, 18

information window, 77, 89

input and output pins, 16, 1819. See digital I/O

inputs, 195197

inputs and outputs, 324

instructions in code, 105

insulators and conductors, 145146

interactivity

three-tone button keyboard, 194195

turning flag, 314316

is equal to (= =) operator, 310

is not equal to (!=) operator, 310, 324325

J

Jameco Electronics, 12

jumper to ground, LED bulb flashlight, 51

jumper wires

creating, 10

illustration, 8

LED bulb flashlight, 48

LED to ground, 123

pin to breadboard, 121

K

kits, 13

L

LEA4_Blink sketch. See also Blink sketch

button circuit, 200

code, 99

comments, 99101

running, 9596

saving, 92

schematic for circuit, 117

screenshot, 9899

LEA4_SOS sketch. See also SOS signal light

and circuit, 126

downloading, 135

loop() code, 128

saving and renaming, 126128

setup() code, 127128

LEA6_1_tonebutton sketch, 221

LEA6_2_tonebuttons sketch

buttons, 233234

editing, 229230

else if loop, 230232

LEA6_3_tonebuttons sketch, 234236

LEA6_Button sketch

code, 206207

code and variables, 207212

code initialization, 207208

conditional statement, 216220

else statement, 218220

loop() code, 215216

saving, 204

setup(), 212213

variable initialization, 207208

variables, 206208

LEA7_AnalogInOutSerial sketch

analogInPin, 255

analogOutPin, 256

begin() function, 258

code, 254

initialization, 255257

loop() code, 258259

outputValue, 257

saving, 250

sensorValue, 256

setup() code, 257258

summary, 277278

LEA7_VariableResistorTone

code, 279280

features, 280281

LEA8_2_servos sketch

code, 322

comparison operator, 324325

custom functions, 325328

initialization, 323

loop() code, 324325

setup() function, 323324

turnServos(), 328330

LEA8_Knob sketch. See also servo motors

code, 316

initialization, 317318

loop() code, 318319

saving, 315

setup() code, 318

LEA8_Sweep sketch

initialization, 302303

library, 302

loop() code, 304

objects, 303

opening and saving, 300

overview, 301

setup() code, 303304

LED bulb flashlight

330-ohm resistor, 4849

battery, 5254

battery cap, 52

breadboard, 4247

circuit, 4852

debugging circuit, 5760, 6970

electricity, 5556

jumper to ground, 51

lighting up, 5354

multimeter, 6069

project description, 3637

schematic, 3742

LED circuit, buttons, 198

LEDs

adding to circuit, 122

anode and cathode, 9, 58

blinking, 25, 95, 108

built-in, 16, 19

data sheet, 2829

debugging unblinking, 9698, 124

dimming and brightening, 250

features, 89

illustration, 7

On indicator, 16

LED bulb flashlight, 48, 5051

orientation, 58

in parallel, 182183

positive and negative leads, 58

symbol, 3842

turning on, 22

voltage, current, resistance, 176

Leonardo board, 347

less than (<) operator, 310

less than or equal to (<=) operator, 310

libraries, defined, 302

light switches, flipping, 266

lights, dimming, 250251

Lilypad Arduino, 346347

logical and (&&) operator, 329

logical comparison operators, 310

logical or (||) operator, 329

loop() function, 99, 109115. See alsofor loop; setup() function

8 ohm speaker, 223224

code, 113114

conditional statements, 215216

contents, 110

digitalWrite() and delay(), 111112

LEA4_Blink sketch, 99

LEA4_SOS sketch, 128

mini-keyboard instrument, 230232

running, 110

SOS signal light, 132134

loops, types, 313

M

Macs

downloading IDE, 7879

port selection, 86

Maker Shed, 1213

map() function, 262264

Mega 2560 board, 347

menus, 77

message areas, 77, 89

message window, 9495

metal, warning about touching, 154

meter. See multimeter

Micro board, 347

Micro Center, 12

mini-keyboard instrument

adding buttons, 233234

button attachment, 229

else if statement, 230232

LEA6_2_tonebuttons, 229230

loop() code, 230232

parts, 228

playing, 236

pushing buttons, 232

testing code, 232

tone() function, 232

two-button circuit, 228

mini-keyboard instrument, playing, 238

minus (−) sign, 43

MKR ZERO board, 347

MKR1000 board, 347348

momentary switches/buttons, 5, 7

Morse code, 125

motion and distance, sensing, 338

motor circuit, 32

motors and actuators, 340342. See also servo motors

Mouser Electronics, 12

multimeter

adjusting, 164166

continuity testing, 59, 6569

dial, 63, 67

features, 60

high current, 167

illustration, 9

LED bulb flashlight, 6069

measuring DC voltage, 154156

measuring electrical properties, 139140

measuring resistance, 170173

parallel, 184185

parts, 6162

ports, 6465

powering, 62

preserving battery, 156

probes, 6364, 6768, 70, 166

protecting, 166

series, 191192

setting, 166

turning off, 62

types, 61

warning, 166

multiplication operator, 311

N

needle-nose pliers, 10, 48

New button, 90

not (!) operator, 329

note chart, 225

notes, playing, 239

O

objects, explained, 303

ohms, symbol, 168

Ohm’s law, 138, 177180. See also current; resistance; voltage

ON indicator LED, 16, 1819

Open button, 90

open source hardware, 3

operators, 309311. See also Boolean operators

output, treating pins as, 107, 109

outputs, 197

P

parallel

components, 185186

LEDs, 182183

multimeter, 184185

order of components, 180

parentheses (()) in functions, 226, 305

parts. See also components; tools

Arduino, 16

numbers and store guides, 27

obtaining, 12

placing in box, 27

sorting, 2627

parts list, 5

pausing Arduino, 111112, 114, 226227

PCBs (printed circuit boards), 3435

photographing projects, 348349

photoresistor

adding, 282288

circuit, 32

features, 7

illustration, 8

and resistor, 284

shining light, 286

physical computing, 3

pin and resistor, connecting, 121122

pinMode() function, calling, 106109

pins

declaring, 109

treating like output, 107

using on breadboard, 120

PIRs (passive infrared sensors), 338

pitch, changing, 281, 285286

planning notes, 335

pliers, needle-nose, 10

plus (+) and minus (-) terminals, 9V battery, 52

plus (+) sign, 44

ports, specifying, 8588

potential and voltage, 149153

potentiometer

adding, 248249, 314316

analog-to-digital conversion, 260

brightness value, 251254

component drawing, 245

dimming lights, 250

illustration, 7

pins, 248

schematic, 245

values, 259261

x-ray, 285

potentiometer circuit. See also circuits

building, 247

completion, 246

LED attached to Pin 9, 247

parts, 247

role of sketch, 251254

schematic, 243

power

battery, 56

terminology, 55

power adapter, 7

power and ground

buses, 4445

checking connections, 57

symbols, 40

power and ground pins, 16, 1819, 141142. See also GND and 5V power

power port, 1617

power supply, 2226, 162

printing to serial monitor, 273276

programming language, reference guide, 115

programs. See sketches

project management, 334337

projects

documenting and sharing, 348350

types, 342344

writing up, 349

prototyping, 3, 4243

pushbutton, 7

pushing buttons, 238

PWM (pulse width modulation), 265268. See also analog values

R

Reset button, 1617, 98

resistance. See also Ohm’s law

calculating, 359

current and voltage, 173177

defined, 168

explained, 175176

impact on batteries, 176

impact on LEDs, 176

impact on resistors, 176

measuring, 168

multimeter measurement, 170173

restricting flow, 167169

review, 173177

series and parallel, 192

symbol, 174175, 177

voltage and current, 148149, 177180

water tank analogy, 168

resistors. See also 330-ohm resistor

accuracy, 357

bands, 354356, 358359

body and wire leads, 351

buying, 54

checking, 58

color bands, 357358

color chart, 352353, 358359

connecting to pin, 121122

current and voltage, 173

decoding, 353356

electrical model, 169

features, 169170

illustration, 7

numbering bands, 352

orienting, 352, 358

parallel arrangement, 181

and photoresistors, 284

series arrangement, 181

symbol, 3942

value calculation, 355

voltage, current, resistance, 176

voltage measurement, 156

robots, 343

S

Save button, 77, 90

saving sketches, 92

schematics. See also symbols

annotation, 119

Arduino, 116117

and board, 116

buttons, 198199

circuits, 116118, 141

complexity, 198199

drawing, 4142

electrical model, 150151

explained, 37

LED bulb flashlight, 3742

LEDs in series, 186

potentiometer, 245

potentiometer circuit, 243

reading, 38

servo circuit, 296, 320

semicolon (;) in code, 105106

sensors, 338340

serial code, 272273

serial communication

explained, 269270

input and output, 269

loop() and delay(), 276

strings, 272273, 277

serial functions, 277

serial monitor

printing to, 273276

running, 271

using, 270272

serial output, reading, 287288

series

components, 189190

LED circuit, 186187

metering voltage of components, 187188

multimeter, 191192

order of components, 180181

series arrangement, Christmas lights, 190

server, 8

servo circuit

attaching, 298300

attaching computer, 300301

connector, 298

flag attached to horn, 297

parts, 295296

preparing, 296298

removing horn, 297

schematic and drawing, 296

Sweep sketch, 300301

servo motors, 8, 287288. See also LEA8_Knob sketch; motors and actuators

adding, 320322

analog data, 291292

annotation, 294

degrees of rotation, 290

horns, 294

moving, 312313

online vendors, 293

parts, 292295

positional rotation, 291292

turning on, 328330

using, 289

wire colors, 295

setup() function. See alsoloop() function

8 ohm speaker, 222223

curly braces ({}), 104

happening once, 107108

initial conditions, 104108

LEA4_Blink sketch, 99

LEA4_SOS sketch, 127128

LEA6_Button sketch, 212213

and loop(), 101108, 113114

pin mode, 108

positioning, 108

short circuit, 154. See also circuits

sketch window, 91

sketches

explained, 83, 90

message window, 9495

opening, 9092

running, 95

saving, 90, 92

status bar, 9495

uploading, 9396

verifying, 9394

soldering iron versus breadboard, 1011

solenoids, 341342

sorting parts, 2627

SOS signal light. See also LEA4_SOS sketch

creating, 125126

flashes on and off, 128132, 134

loop() code, 132134

saving and renaming sketch, 126128

spaghetti wiring, 349

SparkFun Electronics, 12

speaker. See 8 ohm speaker

start = positive, symbol, 39

statements, ending in code, 106

status bar, 94

stepper motors, 341

strings, 272273, 277

subtraction operators, 311

surge protector, 25

Sweep sketch. See LEA8_Sweep sketch

switches

and buttons, 206

buttons, 202

flipping, 266

functionality, 238

using, 196197

symbols. See also schematics

anode and cathode, 39, 4142

battery, 3942

components, 40

current, 174175, 177

DC current, 159

DC voltage, 175

electrical properties, 174

end = ground, 39

LEDs, 3842

ohms, 168

parallel arrangement, 181

power and ground, 40

resistance, 174177

resistors, 3942

series arrangement, 181

start = positive, 39

voltage, 174175, 177

T

tab ( ), creating, 277

testing, continuity, 6970

text, representing, 273

theremin, playing, 243, 285286

three-button “Instrument” loop() function, 235236. See also buttons

tie points

breadboard, 44, 46

debugging, 5859

tone() and notone() functions, 224227, 239

tools, 911. See also parts

trench, 46

turnServos(), 328330

two-button circuit, 228. See also buttons

tx and rx pins, 1819

U

ultrasonic sensors, 339

Uno version. See also Arduino

analog pins, 18

built-in LEDs, 18

illustration, 2, 4

On indicator LED, 18

input and output pins, 18

left side, 17

parts, 16

power and ground pins, 18

power port, 17

reset button, 17

right side, 18

tx and rx pins, 18

USB port, 17

voltage regulator, 1718

unplugging Arduino, 23

Upload button, 8990, 94

uploading, 75

URLs. See websites

USB A-B cable, 56

USB port

Arduino, 2021

locating, 16

Uno version, 17

user testing, 336337

V

values

setting, 110

testing equality, 217

variables

const, 212

declaring, 208211

explained, 208

LEA6_Button sketch, 206207

names, 209

qualifiers, 211

reviewing, 238239

types, 210211

values, 209210

Verify button, 8890, 9394

void in functions, 327

voltage. See also Ohm’s law

checking, 153157

checking across components, 156157, 159

components in parallel, 185186

components in series, 189190

converting to analog reading, 260

current and resistance, 148149, 173180

defined, 152

determining, 179

explained, 175

impact on batteries, 176

impact on LEDs, 176

impact on resistors, 176

LEDs in parallel, 183184

measuring, 150151, 153156

metering components in series, 187188

metering on breadboard, 155

potential, 149153

review, 173177

scaled measurement, 260

series and parallel, 192

symbol, 174, 177

symbols, 175

use by components, 159

values, 152153, 189

water analogy, 150

voltage divider, 284

voltage drop, 157159

voltage potential, 149152

voltage regulator, 1618

voltage value, mapping to, 264

voltage-to-analog conversion, 262

W

water tank analogy

electricity, 148149, 174

resistance, 168

voltage, 150

wearable projects, 344

websites

Adafruit Industries, 1213

Arduino 101, 345

Arduino programming language, 115

Arduino YÚN, 346

components, 12

Digi-Key Electronics, 12

forums, 336

IDE (integrated development environment), 76, 78, 80

inputs and outputs, 324

Jameco Electronics, 12

kits, 13

Maker Shed, 1213

Micro Center, 12

Mouser Electronics, 12

note chart, 225

servo motors, 287288

sharing projects, 349350

SparkFun Electronics, 12

Windows PC

downloading IDE, 8082

port selection, 8788

wire strippers, 10

words, sending to serial monitor, 272273

Z

zero volts, 152

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.31.73