Index

  • Numbers and Symbols
  • 32-bit architecture, 7
  • 8-bit architecture, 7
  • 9V batteries, 70
  • A
  • AC (alternating current), 354–355
    • double insulated, 356
    • power transmission, 354
    • relays, 356–357
      • connecting to Arduino, 360–361
      • control, programming, 358–360
      • SPDT (Single Pole Double Throw), 357
      • wiring, 356
  • accel.begin( ) function, 239
  • accelerometers
    • analog, triple-axis, 56–57
    • audiovisual instrument, 241
      • hardware, 242
      • software, 242–246
    • data streaming, 241
    • datasheets, 231–233
    • description, 229–230
    • hardware
      • RGB LED, 235
      • setup, 233–235
    • MEMS (Micro Electro Mechanical Systems), 228–229
    • micro-machined, 231
    • sensor libraries, Adafruit, 236–241
    • single-axis accelerometer, 230
    • software, writing, 235–241
    • SPI bus, 228–229
  • Adafruit
    • LED Backpack library, 443
    • sensor libraries, 236–241
    • Adafruit Bluefruit LE Connect, 377
    • Adafruit Feather 32u4 Bluefruit LE, 14
    • Adafruit GFX library, 443
    • Adafruit LIS3DH Library, 236–237
    • Adafruit METRO 328, 4
      • drivers, 4
      • USB/serial interface, 172
    • Adafruit Unified Sensor Library, 236–237
    • ADCs (analog-to-digital converters), 8, 50
    • Arduino Due, 12
      • pins, 9
  • ALS (ambient light sensor), 63
  • alternate.ino, 190
  • amplitude, 126
    • sound waves, 127
  • analog accelerometers, triple-axis, 56–57
  • analog input, analog output control, 64–65
  • analog output, controlling, 64–65
  • analog sensors, 48, 56
    • potentiometers, reading, 51–55
    • Sharp infrared proximity sensor, 56
    • temperature sensor, 57–60
    • TMP36 temperature sensor, 56
    • triple-axis analog accelerometers, 56–57
    • variable resistors and analog input and analog output, 64–65
    • resistive voltage dividers, 60–64
  • analog signals, 48
    • ADC (analog-to-digital converter), 50
    • AM and FM modulation, 344
    • compared to digital, 48–49
    • converting to digital, 49–51
  • analogRead( ) command, 51–60, 52, 54
  • analogWrite( ) command, 31–35, 64–65
  • anodes, 25–26
  • antenna, RF communications, 346–347
  • APIs (application programming interface)
    • browser response, 432
    • call, successful, 439
    • keys, invalid, 436
    • structure, 430
    • weather, 428–429
      • data parsing, 431–433
      • JSON-formatted, 430–431
      • live temperature display, 440–449
      • local temperature, 433–439
      • server provider account, 429
      • structure, 430
    • web, interfacing with, 427–428
  • applications, Processing, 161–162
    • color selection, 168
    • IDE, 163
    • installation, 162
    • sending data to Arduino, 166–169
    • sketches
      • controlling, 162–166
      • examples, 165–166
    • Arduino
      • boards, 4, 10–15
      • clones, 14
      • functionality, 5–10
      • software, 4
      • Wi-Fi, 404
    • Arduino Mega, 106, 142
    • Arduino Mega 2560, 11
    • Arduino Mega ADK, 148
    • Arduino Micro, 12, 13
    • Arduino Nano, 141, 142
      • FTDI chip, 144
    • Arduino NG, 142
    • Arduino Uno, 4, 11, 17
      • 16U2 serial converter chip, 144
      • accelerometer breakdown, 231
      • ADC, 50
      • analog sensor, 57
      • ATmega 328P, 9
      • components, 6
      • enclosures, 3D-printable, 230
      • integrated circuit, 146
      • interface, 9
      • LEDs, wiring, 26
      • multiplexing, 205, 234
      • PWM pins, 32, 106
      • real-time clock, 317
      • receiver antenna, 347
      • resolution, 51
      • RGB LED wiring, 231
      • serial converter emulation, 146–147
      • serial port, 143
      • schematics, 443–459
      • SPI pins, 230
      • square wave frequency, 33
      • stepper motor wiring, 112
      • USB/serial interface, 172, 376
    • Arduino.cc, 5
      • Arduino IDE download, 16
    • Arduino.org, 5
    • arguments, 20
    • Arm, 8
    • ARPA (Advanced Research Projects Agency), 401
    • ARPANET, 401
    • ASCII table, 155
    • asynchronous sketches, 276
    • AT commands, 371–372
    • ATmega 32U4, USB, 376
    • Atmel. See Microchip
    • Atmel ATmega, 5
    • attachInterrupt( ) function, 278–279
    • AVR architecture, 5, 7
    • AVRISP mkII, 141
  • B
  • bar graph
    • decimal representations, 196
    • distance-responsive, 196–197
  • bare_minimum_server.ino, 412–415
  • bargraph.ino, 195–196
  • batteries, 9V, 70
  • baud rate, 54
  • begin( ) function, 370–371
  • binary to decimal conversion, 192
  • bipolar stepper motors, 111–112
    • NEMA-17, 109–110
  • BJT (bipolar junction transistor), 72
  • BLE (Bluetooth Low Energy), 364
  • Blink, 18
    • code, 18–21
  • blink.ino, 30–31
  • Bluetooth
    • BLE (Bluetooth Low Energy), 364
    • Bluetooth Classic, 365
    • BTLE (Bluetooth Low Energy), 364
    • GATT (Generic Attribute), 366
    • IEEE standards, 364
    • profiles, 365–366
    • security, 395–396
    • smart home lamp, 389
      • pairing phone, 394–396
      • pairing phone to BTLE device, 389–390
      • proximity control software, 390–394
  • boards, 4
    • Adafruit
      • LED Backpack library, 443
      • sensor libraries, 236–241
    • Adafruit Bluefruit LE Connect, 377
    • Adafruit Feather 32u4 Bluefruit LE, 14
    • Adafruit GFX library, 443
    • Adafruit LIS3DH Library, 236–237
    • Adafruit METRO 328, 3, 4
      • drivers, 4
      • USB/serial interface, 172
    • Adafruit Unified Sensor Library, 236–237
    • architectures, 5–7
    • Arduino Diecimila, 142
    • Arduino Due, 7, 12, 13, 51, 126, 136, 148
    • Arduino Duemilanove, 142
    • Arduino Extreme, 142
    • Arduino Leonardo, 9, 12, 143, 145, 172, 358
      • joystick mouse circuit, 179
      • mouse emulation, 176
      • USB and, 172
    • Arduino Mega, 106, 142
    • Arduino Mega 2560, 11
    • Arduino Mega ADK, 148
    • Arduino Micro, 12, 13
    • Arduino Nano, 141, 142, 144
    • Arduino NG, 142
    • Arduino Uno, 3, 4, 10, 11, 17
      • 16U2 serial converter chip, 144
      • accelerometer breakdown, 231
      • ADC, 50
      • analog sensor, 57
      • ATmega 328P, 9
      • components, 6
      • enclosures, 3D-printable, 230
      • integrated circuit, 146
      • interface, 9
      • LEDs, wiring, 26
      • multiplexing, 205, 234
      • PWM pins, 32, 106
      • real-time clock, 317
      • receiver antenna, 347
      • resolution, 51
      • RGB LED wiring, 231
      • serial converter emulation, 146–147
      • serial port, 143
      • schematics, 443–459
      • SPI pins, 230
      • square wave frequency, 33
      • stepper motor wiring, 112
      • USB/serial interface, 172, 376
    • breadboards, 24–25
      • buses, 25
      • connections, 25
      • LCD wired to Arduino, 251
      • robot, 91
    • breakout boards, 228–229
    • clock pins, 8
    • connecting to, 17–18
    • counterfeit, 4
    • Feather, programming, 369–373
    • first-party, 4
    • LED, 17–18
    • oscillating crystal, 8
    • Particle Photon, 15
    • pins, 20
    • resonator, 8
    • third-party, 4, 12, 363–365
    • USB-host capabilities, 147–148
    • USB-to-serial converter, 143–146
  • Boolean variables, 41
  • bootloader, 9
  • breadboards, 24–25
    • buses, 25
    • connections, 25
    • LCD wired to Arduino, 251
    • robot, 91
  • breakout boards, 228–229
  • brushed DC motors, 71
  • brushless DC motors, 71
    • stepper motors, 109
  • BTLE (Bluetooth Low Energy), 364
    • Feather board, potentiometer, 366–367
    • GATT (Generic Attribute), 366
    • HID (Human Interface Device) profile, 390
    • module library, 369
    • natural language commands, 384–389
    • Nordic chip, 384
    • smartphone connection, 376–379
      • sending commands, 379–389
  • BTLE_led.ino, 384–387, 392–394
  • BTLE_sensor.ino, 373–376
  • buses, power/ground, 25
  • buttons
    • bouncy, 38–42
    • switch bouncing, 39
  • C
  • capacitors, decoupling, 88
  • car.ino, 93–96
  • cascaded shift registers, 191
  • cathodes, 25–26
  • CdS (cadmium sulfide) photoresistors, 62–63
  • CERN (European Organization for Nuclear Research), 401
  • changeKey( ) function, 293
  • chronograph, 118
    • programming, 119–124
    • start button, 117
    • stepper motor, 117
    • stop button, 117
    • transform to clock, 324
    • wiring diagram, 117
  • chronograph.ino, 121–123
  • circuits, 4, 27
    • H-bridges, 79
      • building, 80–81
    • photoresistors, 63
    • temperature and light sensor, 174
    • voltage divider circuit, 61
  • client-to-client communication, 412
  • clients, 403–404
  • CLK (clock), 227
  • clock phase, 224
  • clock polarity, 224
  • clock signal (SCL), I2C bus, 203, 209
  • clone boards, 14
  • Cloud, 401
  • code, comments
    • multiline, 18
    • single-line, 19
  • command strings, serial monitor, 152–153
  • commands
    • arguments, 20
    • natural language, 381–383
  • comments
    • multiline, 18
    • single-line, 19
  • communication buses, 8
  • communications, pin connections, 250
  • connect_to_wifi.ino, 410–411
  • const int statement, 38
  • constrain( ) functions, 64
  • continuous rotation servo motor, 100–101
  • control gloves, 136
  • Cortex-M Series, 8
  • counterfeit boards, 4
  • CS (chip select), 227 See also SS (Slave Select)
    • pin, SD cards, SPI interface, 307
  • CSV files, 297
  • csv_logger.ino, 174–176
  • D
  • DACs (digital-to-analog converters), 12, 31–32
  • data logging
    • CSV files, 297
    • entrance logger, 330–334
    • SD cards, 29
      • formatting, 298–303
    • shields, shield stacking headers, 306
    • spreadsheet, 312
  • data streaming, accelerometers, 241
  • dataFile.println( ) function, 309
  • datasheets
    • accelerometers, 231–233
    • ATmega328P, 452
    • chips, 453
    • I/O pins diagram, 454
    • pin-outs, 454–456
    • reading, 451–456
  • DC (direct current), 354–355
    • motors, 70–71
      • brushed DC motors, 71
      • direction, H-bridges, 78–86
      • inductive load, high current, 71–76
      • speed, PWM and, 76–78
      • stall current, 87
      • wiring, 74–76
  • debounce.ino, 40–41
  • debounce( ) function, 264
  • debugging, 424
  • decimal formats
    • bar graph, 195
    • converting from binary, 192
  • decoupling capacitors, 88
  • delay( ) function, 21
  • device miniaturization, 228–229
  • DHCP (Dynamic Host Configuration Protocol), 401
    • address reservation, 426
    • IP address retrieval, 409–412
  • digital input
    • bouncy buttons, 38–42
    • reading, pull-down resistors, 35–38
  • digital output, 24
    • programming, 29–30
      • for loops, 30–31
  • digital pins, 20
  • digital signals, 48
    • ADC (analog-to-digital converter), 50
    • ASK modulation, 344
    • compared to analog, 48–49
    • converting from analog, 49–51
  • digitalPinToInterrupt( ) function, 279
  • digitalRead statement, 38
  • digitalRead( ) function, 278, 348
  • digitalWrite( ) function, 21, 29–30, 348
  • diodes
  • Light Emitting Diode (LEDs), 17–18
    • flybacks, 72
    • freewheeling, 72
    • protection, 73
    • snubbers, 72
  • DIP (Dual-Inline Package), 25, 229
  • display_temp.pde, 219
  • distance sensor, 105–109
  • distance-responsive bar graph, 196
  • DNS (Domain Name System), 401
    • updating service, 426–427
  • doorbell.ino, 350–351
  • downloads, IDE (integrated environment), 16
  • duty cycle, 33
    • PWM signals and, 34
  • E
  • echo.ino, 154
  • emulation
    • mouse, 178–182
    • USB keyboard, 173–176
      • key combinations, 177–178
  • entrance logger
    • data analysis, 334
    • hardware, 327–328
      • IR distance sensor, 327
      • shield stacking headers, 327
    • software, 328–334
      • change threshold, 329
  • entrance:logger.ino, 329–333
  • external hardware, 4
    • programmers, 141–142
  • external LED, pin 9, 24–25
  • F
  • fade.ino, 32
  • FAT16, SD cards, 298
  • FAT32, SD cards, 298
  • Feather boards, 369–371
    • BTLE board
      • LED and, 380
      • potentiometer, 366–367
    • IDE setup, 406–407
    • LED temperature display, 442
    • programming, 369–371
    • relay controller, 396
    • smartphone connection, 376–379
    • Wi-Fi
      • MAC address on module, 426
      • server sketch, 408–423
  • FireWire (IEEE 1394), 364
  • firmware, setup, 10
  • flybacks, 72
  • for loops, 30–31
  • freewheeling diodes, 72
  • frequency, 126
    • sound waves, 127
  • frequency of signals versus period, 33
  • FTDI USB-to-serial converter, 143–146
  • fun_with_sound.ino, 292–293
  • functions, 40
    • accel.begin( ), 239
    • analogRead( ), 52
    • attachInterrupt( ), 278–279
    • begin( ), 370–371
    • changeKey( ), 293
    • constrain( ), 64
    • dataFile.println( ), 309
    • debounce( ), 264
    • delay( ), 21
    • digitalPinToInterrupt( ), 279
    • digitalRead( ), 278, 348
    • digitalWrite( ), 348
    • Keyboard.begin( ), 176
    • loop( ), 29
    • map( ), 64
    • millis( ), 120, 348
    • Mouse.press( ), 181
    • Mouse.release( ), 181
    • readJoystick( ), 181
    • RTC.adjust( ), 319
    • Serial.available( ), 154
    • Serial.begin( ), 148
    • Serial.println( ), 52, 148
    • setup( ), 19–20, 54
    • shiftOut( ), 187–188
    • tone( ), 129–136, 137, 265
    • updateDateTime( ), 323
    • void loop( ), 20
    • void setup( ), 19
    • waitForOK( ), 373
    • Wire.beginTransmission( ), 213–214
    • Wire.requestFrom( ), 213–214
  • G
  • GATT (Generic Attribute), 366
  • GET, 403
  • global variables, 41
  • GND (ground) connection, 56
  • digital ground, 356
  • Google Docs, 401
  • GPIO (general-purpose input/output), 8, 9
  • Great Arduino Schism and Reformation, 5
  • gyroscope, 229–230
  • H
  • H-bridges, 78–79
    • circuits
      • building, 80–81
      • operating, 81–82
    • operation states, 79
    • rate variables, 83
    • short circuits, 79
    • wiring diagram, 82
  • hardware
    • accelerometers, 233–235
    • circuits, 4
    • external, 4
    • I/O, 404–405
    • programmers, 141–142
    • shields, 4
    • SPI bus, 225–227
  • hardware interrupts
    • accuracy, 278
    • capabilities, 278–279
    • hardware implementation, 277–278
    • hardware-debounced circuit, 280–284
      • assembling, 285
      • software, 285–288
    • multitasking, 278
    • polling, 277–278
    • Schmitt triggers, 282
    • software implementation, 277
  • hbridge.ino, 85–86
  • HID (Human Interface Device) profile, 390
  • high-current inductive load, 71–72
    • motor wiring, 74–76
    • protection diodes, 73
    • secondary power source, 74
    • switches, transistors as, 72–73
  • HTML (Hypertext Markup Language), 402
  • HTTP (Hypertext Transfer Protocol), 402–403
    • requests, 413
    • response codes, 413
  • HTTPS (HTTP over Secure Sockets Layer), 403
  • hw_multitask.ino, 286–287
  • hysteresis, 282
  • I
  • I/O (Input/Output), 5, 8, 9
    • control hardware, 404–405
    • parallel data, 185
    • serial data, 185
  • I2C bus, 202
    • AD7414 addressing, 205
    • clock signal, 203
    • embedded program, 215–218
    • hardware design, 203
      • temperature monitoring system, 214–215
    • hardware requirements, 206–208
    • history, 202
    • I/O pins, 206–207
    • I2C protocol, 202
    • ID numbers, 204
    • part selection, 205–206
    • Processing program, 218–221
    • product design, 205–206
    • pull-up resistors, 206–208
    • SCL (clock signal), 203, 209
    • slave devices, 202, 203–204
      • communications, 204
      • temperature sensor, 208, 213–214
    • SPI comparison, 227–228
    • TC74 address options, 204
    • temperature probe, 208
      • datasheet, 210–212
      • hardware, 208–209
      • serial output, 214
      • shift register bar graph, 215
      • software, writing, 212–214
    • tuning over wires, 441
  • ICs (integrated circuits), 25, 70, 201–202
    • pins, 80–81
    • Schmitt triggers, 282
  • ICSP (In-Circuit Serial Programming), 8
  • IDE (integrated environment), 4. See also Arduino IDE
    • Arduino Cloud IDE, 15
    • Blink, 18
    • downloading, 16
    • Feather board setup, 406–407
    • header files, 130
    • installing, 16
    • port, 18
    • running, 17–18
    • servo control, 104–105
    • third-party boards, 367–369
  • IEEE (Institute of Electrical and Electronics Engineers), 364
    • FireWire (IEEE 1394), 364
    • POSIX (IEEE 1003), 364
    • Power over Ethernet (IEEE 802.3), 364
  • if( ) statements, 372
  • if/else statements, 38
  • IMU (inertial measurement unit), 245
  • inductive load, high-current, 71–72
    • motor wiring, 74–76
    • protection diodes, 73
    • secondary power source, 74
    • switches, transistors as, 72–73
  • inductors, 73
  • installation, IDE (integrated environment), 16
  • instrument.ino, 244–245
  • Internet, 401
  • interrupts
    • polling, 277–278
    • sound machine
      • hardware, 291
      • software, 291–293
  • IP (Internet Protocol) address, 401–402
    • retrieving, DHCP and, 409–412
  • ipconfig, 425
  • IR (infrared), distance sensor, 105–109
  • IR LED, 105–109
  • ISP (internet service provider), 365
  • J
  • JSON (JavaScript Object Notation), 430
  • K
  • Keyboard.begin( ) function, 176
  • L
  • lamp_remote.ino, 358–360
  • LCD (liquid crystal display), 248
    • breadboard, 251
    • headers, 249
    • LiquidCrystal library, 251
      • animations, 254–258
      • special characters, 254–258
      • text, adding, 252–254
    • pins, parallel, 249–250
    • setup, 245–251
    • thermostat
      • audible warning, 265–266
      • custom characters, 263
      • data display, 261–264
      • fan, 265–266
      • hardware, 258–261
      • LCD_thermostat.ino, 266–270
      • program, 266–270
      • schematic, 259
      • set point button, 264–265
      • system diagram, 261
  • LCD_progress_bar.ino, 255–258
  • LCD_text.ino, 253
  • lcd.print( ) function, 253–254
  • LED Backpack library (Adafruit), 443
  • led_button.ino, 38
  • led.ino, 29
  • LEDs (light-emitting diodes), 17–18
    • bar graph, 196
    • external, pin 9, 24–25
    • interrupts, hardware-debounced pushbutton, 279–288
    • live tempurature display, 440–442
    • nightlight, building, 42–46
    • single characters controlling, 156–158
    • wiring, 25–26
  • libraries
    • Adafruit, 236–241
    • Adafruit GFX, 443
    • BTLE module library, 369
    • LiquidCrystal, 248
    • RTClib, 317–318
    • timer interrupts, 288
    • WiFi101, Wi-Fi module and, 407–408
  • lightrider.ino, 192–193
  • linear regulators, 88
    • power supply and, 89
  • Linux
    • SD card formatting, 298–303
    • serial ports, 18
  • LiquidCrystal library, 248, 251
    • animations, 254–258
    • progress bar, 255
    • special characters, 254–258
    • text, adding, 252–254
  • list_control.ino, 159–161
  • local network
    • Arduino control, 423–424
    • web and, 400
  • lock_computer.ino, 177–178
  • loop( ) function, 29
  • M
  • M0 bootloader, 407
  • MAC addresses, 402
    • Feather Wi-Fi module, 426
  • MacOS
    • SD card formatting, 300–302
    • serial ports, 18
  • map( ) function, 64
  • MCU (microcontroller unit), 5–7
    • Arm Cortex-M3 SAM3X, 12
    • ATmega 328P, 9
    • Atmel ATmega, 5
    • I2C bus, 202
    • Microchip/Atmel ATmega2560, 11
    • single-use USB, 147
  • MEMS (Micro Electro Mechanical Systems), 228–229
  • micro piano, 136–139
    • tone( ) function, 137
    • wiring diagram, 137
  • Microchip, 7
    • ATmega chip, 7
  • millis( ) function, 120, 344
  • MISO (master input, slave output), SD cards, SPI interface, 307
  • MOSI (master output, slave input), SD cards, SPI interface, 307
  • motion-based instrument wiring, 243
  • motor_pot.ino, 78
  • motors
    • servo motors, 101
    • stepper motors, 109
    • brushed DC motors, 71
    • wiring, 74–76
  • mouse emulation, 178–182
  • mouse.ino, 179–180
  • Mouse.press( ) function, 181
  • Mouse.release( ) function, 181
  • multiline comments, 18
  • multimeters, 53
  • music.ino, 134–135
  • N
  • NAT (network address translation), 402
  • natural languages commands, 381–383
  • NEMA-17, bipolar motor, 109–110
  • networks
    • client-to-client communication, 412
    • clients, 403–404
    • the Cloud, 401
    • DHCP (Dynamic Host Configuration Protocol), 403
      • address reservation, 426
      • IP address retrieval, 409–412
    • DNS (Domain Name System), 403
    • GET, 403
    • HTML (Hypertext Markup Language), 402
    • HTTP (Hypertext Transfer Protocol), 402–403
    • the Internet, 401
    • IP address, 401–402
    • local
      • Arduino control, 423–424
      • web and, 400
    • MAC addresses, 402
    • NAT (network address translation), 402
    • port forwarding, 425–427, 426
    • POST, 403
    • router, login, 425
    • servers, 403–404
    • the web, 401
  • nightlight LED project, 42–46
  • nightlight.ino, 65
  • NPN BJTs, 72, 73
  • O
  • Ohm's law, 27–28
  • orientation.ino, 238–239
  • P
  • parallel data, shift register and, 185
  • Particle Photon, 15
  • period of signals, versus frequency, 33
  • phone communication, potentiometer, 366–367
  • photoresistors, 61–62
    • CdS (cadmium sulfide), 62–63
    • circuit, 63
  • piano.ino, 138
  • pin-outs, 454–456
  • ping requests, 411–412
  • pinMode( ) command, 20, 29
  • pins, 20
    • active low, 185–186
    • ADC, 9
    • breadboards, 24–25
    • clock pins, 8
    • communications connections, 250
    • digital, 20
    • ICs (integrated circuits), 80–81
    • LCD, parallel, 249–250
    • serial clear pin, 187
    • servo motors, 101
      • dedicated control pin, 102
    • shift register, 185–186
  • port forwarding, 426
    • Arduino control, 425–427
  • portability, 20
  • ports
    • IDE, 18
    • serial, 142–143
    • USB, 142–143
  • POSIX (IEEE 1003), 364
  • POST, 403
  • pot_tabular.ino, 150–151
  • pot_to_processing/arduino_read_pot, 163–164
  • pot_to_processing/processing_display_color, 164–165
  • pot.ino, 53, 149–150
  • potentiometers
    • DC motor speed, 77–78
    • phone connection, 366–367
    • reading, 51–55
    • speakers, 127
    • wiring diagram, 149
  • power, 5, 9
    • linear regulators, 89
  • Power over Ethernet (IEEE 802.3), 364
  • power sources, secondary, 74
  • print statements, 148–150
  • Processing, 161–162
    • color selection, 168
    • font creator, 218
    • IDE, 163
    • installation, 162
    • program writing, 218–219
    • sending data to Arduino, 166–169
    • sketches
      • controlling, 162–166
      • examples, 165–166
    • temperature sensor, 215–221
  • processing_control_RGB/processing_control_RGB, 167–168
  • programmers, 141–142
  • programming, 29–30
    • functions, 40
    • loop( ) function, 29
    • for loops, 30–31
    • pinMode( ) function, 29
    • setup( ) function, 29
    • sound
      • definition file, 129–130
      • tone( ) function, 129–136
  • programming interfaces, 5
    • ICSP (In-Circuit Serial Programming), 8
    • portability, 20
  • protection diodes, 73
  • pull-down resistors, 35–36
    • strong pull-downs, 37
    • weak pull-downs, 37
  • pushbutton input, pull-down resistors, 35–36
  • PWM (pulse-width modulation), 12, 24, 31–35, 71
    • analogWrite( ), 31
    • LED brightness control, 246
    • DC motor speed control, 76–78
    • thermostat fan, 270
  • R
  • rate variables, H-bridges, 83
  • RC (radio control), cars, 71
  • read_temp.ino, 212–213
  • reading digital inputs, pull-down resistors, 35–38
  • readJoystick( ) function, 181
  • real-time clocks, 317–318
    • communications, 317
    • RTC module, 319
    • RTClib, 317–318
    • SD card module, 319
    • SD card test, 323
    • software, 319
  • refresh speed, 312–313
  • register clock pin, 185
  • resistance, 27
  • resistors
    • pull-up, 206–208
    • current limiting, 21
    • leakage, 37
    • pull-down, 35
  • RF communications
    • AM (amplitude modulation), 344
    • analog modulation, 344
    • antenna, 346–347
    • ASK modulation, 344
    • carrier waves, 344
    • digital modulation, 344
    • electromagnetic spectrum, 336–337
      • frequency, 338
      • ISM band, 339
      • radio spectrum allocation, 338
      • wavelengths, 338
    • FM (frequency modulation), 344
    • key presses, receiver connection, 346–347
    • lamp, 354–361
    • modulation, 344
    • receiver module
      • installed, 347
      • programming, 347–351
      • state variables, 350
      • wireless doorbell, 351–353
    • rf_test.ino, 348–349
    • sending/receiving data, 339–341
    • serial output, RF test, 350
    • smart home lamp, 354
      • AC (alternating current), 355–357
      • connecting to Arduino, 360–361
      • relay connection, 360–361
    • wireless doorbell
      • receiver programming, 351–353
      • receiver wiring, 351
  • rf_test.ino, 348–349
  • RGB (Red, Green, Blue), 24
  • RGB LED
    • nightlight project, 42–46
    • values controlling, 158–161
  • robot
    • breadboard, 91
    • construction, 89–92
    • electronics, 92
    • parts, 86
      • gearbox, 87
      • motor, 87
    • power, 87–89
    • software, writing, 92–96
  • rotors, 71
  • routers, login, 425
  • RTC.adjust( ) function, 319
  • RTClib, 317–318
    • functions, 324
  • running mode, 176
  • S
  • schematics, 456
    • ATmega pin mapping, 457
    • Rev3, 456
  • Schmitt triggers, 282
  • SCK (clock), 227
  • SCLK (serial clock line), 224
    • SD cards, SPI interface, 307
  • SD cards, 29
    • formatting
    • micro SD-to-SD adapter, 297
    • reading from, 312–316
    • real-time clock, 319
    • refresh speed, 312–313
    • reporting, 308–309
      • debugging, output, 311
    • shields, 304–307
    • SPI interface, 307
    • writing to, 307
  • sd_read_write_rtc.ino, 320–324
  • sd_read_write.ino, 314–316
  • SD.open( ) command, 310
  • SDI (serial data in), 227
  • SDO (serial data out), 227
  • secondary power sources, 74
  • sensor libraries, Adafruit, 236–241
  • sensors, analog, 48
  • serial clear pin, 187
  • serial clock, 227
  • serial communications, 142
    • data type representations, 151–152
    • desktop apps, 161–162
      • Processing, 162–169
    • incoming data, 153
      • chars versus ints, 155–156
      • echoing, 154–155
      • single characters, LED and, 156–158
      • values, RGB LED and, 158–161
    • print statements, 148–150
    • serial converter emulation, 146–147
    • software, 215–216
    • special characters, 150–151
    • USB-to-serial converter, 143–146
  • serial data
    • SDI (serial data in), 227
    • SDO (serial data out), 227
    • shift register and, 186–191
  • serial debugging, 424
  • serial interfaces, 8
    • incoming serial data, 55
    • serial monitor button, 55
    • setup( ) function, 54
  • serial monitor
    • Adafruit Bluefruit LE Connect, 377
    • command strings, sending, 152–153
  • serial ports, 18, 142–143
    • Virtual Serial Port, 143–146
  • Serial.available( ) function, 154
  • Serial.begin( ) function, 148
  • Serial.println( ) function, 52, 148
  • server_form.html, 417–418
  • servers, 403–404
  • servo motors
    • color coding, 101
    • continuous rotation, 100–101
    • control, 101–104
    • pins, 101–102
    • standard, compared to continuous rotation, 100–101
    • sweeping distance resistor, 105–109
    • timing, diagram, 102
  • servo.ino, 104–105
  • setup( ) function, 19–20, 54
  • Shaper Tools, stepper motors, 109
  • Sharp infrared proximity sensor, 56
  • shields, 4
    • SD card shields, 304
    • data logging, 306
    • shield stacking headers, 308
  • shift registers, 183–184
    • 74HC595, 186–188
    • animations, 192–197
    • cascaded, 191
    • eight-LED circuit diagram, 190
    • input/output diagram, 185
    • LED bar graph, 194–197
    • light rider effect, 192–194
    • overview, 187
    • pin functions, 186–187
    • register clock pin, 185
    • serial clear pin, 187
    • serial data, 189–191
    • shifting value to, 187–191
    • SIPO (serial in, parallel out), 185
  • shiftOut( ) function, 187–188
  • signals
    • analog, 48
    • digital, 48
    • duty cycles, 34
  • Silicon Labs USB-to-serial converter, 143–146
  • single_char_control.ino, 156–157
  • single-axis accelerometer, 230
  • single-line comments, 19
  • sinusoidal voltage signal, 128
  • SIPO (serial in, parallel out) shift registers, 185
  • Slave Select (SS), 224
  • slave devices
  • SM Bus (System Management Bus), 202
  • smart home lamp
    • AC (alternating current)
      • digital ground, 356
      • double insulated wire, 356
      • power transmission, 354
      • relay control programming, 360–361
      • relays, 356–357
      • wiring, 356
    • Bluetooth control, 389
      • pairing phone, 394–396
      • pairing phone to BTLE device, 389–390
      • proximity control software, 390–394
    • relays, connections to Arduino, 360–361
  • smartphone connection
    • Bluetooth pairing
      • Android, 394–395
      • iPhone, 395–396
    • BTLE transmitter connection, 376–379
      • sending commands, 379–389
  • SMT (Surface Mount Technology), 229
  • snubbers, 72
  • software
    • robot, 92–96
    • serial communication, 215–216
    • volatile variables, 286
  • sound
    • amplitude, 126
    • frequency, 126
    • micro piano, 136–139
    • producing with speaker, 128
    • programming
      • definition file, 129–130
      • tone( ) function, 129–136
    • sequences, 132, 134–135
      • arrays, 133–134
    • square wave, 128
    • tone( ) function, 129–136
  • sound machine
    • hardware, 291
    • software, 291–293
    • wiring diagram, 291
  • sound waves
    • amplitude, 127
    • frequencies, 127
  • SPDT (Single Pole Double Throw), 357
  • speakers, 126
    • cross section, 128
    • magnet, 128
    • potentiometer, 127
    • sinusoidal voltage signal, 128
    • sound production, 128
    • wiring, 130–132
  • speed, refresh, 312–313
  • SPI (Serial Peripheral Interface) bus, 223–224
    • accelerometer, 228–229
    • BTLE SPI library, 370
    • communication lines, 226
    • communication modes, 225
    • communication scheme, 227
    • hardware
      • configuration, 225–227
      • pins, 234–235
    • I2C comparison, 227–228
    • IP address retrieval, 409–412
    • naming conventions, 227
    • SD cards, 306
    • as slave devices, 224
    • UART comparison, 227–228
  • spinning coils, rotors, 71
  • square wave, 128
  • SSL (Secure Sockets Layer), 403
  • stall current, DC motors, 87
  • statements
    • const int, 38
    • digitalRead, 38
    • if/else, 38
  • stationary magnets, stator, 71
  • stators, 71
  • stepper motors, 109–110
    • bipolar, 111–112
      • NEMA-17, 109–110
    • chronograph, 117
    • movement flow chart, 111–112
    • moving, 113–116
    • wiring diagram, 115
    • wiring schematic, 114
  • stepper.ino, 115–116
  • strong pull-downs, 37
  • SudoGlove, 136
  • sweep.ino, 107–109
  • sweeping distance resistor, 105–109
  • switch bouncing, 39
  • switches, transistors as, 72–73
  • T
  • TC74 sensor communication scheme, 210
  • temp_unit.ino, 216
  • tempalert.ino, 59–60
  • temperature and light sensor circuit, 174
  • temperature probe (I2C bus), 208
    • datasheet, 210–212
    • hardware, 208–209
      • building, 214–215
    • serial output, 214
    • shift register bar graph, 215
    • software, writing, 212–214
    • TC74 register information, 211
    • TC74 sensor communication scheme, 210
  • temperature sensor, 57–60
  • third-party boards, Feather, 367–369
  • timer interrupts, 288
    • library, 289
    • multitasking, 288–290
  • timer1.ino, 289
  • TMP36 temperature sensor, 56
  • tone( ) function, 129–136, 265
    • micro piano, 137
  • transistors
    • BJT (bipolar junction transistor), 72
    • as switches, 72–73
  • transmission, baud rate, 54
  • triple-axis analog accelerometers, 56–57
  • U
  • UART
    • Serial UART, 143, 223
    • Nordic BTLE chip, 384
    • SPI comparison, 227–228
  • updateDateTime( ) function, 323
  • USART (Universal Synchronous/Asynchronous Receiver/Transmitter), 9, 141–142
  • USB devices, 172
    • ATmega 32U4, 376
    • keyboard emulation, typing, 173–176
    • Leonardo and, 172
  • USB interfaces, 8
  • USB ports, 142–143
    • boards with host capabilities, 147–148
    • single USB-capable MCU, 147
  • USB-to-serial converter, 143–146
    • emulation, 146–147
  • V
  • variable resistors
    • photoresistors, 61–62
      • CdS (cadmium sulfide), 62–63
      • resistive voltage dividers, 60–64
    • variables
      • Boolean, 41
      • global, 41
      • volatile, 286
    • VCC, 56
    • Virtual Serial Port, 143–146
    • void loop( ) function, 20
    • void setup( ) function, 19
    • volatile variables, 286
    • voltage, 27
      • divider circuits, 61
  • W
  • waitForOK( ) function, 373
  • weak pull-downs, 37
  • weather API, 428–429
    • data parsing, 431–433
    • JSON-formatted, 430–431
    • live temperature display, 440
      • LED readout wiring, 440–442
      • temperature data, 443–449
    • local temperature, 433–439
    • server provider account, 429
    • structure, 430
  • web, 401
  • web page design, 416–418
  • web server
    • bare-minimum, 412–415
    • sketch, 414–419
  • web_control_server.ino, 419–423
  • web_weather_display.ino, 445–448
  • web_weather.ino, 436–439
  • Wi-Fi
    • Arduino, 404
    • Feather board, WINC1500 library, 407–408
    • IEEE 802.11, 364
    • ping requests, 411–412
    • server sketch, 408–423
  • WiFi101 library, Wi-Fi module and, 407–408
  • WINC1500 library, 407–408
  • Windows, SD card formatting, 298–300
  • Wire library, 209–210
  • Wire.beginTransmission( ) function, 213–214
  • Wire.requestFrom( ) function, 213–214
  • wireless connectivity. See also Bluetooth
  • wiring
    • anodes, 25–26
    • cathodes, 25–26
    • H-bridges, 82
    • motion-based, 243
    • motors, 74–76
    • speakers, 130–132
  • write_to_sd.ino, 307–309
  • X–Y–Z
    • XBee radios, 336
..................Content has been hidden....................

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