Details

Exploring Arduino


Exploring Arduino

Tools and Techniques for Engineering Wizardry
2. Aufl.

von: Jeremy Blum

CHF 29.00

Verlag: Wiley
Format: PDF
Veröffentl.: 16.10.2019
ISBN/EAN: 9781119405351
Sprache: englisch
Anzahl Seiten: 512

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>The bestselling beginner Arduino guide, updated with new projects!</b> <p><i>Exploring Arduino</i> makes electrical engineering and embedded software accessible. Learn step by step everything you need to know about electrical engineering, programming, and human-computer interaction through a series of increasingly complex projects. Arduino guru Jeremy Blum walks you through each build, providing code snippets and schematics that will remain useful for future projects. Projects are accompanied by downloadable source code, tips and tricks, and video tutorials to help you master Arduino. You'll gain the skills you need to develop your own microcontroller projects! <p>This new 2nd edition has been updated to cover the rapidly-expanding Arduino ecosystem, and includes new full-color graphics for easier reference. Servo motors and stepper motors are covered in richer detail, and you'll find more excerpts about technical details behind the topics covered in the book. Wireless connectivity and the Internet-of-Things are now more prominently featured in the advanced projects to reflect Arduino's growing capabilities. You'll learn how Arduino compares to its competition, and how to determine which board is right for your project. If you're ready to start creating, this book is your ultimate guide! <ul> <li>Get up to date on the evolving Arduino hardware, software, and capabilities</li> <li>Build projects that interface with other devices—wirelessly!</li> <li>Learn the basics of electrical engineering and programming</li> <li>Access downloadable materials and source code for every project</li> </ul> <p>Whether you're a first-timer just starting out in electronics, or a pro looking to mock-up more complex builds, Arduino is a fantastic tool for building a variety of devices. This book offers a comprehensive tour of the hardware itself, plus in-depth introduction to the various peripherals, tools, and techniques used to turn your little Arduino device into something useful, artistic, and educational. <i>Exploring Arduino</i> is your roadmap to adventure—start your journey today!
<p>Introduction xxv</p> <p><b>Part I Arduino Engineering Basics 1</b></p> <p><b>1 Getting Started and Understanding the Arduino Landscape 3</b></p> <p>Exploring the Arduino Ecosystem 4</p> <p>Arduino Functionality 5</p> <p>The Microcontroller 7</p> <p>Programming Interfaces 8</p> <p>Input/Output: GPIO, ADCs, and Communication Busses 9</p> <p>Power 9</p> <p>Arduino Boards 11</p> <p>Creating Your First Program 15</p> <p>Downloading and Installing the Arduino IDE 16</p> <p>Running the IDE and Connecting to the Arduino 17</p> <p>Breaking Down Your First Program 18</p> <p>Summary 21</p> <p><b>2 Digital Inputs, Outputs, and Pulse-Width Modulation 23</b></p> <p>Digital Outputs 24</p> <p>Wiring Up an LED and Using Breadboards 24</p> <p>Working with Breadboards 24</p> <p>Wiring LEDs 25</p> <p>Programming Digital Outputs 29</p> <p>Using For Loops 30</p> <p>Pulse-Width Modulation with <i>analogWrite()</i> 31</p> <p>Reading Digital Inputs 35</p> <p>Reading Digital Inputs with Pull-Down Resistors 35</p> <p>Working with “Bouncy” Buttons 38</p> <p>Building a Controllable RGB LED Nightlight 42</p> <p>Summary 46</p> <p><b>3 Interfacing with Analog Sensors 47</b></p> <p>Understanding Analog and Digital Signals 48</p> <p>Comparing Analog and Digital Signals 48</p> <p>Converting an Analog Signal to Digital 49</p> <p>Reading Analog Sensors with the Arduino: <i>analogRead()</i> 51</p> <p>Reading a Potentiometer 51</p> <p>Using Analog Sensors 56</p> <p>Using Variable Resistors to Make Your Own Analog Sensors 60</p> <p>Using Resistive Voltage Dividers 61</p> <p>Using Analog Inputs to Control Analog Outputs 64</p> <p>Summary 66</p> <p><b>Part II Interfacing with Your Environment</b><b> 67</b></p> <p>4 Using Transistors and Driving DC Motors 69</p> <p>Driving DC Motors 70</p> <p>Handling High-Current Inductive Loads 71</p> <p>Using Transistors as Switches 72</p> <p>Using Protection Diodes73</p> <p>Using a Secondary Power Source 74</p> <p>Wiring the Motor 74</p> <p>Controlling Motor Speed with PWM 76</p> <p>Using an H-Bridge to Control DC Motor Direction 78</p> <p>Building an H-Bridge Circuit 80</p> <p>Operating an H-Bridge Circuit 82</p> <p>Building a Roving Robot 86</p> <p>Choosing the Robot Parts 87</p> <p>Selecting a Motor and Gearbox 87</p> <p>Powering Your Robot 87</p> <p>Constructing the Robot 89</p> <p>Writing the Robot Software 92</p> <p>Bringing It Together 96</p> <p>Summary 97</p> <p><b>5 Driving Stepper and Servo Motors 99</b></p> <p>Driving Servo Motors 100</p> <p>Understanding the Difference between Continuous Rotation and Standard Servos 100</p> <p>Understanding Servo Control 101</p> <p>Controlling a Servo 104</p> <p>Building a Sweeping Distance Sensor 105</p> <p>Understanding and Driving Stepper Motors 109</p> <p>How Bipolar Stepper Motors Work 111</p> <p>Making Your Stepper Move 113</p> <p>Building a “One-Minute Chronograph” 117</p> <p>Wiring and Building the Chronograph 117</p> <p>Programming the Chronograph 119</p> <p>Summary 124</p> <p><b>6 Making Sounds and Music 125</b></p> <p>Understanding How Speakers Work 126</p> <p>The Properties of Sound 126</p> <p>How a Speaker Produces Sound 128</p> <p>Using tone() to Make Sounds 129</p> <p>Including a Definition File 129</p> <p>Wiring the Speaker 130</p> <p>Making Sound Sequences 133</p> <p>Using Arrays 133</p> <p>Making Note and Duration Arrays 134</p> <p>Completing the Program 134</p> <p>Understanding the Limitations of the tone() Function 136</p> <p>Building a Micro Piano 136</p> <p>Summary 139</p> <p><b>7 USB Serial Communication 141</b></p> <p>Understanding the Arduino’s Serial Communication Capabilities 142</p> <p>Arduino Boards with an Internal or External FTDI or Silicon Labs USB-to-Serial Converter 143</p> <p>Arduino Boards with a Secondary USB-Capable ATmega MCU Emulating a Serial Converter 146</p> <p>Arduino Boards with a Single USB-Capable MCU 147</p> <p>Arduino Boards with USB-Host Capabilities 147</p> <p>Listening to the Arduino 148</p> <p>Using <i>print</i> Statements 148</p> <p>Using Special Characters 150</p> <p>Changing Data Type Representations 152</p> <p>Talking to the Arduino 152</p> <p>Configuring the Arduino IDE’s Serial Monitor to Send Command Strings 152</p> <p>Reading Incoming Data from a Computer or Other Serial Device 153</p> <p>Telling the Arduino to Echo Incoming Data 153</p> <p>Understanding the Differences between Chars and Ints 154</p> <p>Sending Single Characters to Control an LED 156</p> <p>Sending Lists of Values to Control an RGB LED 158</p> <p>Talking to a Desktop App 161</p> <p>Installing Processing 162</p> <p>Controlling a Processing Sketch from Your Arduino 163</p> <p>Sending Data from Processing to Your Arduino 166</p> <p>Summary 169</p> <p><b>8 Emulating USB Devices 171</b></p> <p>Emulating a Keyboard 173</p> <p>Typing Data into the Computer 173</p> <p>Commanding Your Computer to Do Your Bidding 177</p> <p>Emulating a Mouse 178</p> <p>Summary 182</p> <p><b>9 Shift Registers 183</b></p> <p>Understanding Shift Registers 184</p> <p>Sending Parallel and Serial Data 185</p> <p>Working with the 74HC595 Shift Register 186</p> <p>Understanding the Shift Register pin Functions 186</p> <p>Understanding How the Shift Register Works 187</p> <p>Shifting Serial Data from the Arduino 189</p> <p>Converting Between Binary and Decimal Formats 192</p> <p>Controlling Light Animations with a Shift Register 192</p> <p>Building a “Light Rider” 192</p> <p>Responding to Inputs with an LED Bar Graph 194</p> <p>Summary 197</p> <p><b>Part III Communication Interfaces 199</b></p> <p><b>10 The I<sup>2</sup>C Bus 201</b></p> <p>History of the I<sup>2</sup>C Bus 202</p> <p>I<sup>2</sup>C Hardware Design 203</p> <p>Communication Scheme and ID Numbers 203</p> <p>Hardware Requirements and Pull-Up Resistors 206</p> <p>Communicating with an I<sup>2</sup>C Temperature Probe 208</p> <p>Setting Up the Hardware208</p> <p>Referencing the Datasheet 210</p> <p>Writing the Software 212</p> <p>Combining Shift Registers, Serial Communication, and I<sup>2</sup>C Communications 214</p> <p>Building the Hardware for a Temperature Monitoring System 214</p> <p>Modifying the Embedded Program 215</p> <p>Writing the Processing Sketch 218</p> <p>Summary 221</p> <p><b>11 The SPI Bus and Third-Party Libraries 223</b></p> <p>Overview of the SPI Bus 224</p> <p>SPI Hardware and Communication Design 225</p> <p>Hardware Configuration 225</p> <p>Communication Scheme 227</p> <p>Comparing SPI to I<sup>2</sup>C and UART 227</p> <p>Communicating with an SPI Accelerometer 228</p> <p>What is an Accelerometer? 229</p> <p>Gathering Information from the Datasheet 231</p> <p>Setting Up the Hardware233</p> <p>Writing the Software 235</p> <p>Installing the Adafruit Sensor Libraries 236</p> <p>Leveraging the Library 237</p> <p>Creating an Audiovisual Instrument Using a 3-Axis Accelerometer 241</p> <p>Setting Up the Hardware242</p> <p>Modifying the Software 242</p> <p>Summary 246</p> <p><b>12 Interfacing with Liquid Crystal Displays 247</b></p> <p>Setting Up the LCD 248</p> <p>Using the LiquidCrystal Library to Write to the LCD 251</p> <p>Adding Text to the Display 252</p> <p>Creating Special Characters and Animations 254</p> <p>Building a Personal Thermostat 258</p> <p>Setting Up the Hardware 258</p> <p>Displaying Data on the LCD 261</p> <p>Adjusting the Set Point with a Button 264</p> <p>Adding an Audible Warning and a Fan 265</p> <p>Bringing It All Together: The Complete Program 266</p> <p>Taking This Project to the Next Level 270</p> <p>Summary 271</p> <p><b>Part IV Digging Deeper and Combining Functions</b><b> 273</b></p> <p><b>13 Interrupts and Other Special Functions 275</b></p> <p>Using Hardware Interrupts 276</p> <p>Knowing the Tradeoffs Between Polling and Interrupting 277</p> <p>Ease of Implementation (Software) 277</p> <p>Ease of Implementation (Hardware) 277</p> <p>Multitasking 278</p> <p>Acquisition Accuracy 278</p> <p>Understanding the Arduino Hardware Interrupt Capabilities 278</p> <p>Building and Testing a Hardware-Debounced Button Interrupt Circuit 279</p> <p>Creating a Hardware-Debouncing Circuit 280</p> <p>Assembling the Complete Test Circuit 284</p> <p>Writing the Software 285</p> <p>Using Timer Interrupts 288</p> <p>Understanding Timer Interrupts 288</p> <p>Getting the Library 289</p> <p>Executing Two Tasks Simultaneously(ish) 289</p> <p>Building an Interrupt-Driven Sound Machine 290</p> <p>Sound Machine Hardware 291</p> <p>Sound Machine Software 291</p> <p>Summary 294</p> <p><b>14 Data Logging with SD Cards 295</b></p> <p>Getting Ready for Data Logging 296</p> <p>Formatting Data with CSV Files 297</p> <p>Preparing an SD Card for Data Logging 297</p> <p>Formatting Your SD Card Using a Windows PC 298</p> <p>Formatting Your SD Card Using Mac OS 300</p> <p>Formatting Your SD Card Using Linux 302</p> <p>Interfacing the Arduino with an SD Card 304</p> <p>SD Card Shields 304</p> <p>SD Card SPI Interface 307</p> <p>Writing to an SD Card 307</p> <p>Reading from an SD Card 312</p> <p>Real-Time Clocks 317</p> <p>Understanding Real-Time Clocks 317</p> <p>Communicating with a Real-Time Clock 317</p> <p>Using the RTC Arduino Third-Party Library 318</p> <p>Using a Real-Time Clock 319</p> <p>Installing the RTC and SD Card Modules 319</p> <p>Updating the Software 320</p> <p>Building an Entrance Logger 327</p> <p>Logger Hardware 328</p> <p>Logger Software 329</p> <p>Data Analysis 334</p> <p>Summary 335</p> <p><b>Part V Going Wireless 337</b></p> <p><b>15 Wireless RF Communications 339</b></p> <p>The Electromagnetic Spectrum 340</p> <p>The Spectrum 342</p> <p>How Your RF Link Will Send and Receive Data 343</p> <p>Receiving Key Presses with the RF Link 346</p> <p>Connecting Your Receiver 346</p> <p>Programming Your Receiver 347</p> <p>Making a Wireless Doorbell 351</p> <p>Wiring the Receiver 351</p> <p>Programming the Receiver 351</p> <p>The Start of Your Smart Home—Controlling a Lamp 354</p> <p>Your Home’s AC Power 356</p> <p>How a Relay Works 356</p> <p>Programming the Relay Control 358</p> <p>Hooking up Your Lamp and Relay to the Arduino 360</p> <p>Summary 361</p> <p><b>16 Bluetooth Connectivity</b><b> 363</b></p> <p>Demystifying Bluetooth 364</p> <p>Bluetooth Standards and Versions 364</p> <p>Bluetooth Profiles and BTLE GATT Services 365</p> <p>Communication between Your Arduino and Your Phone 366</p> <p>Reading a Sensor over BTLE 366</p> <p>Adding Support for Third-Party Boards to the Arduino IDE 367</p> <p>Installing the BTLE Module Library 369</p> <p>Programming the Feather Board 369</p> <p>Connecting Your Smartphone to Your BTLE Transmitter 377</p> <p>Sending Commands from Your Phone over BTLE 379</p> <p>Parsing Command Strings 380</p> <p>Commanding Your BTLE Device with Natural Language 384</p> <p>Controlling an AC Lamp with Bluetooth 389</p> <p>How Your Phone “Pairs” to BTLE Devices 389</p> <p>Writing the Proximity Control Software 390</p> <p>Pairing Your Phone 394</p> <p>Pairing an Android Phone 394</p> <p>Pairing an iPhone 395</p> <p>Make Your Lamp React to Your Presence 396</p> <p>Summary 397</p> <p><b>17 Wi-Fi and the Cloud</b><b> 399</b></p> <p>The Web, the Arduino, and You 400</p> <p>Networking Lingo 401</p> <p>The Internet vs. the World Wide Web vs. the Cloud 401</p> <p>IP Address 401</p> <p>Network Address Translation 402</p> <p>MAC Address 402</p> <p>HTML 402</p> <p>HTTP and HTTPS 402</p> <p>GET/POST 403</p> <p>DHCP 403</p> <p>DNS 403</p> <p>Clients and Servers 403</p> <p>Your Wi-Fi–Enabled Arduino 404</p> <p>Controlling Your Arduino from the Web 404</p> <p>Setting Up the I/O Control Hardware 404</p> <p>Preparing the Arduino IDE for Use with the Feather Board.406</p> <p>Ensuring the Wi-Fi Library is Matched to the Wi-Fi Module’s Firmware 407</p> <p>Checking the WINC1500’s Firmware Version 408</p> <p>Updating the WINC1500’s Firmware 408</p> <p>Writing an Arduino Server Sketch 408</p> <p>Connecting to the Network and Retrieving an IP Address via DHCP 409</p> <p>Writing the Code for a Bare-Minimum Web Server 412</p> <p>Controlling Your Arduino from Inside and Outside Your Local Network 423</p> <p>Controlling Your Arduino over the Local Network 423</p> <p>Using Port Forwarding to Control Your Arduino from Anywhere 425</p> <p>Interfacing with Web APIs 427</p> <p>Using a Weather API428</p> <p>Creating an Account with the API Service Provider 429</p> <p>Understanding How APIs are Structured 430</p> <p>JSON-Formatted Data and Your Arduino 430</p> <p>Fetching and Parsing Weather Data 431</p> <p>Getting the Local Temperature from the Web on Your Arduino 433</p> <p>Completing the Live Temperature Display 440</p> <p>Wiring up the LED Readout Display 440</p> <p>Driving the Display with Temperature Data 443</p> <p>Summary 449</p> <p>Appendix A: Deciphering Datasheets and Schematics 451</p> <p>Index 461</p>
<p><b>Jeremy Blum</b> is an electrical engineer known for his series of educational YouTube videos that have taught engineering concepts to millions of people around the world. Previously as a hardware engineer at Google [X] and currently as director of engineering at Shaper Tools, he spends every day creating complex electromechanical products. He has designed and built solar trackers, prosthetic arms, truss-traversing robots, musical theremins, gesture controllers, home automation systems, augmented reality hardware, and more.
<p>"Jeremy's easy-to-understand style and depth of content about the Arduino. . . will not only allow digital beginners to get their footing but will also allow the old guard of hardware to dip a toe into the hobbyist-friendly end of the swimming pool and start connecting their devices."</br> — <b><i>Chris Gammell,</i></b><b></b> <i>Co-host of the Amp Hour Podcast</i> <p><b>ARDUINO CAN TAKE YOU ANYWHERE. THIS BOOK IS THE ROADMAP.</b> <p><i>Exploring Arduino</i>??shows how to use the world's most popular microcontroller to create cool, practical, artistic, and educational projects. Through lessons in electrical engineering, programming, and human computer interaction, this book walks you through specific, increasingly complex projects, all the while providing best practices that can apply to your own projects once you've mastered these. You'll acquire valuable skills—and have a whole lot of fun. <ul> <li>Explore the features of several commonly used Arduino boards</li> <li>Use the Arduino to control very simple tasks or complex electronics</li> <li>Learn principles of system design, programming, and electrical engineering</li> <li>Discover code snippets, best practices, and system schematics you can apply to your original projects</li> <li>Master skills you can use for engineering endeavors in other fields and with different platforms</li> <li>Connect your projects to the internet</li> <li>Expands on the first edition with updated projects, all new topics like wireless connectivity and stepper motors, and more deep dives into electrical engineering and product design topics</li> </ul> <p>Find schematics, tutorial videos, code downloads, and more at the companion website: <b>www.exploringarduino.com.</b> <p><b>CONVENIENT COMPONENT KITS</b></br> Component kits are available for this book! Visit exploringarduino.com/kits.

Diese Produkte könnten Sie auch interessieren:

Optical Communication Theory and Techniques
Optical Communication Theory and Techniques
von: Enrico Forestieri
PDF ebook
CHF 177.00
Virtual Organizations
Virtual Organizations
von: Luis M. Camarinha-Matos, Hamideh Afsarmanesh, Martin Ollus
PDF ebook
CHF 177.00
Quantitative Measure for Discrete Event Supervisory Control
Quantitative Measure for Discrete Event Supervisory Control
von: Asok Ray, Vir V. Phoha, Shashi Phoha
PDF ebook
CHF 118.00